rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
dwrErrorHandler = handler;
dwrDeprecated(); DWREngine.setErrorHandler(handler);
function dwrSetErrorHandler(handler){ dwrErrorHandler = handler;}
dwrPostHook = handler;
dwrDeprecated(); DWREngine.setPostHook(handler);
function dwrSetPostHook(handler){ dwrPostHook = handler;}
dwrPreHook = handler;
dwrDeprecated(); DWREngine.setPreHook(handler);
function dwrSetPreHook(handler){ dwrPreHook = handler;}
try
function dwrStateChange(call){ if (call.req.readyState == 4) { try { if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); } } catch (ex) { dwrHandleError(call.id, ex); } }}
catch (ex)
function dwrStateChange(call){ if (call.req.readyState == 4) { try { if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); } } catch (ex) { dwrHandleError(call.id, ex); } }}
dwrHandleError(call.id, ex);
function dwrStateChange(call){ if (call.req.readyState == 4) { try { if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); } } catch (ex) { dwrHandleError(call.id, ex); } }}
if (call.req.status == 200)
try
function dwrStateChange(call){ if (call.req.readyState == 4) { if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); } }}
eval(call.req.responseText);
if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); }
function dwrStateChange(call){ if (call.req.readyState == 4) { if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); } }}
else
catch (ex)
function dwrStateChange(call){ if (call.req.readyState == 4) { if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); } }}
dwrHandleError(call.id, call.req.responseText);
dwrHandleError(call.id, ex);
function dwrStateChange(call){ if (call.req.readyState == 4) { if (call.req.status == 200) { eval(call.req.responseText); } else { dwrHandleError(call.id, call.req.responseText); } }}
each: function( fn ) {
each: function( fn, args ) {
each: function( fn ) { // Iterate through all of the matched elements for ( var i = 0; i < this.length; i++ ) // Execute the function within the context of each element fn.apply( this[i], [i] ); return this; },
fn.apply( this[i], [i] );
fn.apply( this[i], args || [i] );
each: function( fn ) { // Iterate through all of the matched elements for ( var i = 0; i < this.length; i++ ) // Execute the function within the context of each element fn.apply( this[i], [i] ); return this; },
for ( var i = 0; i < this.size(); i++ ) $.apply( this.get(i), f, [i] ); return this; },
for ( var i = 0; i < this.size(); i++ ) f.apply( this.get(i), [i] ); return this; },
each: function(f) { for ( var i = 0; i < this.size(); i++ ) $.apply( this.get(i), f, [i] ); return this; },
rv = ch.charCodeAt().toString(16);
var rv = ch.charCodeAt().toString(16);
function ecmaEscape(str){ function replaceNonPrintables(ch) { rv = ch.charCodeAt().toString(16); if (rv.length == 1) rv = "0" + rv; else if (rv.length == 3) rv = "u0" + rv; else if (rv.length == 4) rv = "u" + rv; return "%" + rv; }; // Replace any character that is not in the 69 character set // [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./] // with an escape sequence. Two digit sequences in the form %XX are used // for characters whose codepoint is less than 255, %uXXXX for all others. // See section B.2.1 of ECMA-262 rev3 for more information. return str.replace(/[^A-Za-z0-9@*_+.\-\/]/g, replaceNonPrintables);}
var rv;
function ecmaUnescape(str){ function replaceEscapes(seq) { var ary = seq.match(/([\da-f]{1,2})(.*)|u([\da-f]{1,4})/); if (!ary) return "<ERROR>"; if (ary[1]) { // two digit escape, possibly with cruft after rv = String.fromCharCode(parseInt(ary[1], 16)) + ary[2]; } else { // four digits, no cruft rv = String.fromCharCode(parseInt(ary[3], 16)); } return rv; }; // Replace the escape sequences %X, %XX, %uX, %uXX, %uXXX, and %uXXXX with // the characters they represent, where X is a hexadecimal digit. // See section B.2.2 of ECMA-262 rev3 for more information. return str.replace(/%u?([\da-f]{1,4})/ig, replaceEscapes);}
var selArray = resultsTree.getElementsByAttribute('selected', 'true');
function EditCard(){ var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); var resultsTree = document.getElementById('resultsTree'); var selArray = resultsTree.getElementsByAttribute('selected', 'true'); if ( selArray && selArray.length == 1 ) { var uri = selArray[0].getAttribute('id'); var card = rdf.GetResource(uri); card = card.QueryInterface(Components.interfaces.nsIAbCard); AbEditCardDialog(card, UpdateCardView); }}
if ( selArray && selArray.length == 1 )
if ( resultsTree.selectedItems && resultsTree.selectedItems.length == 1 )
function EditCard(){ var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); var resultsTree = document.getElementById('resultsTree'); var selArray = resultsTree.getElementsByAttribute('selected', 'true'); if ( selArray && selArray.length == 1 ) { var uri = selArray[0].getAttribute('id'); var card = rdf.GetResource(uri); card = card.QueryInterface(Components.interfaces.nsIAbCard); AbEditCardDialog(card, UpdateCardView); }}
var uri = selArray[0].getAttribute('id');
var uri = resultsTree.selectedItems[0].getAttribute('id');
function EditCard(){ var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); var resultsTree = document.getElementById('resultsTree'); var selArray = resultsTree.getElementsByAttribute('selected', 'true'); if ( selArray && selArray.length == 1 ) { var uri = selArray[0].getAttribute('id'); var card = rdf.GetResource(uri); card = card.QueryInterface(Components.interfaces.nsIAbCard); AbEditCardDialog(card, UpdateCardView); }}
SetCardValues(gEditCard.card, document);
CheckAndSetCardValues(gEditCard.card, document, false);
function EditCardOKButton(){ // See if this card is in any mailing list // if so then we need to update the addresslists of those mailing lists var index = -1; var directory = GetDirectoryFromURI(gEditCard.abURI); // if the directory is a mailing list we need to search all the mailing lists // in the parent directory if the card exists. if (directory.isMailList) { var parentURI = GetParentDirectoryFromMailingListURI(gEditCard.abURI); directory = GetDirectoryFromURI(parentURI); } var listDirectoriesCount = directory.addressLists.Count(); var foundDirectories = new Array(); var foundDirectoriesCount = 0; var i; // create a list of mailing lists and the index where the card is at. for ( i=0; i < listDirectoriesCount; i++ ) { var subdirectory = directory.addressLists.QueryElementAt(i, Components.interfaces.nsIAbDirectory); index = findCardIndex(subdirectory); if (index > -1) { foundDirectories[foundDirectoriesCount] = {directory:subdirectory, index:index}; foundDirectoriesCount++; } } SetCardValues(gEditCard.card, document); gEditCard.card.editCardToDatabase(gEditCard.abURI); for (i=0; i<foundDirectoriesCount; i++) { // Update the addressLists item for this card foundDirectories[i].directory.addressLists. SetElementAt(foundDirectories[i].index, gEditCard.card); } NotifySaveListeners(); // callback to allow caller to update if (gOkCallback) gOkCallback(); return true; // close the window}
window.setCursor( "wait" );
function editEvent( calendarEvent ){ // set up a bunch of args to pass to the dialog var args = new Object(); args.mode = "edit"; args.onOk = self.modifyEventDialogResponse; args.calendarEvent = calendarEvent; // open the dialog modally openDialog("chrome://calendar/content/calendarEventDialog.xul", "caEditEvent", "chrome,modal", args );}
window.setCursor( "wait" );
function editNewEvent( calendarEvent, server ){ // set up a bunch of args to pass to the dialog var args = new Object(); args.mode = "new"; args.onOk = self.addEventDialogResponse; args.calendarEvent = calendarEvent; if( server ) args.server = server; // open the dialog modally openDialog("chrome://calendar/content/calendarEventDialog.xul", "caEditEvent", "chrome,modal", args );}
contentWindow.focus();
function EditorAlign(align){ dump("aligning\n"); window.editorShell.Align(align);}
window.content.focus();
window._content.focus();
function EditorApplyStyle(tagName){ editorShell.SetTextProperty(tagName, "", ""); window.content.focus();}
if (IsWebComposer() && event.target && IsHTMLEditor() && gEditorDisplayMode == kDisplayModeAllTags)
if (IsWebComposer() && event.explicitOriginalTarget && IsHTMLEditor() && gEditorDisplayMode == kDisplayModeAllTags)
function EditorClick(event){ if (!event) return; if (event.detail == 2) { EditorDblClick(event); return; } // For Web Composer: In Show All Tags Mode, // single click selects entire element, // except for body and table elements if (IsWebComposer() && event.target && IsHTMLEditor() && gEditorDisplayMode == kDisplayModeAllTags) { try { var element = event.target.QueryInterface( Components.interfaces.nsIDOMElement); var name = element.localName.toLowerCase(); if (name != "body" && name != "table" && name != "td" && name != "th" && name != "caption" && name != "tr") { GetCurrentEditor().selectElement(event.target); event.preventDefault(); } } catch (e) {} }}
var element = event.target.QueryInterface( Components.interfaces.nsIDOMElement);
var element = event.explicitOriginalTarget.QueryInterface( Components.interfaces.nsIDOMElement);
function EditorClick(event){ if (!event) return; if (event.detail == 2) { EditorDblClick(event); return; } // For Web Composer: In Show All Tags Mode, // single click selects entire element, // except for body and table elements if (IsWebComposer() && event.target && IsHTMLEditor() && gEditorDisplayMode == kDisplayModeAllTags) { try { var element = event.target.QueryInterface( Components.interfaces.nsIDOMElement); var name = element.localName.toLowerCase(); if (name != "body" && name != "table" && name != "td" && name != "th" && name != "caption" && name != "tr") { GetCurrentEditor().selectElement(event.target); event.preventDefault(); } } catch (e) {} }}
GetCurrentEditor().selectElement(event.target);
GetCurrentEditor().selectElement(event.explicitOriginalTarget);
function EditorClick(event){ if (!event) return; if (event.detail == 2) { EditorDblClick(event); return; } // For Web Composer: In Show All Tags Mode, // single click selects entire element, // except for body and table elements if (IsWebComposer() && event.target && IsHTMLEditor() && gEditorDisplayMode == kDisplayModeAllTags) { try { var element = event.target.QueryInterface( Components.interfaces.nsIDOMElement); var name = element.localName.toLowerCase(); if (name != "body" && name != "table" && name != "td" && name != "th" && name != "caption" && name != "tr") { GetCurrentEditor().selectElement(event.target); event.preventDefault(); } } catch (e) {} }}
contentWindow.focus();
function EditorCopy(){ window.editorShell.Copy();}
contentWindow.focus();
function EditorCut(){ window.editorShell.Cut();}
if (event.target)
if (event.explicitOriginalTarget)
function EditorDblClick(event){ if (event.target) { // Only bring up properties if clicked on an element or selected link var element; try { element = event.target.QueryInterface(Components.interfaces.nsIDOMElement); } catch (e) {} // We use "href" instead of "a" to not be fooled by named anchor if (!element) try { element = GetCurrentEditor().getSelectedElement("href"); } catch (e) {} if (element) { goDoCommand("cmd_objectProperties"); event.preventDefault(); } }}
element = event.target.QueryInterface(Components.interfaces.nsIDOMElement);
element = event.explicitOriginalTarget.QueryInterface( Components.interfaces.nsIDOMElement);
function EditorDblClick(event){ if (event.target) { // Only bring up properties if clicked on an element or selected link var element; try { element = event.target.QueryInterface(Components.interfaces.nsIDOMElement); } catch (e) {} // We use "href" instead of "a" to not be fooled by named anchor if (!element) try { element = GetCurrentEditor().getSelectedElement("href"); } catch (e) {} if (element) { goDoCommand("cmd_objectProperties"); event.preventDefault(); } }}
dump(outputHTML + "\n");
function EditorDumpContent(){ if (window.editorShell) { dump("============== Content Tree: ================\n"); window.editorShell.DumpContentTree(); dump(outputHTML + "\n"); }}
inputStream.init(theFile, 1, 0);
inputStream.init(theFile, 1, 0, false);
function EditorExecuteScript(theFile){ var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(); inputStream = inputStream.QueryInterface(Components.interfaces.nsIFileInputStream); inputStream.init(theFile, 1, 0); // open read only var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(); scriptableInputStream = scriptableInputStream.QueryInterface(Components.interfaces.nsIScriptableInputStream); scriptableInputStream.init(inputStream); // open read only var buf = { value:null }; var tmpBuf = { value:null }; var didTruncate = { value:false }; var lineNum = 0; var ex;/* // Log files can be quite huge, so read in a line // at a time and execute it: while (!inputStream.eof()) { buf.value = ""; didTruncate.value = true; // Keep looping until we get a complete line of // text, or we hit the end of file: while (didTruncate.value && !inputStream.eof()) { didTruncate.value = false; fileSpec.readLine(tmpBuf, 1024, didTruncate); buf.value += tmpBuf.value; // XXX Need to null out tmpBuf.value to avoid crashing // XXX in some JavaScript string allocation method. // XXX This is probably leaking the buffer allocated // XXX by the readLine() implementation. tmpBuf.value = null; } ++lineNum;*/ { // suck in the entire file var fileSize = scriptableInputStream.available(); var fileContents = scriptableInputStream.read(fileSize); dump(fileContents); try { eval(fileContents); } catch(ex) { dump("Playback ERROR: Line " + lineNum + " " + ex + "\n"); return; } } buf.value = null;}
window.editorShell.exit();
window.editorShell.Exit();
function EditorExit(){ if (window.editorShell) { dump("Exiting\n"); window.editorShell.exit(); }}
var haveProps = IsMenuItemShowing("objectProperties_cm");
var haveProps = IsMenuItemShowing("objectProperties_cm") || IsMenuItemShowing("menu_saveImage_cm")
function EditorFillContextMenu(event, contextMenuNode){ if ( event.target != contextMenuNode ) return; goUpdateCommand("cmd_undo"); goUpdateCommand("cmd_redo"); goUpdateCommand("cmd_cut"); goUpdateCommand("cmd_copy"); goUpdateCommand("cmd_paste"); goUpdateCommand("cmd_delete"); // Setup object property menuitem var objectName = InitObjectPropertiesMenuitem("objectProperties_cm"); InitRemoveStylesMenuitems("removeStylesMenuitem_cm", "removeLinksMenuitem_cm"); var inCell = IsInTableCell(); // Set appropriate text for join cells command InitJoinCellMenuitem("joinTableCells_cm"); goUpdateCommand("cmd_JoinTableCells"); goUpdateCommand("cmd_SplitTableCell"); goUpdateCommand("cmd_TableOrCellColor"); // Loop through all children to hide disabled items var children = contextMenuNode.childNodes; if (children) { var count = children.length; for (var i = 0; i < count; i++) HideDisabledItem(children.item(i)); } // Remove separators if all items in immediate group above are hidden // A bit complicated to account if multiple groups are completely hidden! var haveUndo = IsMenuItemShowing("menu_undo_cm") || IsMenuItemShowing("menu_redo_cm"); var haveEdit = IsMenuItemShowing("menu_cut_cm") || IsMenuItemShowing("menu_copy_cm") || IsMenuItemShowing("menu_paste_cm") || IsMenuItemShowing("menu_delete_cm"); var haveStyle = IsMenuItemShowing("removeStylesMenuitem_cm") || IsMenuItemShowing("createLink_cm") || IsMenuItemShowing("removeLinksMenuitem_cm"); var haveProps = IsMenuItemShowing("objectProperties_cm"); ShowMenuItem("undoredo-separator", haveUndo && haveEdit); ShowMenuItem("edit-separator", haveEdit || haveUndo); // Note: Item "menu_selectAll_cm" and // folowing separator are ALWAYS enabled, // so there will always be 1 separator here ShowMenuItem("styles-separator", haveStyle && (haveProps || inCell)); ShowMenuItem("property-separator", (haveProps && inCell) || !haveStyle); // Remove table submenus if not in table ShowMenuItem("tableInsertMenu_cm", inCell); ShowMenuItem("tableSelectMenu_cm", inCell); ShowMenuItem("tableDeleteMenu_cm", inCell);}
dump("haveStyle = "+haveStyle+", "+haveProps+", inCell"+inCell+"\n");
function EditorFillContextMenu(event, contextMenuNode){ if ( event.target != contextMenuNode ) return; goUpdateCommand("cmd_undo"); goUpdateCommand("cmd_redo"); goUpdateCommand("cmd_cut"); goUpdateCommand("cmd_copy"); goUpdateCommand("cmd_paste"); goUpdateCommand("cmd_delete"); // Setup object property menuitem var objectName = InitObjectPropertiesMenuitem("objectProperties_cm"); InitRemoveStylesMenuitems("removeStylesMenuitem_cm", "removeLinksMenuitem_cm"); var inCell = IsInTableCell(); // Set appropriate text for join cells command InitJoinCellMenuitem("joinTableCells_cm"); goUpdateCommand("cmd_JoinTableCells"); goUpdateCommand("cmd_SplitTableCell"); goUpdateCommand("cmd_TableOrCellColor"); // Loop through all children to hide disabled items var children = contextMenuNode.childNodes; if (children) { var count = children.length; for (var i = 0; i < count; i++) HideDisabledItem(children.item(i)); } // Remove separators if all items in immediate group above are hidden // A bit complicated to account if multiple groups are completely hidden! var haveUndo = IsMenuItemShowing("menu_undo_cm") || IsMenuItemShowing("menu_redo_cm"); var haveEdit = IsMenuItemShowing("menu_cut_cm") || IsMenuItemShowing("menu_copy_cm") || IsMenuItemShowing("menu_paste_cm") || IsMenuItemShowing("menu_delete_cm"); var haveStyle = IsMenuItemShowing("removeStylesMenuitem_cm") || IsMenuItemShowing("createLink_cm") || IsMenuItemShowing("removeLinksMenuitem_cm"); var haveProps = IsMenuItemShowing("objectProperties_cm"); ShowMenuItem("undoredo-separator", haveUndo && haveEdit); ShowMenuItem("edit-separator", haveEdit || haveUndo); // Note: Item "menu_selectAll_cm" and // folowing separator are ALWAYS enabled, // so there will always be 1 separator here ShowMenuItem("styles-separator", haveStyle && (haveProps || inCell)); ShowMenuItem("property-separator", (haveProps && inCell) || !haveStyle); // Remove table submenus if not in table ShowMenuItem("tableInsertMenu_cm", inCell); ShowMenuItem("tableSelectMenu_cm", inCell); ShowMenuItem("tableDeleteMenu_cm", inCell);}
contentWindow.focus();
function EditorFind(){ window.editorShell.Find();}
var outputHTML = editorShell.GetContentsAs("text/html", 0);
var outputHTML = editorShell.GetContentsAs("text/html", 256);
function EditorGetHTML(){ if (editorShell) { dump("Getting HTML\n"); var outputHTML = editorShell.GetContentsAs("text/html", 0); dump(outputHTML + "\n"); }}
var fs = Components.classes["component:
var fs = Components.classes["@mozilla.org/filespec;1"].createInstance();
function EditorGetScriptFileSpec(){ var fs = Components.classes["component://netscape/filespec"].createInstance(); fs = fs.QueryInterface(Components.interfaces.nsIFileSpec); fs.unixStyleFilePath = "journal.js"; return fs;}
*/
function EditorInitEditMenu(){ // Fake the keybinding hint for the "Clear" item // (Don't bother for Mac?) if (!gIsMac) document.getElementById("menu_clear").setAttribute("acceltext", GetString("Del")); //TODO: We should modify the Paste menuitem to build a submenu // with multiple paste format types}
case 'IMG':
case 'img':
function EditorInitFormatMenu(){ // Set the string for the background color menu item SetBackColorString("backgroundColorMenu"); var menuItem = document.getElementById("objectProperties"); if (menuItem) { var element = GetSelectedElementOrParentCell(); var menuStr = GetString("ObjectProperties"); if (element && element.nodeName) { var objStr = ""; menuItem.removeAttribute("disabled"); switch (element.nodeName) { case 'IMG': objStr = GetString("Image"); break; case 'HR': objStr = GetString("HLine"); break; case 'TABLE': objStr = GetString("Table"); break; case 'TD': objStr = GetString("TableCell"); break; case 'A': if(element.href) objStr = GetString("Link"); else if (element.name) objStr = GetString("NamedAnchor"); break; } menuStr = menuStr.replace(/%obj%/,objStr); } else { // We show generic "Properties" string, but disable menu item menuItem.setAttribute("disabled","true"); // Replace placeholder with "", then remaining space on left side menuStr = menuStr.replace(/%obj%/,"").replace(/^\s+/, ""); } menuItem.setAttribute("value", menuStr); }}
case 'HR':
case 'hr':
function EditorInitFormatMenu(){ // Set the string for the background color menu item SetBackColorString("backgroundColorMenu"); var menuItem = document.getElementById("objectProperties"); if (menuItem) { var element = GetSelectedElementOrParentCell(); var menuStr = GetString("ObjectProperties"); if (element && element.nodeName) { var objStr = ""; menuItem.removeAttribute("disabled"); switch (element.nodeName) { case 'IMG': objStr = GetString("Image"); break; case 'HR': objStr = GetString("HLine"); break; case 'TABLE': objStr = GetString("Table"); break; case 'TD': objStr = GetString("TableCell"); break; case 'A': if(element.href) objStr = GetString("Link"); else if (element.name) objStr = GetString("NamedAnchor"); break; } menuStr = menuStr.replace(/%obj%/,objStr); } else { // We show generic "Properties" string, but disable menu item menuItem.setAttribute("disabled","true"); // Replace placeholder with "", then remaining space on left side menuStr = menuStr.replace(/%obj%/,"").replace(/^\s+/, ""); } menuItem.setAttribute("value", menuStr); }}
case 'TABLE':
case 'table':
function EditorInitFormatMenu(){ // Set the string for the background color menu item SetBackColorString("backgroundColorMenu"); var menuItem = document.getElementById("objectProperties"); if (menuItem) { var element = GetSelectedElementOrParentCell(); var menuStr = GetString("ObjectProperties"); if (element && element.nodeName) { var objStr = ""; menuItem.removeAttribute("disabled"); switch (element.nodeName) { case 'IMG': objStr = GetString("Image"); break; case 'HR': objStr = GetString("HLine"); break; case 'TABLE': objStr = GetString("Table"); break; case 'TD': objStr = GetString("TableCell"); break; case 'A': if(element.href) objStr = GetString("Link"); else if (element.name) objStr = GetString("NamedAnchor"); break; } menuStr = menuStr.replace(/%obj%/,objStr); } else { // We show generic "Properties" string, but disable menu item menuItem.setAttribute("disabled","true"); // Replace placeholder with "", then remaining space on left side menuStr = menuStr.replace(/%obj%/,"").replace(/^\s+/, ""); } menuItem.setAttribute("value", menuStr); }}
case 'TD':
case 'td':
function EditorInitFormatMenu(){ // Set the string for the background color menu item SetBackColorString("backgroundColorMenu"); var menuItem = document.getElementById("objectProperties"); if (menuItem) { var element = GetSelectedElementOrParentCell(); var menuStr = GetString("ObjectProperties"); if (element && element.nodeName) { var objStr = ""; menuItem.removeAttribute("disabled"); switch (element.nodeName) { case 'IMG': objStr = GetString("Image"); break; case 'HR': objStr = GetString("HLine"); break; case 'TABLE': objStr = GetString("Table"); break; case 'TD': objStr = GetString("TableCell"); break; case 'A': if(element.href) objStr = GetString("Link"); else if (element.name) objStr = GetString("NamedAnchor"); break; } menuStr = menuStr.replace(/%obj%/,objStr); } else { // We show generic "Properties" string, but disable menu item menuItem.setAttribute("disabled","true"); // Replace placeholder with "", then remaining space on left side menuStr = menuStr.replace(/%obj%/,"").replace(/^\s+/, ""); } menuItem.setAttribute("value", menuStr); }}
case 'A': if(element.href)
case 'a': if (element.name) objStr = GetString("NamedAnchor"); else if(element.href)
function EditorInitFormatMenu(){ // Set the string for the background color menu item SetBackColorString("backgroundColorMenu"); var menuItem = document.getElementById("objectProperties"); if (menuItem) { var element = GetSelectedElementOrParentCell(); var menuStr = GetString("ObjectProperties"); if (element && element.nodeName) { var objStr = ""; menuItem.removeAttribute("disabled"); switch (element.nodeName) { case 'IMG': objStr = GetString("Image"); break; case 'HR': objStr = GetString("HLine"); break; case 'TABLE': objStr = GetString("Table"); break; case 'TD': objStr = GetString("TableCell"); break; case 'A': if(element.href) objStr = GetString("Link"); else if (element.name) objStr = GetString("NamedAnchor"); break; } menuStr = menuStr.replace(/%obj%/,objStr); } else { // We show generic "Properties" string, but disable menu item menuItem.setAttribute("disabled","true"); // Replace placeholder with "", then remaining space on left side menuStr = menuStr.replace(/%obj%/,"").replace(/^\s+/, ""); } menuItem.setAttribute("value", menuStr); }}
else if (element.name) objStr = GetString("NamedAnchor");
function EditorInitFormatMenu(){ // Set the string for the background color menu item SetBackColorString("backgroundColorMenu"); var menuItem = document.getElementById("objectProperties"); if (menuItem) { var element = GetSelectedElementOrParentCell(); var menuStr = GetString("ObjectProperties"); if (element && element.nodeName) { var objStr = ""; menuItem.removeAttribute("disabled"); switch (element.nodeName) { case 'IMG': objStr = GetString("Image"); break; case 'HR': objStr = GetString("HLine"); break; case 'TABLE': objStr = GetString("Table"); break; case 'TD': objStr = GetString("TableCell"); break; case 'A': if(element.href) objStr = GetString("Link"); else if (element.name) objStr = GetString("NamedAnchor"); break; } menuStr = menuStr.replace(/%obj%/,objStr); } else { // We show generic "Properties" string, but disable menu item menuItem.setAttribute("disabled","true"); // Replace placeholder with "", then remaining space on left side menuStr = menuStr.replace(/%obj%/,"").replace(/^\s+/, ""); } menuItem.setAttribute("value", menuStr); }}
if (editorShell.GetFirstSelectedCell())
var tagNameObj = new Object; var countObj = new Object; if (window.editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj) && countObj.value > 1)
function EditorInitTableMenu(){ // Change text on the "Join..." item depending if we // are joining selected cells or just cell to right // TODO: What to do about normal selection that crosses // table border? Try to figure out all cells // included in the selection? var menuText; if (editorShell.GetFirstSelectedCell()) menuText = GetString("JoinSelectedCells"); else menuText = GetString("JoinCellToRight"); document.getElementById("menu_tableJoinCells").setAttribute("value",menuText); // Set platform-specific hints for how to select cells if (gIsWin) osKey = "XulKeyWin"; if (gIsMac) osKey = "XulKeyMac"; if (gIsUNIX) osKey = "XulKeyUnix"; var DragStr = GetString(osKey)+GetString("Drag"); var ClickStr = GetString(osKey)+GetString("Click"); var DelStr = GetString(gIsMac ? "Clear" : "Del"); document.getElementById("menu_DeleteCell").setAttribute("acceltext",ClickStr); document.getElementById("menu_SelectRow").setAttribute("acceltext",DragStr); document.getElementById("menu_SelectColumn").setAttribute("acceltext",DragStr); document.getElementById("menu_SelectAllCells").setAttribute("acceltext",DragStr); // And add "Del" or "Clear" document.getElementById("menu_DeleteCellContents").setAttribute("acceltext",DelStr); // Set enable states for all table commands goUpdateTableMenuItems(document.getElementById("composerTableMenuItems"));}
if (window.editorShell) { dump("Image Properties Dialog starting.\n"); window.openDialog("chrome: }
dump("Image Properties Dialog starting.\n"); window.openDialog("chrome: contentWindow.focus();
function EditorInsertImage(){ if (window.editorShell) { dump("Image Properties Dialog starting.\n"); window.openDialog("chrome://editordlgs/content/EdImageProps.xul", "dlg", "chrome", ""); }}
contentWindow.focus();
function EditorInsertList(listType){ dump("Inserting list\n"); window.editorShell.InsertList(listType);}
window._content.focus();
gContentWindow.focus();
function EditorInsertOrEditTable(insertAllowed){ if (IsInTable()) { // Edit properties of existing table window.openDialog("chrome://editor/content/EdTableProps.xul", "_blank", "chrome,close,titlebar,modal", "","TablePanel"); window._content.focus(); } else if(insertAllowed) { EditorInsertTable(); }}
EditorInsertTable();
if (editorShell.editorSelection.isCollapsed) EditorInsertTable(); else goDoCommand("cmd_ConvertToTable");
function EditorInsertOrEditTable(insertAllowed){ if (IsInTable()) { // Edit properties of existing table window.openDialog("chrome://editor/content/EdTableProps.xul", "_blank", "chrome,close,titlebar,modal", "","TablePanel"); window._content.focus(); } else if(insertAllowed) { EditorInsertTable(); }}
window.content.focus();
window._content.focus();
function EditorInsertOrEditTable(insertAllowed){ if (IsInTable()) { // Edit properties of existing table window.openDialog("chrome://editor/content/EdTableProps.xul", "_blank", "chrome,close,titlebar,modal", "","TablePanel"); window.content.focus(); } else if(insertAllowed) { EditorInsertTable(); }}
window._content.focus();
gContentWindow.focus();
function EditorInsertTable(){ // Insert a new table window.openDialog("chrome://editor/content/EdInsertTable.xul", "_blank", "chrome,close,titlebar,modal", ""); window._content.focus();}
window.content.focus();
window._content.focus();
function EditorInsertTable(){dump("EditorInsertTable\n"); // Insert a new table window.openDialog("chrome://editor/content/EdInsertTable.xul", "_blank", "chrome,close,titlebar,modal", ""); window.content.focus();}
var found = FindAndSelectEditorWindowWithURL(fp.file.path);
var found = FindAndSelectEditorWindowWithURL(fp.fileURL.spec);
function EditorOpen(){ dump("In EditorOpen..\n"); var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker); fp.init(window, editorShell.GetString("OpenHTMLFile"), nsIFilePicker.modeOpen); // While we include "All", include filters that prefer HTML and Text files fp.setFilters(nsIFilePicker.filterText | nsIFilePicker.filterHTML | nsIFilePicker.filterAll); /* doesn't handle *.shtml files */ try { fp.show(); /* need to handle cancel (uncaught exception at present) */ } catch (ex) { dump("filePicker.chooseInputFile threw an exception\n"); } /* check for already open window and activate it... */ if (fp.file) { var found = FindAndSelectEditorWindowWithURL(fp.file.path); if (!found) { /* open new window */ window.openDialog("chrome://editor/content", "_blank", "chrome,dialog=no,all", fp.file.path); } }}
fp.file.path);
fp.fileURL.spec);
function EditorOpen(){ dump("In EditorOpen..\n"); var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker); fp.init(window, editorShell.GetString("OpenHTMLFile"), nsIFilePicker.modeOpen); // While we include "All", include filters that prefer HTML and Text files fp.setFilters(nsIFilePicker.filterText | nsIFilePicker.filterHTML | nsIFilePicker.filterAll); /* doesn't handle *.shtml files */ try { fp.show(); /* need to handle cancel (uncaught exception at present) */ } catch (ex) { dump("filePicker.chooseInputFile threw an exception\n"); } /* check for already open window and activate it... */ if (fp.file) { var found = FindAndSelectEditorWindowWithURL(fp.file.path); if (!found) { /* open new window */ window.openDialog("chrome://editor/content", "_blank", "chrome,dialog=no,all", fp.file.path); } }}
contentWindow.focus();
function EditorPaste(){ window.editorShell.Paste();}
contentWindow.focus();
function EditorPasteAsQuotation(){ window.editorShell.PasteAsQuotation();}
contentWindow.focus();
function EditorPasteAsQuotationCited(citeString){ window.editorShell.PasteAsCitedQuotation(CiteString);}
if (fileurl != "" && fileurl != "about:blank") { window.openDialog("chrome:
if (fileurl != "" && fileurl != "about:blank") { window.openDialog(getBrowserURL(),
function EditorPreview(){ if (!editorShell.CheckAndSaveDocument(editorShell.GetString("BeforePreview"))) return; fileurl = ""; try { fileurl = window.content.location; } catch (e) { return; } // CheckAndSave doesn't tell us if the user said "Don't Save", // so make sure we have a url: if (fileurl != "" && fileurl != "about:blank") { window.openDialog("chrome://navigator/content/navigator.xul", "EditorPreview", "chrome,all,dialog=no", fileurl ); }}
contentWindow.focus();
function EditorPrint(){ dump("In EditorPrint..\n"); window.editorShell.Print();}
contentWindow.focus();
function EditorPrintPreview(){ window.openDialog("resource:/res/samples/printsetup.html", "PrintPreview", "chrome", "");}
contentWindow.focus();
function EditorRedo(){ dump("Redoing\n"); window.editorShell.Redo();}
window.content.focus();
window._content.focus();
function EditorRemoveBackColor(ColorWellID){ if (ColorWellID) { var menupopup = document.getElementById("BackColorPopup"); if (menupopup) menupopup.closePopup(); } //TODO: Set colorwell to browser's default color editorShell.SetBackgroundColor(""); window.content.focus();}
contentWindow.focus();
function EditorRemoveLinks(){ dump("NOT IMPLEMENTED YET\n");}
window.content.focus();
window._content.focus();
function EditorRemoveLinks(){ editorShell.RemoveTextProperty("href", ""); window.content.focus();}
window.content.focus();
window._content.focus();
function EditorRunLog(){ var fs; fs = EditorGetScriptFileSpec(); EditorExecuteScript(fs); window.content.focus();}
contentWindow.focus();
function EditorSave(){ dump("In EditorSave...\n"); window.editorShell.Save();}
contentWindow.focus();
function EditorSaveAs(){ dump("In EditorSave...\n"); window.editorShell.SaveAs();}
contentWindow.focus();
function EditorSelectAll(){ window.editorShell.SelectAll();}
window.content.focus();
window._content.focus();
function EditorSelectBackColor(ColorPickerID, ColorWellID){ var color = getColorAndSetColorWell(ColorPickerID, ColorWellID); //dump("EditorSelectBackColor: "+color+"\n"); // Close appropriate menupopup var menupopup; if (ColorPickerID == "menuBackCP") menupopup = document.getElementById("formatMenuPopup"); else if (ColorPickerID == "BackColorPicker") menupopup = document.getElementById("BackColorPopup"); if (menupopup) menupopup.closePopup(); EditorSetBackgroundColor(color); window.content.focus();}
window._content.focus();
gContentWindow.focus();
function EditorSelectColor(colorType, mouseEvent){ if (!gColorObj) return; // Shift + mouse click automatically applies last color, if available var useLastColor = mouseEvent ? ( mouseEvent.button == 0 && mouseEvent.shiftKey ) : false; var element; var table; var currentColor = ""; var commandNode; if (!colorType) colorType = ""; if (colorType == "Text") { gColorObj.Type = colorType; // Get color from command node state commandNode = document.getElementById("cmd_fontColor"); currentColor = commandNode.getAttribute("state"); gColorObj.TextColor = currentColor; if (useLastColor && gColorObj.LastTextColor ) gColorObj.TextColor = gColorObj.LastTextColor; else useLastColor = false; } else { element = GetBackgroundElementWithColor(); if (!element) return; // Get the table if we found a cell if (gColorObj.Type == "Table") table = element; else if (gColorObj.Type == "Cell") table = GetParentTable(element); // Save to avoid resetting if not necessary currentColor = gColorObj.BackgroundColor; if (colorType == "TableOrCell" || colorType == "Cell") { if (gColorObj.Type == "Cell") gColorObj.Type = colorType; else if (gColorObj.Type != "Table") return; } else if (colorType == "Table" && gColorObj.Type == "Page") return; if (colorType == "" && gColorObj.Type == "Cell") { // Using empty string for requested type means // we can let user select cell or table gColorObj.Type = "TableOrCell"; } if (useLastColor && gColorObj.LastBackgroundColor ) gColorObj.BackgroundColor = gColorObj.LastBackgroundColor; else useLastColor = false; } // Save the type we are really requesting colorType = gColorObj.Type; if (!useLastColor) { // Avoid the JS warning gColorObj.NoDefault = false; // Launch the ColorPicker dialog // TODO: Figure out how to position this under the color buttons on the toolbar window.openDialog("chrome://editor/content/EdColorPicker.xul", "_blank", "chrome,close,titlebar,modal", "", gColorObj); // User canceled the dialog if (gColorObj.Cancel) return; } if (colorType == "Text") { if (currentColor != gColorObj.TextColor) { window.editorShell.SetTextProperty("font", "color", gColorObj.TextColor); } // Update the command state (this will trigger color button update) goUpdateCommand("cmd_fontColor"); } else if (element) { if (gColorObj.Type == "Table") { // Set background on a table // Note that we shouldn't trust "currentColor" because of "TableOrCell" behavior if (table) { var bgcolor = table.getAttribute("bgcolor"); if (bgcolor != gColorObj.BackgroundColor) { if (gColorObj.BackgroundColor) window.editorShell.SetAttribute(table, "bgcolor", gColorObj.BackgroundColor); else window.editorShell.RemoveAttribute(table, "bgcolor"); } } } else if (currentColor != gColorObj.BackgroundColor) window.editorShell.SetBackgroundColor(gColorObj.BackgroundColor); goUpdateCommand("cmd_backgroundColor"); } window._content.focus();}
window.content.focus();
window._content.focus();
function EditorSetBackgroundColor(color){ editorShell.SetBackgroundColor(color); window.content.focus();}
window.content.focus();
window._content.focus();
function EditorSetFontColor(color){ editorShell.SetTextProperty("font", "color", color); window.content.focus();}
if( fontFace == "tt") {
if( fontFace == "" || fontFace == "normal") { window.editorShell.RemoveTextProperty("font", "face"); } else if( fontFace == "tt") {
function EditorSetFontFace(fontFace){ if( fontFace == "tt") { // The old "teletype" attribute window.editorShell.SetTextProperty("tt", "", ""); // Clear existing font face fontFace = ""; window.editorShell.SetTextProperty("font", "face", fontFace); } contentWindow.focus();}
fontFace = "";
window.editorShell.RemoveTextProperty("font", "face"); } else {
function EditorSetFontFace(fontFace){ if( fontFace == "tt") { // The old "teletype" attribute window.editorShell.SetTextProperty("tt", "", ""); // Clear existing font face fontFace = ""; window.editorShell.SetTextProperty("font", "face", fontFace); } contentWindow.focus();}
window.content.focus();
window._content.focus();
function EditorSetFontFace(commandID, fontFace){ dump("Setting font face to " + fontFace + "\n"); var commandNode = document.getElementById(commandID); commandNode.setAttribute("state", fontFace); window.content.focus(); // needed for command dispatch to work goDoCommand(commandID);}
size === "+0" )
size == "+0" )
function EditorSetFontSize(size){ if( size == "0" || size == "normal" || size === "+0" ) { window.editorShell.RemoveTextProperty("font", size); dump("Removing font size\n"); } else { dump("Setting font size\n"); window.editorShell.SetTextProperty("font", "size", size); } contentWindow.focus();}
window.content.focus();
window._content.focus();
function EditorSetParagraphFormat(commandID, paraFormat){ var commandNode = document.getElementById(commandID); commandNode.setAttribute("state", paraFormat); window.content.focus(); // needed for command dispatch to work goDoCommand(commandID);}
gContentWindow = window._content;
function EditorSharedStartup(){ // set up JS-implemented commands for Text or HTML editing switch (editorShell.editorType) { case "html": case "htmlmail": SetupHTMLEditorCommands(); window.gDefaultSaveMimeType = "text/html"; break; case "text": case "textmail": SetupTextEditorCommands(); window.gDefaultSaveMimeType = "text/plain"; break; default: dump("INVALID EDITOR TYPE: "+editorShell.editorType+"\n"); SetupTextEditorCommands(); window.gDefaultSaveMimeType = "text/plain"; break; } // Just for convenience gContentWindow = window._content; gIsWindows = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWindows && !gIsUNIX; //dump("IsWin="+gIsWindows+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // Set platform-specific hints for how to select cells // Mac uses "Cmd", all others use "Ctrl" var tableKey = GetString(gIsMac ? "XulKeyMac" : "TableSelectKey"); var dragStr = tableKey+GetString("Drag"); var clickStr = tableKey+GetString("Click"); var delStr = GetString(gIsMac ? "Clear" : "Del"); SafeSetAttribute("menu_SelectCell", "acceltext", clickStr); SafeSetAttribute("menu_SelectRow", "acceltext", dragStr); SafeSetAttribute("menu_SelectColumn", "acceltext", dragStr); SafeSetAttribute("menu_SelectAllCells", "acceltext", dragStr); // And add "Del" or "Clear" SafeSetAttribute("menu_DeleteCellContents", "acceltext", delStr); // Remove a Privacy menu that causes problems // (method is in tasksOverlay.js) // HideImage(); // hide UI that we don't have components for RemoveInapplicableUIElements(); // Use global prefs if EditorStartup already run, // else get service for other editor users if (!gPrefs) GetPrefsService(); // Use browser colors as initial values for editor's default colors var BrowserColors = GetDefaultBrowserColors(); if (BrowserColors) { gDefaultTextColor = BrowserColors.TextColor; gDefaultBackgroundColor = BrowserColors.BackgroundColor; } // For new window, no default last-picked colors gColorObj.LastTextColor = ""; gColorObj.LastBackgroundColor = "";}
gContentWindow = window.content;
gContentWindow = window._content;
function EditorSharedStartup(){ // set up JS-implemented commands SetupControllerCommands(); // Just for convenience gContentWindow = window.content; gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; //dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // hide UI that we don't have components for HideInapplicableUIElements();}
window.editorShell.ShowClipboard();
function EditorShowClipboard(){ dump("In EditorShowClipboard...\n"); window.editorShell.ShowClipboard(); }
return editorShell.Shutdown();
function EditorShutdown(){ dump("In EditorShutdown..\n");}
window.content.focus();
window._content.focus();
function EditorStartLog(){ var fs; fs = EditorGetScriptFileSpec(); editorShell.StartLogging(fs); window.content.focus(); fs = null;}
contentWindow = window.frames[0];
contentWindow = window.content;
function EditorStartup(editorType){ dump("Doing Startup...\n"); contentWindow = window.frames[0]; dump("Trying to make an editor appcore through the component manager...\n"); var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); if (!editorShell) { dump("Failed to create editor shell\n"); window.close(); return; } // store the editor shell in the window, so that child windows can get to it. window.editorShell = editorShell; window.editorShell.Init(); window.editorShell.SetWebShellWindow(window); window.editorShell.SetToolbarWindow(window) window.editorShell.SetEditorType(editorType); window.editorShell.SetContentWindow(contentWindow); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); window.editorShell.LoadUrl(url); dump("EditorAppCore windows have been set.\n"); SetupToolbarElements(); // Set focus to the edit window // (A bug currently prevents this from working, // the actual edit window is a child of the webshell window // designated as the contentWindow) contentWindow.focus();}
window.frames[0].focus();
function EditorStartup(editorType){ dump("Doing Startup...\n"); contentWindow = window.frames[0]; dump("Trying to make an editor appcore through the component manager...\n"); var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); if (!editorShell) { dump("Failed to create editor shell\n"); window.close(); return; } // store the editor shell in the window, so that child windows can get to it. window.editorShell = editorShell; window.editorShell.Init(); window.editorShell.SetWebShellWindow(window); window.editorShell.SetToolbarWindow(window) window.editorShell.SetEditorType(editorType); window.editorShell.SetContentWindow(contentWindow); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); window.editorShell.LoadUrl(url); dump("EditorAppCore windows have been set.\n"); SetupToolbarElements(); // Set focus to the edit window // (A bug currently prevents this from working, // the actual edit window is a child of the webshell window // designated as the contentWindow) contentWindow.focus();}
cmd.setAttribute("collapsed", "true");
cmd.collapsed = true;
function EditorStartup(){ var is_HTMLEditor = IsHTMLEditor(); if (is_HTMLEditor) { gSourceContentWindow = document.getElementById("content-source"); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); gViewFormatToolbar = document.getElementById("viewFormatToolbar"); } // set up our global prefs object GetPrefsService(); // Startup also used by other editor users, such as Message Composer EditorSharedStartup(); // Commands specific to the Composer Application window, // (i.e., not embedded editors) // such as file-related commands, HTML Source editing, Edit Modes... SetupComposerWindowCommands(); gCSSPrefListener = new nsButtonPrefListener(); // hide Highlight button if we are in an HTML editor with CSS mode off var cmd = document.getElementById("cmd_highlight"); if (cmd) { var prefs = GetPrefs(); var useCSS = prefs.getBoolPref("editor.use_css"); if (!useCSS && is_HTMLEditor) { cmd.setAttribute("collapsed", "true"); } } // Get url for editor content and load it. // the editor gets instantiated by the edittingSession when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); try { var charset = document.getElementById("args").getAttribute("charset"); var contentViewer = GetCurrentEditorElement().docShell.contentViewer; contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); contentViewer.defaultCharacterSet = charset; contentViewer.forceCharacterSet = charset; } catch (e) {} EditorLoadUrl(url);}
gContentWindow = window.content; gSourceContentWindow = document.getElementById("content-source");
function EditorStartup(editorType, editorElement){ gContentWindow = window.content; gSourceContentWindow = document.getElementById("content-source"); gIsHTMLEditor = (editorType == "html"); if (gIsHTMLEditor) { gEditModeLabel = document.getElementById("EditModeLabel"); gNormalModeButton = document.getElementById("NormalModeButton"); gTagModeButton = document.getElementById("TagModeButton"); gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); // The "type" attribute persists, so use that value // to setup edit mode buttonsdump("Edit Mode: "+gNormalModeButton.getAttribute('type')+"\n"); ToggleEditModeType(gNormalModeButton.getAttribute("type")); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); } gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // store the editor shell in the window, so that child windows can get to it. editorShell = editorElement.editorShell; editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.webShellWindow = window; editorShell.contentWindow = gContentWindow; // hide UI that we don't have components for HideInapplicableUIElements(); // set up JS-implemented commands SetupControllerCommands(); // add a listener to be called when document is really done loading editorShell.RegisterDocumentStateListener( DocumentStateListener ); // set up our global prefs object GetPrefsService(); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); editorShell.LoadUrl(url);}
dump("Edit Mode: "+gNormalModeButton.getAttribute('type')+"\n");
function EditorStartup(editorType, editorElement){ gContentWindow = window.content; gSourceContentWindow = document.getElementById("content-source"); gIsHTMLEditor = (editorType == "html"); if (gIsHTMLEditor) { gEditModeLabel = document.getElementById("EditModeLabel"); gNormalModeButton = document.getElementById("NormalModeButton"); gTagModeButton = document.getElementById("TagModeButton"); gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); // The "type" attribute persists, so use that value // to setup edit mode buttonsdump("Edit Mode: "+gNormalModeButton.getAttribute('type')+"\n"); ToggleEditModeType(gNormalModeButton.getAttribute("type")); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); } gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // store the editor shell in the window, so that child windows can get to it. editorShell = editorElement.editorShell; editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.webShellWindow = window; editorShell.contentWindow = gContentWindow; // hide UI that we don't have components for HideInapplicableUIElements(); // set up JS-implemented commands SetupControllerCommands(); // add a listener to be called when document is really done loading editorShell.RegisterDocumentStateListener( DocumentStateListener ); // set up our global prefs object GetPrefsService(); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); editorShell.LoadUrl(url);}
gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n");
function EditorStartup(editorType, editorElement){ gContentWindow = window.content; gSourceContentWindow = document.getElementById("content-source"); gIsHTMLEditor = (editorType == "html"); if (gIsHTMLEditor) { gEditModeLabel = document.getElementById("EditModeLabel"); gNormalModeButton = document.getElementById("NormalModeButton"); gTagModeButton = document.getElementById("TagModeButton"); gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); // The "type" attribute persists, so use that value // to setup edit mode buttonsdump("Edit Mode: "+gNormalModeButton.getAttribute('type')+"\n"); ToggleEditModeType(gNormalModeButton.getAttribute("type")); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); } gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // store the editor shell in the window, so that child windows can get to it. editorShell = editorElement.editorShell; editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.webShellWindow = window; editorShell.contentWindow = gContentWindow; // hide UI that we don't have components for HideInapplicableUIElements(); // set up JS-implemented commands SetupControllerCommands(); // add a listener to be called when document is really done loading editorShell.RegisterDocumentStateListener( DocumentStateListener ); // set up our global prefs object GetPrefsService(); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); editorShell.LoadUrl(url);}
editorShell.contentWindow = gContentWindow;
editorShell.contentWindow = window.content;
function EditorStartup(editorType, editorElement){ gContentWindow = window.content; gSourceContentWindow = document.getElementById("content-source"); gIsHTMLEditor = (editorType == "html"); if (gIsHTMLEditor) { gEditModeLabel = document.getElementById("EditModeLabel"); gNormalModeButton = document.getElementById("NormalModeButton"); gTagModeButton = document.getElementById("TagModeButton"); gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); // The "type" attribute persists, so use that value // to setup edit mode buttonsdump("Edit Mode: "+gNormalModeButton.getAttribute('type')+"\n"); ToggleEditModeType(gNormalModeButton.getAttribute("type")); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); } gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // store the editor shell in the window, so that child windows can get to it. editorShell = editorElement.editorShell; editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.webShellWindow = window; editorShell.contentWindow = gContentWindow; // hide UI that we don't have components for HideInapplicableUIElements(); // set up JS-implemented commands SetupControllerCommands(); // add a listener to be called when document is really done loading editorShell.RegisterDocumentStateListener( DocumentStateListener ); // set up our global prefs object GetPrefsService(); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); editorShell.LoadUrl(url);}
HideInapplicableUIElements(); SetupControllerCommands();
function EditorStartup(editorType, editorElement){ gContentWindow = window.content; gSourceContentWindow = document.getElementById("content-source"); gIsHTMLEditor = (editorType == "html"); if (gIsHTMLEditor) { gEditModeLabel = document.getElementById("EditModeLabel"); gNormalModeButton = document.getElementById("NormalModeButton"); gTagModeButton = document.getElementById("TagModeButton"); gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); // The "type" attribute persists, so use that value // to setup edit mode buttonsdump("Edit Mode: "+gNormalModeButton.getAttribute('type')+"\n"); ToggleEditModeType(gNormalModeButton.getAttribute("type")); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); } gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // store the editor shell in the window, so that child windows can get to it. editorShell = editorElement.editorShell; editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.webShellWindow = window; editorShell.contentWindow = gContentWindow; // hide UI that we don't have components for HideInapplicableUIElements(); // set up JS-implemented commands SetupControllerCommands(); // add a listener to be called when document is really done loading editorShell.RegisterDocumentStateListener( DocumentStateListener ); // set up our global prefs object GetPrefsService(); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); editorShell.LoadUrl(url);}
EditorSharedStartup()
function EditorStartup(editorType, editorElement){ gContentWindow = window.content; gSourceContentWindow = document.getElementById("content-source"); gIsHTMLEditor = (editorType == "html"); if (gIsHTMLEditor) { gEditModeLabel = document.getElementById("EditModeLabel"); gNormalModeButton = document.getElementById("NormalModeButton"); gTagModeButton = document.getElementById("TagModeButton"); gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); // The "type" attribute persists, so use that value // to setup edit mode buttonsdump("Edit Mode: "+gNormalModeButton.getAttribute('type')+"\n"); ToggleEditModeType(gNormalModeButton.getAttribute("type")); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); } gIsWin = navigator.appVersion.indexOf("Win") != -1; gIsUNIX = (navigator.appVersion.indexOf("X11") || navigator.appVersion.indexOf("nux")) != -1; gIsMac = !gIsWin && !gIsUNIX; dump("IsWin="+gIsWin+", IsUNIX="+gIsUNIX+", IsMac="+gIsMac+"\n"); // store the editor shell in the window, so that child windows can get to it. editorShell = editorElement.editorShell; editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.webShellWindow = window; editorShell.contentWindow = gContentWindow; // hide UI that we don't have components for HideInapplicableUIElements(); // set up JS-implemented commands SetupControllerCommands(); // add a listener to be called when document is really done loading editorShell.RegisterDocumentStateListener( DocumentStateListener ); // set up our global prefs object GetPrefsService(); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); editorShell.LoadUrl(url);}
editorShell.contentWindow = window.content;
editorShell.contentWindow = window._content;
function EditorStartup(editorType, editorElement){ gIsHTMLEditor = (editorType == "html"); if (gIsHTMLEditor) { gSourceContentWindow = document.getElementById("content-source"); gEditModeBar = document.getElementById("EditModeToolbar"); gEditModeLabel = document.getElementById("EditModeLabel"); gNormalModeButton = document.getElementById("NormalModeButton"); gTagModeButton = document.getElementById("TagModeButton"); gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); // The "type" attribute persists, so use that value // to setup edit mode buttons ToggleEditModeType(gNormalModeButton.getAttribute("type")); // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); } // store the editor shell in the window, so that child windows can get to it. editorShell = editorElement.editorShell; // this pattern exposes a JS/XBL bug that causes leaks// editorShell = editorElement.boxObject.QueryInterface(Components.interfaces.nsIEditorBoxObject).editorShell; editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.webShellWindow = window; editorShell.contentWindow = window.content; // add a listener to be called when document is really done loading editorShell.RegisterDocumentStateListener( DocumentStateListener ); // Startup also used by other editor users, such as Message Composer EditorSharedStartup() // set up our global prefs object GetPrefsService(); // Get url for editor content and load it. // the editor gets instantiated by the editor shell when the URL has finished loading. var url = document.getElementById("args").getAttribute("value"); editorShell.LoadUrl(url);}
window.content.focus();
window._content.focus();
function EditorStopLog(){ editorShell.StopLogging(); window.content.focus();}
window._content.focus();
gContentWindow.focus();
function EditorTableCellProperties(){ var cell = editorShell.GetElementOrParentByTagName("td", null); if (cell) { // Start Table Properties dialog on the "Cell" panel window.openDialog("chrome://editor/content/EdTableProps.xul", "_blank", "chrome,close,titlebar,modal", "", "CellPanel"); window._content.focus(); }}
window.content.focus();
window._content.focus();
function EditorTableCellProperties(){ var cell = editorShell.GetElementOrParentByTagName("td", null); if (cell) { // Start Table Properties dialog on the "Cell" panel window.openDialog("chrome://editor/content/EdTableProps.xul", "_blank", "chrome,close,titlebar,modal", "", "CellPanel"); window.content.focus(); }}
rowSpanObj, colSpanObj, isSelectedObj);
rowSpanObj, colSpanObj, actualRowSpanObj, actualColSpanObj, isSelectedObj);
function EditorTestTableLayout(){ var table = editorShell.GetElementOrParentByTagName("table", null); if (!table) { dump("Enclosing Table not found: Place caret in a table cell to do this test\n\n"); return; } var cell; var startRowIndexObj = new Object(); var startColIndexObj = new Object(); var rowSpanObj = new Object(); var colSpanObj = new Object(); var isSelectedObj = new Object(); var startRowIndex = 0; var startColIndex = 0; var rowSpan; var colSpan; var isSelected; var col = 0; var row = 0; var rowCount = 0; var maxColCount = 0; var doneWithRow = false; var doneWithCol = false; dump("\n\n\n************ Starting Table Layout test ************\n"); // Note: We could also get the number of rows, cols and use for loops, // but this tests using out-of-bounds offsets to detect end of row or column while (!doneWithRow) // Iterate through rows { while(!doneWithCol) // Iterate through cells in the row { try { cell = editorShell.GetCellDataAt(table, row, col, startRowIndexObj, startColIndexObj, rowSpanObj, colSpanObj, isSelectedObj); if (cell) { rowSpan = rowSpanObj.value; colSpan = colSpanObj.value; isSelected = isSelectedObj.value; dump("Row,Col: "+row+","+col+" StartRow,StartCol: "+startRowIndexObj.value+","+startColIndexObj.value+" RowSpan="+rowSpan+" ColSpan="+colSpan); if (isSelected) dump(" Cell is selected\n"); else dump(" Cell is NOT selected\n"); // Save the indexes of a cell that will span across the cellmap grid if (rowSpan > 1) startRowIndex = startRowIndexObj.value; if (colSpan > 1) startColIndex = startColIndexObj.value; // Initialize these for efficient spanned-cell search startRowIndexObj.value = startRowIndex; startColIndexObj.value = startColIndex; col++; } else { doneWithCol = true; // Get maximum number of cells in any row if (col > maxColCount) maxColCount = col; dump(" End of row found\n\n"); } } catch (e) { dump(" *** GetCellDataAt barfed at Row,Col:"+row+","+col+" ***\n\n"); col++; } } if (col == 0) { // Didn't find a cell in the first col of a row, // thus no more rows in table doneWithRow = true; rowCount = row; dump("No more rows in table\n\n"); } else { // Setup for next row col = 0; row++; doneWithCol = false; dump("Setup for next row\n"); } } dump("Counted during scan: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n"); rowCount = editorShell.GetTableRowCount(table); maxColCount = editorShell.GetTableColumnCount(table); dump("From nsITableLayout: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n****** End of Table Layout Test *****\n\n");}
dump("Row,Col: "+row+","+col+" StartRow,StartCol: "+startRowIndexObj.value+","+startColIndexObj.value+" RowSpan="+rowSpan+" ColSpan="+colSpan);
dump(" Row="+row+", Col="+col+" StartRow="+startRowIndexObj.value+", StartCol="+startColIndexObj.value+"\n"); dump(" RowSpan="+rowSpan+", ColSpan="+colSpan+" ActualRowSpan="+actualRowSpan+", ActualColSpan="+actualColSpan);
function EditorTestTableLayout(){ var table = editorShell.GetElementOrParentByTagName("table", null); if (!table) { dump("Enclosing Table not found: Place caret in a table cell to do this test\n\n"); return; } var cell; var startRowIndexObj = new Object(); var startColIndexObj = new Object(); var rowSpanObj = new Object(); var colSpanObj = new Object(); var isSelectedObj = new Object(); var startRowIndex = 0; var startColIndex = 0; var rowSpan; var colSpan; var isSelected; var col = 0; var row = 0; var rowCount = 0; var maxColCount = 0; var doneWithRow = false; var doneWithCol = false; dump("\n\n\n************ Starting Table Layout test ************\n"); // Note: We could also get the number of rows, cols and use for loops, // but this tests using out-of-bounds offsets to detect end of row or column while (!doneWithRow) // Iterate through rows { while(!doneWithCol) // Iterate through cells in the row { try { cell = editorShell.GetCellDataAt(table, row, col, startRowIndexObj, startColIndexObj, rowSpanObj, colSpanObj, isSelectedObj); if (cell) { rowSpan = rowSpanObj.value; colSpan = colSpanObj.value; isSelected = isSelectedObj.value; dump("Row,Col: "+row+","+col+" StartRow,StartCol: "+startRowIndexObj.value+","+startColIndexObj.value+" RowSpan="+rowSpan+" ColSpan="+colSpan); if (isSelected) dump(" Cell is selected\n"); else dump(" Cell is NOT selected\n"); // Save the indexes of a cell that will span across the cellmap grid if (rowSpan > 1) startRowIndex = startRowIndexObj.value; if (colSpan > 1) startColIndex = startColIndexObj.value; // Initialize these for efficient spanned-cell search startRowIndexObj.value = startRowIndex; startColIndexObj.value = startColIndex; col++; } else { doneWithCol = true; // Get maximum number of cells in any row if (col > maxColCount) maxColCount = col; dump(" End of row found\n\n"); } } catch (e) { dump(" *** GetCellDataAt barfed at Row,Col:"+row+","+col+" ***\n\n"); col++; } } if (col == 0) { // Didn't find a cell in the first col of a row, // thus no more rows in table doneWithRow = true; rowCount = row; dump("No more rows in table\n\n"); } else { // Setup for next row col = 0; row++; doneWithCol = false; dump("Setup for next row\n"); } } dump("Counted during scan: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n"); rowCount = editorShell.GetTableRowCount(table); maxColCount = editorShell.GetTableColumnCount(table); dump("From nsITableLayout: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n****** End of Table Layout Test *****\n\n");}
dump(" *** GetCellDataAt barfed at Row,Col:"+row+","+col+" ***\n\n"); col++;
dump(" *** GetCellDataAt failed at Row="+row+, Col="+col+" ***\n\n"); return;
function EditorTestTableLayout(){ var table = editorShell.GetElementOrParentByTagName("table", null); if (!table) { dump("Enclosing Table not found: Place caret in a table cell to do this test\n\n"); return; } var cell; var startRowIndexObj = new Object(); var startColIndexObj = new Object(); var rowSpanObj = new Object(); var colSpanObj = new Object(); var isSelectedObj = new Object(); var startRowIndex = 0; var startColIndex = 0; var rowSpan; var colSpan; var isSelected; var col = 0; var row = 0; var rowCount = 0; var maxColCount = 0; var doneWithRow = false; var doneWithCol = false; dump("\n\n\n************ Starting Table Layout test ************\n"); // Note: We could also get the number of rows, cols and use for loops, // but this tests using out-of-bounds offsets to detect end of row or column while (!doneWithRow) // Iterate through rows { while(!doneWithCol) // Iterate through cells in the row { try { cell = editorShell.GetCellDataAt(table, row, col, startRowIndexObj, startColIndexObj, rowSpanObj, colSpanObj, isSelectedObj); if (cell) { rowSpan = rowSpanObj.value; colSpan = colSpanObj.value; isSelected = isSelectedObj.value; dump("Row,Col: "+row+","+col+" StartRow,StartCol: "+startRowIndexObj.value+","+startColIndexObj.value+" RowSpan="+rowSpan+" ColSpan="+colSpan); if (isSelected) dump(" Cell is selected\n"); else dump(" Cell is NOT selected\n"); // Save the indexes of a cell that will span across the cellmap grid if (rowSpan > 1) startRowIndex = startRowIndexObj.value; if (colSpan > 1) startColIndex = startColIndexObj.value; // Initialize these for efficient spanned-cell search startRowIndexObj.value = startRowIndex; startColIndexObj.value = startColIndex; col++; } else { doneWithCol = true; // Get maximum number of cells in any row if (col > maxColCount) maxColCount = col; dump(" End of row found\n\n"); } } catch (e) { dump(" *** GetCellDataAt barfed at Row,Col:"+row+","+col+" ***\n\n"); col++; } } if (col == 0) { // Didn't find a cell in the first col of a row, // thus no more rows in table doneWithRow = true; rowCount = row; dump("No more rows in table\n\n"); } else { // Setup for next row col = 0; row++; doneWithCol = false; dump("Setup for next row\n"); } } dump("Counted during scan: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n"); rowCount = editorShell.GetTableRowCount(table); maxColCount = editorShell.GetTableColumnCount(table); dump("From nsITableLayout: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n****** End of Table Layout Test *****\n\n");}
dump("Setup for next row\n");
function EditorTestTableLayout(){ var table = editorShell.GetElementOrParentByTagName("table", null); if (!table) { dump("Enclosing Table not found: Place caret in a table cell to do this test\n\n"); return; } var cell; var startRowIndexObj = new Object(); var startColIndexObj = new Object(); var rowSpanObj = new Object(); var colSpanObj = new Object(); var isSelectedObj = new Object(); var startRowIndex = 0; var startColIndex = 0; var rowSpan; var colSpan; var isSelected; var col = 0; var row = 0; var rowCount = 0; var maxColCount = 0; var doneWithRow = false; var doneWithCol = false; dump("\n\n\n************ Starting Table Layout test ************\n"); // Note: We could also get the number of rows, cols and use for loops, // but this tests using out-of-bounds offsets to detect end of row or column while (!doneWithRow) // Iterate through rows { while(!doneWithCol) // Iterate through cells in the row { try { cell = editorShell.GetCellDataAt(table, row, col, startRowIndexObj, startColIndexObj, rowSpanObj, colSpanObj, isSelectedObj); if (cell) { rowSpan = rowSpanObj.value; colSpan = colSpanObj.value; isSelected = isSelectedObj.value; dump("Row,Col: "+row+","+col+" StartRow,StartCol: "+startRowIndexObj.value+","+startColIndexObj.value+" RowSpan="+rowSpan+" ColSpan="+colSpan); if (isSelected) dump(" Cell is selected\n"); else dump(" Cell is NOT selected\n"); // Save the indexes of a cell that will span across the cellmap grid if (rowSpan > 1) startRowIndex = startRowIndexObj.value; if (colSpan > 1) startColIndex = startColIndexObj.value; // Initialize these for efficient spanned-cell search startRowIndexObj.value = startRowIndex; startColIndexObj.value = startColIndex; col++; } else { doneWithCol = true; // Get maximum number of cells in any row if (col > maxColCount) maxColCount = col; dump(" End of row found\n\n"); } } catch (e) { dump(" *** GetCellDataAt barfed at Row,Col:"+row+","+col+" ***\n\n"); col++; } } if (col == 0) { // Didn't find a cell in the first col of a row, // thus no more rows in table doneWithRow = true; rowCount = row; dump("No more rows in table\n\n"); } else { // Setup for next row col = 0; row++; doneWithCol = false; dump("Setup for next row\n"); } } dump("Counted during scan: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n"); rowCount = editorShell.GetTableRowCount(table); maxColCount = editorShell.GetTableColumnCount(table); dump("From nsITableLayout: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n****** End of Table Layout Test *****\n\n");}