55134038dfe55e79d8d111c0f8448f424663bac9.svn-base 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. // ================================================================
  2. // CHEditor 5
  3. // ----------------------------------------------------------------
  4. // Homepage: http://www.chcode.com
  5. // Copyright (c) 1997-2014 CHSOFT
  6. // ================================================================
  7. var oEditor = null;
  8. var button = [ { alt : "", img : 'submit.gif', cmd : doSubmit },
  9. { alt : "", img : 'cancel.gif', cmd : popupClose } ];
  10. var colour = ["ffffcc","ffcc66","ff9900","ffcc99","ff6633","ffcccc","cc9999","ff6699","ff99cc","ff66cc","ffccff","cc99cc","cc66ff","cc99ff","9966cc","ccccff","9999cc","3333ff","6699ff","0066ff","99ccff","66ccff","99cccc","ccffff","99ffcc","66cc99","66ff99","99ff99","ccffcc","33ff33","66ff00","ccff99","99ff00","ccff66","cccc66","ffffff",
  11. "ffff99","ffcc00","ff9933","ff9966","cc3300","ff9999","cc6666","ff3366","ff3399","ff00cc","ff99ff","cc66cc","cc33ff","9933cc","9966ff","9999ff","6666ff","3300ff","3366ff","0066cc","3399ff","33ccff","66cccc","99ffff","66ffcc","33cc99","33ff99","66ff66","99cc99","00ff33","66ff33","99ff66","99ff33","ccff00","cccc33","cccccc",
  12. "ffff66","ffcc33","cc9966","ff6600","ff3300","ff6666","cc3333","ff0066","ff0099","ff33cc","ff66ff","cc00cc","cc00ff","9933ff","6600cc","6633ff","6666cc","3300cc","0000ff","3366cc","0099ff","00ccff","339999","66ffff","33ffcc","00cc99","00ff99","33ff66","66cc66","00ff00","33ff00","66cc00","99cc66","ccff33","999966","999999",
  13. "ffff33","cc9900","cc6600","cc6633","ff0000","ff3333","993333","cc3366","cc0066","cc6699","ff33ff","cc33cc","9900cc","9900ff","6633cc","6600ff","666699","3333cc","0000cc","0033ff","6699cc","3399cc","669999","33ffff","00ffcc","339966","33cc66","00ff66","669966","00cc00","33cc00","66cc33","99cc00","cccc99","999933","666666",
  14. "ffff00","cc9933","996633","993300","cc0000","ff0033","990033","996666","993366","cc0099","ff00ff","990099","996699","660099","663399","330099","333399","000099","0033cc","003399","336699","0099cc","006666","00ffff","33cccc","009966","00cc66","339933","336633","33cc33","339900","669933","99cc33","666633","999900","333333",
  15. "cccc00","996600","663300","660000","990000","cc0033","330000","663333","660033","990066","cc3399","993399","660066","663366","330033","330066","333366","000066","000033","003366","006699","003333","336666","00cccc","009999","006633","009933","006600","003300","00cc33","009900","336600","669900","333300","666600","000000"];
  16. var none = '없음';
  17. var modifyTable;
  18. var beforeHeaderType;
  19. var whichColor = null;
  20. function popupClose() {
  21. oEditor.popupWinCancel();
  22. }
  23. function isError() {
  24. alert('표 정보를 얻을 수 없습니다. 수정하실 표을 다시 한 번 선택해 주십시오.');
  25. popupClose();
  26. }
  27. function init(dialog) {
  28. oEditor = this;
  29. oEditor.dialog = dialog;
  30. var dlg = new Dialog(oEditor);
  31. dlg.showButton(button);
  32. dlg.setDialogHeight();
  33. var rng = oEditor.range, pNode;
  34. if (oEditor.W3CRange) {
  35. pNode = rng.commonAncestorContainer;
  36. if (!rng.collapsed &&
  37. rng.startContainer === rng.endContainer &&
  38. rng.startOffset - rng.endOffset < 2 &&
  39. rng.startContainer.hasChildNodes())
  40. {
  41. pNode = rng.startContainer.childNodes[rng.startOffset];
  42. }
  43. while (pNode.nodeType === 3) {
  44. pNode = pNode.parentNode;
  45. }
  46. if (pNode.nodeName !== 'TD' && pNode.nodeName !== 'TH' && pNode.nodeName !== 'CAPTION' && pNode.nodeName !== 'TABLE')
  47. {
  48. isError();
  49. return;
  50. }
  51. }
  52. else {
  53. if (rng.item) {
  54. pNode = rng.item(0);
  55. if (pNode.nodeName.toLowerCase() !== 'table') {
  56. isError();
  57. return;
  58. }
  59. }
  60. else {
  61. pNode = rng.parentElement();
  62. }
  63. }
  64. while (pNode && pNode.nodeName.toLowerCase() !== 'table') {
  65. pNode = pNode.parentNode;
  66. }
  67. if (pNode.nodeName.toLowerCase() !== 'table') {
  68. isError();
  69. return;
  70. }
  71. modifyTable = pNode;
  72. var border, el_size, fm_size, el_type, fm_type, cellpd, cellsp, bgcolor, idbgcolor,
  73. bordercolor, idbordercolor, captionValue, summaryValue, caption, captionInput, summary;
  74. border = modifyTable.getAttribute('border');
  75. if (!border || isNaN(border)) {
  76. border = parseInt(modifyTable.style.borderWidth, 10);
  77. if (!border) {
  78. border = 0;
  79. }
  80. }
  81. document.getElementById("bordersize").value = border;
  82. if (modifyTable.className !== '') {
  83. document.getElementById('cssClass').value = modifyTable.className;
  84. }
  85. if (modifyTable.id !== '') {
  86. document.getElementById('cssId').value = modifyTable.id;
  87. }
  88. el_size = modifyTable.getAttribute('width');
  89. if (!el_size) {
  90. el_size = modifyTable.style.width;
  91. }
  92. fm_size = document.getElementById("width");
  93. el_type = 'px';
  94. fm_type = document.getElementById("widthtype");
  95. if (el_size) {
  96. el_type = (/%$/.test(el_size)) ? '%' : 'px';
  97. el_size = parseInt(el_size, 10);
  98. if (isNaN(el_size)) {
  99. el_size = '';
  100. }
  101. }
  102. else {
  103. el_size = '';
  104. }
  105. fm_size.value = el_size;
  106. fm_type.value = el_type;
  107. el_size = modifyTable.getAttribute('height');
  108. if (!el_size) {
  109. el_size = modifyTable.style.height;
  110. }
  111. fm_size = document.getElementById("height");
  112. el_type = 'px';
  113. fm_type = document.getElementById("heighttype");
  114. if (el_size) {
  115. el_type = (/\%$/.test(el_size)) ? '%' : 'px';
  116. el_size = parseInt(el_size, 10);
  117. if (isNaN(el_size)) {
  118. el_size = '';
  119. }
  120. }
  121. else {
  122. el_size = '';
  123. }
  124. fm_size.value = el_size;
  125. fm_type.value = el_type;
  126. fm_type = modifyTable.getAttribute('align');
  127. if (!fm_type) {
  128. fm_type = 'none';
  129. }
  130. document.getElementById("talign").value = fm_type;
  131. cellpd = modifyTable.getAttribute('cellpadding');
  132. if (isNaN(cellpd)) {
  133. cellpd = 0;
  134. }
  135. document.getElementById("cellpd").value = cellpd || 0;
  136. cellsp = modifyTable.getAttribute('cellspacing');
  137. if (isNaN(cellsp)) {
  138. cellsp = 0;
  139. }
  140. document.getElementById("cellsp").value = cellsp || 0;
  141. bgcolor = modifyTable.getAttribute('bgcolor');
  142. idbgcolor = document.getElementById("idbgcolor");
  143. if (bgcolor) {
  144. if (/rgb/.test(bgcolor)) {
  145. bgcolor = oEditor.colorConvert(bgcolor, 'hex');
  146. }
  147. idbgcolor.value = bgcolor.toLowerCase();
  148. idbgcolor.style.backgroundColor = idbgcolor.value;
  149. }
  150. else {
  151. idbgcolor.value = none;
  152. }
  153. bordercolor = modifyTable.getAttribute('bordercolor');
  154. if (!bordercolor) {
  155. bordercolor = modifyTable.style.borderColor;
  156. if (bordercolor) {
  157. bordercolor = oEditor.colorConvert(bordercolor, 'hex');
  158. }
  159. else {
  160. bordercolor = null;
  161. }
  162. }
  163. idbordercolor = document.getElementById("idbordercolor");
  164. if (bordercolor) {
  165. if (/rgb/.test(bordercolor)) {
  166. bordercolor = oEditor.colorConvert(bordercolor, 'hex');
  167. }
  168. idbordercolor.value = bordercolor.toLowerCase();
  169. idbordercolor.style.backgroundColor = idbordercolor.value;
  170. }
  171. else {
  172. idbordercolor.value = none;
  173. }
  174. caption = modifyTable.getElementsByTagName('caption')[0];
  175. if (caption) {
  176. captionValue = oEditor.trimSpace(caption.innerHTML);
  177. if (captionValue !== '') {
  178. captionInput = document.getElementById('tableCaption');
  179. captionInput.value = captionValue;
  180. if (caption.style.visibility === 'hidden') {
  181. document.getElementById('hideCaption').checked = 'checked';
  182. }
  183. }
  184. }
  185. summaryValue = modifyTable.getAttribute('summary');
  186. if (summaryValue) {
  187. summaryValue = oEditor.trimSpace(summaryValue);
  188. if (summaryValue !== '') {
  189. summary = document.getElementById('tableSummary');
  190. summary.value = summaryValue;
  191. }
  192. }
  193. var tableHeader, rows, i, j, cells, headCol, headRow, rowLength, rowCellLength, cellLength, header, headTagName;
  194. headCol = headRow = null;
  195. headTagName = 'th';
  196. tableHeader = document.getElementById('tableHeader');
  197. rows = (modifyTable.rows && modifyTable.rows.length > 0) ? modifyTable.rows : modifyTable.getElementsByTagName('tr');
  198. rowLength = rows.length;
  199. document.getElementById('numrows').appendChild(document.createTextNode(rowLength));
  200. if (rowLength > 0) {
  201. cells = rows[0].cells;
  202. cellLength = cells.length;
  203. if (cellLength > 0) {
  204. for (j=0; j < cellLength; j++) {
  205. if (cells[j].tagName.toLowerCase() === headTagName) {
  206. headCol = 'col';
  207. }
  208. else {
  209. headCol = null;
  210. break;
  211. }
  212. }
  213. }
  214. rowCellLength = 0;
  215. for (i=0; i < rowLength; i++) {
  216. headRow = (rows[i].cells[0] && rows[i].cells[0].tagName.toLowerCase() === headTagName) ? 'row' : null;
  217. if (rowCellLength < rows[i].cells.length) {
  218. rowCellLength = rows[i].cells.length;
  219. }
  220. }
  221. if (headRow && headCol && cellLength === 1) {
  222. headCol = null;
  223. }
  224. document.getElementById('numcols').appendChild(document.createTextNode(rowCellLength));
  225. }
  226. header = (headCol && headRow) ? 'all' : headCol || headRow || 'none';
  227. tableHeader.value = beforeHeaderType = header;
  228. }
  229. function getColor()
  230. {
  231. var color = this.bgColor;
  232. var input = document.getElementById("id"+whichColor);
  233. input.style.backgroundColor = input.value = color;
  234. }
  235. function drawColor() {
  236. var table, tr, td, insideTable, k = 0, i, j, tr2, td2;
  237. table = document.createElement('table');
  238. table.cellPadding = 0;
  239. table.cellSpacing = 0;
  240. table.border = 0;
  241. table.align = 'center';
  242. tr = table.insertRow(0);
  243. td = tr.insertCell(0);
  244. td.style.backgroundColor = '#fff';
  245. insideTable = document.createElement('table');
  246. insideTable.border = 0;
  247. insideTable.cellSpacing = 1;
  248. insideTable.cellPadding = 0;
  249. insideTable.align = 'center';
  250. var onMouseOver = function() { this.className = 'colorCellMouseOver'; };
  251. var onMouseOut = function() { this.className = 'colorCellMouseOut'; };
  252. for (i = 0; i < 6; i++) {
  253. tr2 = insideTable.insertRow(i);
  254. for (j = 0; j < 36; j++) {
  255. td2 = tr2.insertCell(j);
  256. td2.setAttribute('bgColor', '#' + colour[k]);
  257. td2.className = 'colorCellMouseOut';
  258. td2.onclick = getColor;
  259. td2.appendChild(document.createTextNode('\u00a0'));
  260. td2.onmouseover = onMouseOver;
  261. td2.onmouseout = onMouseOut;
  262. k++;
  263. }
  264. }
  265. td.appendChild(insideTable);
  266. document.getElementById('colorWrapper').appendChild(table);
  267. }
  268. function setColor(which) {
  269. whichColor = which;
  270. }
  271. function doSubmit()
  272. {
  273. var width, widthType, widthValue, cellWidth, i, j, row, rows, cell;
  274. width = document.getElementById("width");
  275. widthType = document.getElementById("widthtype").value;
  276. if (width) {
  277. widthValue = parseInt(oEditor.trimSpace(width.value), 10);
  278. if (isNaN(widthValue)) {
  279. cellWidth = widthValue = null;
  280. }
  281. else {
  282. modifyTable.removeAttribute('width');
  283. modifyTable.style.width = widthValue + widthType;
  284. rows = modifyTable.rows;
  285. if (rows.length > 0) {
  286. for (i=0; i < rows.length; i++) {
  287. row = rows[i];
  288. for (j=0; j < row.cells.length; j++) {
  289. cellWidth = parseInt(widthValue/row.cells.length, 10) + widthType;
  290. cell = row.cells[j];
  291. cell.setAttribute("width", cellWidth);
  292. }
  293. }
  294. }
  295. }
  296. }
  297. var height, heightValue;
  298. height = document.getElementById("height");
  299. if (height) {
  300. heightValue = parseInt(oEditor.trimSpace(height.value), 10);
  301. if (isNaN(heightValue)) {
  302. heightValue = null;
  303. }
  304. else {
  305. heightValue += document.getElementById("heighttype").value;
  306. modifyTable.removeAttribute('height');
  307. modifyTable.style.height = heightValue;
  308. }
  309. }
  310. var cellpadding, cellpaddingValue;
  311. cellpadding = document.getElementById("cellpd");
  312. if (cellpadding) {
  313. cellpaddingValue = oEditor.trimSpace(cellpadding.value);
  314. if (!cellpaddingValue || isNaN(cellpaddingValue)) {
  315. cellpaddingValue = 0;
  316. }
  317. else {
  318. cellpaddingValue = parseInt(cellpaddingValue, 10);
  319. }
  320. modifyTable.setAttribute('cellpadding', cellpaddingValue);
  321. }
  322. var cellspacing, cellspacingValue;
  323. cellspacing = document.getElementById("cellsp");
  324. if (cellspacing) {
  325. cellspacingValue = oEditor.trimSpace(cellspacing.value);
  326. if (!cellspacingValue || isNaN(cellspacingValue)) {
  327. cellspacingValue = 0;
  328. }
  329. else {
  330. cellspacingValue = parseInt(cellspacingValue, 10);
  331. }
  332. modifyTable.setAttribute('cellspacing', cellspacingValue);
  333. }
  334. var bgcolor, bgcolorValue;
  335. bgcolor = document.getElementById("idbgcolor");
  336. if (bgcolor) {
  337. bgcolorValue = oEditor.trimSpace(bgcolor.value);
  338. if (bgcolorValue !== '' && bgcolorValue !== none) {
  339. modifyTable.removeAttribute('bgcolor');
  340. modifyTable.bgColor = bgcolorValue;
  341. }
  342. }
  343. var align, alignValue;
  344. align = document.getElementById("talign");
  345. if (align) {
  346. alignValue = align.value;
  347. if (alignValue !== 'none') {
  348. modifyTable.removeAttribute('align');
  349. modifyTable.setAttribute('align', alignValue);
  350. }
  351. }
  352. var cssclass, cssclassValue, cssid, cssidValue;
  353. cssclass = document.getElementById('cssClass');
  354. cssclassValue = oEditor.trimSpace(cssclass.value);
  355. if (cssclassValue !== '') {
  356. modifyTable.className = cssclassValue;
  357. }
  358. else {
  359. modifyTable.removeAttribute('class');
  360. }
  361. cssid = document.getElementById('cssId');
  362. cssidValue = oEditor.trimSpace(cssid.value);
  363. if (cssidValue !== '') {
  364. modifyTable.id = cssidValue;
  365. }
  366. else {
  367. modifyTable.removeAttribute('id');
  368. }
  369. var caption = document.getElementById('tableCaption');
  370. var captionValue = oEditor.trimSpace(caption.value);
  371. var summary = document.getElementById('tableSummary');
  372. var summaryValue = oEditor.trimSpace(summary.value);
  373. var oCaption;
  374. if (summaryValue !== '') {
  375. modifyTable.setAttribute('summary', summaryValue);
  376. }
  377. if (captionValue !== '') {
  378. var hideCaption, tableCaption;
  379. tableCaption = modifyTable.createCaption();
  380. tableCaption.innerHTML = captionValue;
  381. hideCaption = document.getElementById('hideCaption');
  382. if (hideCaption.checked === true) {
  383. tableCaption.style.visibility = 'hidden';
  384. tableCaption.style.overFlow = 'hidden';
  385. tableCaption.style.lineHeight = '0px';
  386. tableCaption.style.position = 'absolute';
  387. tableCaption.style.display = 'none';
  388. }
  389. else {
  390. tableCaption.removeAttribute('style');
  391. }
  392. }
  393. else {
  394. oCaption = modifyTable.getElementsByTagName('caption')[0];
  395. if (oCaption) {
  396. modifyTable.removeChild(oCaption);
  397. }
  398. }
  399. var copyAttribute = function(target, source) {
  400. var attr, attrValue, nodeName;
  401. attr = source.attributes;
  402. for (i=0; i<attr.length; i++) {
  403. nodeName = attr[i].nodeName;
  404. if (nodeName === 'style') {
  405. attrValue = source.getAttribute(nodeName);
  406. target.style.cssText = oEditor.undefined(attrValue.cssText) ? attrValue : attrValue.cssText;
  407. }
  408. else if (nodeName === 'class' || nodeName === 'id' || nodeName === 'nowrap' || nodeName === 'colspan' ||
  409. nodeName === 'rowspan' || nodeName === 'align')
  410. {
  411. attrValue = source.getAttribute(nodeName);
  412. if (attrValue) {
  413. target.setAttribute(nodeName, attrValue);
  414. }
  415. }
  416. }
  417. };
  418. var copyChildNodes = function (target, source) {
  419. var child;
  420. child = source.firstChild;
  421. while (child) {
  422. target.appendChild(child);
  423. child = source.firstChild;
  424. }
  425. };
  426. var tableHeader = document.getElementById('tableHeader').value;
  427. var replaceCol = function (rows, newTagName) {
  428. var cellLength, newCell, oldCell, newCells=[], oHead;
  429. row = rows[0];
  430. cellLength = row.cells.length;
  431. for (i=0; i < cellLength; i++) {
  432. oldCell = row.cells[i];
  433. newCell = document.createElement(newTagName);
  434. copyAttribute(newCell, oldCell);
  435. copyChildNodes(newCell, oldCell);
  436. if (newTagName === 'th') {
  437. newCell.setAttribute('scope', 'col');
  438. }
  439. else {
  440. newCell.removeAttribute('scope');
  441. }
  442. newCells.push(newCell);
  443. }
  444. for (j = cellLength-1; j >= 0; j--) {
  445. row.deleteCell(j);
  446. }
  447. for (j=0; j < newCells.length; j++) {
  448. row.appendChild(newCells[j]);
  449. }
  450. if (newTagName === 'th') {
  451. oHead = modifyTable.getElementsByTagName('thead')[0];
  452. if (!oHead) {
  453. oHead = document.createElement('thead');
  454. modifyTable.insertBefore(oHead, modifyTable.firstChild);
  455. oHead.appendChild(row);
  456. }
  457. }
  458. else if (row.parentNode.nodeName.toLowerCase() === 'thead') {
  459. oHead = row.parentNode;
  460. if (rows[1]) {
  461. rows[1].parentNode.insertBefore(row, rows[1]);
  462. }
  463. else {
  464. modifyTable.insertBefore(row, oHead);
  465. }
  466. modifyTable.removeChild(oHead);
  467. }
  468. };
  469. var replaceRow = function (rows, newTagName) {
  470. var len, newCell, sourceCell;
  471. len = rows.length;
  472. for (i=0; i < len; i++) {
  473. row = rows[i];
  474. sourceCell = row.cells[0];
  475. newCell = document.createElement(newTagName);
  476. if (newTagName === 'th') {
  477. newCell.setAttribute('scope', 'row');
  478. }
  479. else {
  480. sourceCell.removeAttribute('scope');
  481. }
  482. row.insertBefore(newCell, sourceCell);
  483. copyAttribute(newCell, sourceCell);
  484. copyChildNodes(newCell, sourceCell);
  485. row.deleteCell(1);
  486. }
  487. };
  488. var border, borderValue;
  489. if (beforeHeaderType !== tableHeader) {
  490. rows = (modifyTable.rows && modifyTable.rows.length > 0) ?
  491. modifyTable.rows :
  492. modifyTable.getElementsByTagName('tr');
  493. if (tableHeader === 'col') {
  494. replaceRow(rows, 'td');
  495. replaceCol(rows, 'th');
  496. }
  497. else if (tableHeader === 'row') {
  498. replaceCol(rows, 'td');
  499. replaceRow(rows, 'th');
  500. }
  501. else if (tableHeader === 'all') {
  502. replaceCol(rows, 'th');
  503. replaceRow(rows, 'th');
  504. }
  505. else if (tableHeader === 'none') {
  506. replaceCol(rows, 'td');
  507. replaceRow(rows, 'td');
  508. }
  509. oCaption = modifyTable.getElementsByTagName('caption')[0];
  510. if (oCaption && oCaption !== modifyTable.firstChild) {
  511. modifyTable.insertBefore(oCaption, modifyTable.firstChild);
  512. }
  513. }
  514. border = document.getElementById("bordersize");
  515. if (border) {
  516. borderValue = oEditor.trimSpace(border.value);
  517. if (isNaN(borderValue) === false) {
  518. var borderColor, borderColorValue;
  519. borderValue = parseInt(borderValue, 10);
  520. rows = (modifyTable.rows && modifyTable.rows.length > 0) ?
  521. modifyTable.rows :
  522. modifyTable.getElementsByTagName('tr');
  523. if (borderValue) {
  524. borderColor = document.getElementById("idbordercolor");
  525. if (borderColor) {
  526. borderColorValue = oEditor.trimSpace(borderColor.value);
  527. }
  528. if (!borderColorValue || borderColorValue === none) {
  529. borderColorValue = '#000000';
  530. }
  531. borderColorValue = oEditor.colorConvert(borderColorValue, 'rgb');
  532. modifyTable.style.border = borderValue + 'px solid ' + borderColorValue;
  533. modifyTable.style.borderCollapse = "collapse";
  534. modifyTable.removeAttribute('border');
  535. for (i=0; i < rows.length; i++) {
  536. row = rows[i];
  537. for (j=0; j < row.cells.length; j++) {
  538. cell = row.cells[j];
  539. cell.style.border = borderValue + 'px solid ' + borderColorValue;
  540. }
  541. }
  542. }
  543. else if (borderValue === 0) {
  544. modifyTable.removeAttribute('border');
  545. modifyTable.style.border = '';
  546. modifyTable.style.borderCollapse = '';
  547. for (i=0; i < rows.length; i++) {
  548. row = rows[i];
  549. for (j=0; j < row.cells.length; j++) {
  550. cell = row.cells[j];
  551. cell.style.border = '';
  552. }
  553. }
  554. }
  555. }
  556. }
  557. oEditor.editArea.focus();
  558. oEditor.backupRange(oEditor.restoreRange());
  559. oEditor.clearStoredSelections();
  560. oEditor.popupWinClose();
  561. }