diff --git a/docs/changelog/5.x.x.txt b/docs/changelog/5.x.x.txt index 04829b48e..1ec00c08f 100644 --- a/docs/changelog/5.x.x.txt +++ b/docs/changelog/5.x.x.txt @@ -13,6 +13,7 @@ - Templatized the HttpProxy wobject. (Thanks to Len Kranendonk.) - Added a "Search for" and "Stop at" option to HttpProxy. (Thanks to Len Kranendonk.) - Fixed a bug in the PreviousDropMenu macro. + - Enhanced HTMLArea editor to include table editing. (Thanks to IRV.) 5.4.3 diff --git a/docs/credits.txt b/docs/credits.txt index a7266e92b..60e9bed1b 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -21,6 +21,7 @@ Contributing Developers..............Peter Beardsley / Appropriate Solutions Greg Fast / WDI Chris Gebhardt / OpenServe Andy Grundman + IRV Chris Jackson Koen de Jonge / ProcoliX Martin Kamerbeek / ProcoliX diff --git a/www/extras/htmlArea/editor.js b/www/extras/htmlArea/editor.js index 227d899a6..92af76ae3 100644 --- a/www/extras/htmlArea/editor.js +++ b/www/extras/htmlArea/editor.js @@ -61,6 +61,10 @@ this.toolbar = [ ['HorizontalRule','Createlink','InsertImage','InsertTable','htmlmode','separator'], ['Macros','separator'], ['Smileys','separator'], + +// inserted by lvn : table actions + ['TableProperties','RowProperties','InsertRowBefore','InsertRowAfter','DeleteRow','InsertColumnBefore','InsertColumnAfter','DeleteColumn','CellProperties','InsertCellBefore','InsertCellAfter','DeleteCell','SplitCell','MergeCells','SplitRow','MergeRows','separator'], +// end insert by lvn // ['custom1','custom2','custom3','separator'], ['popupeditor']]; //,'about']]; @@ -131,6 +135,27 @@ this.btnList = { "custom3": ['custom3', 'Purpose of button 3', 'editor_action(this.id)', 'ed_custom.gif'], // end: custom buttons +// inserted by lvn : table operations + "tableproperties": ['TableProperties', 'Table Properties', 'editor_action(this.id)', 'ed_tableprop.gif'], + "rowproperties": ['RowProperties', 'Row Properties', 'editor_action(this.id)', 'ed_rowprop.gif'], + "insertrowbefore": ['InsertRowBefore', 'Insert Row Before', 'editor_action(this.id)', 'ed_insabove.gif'], + "insertrowafter": ['InsertRowAfter', 'Insert Row After', 'editor_action(this.id)', 'ed_insunder.gif'], + "deleterow": ['DeleteRow', 'Delete Row', 'editor_action(this.id)', 'ed_delrow.gif'], + "insertcolumnbefore": ['InsertColumnBefore','Insert Column Before', 'editor_action(this.id)', 'ed_insleft.gif'], + "insertcolumnafter": ['InsertColumnAfter', 'Insert Column Afer','editor_action(this.id)', 'ed_insright.gif'], + "deletecolumn": ['DeleteColumn', 'Delete Column', ' editor_action(this.id)', 'ed_delcol.gif'], + "cellproperties": ['CellProperties', 'Cell Properties', 'editor_action(this.id)', 'ed_cellprop.gif'], + "insertcellbefore": ['InsertCellBefore', 'Insert Cell Before','editor_action(this.id)', 'ed_inscellft.gif'], + "insertcellafter": ['InsertCellAfter', 'Insert Cell After', 'editor_action(this.id)', 'ed_inscelrgt.gif'], + "deletecell": ['DeleteCell', 'Delete Cell', 'editor_action(this.id)', 'ed_delcel.gif'], + "splitcell": ['SplitCell', 'Split Cell', 'editor_action(this.id)', 'ed_splitcel.gif'], + "mergecells": ['MergeCells', 'Merge Cells', 'editor_action(this.id)', 'ed_mergecels.gif'], + "splitrow": ['SplitRow', 'Split row', 'editor_action(this.id)', 'ed_splitrow.gif'], + "mergerows": ['MergeRows', 'Merge rows', 'editor_action(this.id)', 'ed_mergerows.gif'], + +// end insert by lvn + + "help": ['showhelp', 'Help using editor', 'editor_action(this.id)', 'ed_help.gif']}; @@ -312,6 +337,23 @@ function editor_action(button_id) { 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=640,height=480'); return; } + + // inserted by lvn : showborders + + if (cmdID == 'ShowBorder'){ + var btnObj = document.all["_" +objname+ "_ShowBorder"]; + if (config.showborders){ // toggle is on : put borders off + nullBorders(editor_obj.contentWindow.document,'hide'); + btnObj.className = 'btn'; + config.showborders = false; + } else { + nullBorders(editor_obj.contentWindow.document,'show'); + btnObj.className = 'btnDown'; + config.showborders = true; + } + return; + } +// end insert by lvn // check editor mode (don't perform actions in textedit mode) if (editor_obj.tagName.toLowerCase() == 'textarea') { return; } @@ -365,7 +407,37 @@ function editor_action(button_id) { "resizable: yes; help: no; status: no; scroll: no; "); if (myText) { editor_insertHTML(objname, myText); } } - + + // inserted by lvn : table operations + else if ( cmdID == 'TableProperties' || + cmdID == 'RowProperties' || + cmdID == 'InsertRowBefore' || + cmdID == 'InsertRowAfter' || + cmdID == 'DeleteRow' || + cmdID == 'InsertColumnBefore' || + cmdID == 'InsertColumnAfter' || + cmdID == 'DeleteColumn' || + cmdID == 'CellProperties' || + cmdID == 'InsertCellBefore' || + cmdID == 'InsertCellAfter' || + cmdID == 'SplitCell' || + cmdID == 'MergeRows' || + cmdID == 'SplitRow' || + cmdID == 'MergeCells' || + cmdID == 'DeleteCell' ) { + // table operations + var table_src_element = editdoc.selection.createRange().parentElement(); + while (table_src_element != null && table_src_element.tagName != 'TD' && table_src_element.tagName != 'TH'){ + table_src_element = table_src_element.parentElement; + } + if (table_src_element == null) { + alert('Table operations not allowed here'); + } else { + tables_action(button_id,table_src_element); + } + } +// end insert by lvn + // Custom3 else if (cmdID == 'custom3') { // insert some text editor_insertHTML(objname, "It's easy to add buttons that insert text!"); @@ -492,19 +564,6 @@ oTags[i].outerHTML = oTags[i].innerHTML; var tar_attribute = ''; var linkText = ''; - - // a few tests. - var elmSelectedImage; - var htmlSelectionControl = "Control"; - var grngMaster = editdoc.selection.createRange(); - if (editdoc.selection.type == htmlSelectionControl) { - // alright! here we have an image. - elmSelectedImage = grngMaster.item(0); - highlightedText = elmSelectedImage.outerHTML; - } - - else { // else NOT an image - if (editdoc.selection.createRange().parentElement().outerHTML.search(/^\<[A|a]/) != -1) { var fullElement = editdoc.selection.createRange().parentElement().outerHTML; @@ -531,7 +590,6 @@ oTags[i].outerHTML = oTags[i].innerHTML; linkText = lt[0]; } - } var myValues = new Object(); myValues.highlightedText = highlightedText; @@ -548,17 +606,11 @@ oTags[i].outerHTML = oTags[i].innerHTML; } } else { - if (myText) { - if (editdoc.selection.type == htmlSelectionControl) { - grngMaster.execCommand('Delete'); - } - editor_insertHTML(objname, unescape(myText) ); // this function ALWAYS puts in an absolute link - } + if (myText) { editor_insertHTML(objname, unescape(myText) ); } // this function ALWAYS puts in an absolute link } } - // insert image else if (cmdID.toLowerCase() == 'insertimage'){ showModalDialog(_editor_url + "popups/insert_image.html", editdoc, "resizable: no; help: no; status: no; scroll: no; "); @@ -576,8 +628,270 @@ oTags[i].outerHTML = oTags[i].innerHTML; } editor_event(objname); + // inserted by lvn + editor_obj.focus(); +// end insert by lvn } +// inserted by lvn : table operations +/* ---------------------------------------------------------------------- *\ + Function : tables_action + Description : perform an action on selected table + Usage : + Arguments : table_action - objectname + action to execute + td - startpoint cell +\* ---------------------------------------------------------------------- */ + +function tables_action(table_action,td) { + + // operations only valid on table cells + if (td.tagName == 'TD' || td.tagName == 'TH' ) { + var TableParts = table_action.split("_"); + var objname = table_action.replace(/^_(.*)_[^_]*$/, '$1'); + var cmdID = TableParts[ TableParts.length-1 ]; + var editor_obj = document.all["_" +objname + "_editor"]; + var config = document.all[objname].config; + var tr,td,tbody,table,newtr; + // get the table object model + tr = td.parentNode; + while(tr != null && tr.tagName != 'TR'){tr = tr.parentNode;} + if (tr != null) { + var tbody = tr.parentNode; + while(tbody != null && tbody.tagName != 'TBODY' && tbody.tagName != 'THEAD' && tbody.tagName != 'TFOOT'){tbody = tbody.parentNode;} + if (tbody != null) { + table = tbody.parentNode; + while(table!= null && table.tagName != 'TABLE'){table = table.parentNode;} + } + } + // only execute commands if table object model is complete + if (table != null) { + // local functions to insert rowdetails and columns + function insertRowDetails(tr,newtr) { + //for (var i=0;i < tr.childNodes.length;i++) { + for (var i=0;i < tr.cells.length;i++) { + newtr.insertCell(-1); + } + } + function insertColumn(tbody,where) { + //for (var i=0;i < tbody.childNodes.length;i++) { + for (var i=0;i < tbody.rows.length;i++) { + //tr = tbody.childNodes(i); + tr = tbody.rows(i); + //if (where > tr.childNodes.length){ + if (where > tr.cells.length){ + tr.insertCell(); + } else { + tr.insertCell(where); + } + } + } + function deleteColumn(tbody,where) { + //for (var i=0;i < tbody.childNodes.length;i++) { + for (var i=0;i < tbody.rows.length;i++) { + //var tr = tbody.childNodes(i); + var tr = tbody.rows(i); + //if (tr.childNodes.length - 1 < where){ + if (tr.cells.length - 1 < where){ + //tr.deleteCell(tr.childNodes.length - 1); + tr.deleteCell(tr.cells.length - 1); + } else { + tr.deleteCell(where); + } + //tr = tbody.childNodes(i); + tr = tbody.rows(i); + //if (tr.childNodes.length == 0){ + if (tr.cells.length == 0){ + tbody.deleteRow(i); + } + } + } + function splitCell(tbody,currTr,currTd){ + if (currTd.colSpan > 1) { + // rowspan > 1 just insert cell and decrease colspan + currTd.colSpan = currTd.colSpan - 1; + currTr.insertCell(currTd.cellIndex + 1); + } else { + // rowspan = 1 increase colspan for all other rows and insert cell in current row + for (var i=0;i < tbody.rows.length;i++) { + var tr = tbody.rows(i); + var td = tr.cells(currTd.cellIndex); + if (i == currTr.rowIndex) { + tr.insertCell(currTd.cellIndex + 1); + } else { + td.colSpan = td.colSpan + 1; + } + } + } + } + // commented out! + /* function mergeCells(tbody,currTr,currTd){ + // check if leftmost of cells to merge + var left = false; + for (var i=0;i < tbody.rows.length;i++) { + var tr = tbody.rows(i); + var allTd = tr.cells; + if (currTd.cellIndex + 2 > allTd.length) { + left = false; + break; + } else { + var td = tr.cells(currTd.cellIndex); + if (i != currTr.rowIndex) { + if (td.colSpan > 1) { + left = true; + } else { + left = false; + break; + } + } + } + } + if (left){ + for (var i=0;i < tbody.rows.length;i++){ + var tr = tbody.rows(i); + var td = tr.cells(currTd.cellIndex); + if (currTd.cellIndex + 2 > tr.length) { + alert("You can't merge cells here."); + return; + } else { + var mergeCell = tr.cells(currTd.cellIndex + 1); + if (i == currTr.rowIndex) { + // merge the contents of the current cell with the one on the right + currTd.innerHTML = currTd.innerHTML + mergeCell.innerHTML; + currTr.deleteCell(currTd.cellIndex + 1); + } else { + // decrease colspan for non current rows + td.colSpan = td.colSpan - 1; + } + } + } + } else { + alert('Select the leftmost cell of the split to merge.'); + } + } */ + function mergeCells(tbody,currTr,currTd){ + //first check if there are cells to the right + if (currTd.cellIndex < currTr.cells.length-1) { + //get current colspan and cell to be merged's colspan + //add the two together to get the new one, + //move the conetent and delete the right one + var currColSpan = currTd.colSpan ; + var mergeCellColSpan = currTr.cells(currTd.cellIndex+1).colSpan; + var mergeCell = currTr.cells(currTd.cellIndex+1); + currTd.innerHTML = currTd.innerHTML + mergeCell.innerHTML; + currTr.deleteCell(currTd.cellIndex + 1); + currTd.colSpan = currColSpan+mergeCellColSpan ; + } else { + alert('Select the leftmost cell of the split to merge.'); + } + } + function splitRow(tbody,currTr,currTd){ + // check rowspan on other cells + if (currTd.rowSpan > 1){ + currTd.rowSpan = currTd.rowSpan - 1; + var tr = tbody.rows(currTr.rowIndex + 1); + var where = 0; + for (var i=0;i < currTr.cells.length;i++) { + if (i < currTd.cellIndex){ + if (currTr.cells(i).rowSpan < 2){where++;} + } + } + tr.insertCell(where); + } else { + for (var i=0;i < currTr.cells.length;i++) { + var td = currTr.cells(i); + if (i == currTd.cellIndex) { + tr = tbody.insertRow(currTr.rowIndex + 1); + tr.insertCell(0); + } else { + td.rowSpan = td.rowSpan + 1; + } + } + } + } + function mergeRows(tbody,currTr,currTd){ + // check if topmost of cells to merge + var top = false; + if (currTd.rowSpan < 2){ + for (var i=0;i < currTr.cells.length;i++) { + if (i !== currTd.cellIndex) { + if (currTr.cells(i).rowSpan > 1){ + top = true; + break; + } + } + } + } + if (top){ + return; + } else { + alert('Select the topmost row of the split to merge.'); + } + } + // execute the operation depending on the given command + switch(cmdID) { + case 'CreateCaption' : table.createCaption();break; + case 'DeleteCaption' : table.deleteCaption();break; + case 'CreateTHead' : table.createTHead();break; + case 'DeleteTHead' : table.deleteTHead();break; + case 'CreateTFoot' : table.createTFoot();break; + case 'DeleteTFoot' : table.deleteTFoot();break; + case 'InsertRowTop' : newtr = tbody.insertRow(0);insertRowDetails(tr,newtr);break; + case 'InsertRowBottom' : newtr = tbody.insertRow(-1);insertRowDetails(tr,newtr);break; + case 'InsertRowBefore' : newtr = tbody.insertRow(tr.rowIndex);insertRowDetails(tr,newtr);break; + case 'InsertRowAfter' : newtr = tbody.insertRow(tr.rowIndex+1);insertRowDetails(tr,newtr);break; + case 'InsertRowStart' : newtr = tbody.insertRow(0);insertRowDetails(tr,newtr);break; + case 'DeleteRow' : tbody.deleteRow(tr.rowIndex);break; + case 'InsertColumnLeft' : insertColumn(tbody,0);break; + case 'InsertColumnRight' : insertColumn(tbody,-1);break; + case 'InsertColumnBefore' : insertColumn(tbody,td.cellIndex);break; + case 'InsertColumnAfter' : insertColumn(tbody,td.cellIndex+1);break; + case 'DeleteColumn' : deleteColumn(tbody,td.cellIndex);break; + case 'InsertCellLeft' : tr.insertCell(0);break; + case 'InsertCellRight' : tr.insertCell(-1);break; + case 'InsertCellBefore' : tr.insertCell(td.cellIndex);break; + case 'InsertCellAfter' : tr.insertCell(td.cellIndex+1);break; + case 'InsertCellStart' : tr.insertCell(0);break; + case 'DeleteCell' : tr.deleteCell(td.cellIndex);break; + case 'SplitCell' : splitCell(tbody,tr,td);break; + case 'MergeCells' : mergeCells(tbody,tr,td);break; + case 'SplitRow' : splitRow(tbody,tr,td);break; + case 'MergeRows' : mergeRows(tbody,tr,td);break; +// inserted by lvn : property pallettes + case 'TableProperties' : nullBorders(editor_obj.contentWindow.document,'hide'); + setGlobalVar('_editor_field',objname); + setGlobalVar('_editor_table',table); + showModalDialog(_editor_url + "popups/tableprop.html?"+objname, + window, + "resizable: yes; help: no; status: no; scroll: no; "); + td.focus(); + break; + case 'RowProperties' : setGlobalVar('_editor_field',objname); + setGlobalVar('_editor_row',tr); + showModalDialog(_editor_url + "popups/rowprop.html?"+objname, + window, + "resizable: yes; help: no; status: no; scroll: no; "); + td.focus(); + break; + case 'CellProperties' : setGlobalVar('_editor_field',objname); + setGlobalVar('_editor_cell',td); + showModalDialog(_editor_url + "popups/cellprop.html?"+objname, + window, + "resizable: yes; help: no; status: no; scroll: no; "); + td.focus(); + break; +// end insert lvn property pallettes + default : break; + } + // if 0 table borders and the switch to show them is on: show them + if (config.showborders){ // toggle is on : show null borders + nullBorders(editor_obj.contentWindow.document,'show'); + } + } + } + return; +} +// end insert by lvn + /* ---------------------------------------------------------------------- *\ Function : MS-Word clean-up Description : replace textarea with wysiwyg editor @@ -808,6 +1122,42 @@ function editor_updateToolbar(objname,action) { if (btnObj.disabled != false) { btnObj.disabled = false; } } } + + // inserted by lvn: table operations +// disable table handling buttons when not in a table cell + var table_src_element = null; + // only works on non-control ranges + if (editdoc.selection.type != 'Control'){ + table_src_element = editdoc.selection.createRange().parentElement(); + while (table_src_element != null && table_src_element.tagName != 'TD' && table_src_element.tagName != 'TH'){ + table_src_element = table_src_element.parentElement; + } + } + // check if buttons are set in the config + var IDList = Array('TableProperties','RowProperties','InsertRowBefore','InsertRowAfter','DeleteRow','InsertColumnBefore','InsertColumnAfter','DeleteColumn','CellProperties','InsertCellBefore','InsertCellAfter','DeleteCell','SplitCell','MergeCells','SplitRow','MergeRows'); + for (var i=0; i]*|'[^']*'|"[^"]*")*)>/g; // this will match tags, but still doesn't handle container tags (textarea, comments, etc) contents = contents.replace(matchTag, filterTag); - contents = contents.replace(/http:\/\/www\.___relativelink___\.com\//g, ""); // remove nextlines from output (if requested) if (config.replaceNextlines) { @@ -932,9 +1329,16 @@ function editor_setmode(objname, mode) { editor_obj = document.all["_" +objname + "_editor"]; editor_obj.value = contents; editor_event(objname); - + // inserted by lvn + if (config.showborders) { + editor_updateToolbar(objname, "disable"); + config.showborders = true; + } else { + // end insert by lvn editor_updateToolbar(objname, "disable"); // disable toolbar items - + // insert by lvn + } + // end insert by lvn // set event handlers editor_obj.onkeydown = function() { editor_event(objname); } editor_obj.onkeypress = function() { editor_event(objname); } @@ -983,11 +1387,13 @@ function editor_setmode(objname, mode) { + '' + contents + '\n' + '\n'; + // write to editor window var editdoc = editor_obj.contentWindow.document; @@ -1011,9 +1417,32 @@ function editor_setmode(objname, mode) { editdoc.body.onpaste = function() { editor_event(objname, 100); } editdoc.body.onblur = function() { editor_event(objname, -1); } + // inserted by lvn + // show table borders + if (config.showborders) { + nullBorders(editdoc,'show'); + var btnObj = document.all["_" +objname+ "_ShowBorder"]; + if(btnObj) { btnObj.className = 'btnDown'; } + } + // end insert by lvn + // bring focus to editor if (mode != 'init') { // don't focus on page load, only on mode switch editor_focus(editor_obj); + // insert by lvn : check editor changes) + } else { + if (config.checkChanges == 1) { + var localVar = getGlobalVar("objnames"); + if (localVar == null){ + setGlobalVar("objnames",objname); + } else { + localVar = localVar + ',' + objname; + setGlobalVar("objnames",localVar); + } + setGlobalVar("_" +objname + "_initialText",editdoc.body.innerHTML); + if (window.onbeforeunload == null){window.onbeforeunload = function() {discardOnExit();}} + } +// end insert by lvn } } @@ -1225,7 +1654,10 @@ function _isMouseOver(obj,event) { // determine if mouse is over object function editor_cMenu_generate(editorWin,objname) { var parentWin = window; editorWin.event.returnValue = false; // cancel default context menu - +// inserted by lvn : table operations + var table_object = document.all["_" +objname + "_editor"]; + var table_src_element = table_object.contentWindow.event.srcElement; +// end insert bylvn // define content menu options var cMenuOptions = [ // menu name, shortcut displayed, javascript code ['Cut', 'Ctrl-X', function() {}], @@ -1239,6 +1671,52 @@ function editor_cMenu_generate(editorWin,objname) { ['About this editor...', '', function() { alert("about this editor"); }]]; + + // inserted by lvn: table operations + // (uncomment to have more elements in popup menu) + if (table_src_element.tagName == 'TD') { + // set the contextmenu for tableactions when clicked in a table + cMenuOptions = [ + // ['Insert Table' , '' , function() {editor_action('_' + objname + '_' + 'InsertTable');}], + // ['Delete Table' , '' , function() {tables_action('_' + objname + '_' + 'DeleteTable',table_src_element);}], + // ['Insert Caption' , '' , function() {tables_action('_' + objname + '_' + 'CreateCaption',table_src_element);}], + // ['Delete Caption' , '' , function() {tables_action('_' + objname + '_' + 'DeleteCaption',table_src_element);}], + // ['Insert Head' , '' , function() {tables_action('_' + objname + '_' + 'CreateTHead',table_src_element);}], + // ['Delete Head' , '' , function() {tables_action('_' + objname + '_' + 'DeleteTHead',table_src_element);}], + // ['Insert Foot' , '' , function() {tables_action('_' + objname + '_' + 'CreateTFoot',table_src_element);}], + // ['Delete Foot' , '' , function() {tables_action('_' + objname + '_' + 'DeleteTFoot',table_src_element);}], + // ['Insert Row at Top' , '' , function() {tables_action('_' + objname + '_' + 'InsertRowTop',table_src_element );}], + // ['Insert Row at Bottom' , '' , function() {tables_action('_' + objname + '_' + 'InsertRowBottom',table_src_element );}], + ['Insert Row before' , '' , function() {tables_action('_' + objname + '_' + 'InsertRowBefore',table_src_element );}], + ['Insert Row after' , '' , function() {tables_action('_' + objname + '_' + 'InsertRowAfter',table_src_element );}], + ['Delete Row' , '' , function() {tables_action('_' + objname + '_' + 'DeleteRow',table_src_element );}], + // ['Insert Column leftmost', '' , function() {tables_action('_' + objname + '_' + 'InsertColumnLeft',table_src_element );}], + // ['Insert Column righttmost', '' , function() {tables_action('_' + objname + '_' + 'InsertColumnRight',table_src_element );}], + ['Insert Column before', '' , function() {tables_action('_' + objname + '_' + 'InsertColumnBefore',table_src_element );}], + ['Insert Column after', '' , function() {tables_action('_' + objname + '_' + 'InsertColumnAfter',table_src_element );}], + ['Delete Column', '' , function() {tables_action('_' + objname + '_' + 'DeleteColumn',table_src_element );}], + // ['Insert Cell leftmost', '' , function() {tables_action('_' + objname + '_' + 'InsertCellLeft',table_src_element );}], + // ['Insert Cell rightmost' , '' , function() {tables_action('_' + objname + '_' + 'InsertCellRight',table_src_element );}], + ['Insert Cell before' , '' , function() {tables_action('_' + objname + '_' + 'InsertCellBefore',table_src_element );}], + ['Insert Cell after' , '' , function() {tables_action('_' + objname + '_' + 'InsertCellAfter',table_src_element );}], + ['Delete Cell' , '' , function() {tables_action('_' + objname + '_' + 'DeleteCell',table_src_element );}], + ['Split Cell' , '' , function() {tables_action('_' + objname + '_' + 'SplitCell',table_src_element );}], + ['Merge Cells' , '' , function() {tables_action('_' + objname + '_' + 'MergeCells',table_src_element );}], + ['Split Row' , '' , function() {tables_action('_' + objname + '_' + 'SplitRow',table_src_element );}], + ['Merge Rows' , '' , function() {tables_action('_' + objname + '_' + 'MergeRows',table_src_element );}], +// inserted by lvn : property pallettes + ['Table Properties' , '' , function() {tables_action('_' + objname + '_' + 'TableProperties',table_src_element );}], + ['Row Properties' , '' , function() {tables_action('_' + objname + '_' + 'RowProperties',table_src_element );}], + ['Cell Properties' , '' , function() {tables_action('_' + objname + '_' + 'CellProperties',table_src_element );}] +// end insert lvn property pallettes + ]; + } else { + // reset to de default browser contextmenu + editorWin.event.returnValue = true; + return; + } +// end insert by lvn + editor_cMenu.options = cMenuOptions; // save options // generate context menu @@ -1368,6 +1846,25 @@ function getGlobalVar(varName, value) { } } +// insert by lvn : check editor changes +/* ---------------------------------------------------------------------- *\ + Function : discardOnExit + Description : check if contents have been changed and ask user confirmation + to discard changes + Usage : discardOnExit(); +\* ---------------------------------------------------------------------- */ +function discardOnExit(){ + var objNames = getGlobalVar("objnames").split(","); + for (var i=0;i < objNames.length;i++){ + if (document.all["_" +objNames[i] + "_editor"].contentWindow.document.body.innerHTML + != getGlobalVar("_" + objNames[i] + "_initialText")) { + event.returnValue = "Your document has been changed. Discard changes?"; + } + } +} +// end insert by lvn + + function CheckDocument() { oShell= new diff --git a/www/extras/htmlArea/images/ed_cellprop.gif b/www/extras/htmlArea/images/ed_cellprop.gif new file mode 100644 index 000000000..2f71bae6f Binary files /dev/null and b/www/extras/htmlArea/images/ed_cellprop.gif differ diff --git a/www/extras/htmlArea/images/ed_delcel.gif b/www/extras/htmlArea/images/ed_delcel.gif new file mode 100644 index 000000000..af48ea666 Binary files /dev/null and b/www/extras/htmlArea/images/ed_delcel.gif differ diff --git a/www/extras/htmlArea/images/ed_delcol.gif b/www/extras/htmlArea/images/ed_delcol.gif new file mode 100644 index 000000000..dc950738f Binary files /dev/null and b/www/extras/htmlArea/images/ed_delcol.gif differ diff --git a/www/extras/htmlArea/images/ed_delrow.gif b/www/extras/htmlArea/images/ed_delrow.gif new file mode 100644 index 000000000..a543c4655 Binary files /dev/null and b/www/extras/htmlArea/images/ed_delrow.gif differ diff --git a/www/extras/htmlArea/images/ed_insabove.gif b/www/extras/htmlArea/images/ed_insabove.gif new file mode 100644 index 000000000..dbc15eeb2 Binary files /dev/null and b/www/extras/htmlArea/images/ed_insabove.gif differ diff --git a/www/extras/htmlArea/images/ed_inscellft.gif b/www/extras/htmlArea/images/ed_inscellft.gif new file mode 100644 index 000000000..37da8f518 Binary files /dev/null and b/www/extras/htmlArea/images/ed_inscellft.gif differ diff --git a/www/extras/htmlArea/images/ed_inscelrgt.gif b/www/extras/htmlArea/images/ed_inscelrgt.gif new file mode 100644 index 000000000..4aab4fbc7 Binary files /dev/null and b/www/extras/htmlArea/images/ed_inscelrgt.gif differ diff --git a/www/extras/htmlArea/images/ed_insleft.gif b/www/extras/htmlArea/images/ed_insleft.gif new file mode 100644 index 000000000..67c82d7b6 Binary files /dev/null and b/www/extras/htmlArea/images/ed_insleft.gif differ diff --git a/www/extras/htmlArea/images/ed_insright.gif b/www/extras/htmlArea/images/ed_insright.gif new file mode 100644 index 000000000..a29c46b9b Binary files /dev/null and b/www/extras/htmlArea/images/ed_insright.gif differ diff --git a/www/extras/htmlArea/images/ed_insunder.gif b/www/extras/htmlArea/images/ed_insunder.gif new file mode 100644 index 000000000..4ed40c17d Binary files /dev/null and b/www/extras/htmlArea/images/ed_insunder.gif differ diff --git a/www/extras/htmlArea/images/ed_mergecels.gif b/www/extras/htmlArea/images/ed_mergecels.gif new file mode 100644 index 000000000..b47c3fb28 Binary files /dev/null and b/www/extras/htmlArea/images/ed_mergecels.gif differ diff --git a/www/extras/htmlArea/images/ed_mergerows.gif b/www/extras/htmlArea/images/ed_mergerows.gif new file mode 100644 index 000000000..35a0091cb Binary files /dev/null and b/www/extras/htmlArea/images/ed_mergerows.gif differ diff --git a/www/extras/htmlArea/images/ed_new.gif b/www/extras/htmlArea/images/ed_new.gif new file mode 100644 index 000000000..51f6563e1 Binary files /dev/null and b/www/extras/htmlArea/images/ed_new.gif differ diff --git a/www/extras/htmlArea/images/ed_paste.gif b/www/extras/htmlArea/images/ed_paste.gif new file mode 100644 index 000000000..b173d3d53 Binary files /dev/null and b/www/extras/htmlArea/images/ed_paste.gif differ diff --git a/www/extras/htmlArea/images/ed_preview.gif b/www/extras/htmlArea/images/ed_preview.gif new file mode 100644 index 000000000..3dae943bb Binary files /dev/null and b/www/extras/htmlArea/images/ed_preview.gif differ diff --git a/www/extras/htmlArea/images/ed_print.gif b/www/extras/htmlArea/images/ed_print.gif new file mode 100644 index 000000000..f9baef8ac Binary files /dev/null and b/www/extras/htmlArea/images/ed_print.gif differ diff --git a/www/extras/htmlArea/images/ed_rowprop.gif b/www/extras/htmlArea/images/ed_rowprop.gif new file mode 100644 index 000000000..76397253f Binary files /dev/null and b/www/extras/htmlArea/images/ed_rowprop.gif differ diff --git a/www/extras/htmlArea/images/ed_save.gif b/www/extras/htmlArea/images/ed_save.gif new file mode 100644 index 000000000..eeafe9bed Binary files /dev/null and b/www/extras/htmlArea/images/ed_save.gif differ diff --git a/www/extras/htmlArea/images/ed_show_border.gif b/www/extras/htmlArea/images/ed_show_border.gif new file mode 100644 index 000000000..87833b6ee Binary files /dev/null and b/www/extras/htmlArea/images/ed_show_border.gif differ diff --git a/www/extras/htmlArea/images/ed_splitcel.gif b/www/extras/htmlArea/images/ed_splitcel.gif new file mode 100644 index 000000000..48442e23a Binary files /dev/null and b/www/extras/htmlArea/images/ed_splitcel.gif differ diff --git a/www/extras/htmlArea/images/ed_splitrow.gif b/www/extras/htmlArea/images/ed_splitrow.gif new file mode 100644 index 000000000..97c0db16f Binary files /dev/null and b/www/extras/htmlArea/images/ed_splitrow.gif differ diff --git a/www/extras/htmlArea/images/ed_table.gif b/www/extras/htmlArea/images/ed_table.gif new file mode 100644 index 000000000..4ce3ff49c Binary files /dev/null and b/www/extras/htmlArea/images/ed_table.gif differ diff --git a/www/extras/htmlArea/images/ed_tableprop.gif b/www/extras/htmlArea/images/ed_tableprop.gif new file mode 100644 index 000000000..e15a4a444 Binary files /dev/null and b/www/extras/htmlArea/images/ed_tableprop.gif differ diff --git a/www/extras/htmlArea/images/ed_upload.gif b/www/extras/htmlArea/images/ed_upload.gif new file mode 100644 index 000000000..5b88b64d1 Binary files /dev/null and b/www/extras/htmlArea/images/ed_upload.gif differ diff --git a/www/extras/htmlArea/popups/blank.html b/www/extras/htmlArea/popups/blank.html new file mode 100644 index 000000000..5b1b16d1f --- /dev/null +++ b/www/extras/htmlArea/popups/blank.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/www/extras/htmlArea/popups/cellprop.html b/www/extras/htmlArea/popups/cellprop.html new file mode 100644 index 000000000..f3e1644a0 --- /dev/null +++ b/www/extras/htmlArea/popups/cellprop.html @@ -0,0 +1,262 @@ + + + + + + + + Cell Properties + + + + + + +
+ Height: +
+ + +
+ Width: +
+ + +
+ Id: +
+ +
+ Tooltip: +
+ +
+ Background Image: +
+ +
+ Horizontal Align: +
+ +
+ Vertical Align: +
+ +
+ Background Color: +
+
+
+ Border Color: +
+
+
+ Border Color Dark: +
+
+
+ Border Color Light: +
+
+
+ Colspan: +
+ +
+ Rowspan: +
+ +
+ No Wrap: +
+ + + + + \ No newline at end of file diff --git a/www/extras/htmlArea/popups/cellpropold.html b/www/extras/htmlArea/popups/cellpropold.html new file mode 100644 index 000000000..7c94b95fa --- /dev/null +++ b/www/extras/htmlArea/popups/cellpropold.html @@ -0,0 +1,171 @@ + + + + + + + + Cell Properties + + + + + + +
+ Height: +
+ +
+ Width: +
+ +
+ Id: +
+ +
+ Align: +
+ +
+ Vertical Align: +
+ +
+ Background Image: +
+ +
+ Background Color: +
+ +
+ Border Color: +
+ +
+ Border Color Dark: +
+ +
+ Border Color Light: +
+ +
+ Tooltip: +
+ +
+ Colspan: +
+ +
+ Rowspan: +
+ +
+ No Wrap: +
+ + + + + \ No newline at end of file diff --git a/www/extras/htmlArea/popups/rowprop.html b/www/extras/htmlArea/popups/rowprop.html new file mode 100644 index 000000000..270f7482c --- /dev/null +++ b/www/extras/htmlArea/popups/rowprop.html @@ -0,0 +1,223 @@ + + + + + + + + Row Properties + + + + + + +
+ Height: +
+ + +
+ Width: +
+ + +
+ Id: +
+ +
+ Tooltip: +
+ +
+ Horizontal Align: +
+ +
+ Vertical Align: +
+ +
+ Background Color: +
+
+
+ Border Color: +
+
+
+ Border Color Dark: +
+
+
+ Border Color Light: +
+
+ + + + \ No newline at end of file diff --git a/www/extras/htmlArea/popups/set_color.html b/www/extras/htmlArea/popups/set_color.html new file mode 100644 index 000000000..2c19b4089 --- /dev/null +++ b/www/extras/htmlArea/popups/set_color.html @@ -0,0 +1,352 @@ + + +Select Color + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
No Color
+ +
+ \ No newline at end of file diff --git a/www/extras/htmlArea/popups/tableprop.html b/www/extras/htmlArea/popups/tableprop.html new file mode 100644 index 000000000..a0a77a27f --- /dev/null +++ b/www/extras/htmlArea/popups/tableprop.html @@ -0,0 +1,302 @@ + + + + + + + + Table Properties + + + + + + +
+ Height: +
+ + +
+ Width: +
+ + +
+ Border: +
+ + +
+ Id: +
+ +
+ Caption: +
+ +
+ Tooltip: +
+ +
+ Background Image: +
+ +
+ Frame: +
+ +
+ Rules: +
+ +
+ Horizontal Align: +
+ +
+ Cell Padding: +
+ +
+ Cell Spacing: +
+ +
+ Background Color: +
+
+
+ Border Color: +
+
+
+ Border Color Dark: +
+
+
+ Border Color Light: +
+
+ + + + \ No newline at end of file