rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
function EditorRunLog() { var fs; fs = EditorGetScriptFileSpec(); EditorExecuteScript(fs); window._content.focus(); } function DumpUndoStack() { try { var txmgr = GetCurrentEditor().transactionManager; if (!txmgr) { dump("**** Editor has no TransactionManager!\n"); return; } dump("---------------------- BEGIN UNDO STACK DUMP\n"); dump("<!-- Bottom of Stack -->\n"); PrintTxnList(txmgr.getUndoList(), ""); dump("<!-- Top of Stack -->\n"); dump("Num Undo Items: " + txmgr.numberOfUndoItems + "\n"); dump("---------------------- END UNDO STACK DUMP\n"); } catch (e) { dump("ERROR: DumpUndoStack() failed: " + e); } } function DumpRedoStack() { try { var txmgr = GetCurrentEditor().transactionManager; if (!txmgr) { dump("**** Editor has no TransactionManager!\n"); return; } dump("---------------------- BEGIN REDO STACK DUMP\n"); dump("<!-- Bottom of Stack -->\n"); PrintTxnList(txmgr.getRedoList(), ""); dump("<!-- Top of Stack -->\n"); dump("Num Redo Items: " + txmgr.numberOfRedoItems + "\n"); dump("---------------------- END REDO STACK DUMP\n"); } catch (e) { dump("ERROR: DumpUndoStack() failed: " + e); } } function PrintTxnList(txnList, prefixStr) { var i; for (i=0 ; i < txnList.numItems; i++) { var txn = txnList.getItem(i); var desc = "TXMgr Batch"; if (txn) { txn = txn.QueryInterface(Components.interfaces.nsPIEditorTransaction); desc = txn.txnDescription; } dump(prefixStr + "+ " + desc + "\n"); PrintTxnList(txnList.getChildListForItem(i), prefixStr + "| "); } }
|
function EditorStopLog(){ try { var edlog = gEditor.QueryInterface(Components.interfaces.nsIEditorLogging); edlog.stopLogging(); window._content.focus(); } catch(ex) { dump("Can't stop logging!:\n" + ex + "\n");}function EditorRunLog(){ var fs; fs = EditorGetScriptFileSpec(); EditorExecuteScript(fs); window._content.focus();}// --------------------------- TransactionManager ---------------------------function DumpUndoStack(){ try { var txmgr = GetCurrentEditor().transactionManager; if (!txmgr) { dump("**** Editor has no TransactionManager!\n"); return; } dump("---------------------- BEGIN UNDO STACK DUMP\n"); dump("<!-- Bottom of Stack -->\n"); PrintTxnList(txmgr.getUndoList(), ""); dump("<!-- Top of Stack -->\n"); dump("Num Undo Items: " + txmgr.numberOfUndoItems + "\n"); dump("---------------------- END UNDO STACK DUMP\n"); } catch (e) { dump("ERROR: DumpUndoStack() failed: " + e); }}function DumpRedoStack(){ try { var txmgr = GetCurrentEditor().transactionManager; if (!txmgr) { dump("**** Editor has no TransactionManager!\n"); return; } dump("---------------------- BEGIN REDO STACK DUMP\n"); dump("<!-- Bottom of Stack -->\n"); PrintTxnList(txmgr.getRedoList(), ""); dump("<!-- Top of Stack -->\n"); dump("Num Redo Items: " + txmgr.numberOfRedoItems + "\n"); dump("---------------------- END REDO STACK DUMP\n"); } catch (e) { dump("ERROR: DumpUndoStack() failed: " + e); }}function PrintTxnList(txnList, prefixStr){ var i; for (i=0 ; i < txnList.numItems; i++) { var txn = txnList.getItem(i); var desc = "TXMgr Batch"; if (txn) { txn = txn.QueryInterface(Components.interfaces.nsPIEditorTransaction); desc = txn.txnDescription; } dump(prefixStr + "+ " + desc + "\n"); PrintTxnList(txnList.getChildListForItem(i), prefixStr + "| "); }}
|
|
dump("Function not implemented\n"); return;
|
function EditorTableCellProperties(){//TEMP FOR BETA1: Disable item - dialog not working dump("Function not implemented\n"); return; 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"); contentWindow.focus(); }}
|
|
dump("\n====== Selection as XIF =======================\n"); output = editorShell.GetContentsAs("text/xif", 1); dump(output + "\n\n");
|
function EditorTestSelection(){ dump("Testing selection\n"); var selection = editorShell.editorSelection; if (!selection) { dump("No selection!\n"); return; } dump("Selection contains:\n"); // 3rd param = column to wrap dump(selection.toString("text/plain", gOutputFormatted & gOutputSelectionOnly, 0) + "\n"); var output; dump("\n====== Selection as XIF =======================\n"); output = editorShell.GetContentsAs("text/xif", 1); dump(output + "\n\n"); dump("====== Selection as unformatted text ==========\n"); output = editorShell.GetContentsAs("text/plain", 1); dump(output + "\n\n"); dump("====== Selection as formatted text ============\n"); output = editorShell.GetContentsAs("text/plain", 3); dump(output + "\n\n"); dump("====== Selection as HTML ======================\n"); output = editorShell.GetContentsAs("text/html", 1); dump(output + "\n\n"); dump("====== Length and status =====================\n"); output = "Document is "; if (editorShell.documentIsEmpty) output += "empty\n"; else output += "not empty\n"; output += "Document length is " + editorShell.documentLength + " characters"; dump(output + "\n\n");}
|
|
dump("====== Selection as prettyprinted HTML ========\n"); output = editorShell.GetContentsAs("text/html", 3); dump(output + "\n\n");
|
function EditorTestSelection(){ dump("Testing selection\n"); var selection = editorShell.editorSelection; if (!selection) { dump("No selection!\n"); return; } dump("Selection contains:\n"); // 3rd param = column to wrap dump(selection.toString("text/plain", gOutputFormatted & gOutputSelectionOnly, 0) + "\n"); var output; dump("\n====== Selection as XIF =======================\n"); output = editorShell.GetContentsAs("text/xif", 1); dump(output + "\n\n"); dump("====== Selection as unformatted text ==========\n"); output = editorShell.GetContentsAs("text/plain", 1); dump(output + "\n\n"); dump("====== Selection as formatted text ============\n"); output = editorShell.GetContentsAs("text/plain", 3); dump(output + "\n\n"); dump("====== Selection as HTML ======================\n"); output = editorShell.GetContentsAs("text/html", 1); dump(output + "\n\n"); dump("====== Length and status =====================\n"); output = "Document is "; if (editorShell.documentIsEmpty) output += "empty\n"; else output += "not empty\n"; output += "Document length is " + editorShell.documentLength + " characters"; dump(output + "\n\n");}
|
|
buttonText = "Preview";
|
buttonText = "Edit Mode";
|
function EditorToggleDisplayStyle(){ if (EditorDisplayStyle) { EditorDisplayStyle = false; styleSheet = "resource:/res/ua.css"; //TODO: Where do we store localizable JS strings? buttonText = "Preview"; } else { EditorDisplayStyle = true; styleSheet = "chrome://editor/content/EditorContent.css" buttonText = "Edit Mode"; } EditorApplyStyleSheet(styleSheet); button = document.getElementById("DisplayStyleButton"); if (button) button.setAttribute("value",buttonText);}
|
buttonText = "Edit Mode";
|
buttonText = "Preview";
|
function EditorToggleDisplayStyle(){ if (EditorDisplayStyle) { EditorDisplayStyle = false; styleSheet = "resource:/res/ua.css"; //TODO: Where do we store localizable JS strings? buttonText = "Preview"; } else { EditorDisplayStyle = true; styleSheet = "chrome://editor/content/EditorContent.css" buttonText = "Edit Mode"; } EditorApplyStyleSheet(styleSheet); button = document.getElementById("DisplayStyleButton"); if (button) button.setAttribute("value",buttonText);}
|
GetCurrentEditor().addOverrideStyleSheet(gParagraphMarksStyleSheet);
|
GetCurrentEditor().addOverrideStyleSheet(kParagraphMarksStyleSheet);
|
function EditorToggleParagraphMarks(){ var menuItem = document.getElementById("viewParagraphMarks"); if (menuItem) { // Note that the 'type="checbox"' mechanism automatically // toggles the "checked" state before the oncommand is called, // so if "checked" is true now, it was just switched to that mode var checked = menuItem.getAttribute("checked"); try { if (checked == "true") GetCurrentEditor().addOverrideStyleSheet(gParagraphMarksStyleSheet); else GetCurrentEditor().enableStyleSheet(gParagraphMarksStyleSheet, false); } catch(e) { return; } }}
|
GetCurrentEditor().enableStyleSheet(gParagraphMarksStyleSheet, false);
|
GetCurrentEditor().enableStyleSheet(kParagraphMarksStyleSheet, false);
|
function EditorToggleParagraphMarks(){ var menuItem = document.getElementById("viewParagraphMarks"); if (menuItem) { // Note that the 'type="checbox"' mechanism automatically // toggles the "checked" state before the oncommand is called, // so if "checked" is true now, it was just switched to that mode var checked = menuItem.getAttribute("checked"); try { if (checked == "true") GetCurrentEditor().addOverrideStyleSheet(gParagraphMarksStyleSheet); else GetCurrentEditor().enableStyleSheet(gParagraphMarksStyleSheet, false); } catch(e) { return; } }}
|
if (win.editorShell.checkOpenWindowForURLMatch(url, win))
|
if (CheckOpenWindowForURIMatch(uri, win))
|
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); var emptyWindow; while ( enumerator.hasMoreElements() ) { var win = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( win && win.editorShell) { if (win.editorShell.checkOpenWindowForURLMatch(url, win)) { // We found an editor with our url win.focus(); return; } else if (!emptyWindow && win.PageIsEmptyAndUntouched()) { emptyWindow = win; } } } if (emptyWindow) { // we have an empty window we can use if (emptyWindow.IsInHTMLSourceMode()) emptyWindow.FinishHTMLSource(); emptyWindow.editorShell.LoadUrl(url); emptyWindow.focus(); emptyWindow.SetSaveAndPublishUI(url); return; } // Create new Composer window if (delay) { dump("delaying\n"); launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); } else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
var focusedWindow = document.commandDispatcher.focusedWindow; if (isContentFrame(focusedWindow)) url = Components.lookupMethod(focusedWindow, 'location').call(focusedWindow).href;
|
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isContentFrame(focusedWindow)) url = Components.lookupMethod(focusedWindow, 'location').call(focusedWindow).href; // Always strip off "view-source:" if (url.slice(0,12) == "view-source:") url = url.slice(13); // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var uri = createURI(url, null, null); var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); var emptyWindow; while ( enumerator.hasMoreElements() ) { var win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( win && win.IsWebComposer()) { if (CheckOpenWindowForURIMatch(uri, win)) { // We found an editor with our url win.focus(); return; } else if (!emptyWindow && win.PageIsEmptyAndUntouched()) { emptyWindow = win; } } } if (emptyWindow) { // we have an empty window we can use if (emptyWindow.IsInHTMLSourceMode()) emptyWindow.SetEditMode(emptyWindow.PreviousNonSourceDisplayMode); emptyWindow.editorShell.LoadUrl(url); emptyWindow.focus(); emptyWindow.SetSaveAndPublishUI(url); return; } // Create new Composer window if (delay) { launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); } else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
|
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
|
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
|
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var uri = createURI(url, null, null); var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); var emptyWindow; while ( enumerator.hasMoreElements() ) { var win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( win && win.editorShell) { if (CheckOpenWindowForURIMatch(uri, win)) { // We found an editor with our url win.focus(); return; } else if (!emptyWindow && win.PageIsEmptyAndUntouched()) { emptyWindow = win; } } } if (emptyWindow) { // we have an empty window we can use if (emptyWindow.IsInHTMLSourceMode()) emptyWindow.FinishHTMLSource(); emptyWindow.editorShell.LoadUrl(url); emptyWindow.focus(); emptyWindow.SetSaveAndPublishUI(url); return; } // Create new Composer window if (delay) { dump("delaying\n"); launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); } else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
var wintype = document.firstChild.getAttribute('windowtype');
|
var wintype = document.documentElement.getAttribute('windowtype');
|
function editPage(url, launchWindow, delay){ // Always strip off "view-source:" and #anchors url = url.replace(/^view-source:/, "").replace(/#.*/, ""); // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow.content.document) charsetArg = "charset=" + launchWindow.content.document.characterSet; try { var uri = createURI(url, null, null); var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); var emptyWindow; while ( enumerator.hasMoreElements() ) { var win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( win && win.IsWebComposer()) { if (CheckOpenWindowForURIMatch(uri, win)) { // We found an editor with our url win.focus(); return; } else if (!emptyWindow && win.PageIsEmptyAndUntouched()) { emptyWindow = win; } } } if (emptyWindow) { // we have an empty window we can use if (emptyWindow.IsInHTMLSourceMode()) emptyWindow.SetEditMode(emptyWindow.PreviousNonSourceDisplayMode); emptyWindow.EditorLoadUrl(url); emptyWindow.focus(); emptyWindow.SetSaveAndPublishUI(url); return; } // Create new Composer window if (delay) { launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); } else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
var window = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( window && window.editorShell)
|
var win = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( win && win.editorShell)
|
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); while ( enumerator.hasMoreElements() ) { var window = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( window && window.editorShell) { if (window.editorShell.checkOpenWindowForURLMatch(url, window)) { // We found an editor with our url window.focus(); return; } } } // Create new Composer window if (delay) launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url, charsetArg); else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
if (window.editorShell.checkOpenWindowForURLMatch(url, window))
|
if (win.editorShell.checkOpenWindowForURLMatch(url, window))
|
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); while ( enumerator.hasMoreElements() ) { var window = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( window && window.editorShell) { if (window.editorShell.checkOpenWindowForURLMatch(url, window)) { // We found an editor with our url window.focus(); return; } } } // Create new Composer window if (delay) launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url, charsetArg); else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
window.focus();
|
win.focus();
|
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); while ( enumerator.hasMoreElements() ) { var window = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( window && window.editorShell) { if (window.editorShell.checkOpenWindowForURLMatch(url, window)) { // We found an editor with our url window.focus(); return; } } } // Create new Composer window if (delay) launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url, charsetArg); else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
launchWindow.delayedOpenWindow("chrome:
|
{ dump("delaying\n"); launchWindow.delayedOpenWindow("chrome: }
|
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); while ( enumerator.hasMoreElements() ) { var window = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( window && window.editorShell) { if (window.editorShell.checkOpenWindowForURLMatch(url, window)) { // We found an editor with our url window.focus(); return; } } } // Create new Composer window if (delay) launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url, charsetArg); else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
|
if (gTree.selectedItems && gTree.selectedItems[0]) { var uri = gTree.selectedItems[0].id;
|
if (gList.selectedItems && gList.selectedItems[0]) { var uri = gList.selectedItems[0].id;
|
function editType(){ if (gTree.selectedItems && gTree.selectedItems[0]) { var uri = gTree.selectedItems[0].id; var handlerOverride = new HandlerOverride(uri); window.openDialog("chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", handlerOverride); selectApplication(); }}
|
if (gList.selectedItems && gList.selectedItems[0]) { var uri = gList.selectedItems[0].id;
|
if (gList.currentIndex >= 0) { var uri = gList.view.getResourceAtIndex(gList.currentIndex).Value;
|
function editType(){ if (gList.selectedItems && gList.selectedItems[0]) { var uri = gList.selectedItems[0].id; var handlerOverride = new HandlerOverride(uri); window.openDialog("chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", handlerOverride); selectApplication(); }}
|
var kids = aTreeKids.childNodes; for (var i = 0; i < kids.length; ++i) { aTreeKids.removeChild(kids[i]);
|
while (aTreeKids.hasChildNodes()) { aTreeKids.removeChild(aTreeKids.lastChild);
|
emptyTree: function(aTreeKids) { var kids = aTreeKids.childNodes; for (var i = 0; i < kids.length; ++i) { aTreeKids.removeChild(kids[i]); } },
|
debug("num_selected="+num_selected);
|
function enable_buttons_for_other_panels(){ var add_button = document.getElementById('add_button'); var preview_button = document.getElementById('preview_button'); var all_panels = document.getElementById('other-panels'); var num_selected = 0; // Only count non-folders as selected for button enabling for (var ii=0; ii<all_panels.selectedItems.length; ii++) { var node = all_panels.selectedItems[ii]; if (node.getAttribute('container') != 'true') { num_selected++; } } if (num_selected > 0) { add_button.removeAttribute('disabled'); preview_button.removeAttribute('disabled'); } else { add_button.setAttribute('disabled','true'); preview_button.setAttribute('disabled','true'); }}
|
|
directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled");
|
if (gPrefInt.prefIsLocked("ldap_2.autoComplete.directoryServer")) { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); } else { directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); }
|
function enableAutocomplete(){ var autocompleteLDAP = document.getElementById("autocompleteLDAP"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton");// var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory"); if (autocompleteLDAP.checked) { directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled");// autocompleteSkipDirectory.removeAttribute("disabled"); } else { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true);// autocompleteSkipDirectory.setAttribute("disabled", true); } // if we do not have any directories disable the dropdown list box if (gAvailDirectories.length < 1) directoriesList.setAttribute("disabled", true); gFromGlobalPref = true; LoadDirectories(directoriesListPopup);}
|
window.setCursor("spinning"); window._content.setCursor("spinning");
|
if ( navigator.platform.indexOf("Mac") > 0 ) { window.setCursor("spinning"); window._content.setCursor("spinning"); }
|
function EnableBusyCursor(doEnable) { if (doEnable) { window.setCursor("spinning"); window._content.setCursor("spinning"); } else { window.setCursor("auto"); window._content.setCursor("auto"); }}
|
var unload_toggle = "false";
|
unload_toggle = "false";
|
function enableButtons(){ var login_toggle = "true"; var logout_toggle = "true"; var pw_toggle = "true"; var unload_toggle = "true"; getSelectedItem(); if (selected_module) { var unload_toggle = "false"; showModuleInfo(); } else if (selected_slot) { // here's the workaround - login functions are all with token, // so grab the token type var selected_token = selected_slot.getToken(); if (selected_token != null) { if (selected_token.needsLogin()) { pw_toggle = "false"; if (selected_token.isLoggedIn()) { logout_toggle = "false"; } else { login_toggle = "false"; } } } showSlotInfo(); } var thebutton = document.getElementById('login_button'); thebutton.setAttribute("disabled", login_toggle); thebutton = document.getElementById('logout_button'); thebutton.setAttribute("disabled", logout_toggle); thebutton = document.getElementById('change_pw_button'); thebutton.setAttribute("disabled", pw_toggle); thebutton = document.getElementById('unload_button'); thebutton.setAttribute("disabled", unload_toggle); // not implemented //thebutton = document.getElementById('change_slotname_button'); //thebutton.setAttribute("disabled", toggle);}
|
document.getElementById("msgSubject").removeAttribute("disabled");
|
function enableEditableFields(){ editorShell.editor.SetFlags(plaintextEditor.eEditorMailMask); document.getElementById("msgSubject").removeAttribute("disabled"); var enableElements = document.getElementsByAttribute("disableonsend", "true"); for (i=0;i<enableElements.length;i++) { enableElements[i].removeAttribute('disabled'); }}
|
|
debug("enableElement: enabling " + elementId);
|
function enableElement(elementId){ try { debug("enableElement: enabling " + elementId); //document.getElementById(elementId).setAttribute("disabled", "false"); // call remove attribute beacuse some widget code checks for the presense of a // disabled attribute, not the value. document.getElementById(elementId).removeAttribute("disabled"); } catch (e) { dump("enableElement: Couldn't remove disabled attribute on " + elementId + "\n"); }}
|
|
}
|
function enableEncryptionControls(){ gEncryptAlways.removeAttribute("disabled"); gNeverEncrypt.removeAttribute("disabled");}
|
|
}
|
function enableSigningControls(){ gSignMessages.removeAttribute("disabled");}
|
|
function enableUriLoading() { var pref = Components.classes['component: if (pref) { pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); pref.SetDefaultBoolPref("browser.uriloader", true); }
|
function enableUriLoading() { if( pref ) pref.SetDefaultBoolPref("browser.uriloader", true);
|
function enableUriLoading() { var pref = Components.classes['component://netscape/preferences']; if (pref) { pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); pref.SetDefaultBoolPref("browser.uriloader", true); }}
|
var attrVal=overrideGlobalPref.getAttribute("disabled"); document.getElementById("ldapAutocomplete").disabled=attrVal;
|
function enabling(){ var autocomplete = document.getElementById("ldapAutocomplete"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); // this is the hidden text element that assigned a value from the prefs var overrideGlobalPref = document.getElementById("identity.overrideGlobalPref"); switch(autocomplete.selectedItem.value) { case "0": directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); break; case "1": directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); break; } var attrVal=overrideGlobalPref.getAttribute("disabled"); document.getElementById("ldapAutocomplete").disabled=attrVal; // if the pref is locked, we'll need to disable the elements if (overrideGlobalPref.getAttribute("disabled") == "true") { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); } gFromGlobalPref = false; LoadDirectories(directoriesListPopup);}
|
|
if (overrideGlobalPref.getAttribute("disabled") == "true") { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true);
|
if (!gPrefInt) { gPrefInt = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch);
|
function enabling(){ var autocomplete = document.getElementById("ldapAutocomplete"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); // this is the hidden text element that assigned a value from the prefs var overrideGlobalPref = document.getElementById("identity.overrideGlobalPref"); switch(autocomplete.selectedItem.value) { case "0": directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); break; case "1": directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); break; } var attrVal=overrideGlobalPref.getAttribute("disabled"); document.getElementById("ldapAutocomplete").disabled=attrVal; // if the pref is locked, we'll need to disable the elements if (overrideGlobalPref.getAttribute("disabled") == "true") { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); } gFromGlobalPref = false; LoadDirectories(directoriesListPopup);}
|
if (gPrefInt.prefIsLocked("mail.identity." + gIdentity.key + ".overrideGlobal_Pref")) { document.getElementById("useGlobalPref").setAttribute("disabled", "true"); document.getElementById("directories").setAttribute("disabled", "true"); } else { document.getElementById("useGlobalPref").removeAttribute("disabled"); document.getElementById("directories").removeAttribute("disabled"); } if (gPrefInt.prefIsLocked("mail.identity." + gIdentity.key + ".directoryServer")) { document.getElementById("directoriesList").setAttribute("disabled", "true"); document.getElementById("directoriesListPopup").setAttribute("disabled", "true"); }
|
function enabling(){ var autocomplete = document.getElementById("ldapAutocomplete"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); // this is the hidden text element that assigned a value from the prefs var overrideGlobalPref = document.getElementById("identity.overrideGlobalPref"); switch(autocomplete.selectedItem.value) { case "0": directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); break; case "1": directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); break; } var attrVal=overrideGlobalPref.getAttribute("disabled"); document.getElementById("ldapAutocomplete").disabled=attrVal; // if the pref is locked, we'll need to disable the elements if (overrideGlobalPref.getAttribute("disabled") == "true") { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); } gFromGlobalPref = false; LoadDirectories(directoriesListPopup);}
|
|
if (override.checked)
|
if (override.checked && !override.disabled)
|
function enabling(){ var override = document.getElementById("identity.overrideGlobalPref"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); if (override.checked) { directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); } else { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); } gFromGlobalPref = false; LoadDirectories(directoriesListPopup);}
|
gSMIMEContainer.removeAttribute('collapsed');
|
encryptionStatus: function(aValidEncryption) { if (aValidEncryption) { gEncryptedUINode.removeAttribute('collapsed'); } else { // show a broken encryption icon.... } gEncryptionUIVisible = true; },
|
|
if (nsICMSMessageErrors.SUCCESS != aEncryptionStatus) { var brand = gBrandBundle.getString("brandShortName"); var title = gSMIMEBundle.getString("CantDecryptTitle").replace(/%brand%/g,brand); var body = gSMIMEBundle.getString("CantDecryptBody").replace(/%brand%/g,brand); msgWindow.displayHTMLInMessagePane(title, "<html>\n"+ "<body bgcolor=\"#fafaee\">\n"+ "<center><br><br><br>\n"+ "<table>\n"+ "<tr><td>\n"+ "<center><strong><font size=\"+3\">\n"+ title+"</font></center><br>\n"+ body+"\n"+ "</td></tr></table></center></body></html>", false); }
|
encryptionStatus: function(aNestingLevel, aEncryptionStatus, aRecipientCert) { if (aNestingLevel > 1) { // we are not interested return; } gEncryptionStatus = aEncryptionStatus; gEncryptionCert = aRecipientCert; gSMIMEContainer.collapsed = false; gEncryptedUINode.collapsed = false; if (nsICMSMessageErrors.SUCCESS == aEncryptionStatus) { gEncryptedUINode.setAttribute("encrypted", "ok"); gStatusBar.setAttribute("encrypted", "ok"); } else { gEncryptedUINode.setAttribute("encrypted", "notok"); gStatusBar.setAttribute("encrypted", "notok"); } if (gEncryptedURIService) { gMyLastEncryptedURI = GetLoadedMessage(); gEncryptedURIService.rememberEncrypted(gMyLastEncryptedURI); } },
|
|
if (this._outputStream) { this._outputStream.close(); this._outputStream = null; }
|
if (!this._outputStream) return; this._outputStream.close(); this._outputStream = null;
|
end: function() { if (this._outputStream) { this._outputStream.close(); this._outputStream = null; } }
|
getBrowser().userTypedClear = false;
|
endDocumentLoad : function(aRequest, aStatus) { const nsIChannel = Components.interfaces.nsIChannel; var urlStr = aRequest.QueryInterface(nsIChannel).originalURI.spec; var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad"; try { observerService.notifyObservers(_content, notification, urlStr); } catch (e) { } }
|
|
observerService.notifyObservers(_content, notification, urlStr);
|
observerService.notifyObservers(content, notification, urlStr);
|
endDocumentLoad : function(aRequest, aStatus) { // The document is done loading, it's okay to clear // the value again. if (getBrowser().userTypedClear > 0) getBrowser().userTypedClear--; const nsIChannel = Components.interfaces.nsIChannel; var urlStr = aRequest.QueryInterface(nsIChannel).originalURI.spec; if (Components.isSuccessCode(aStatus)) dump("Document "+urlStr+" loaded successfully\n"); // per QA request else { // per QA request var e = new Components.Exception("", aStatus); var name = e.name; dump("Error loading URL "+urlStr+" : "+ Number(aStatus).toString(16)); if (name) dump(" ("+name+")"); dump('\n'); } var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad"; try { observerService.notifyObservers(_content, notification, urlStr); } catch (e) { } }
|
ENSURE(aLocation.exists(), "Can't init an engine from a non-existent file!", Cr.NS_ERROR_FAILURE);
|
function Engine(aLocation, aSourceDataType, aIsReadOnly) { this._dataType = aSourceDataType; this._readOnly = aIsReadOnly; this._urls = []; if (aLocation instanceof Ci.nsILocalFile) { ENSURE(aLocation.exists(), "Can't init an engine from a non-existent file!", Cr.NS_ERROR_FAILURE); // we already have a file (e.g. loading engines from disk) this._file = aLocation; this._getData(); // parse the data and set up fields accordingly this._init(); } else if (aLocation instanceof Ci.nsIURI) { this._uri = aLocation; switch (aLocation.scheme) { case "https": case "http": case "data": case "file": case "resource": // we have a URI, and no file this._getDataFromURI(aLocation); break; case "javascript": // Passing a javascript URI to addEngine causes a crash (bug 328697). // Fall through... default: ERROR("Invalid URI passed to the nsISearchEngine constructor", Cr.NS_ERROR_INVALID_ARG); } } else ERROR("Engine location is neither a File nor a URI object", Cr.NS_ERROR_INVALID_ARG);}
|
|
this._getData(); this._init();
|
function Engine(aLocation, aSourceDataType, aIsReadOnly) { this._dataType = aSourceDataType; this._readOnly = aIsReadOnly; this._urls = []; if (aLocation instanceof Ci.nsILocalFile) { ENSURE(aLocation.exists(), "Can't init an engine from a non-existent file!", Cr.NS_ERROR_FAILURE); // we already have a file (e.g. loading engines from disk) this._file = aLocation; this._getData(); // parse the data and set up fields accordingly this._init(); } else if (aLocation instanceof Ci.nsIURI) { this._uri = aLocation; switch (aLocation.scheme) { case "https": case "http": case "data": case "file": case "resource": // we have a URI, and no file this._getDataFromURI(aLocation); break; case "javascript": // Passing a javascript URI to addEngine causes a crash (bug 328697). // Fall through... default: ERROR("Invalid URI passed to the nsISearchEngine constructor", Cr.NS_ERROR_INVALID_ARG); } } else ERROR("Engine location is neither a File nor a URI object", Cr.NS_ERROR_INVALID_ARG);}
|
|
this._getDataFromURI(aLocation);
|
this._uri = aLocation;
|
function Engine(aLocation, aSourceDataType, aIsReadOnly) { this._dataType = aSourceDataType; this._readOnly = aIsReadOnly; this._urls = []; if (aLocation instanceof Ci.nsILocalFile) { ENSURE(aLocation.exists(), "Can't init an engine from a non-existent file!", Cr.NS_ERROR_FAILURE); // we already have a file (e.g. loading engines from disk) this._file = aLocation; this._getData(); // parse the data and set up fields accordingly this._init(); } else if (aLocation instanceof Ci.nsIURI) { this._uri = aLocation; switch (aLocation.scheme) { case "https": case "http": case "data": case "file": case "resource": // we have a URI, and no file this._getDataFromURI(aLocation); break; case "javascript": // Passing a javascript URI to addEngine causes a crash (bug 328697). // Fall through... default: ERROR("Invalid URI passed to the nsISearchEngine constructor", Cr.NS_ERROR_INVALID_ARG); } } else ERROR("Engine location is neither a File nor a URI object", Cr.NS_ERROR_INVALID_ARG);}
|
case "javascript":
|
function Engine(aLocation, aSourceDataType, aIsReadOnly) { this._dataType = aSourceDataType; this._readOnly = aIsReadOnly; this._urls = []; if (aLocation instanceof Ci.nsILocalFile) { ENSURE(aLocation.exists(), "Can't init an engine from a non-existent file!", Cr.NS_ERROR_FAILURE); // we already have a file (e.g. loading engines from disk) this._file = aLocation; this._getData(); // parse the data and set up fields accordingly this._init(); } else if (aLocation instanceof Ci.nsIURI) { this._uri = aLocation; switch (aLocation.scheme) { case "https": case "http": case "data": case "file": case "resource": // we have a URI, and no file this._getDataFromURI(aLocation); break; case "javascript": // Passing a javascript URI to addEngine causes a crash (bug 328697). // Fall through... default: ERROR("Invalid URI passed to the nsISearchEngine constructor", Cr.NS_ERROR_INVALID_ARG); } } else ERROR("Engine location is neither a File nor a URI object", Cr.NS_ERROR_INVALID_ARG);}
|
|
LOG(message, true);
|
LOG(message);
|
function ENSURE(assertion, message, resultCode) { if (!assertion) { LOG(message, true); throw resultCode; }}
|
ASSERT(assertion, message);
|
NS_ASSERT(assertion, SEARCH_LOG_PREFIX + message);
|
function ENSURE_WARN(assertion, message, resultCode) { ASSERT(assertion, message); if (!assertion) throw resultCode;}
|
mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch);
|
mPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
function ensureDefaultEnginePrefs(aRDF,aDS) { mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch); var defaultName = mPrefs.getComplexValue("browser.search.defaultenginename" , Components.interfaces.nsIPrefLocalizedString); var kNC_Root = aRDF.GetResource("NC:SearchEngineRoot"); var kNC_child = aRDF.GetResource("http://home.netscape.com/NC-rdf#child"); var kNC_Name = aRDF.GetResource("http://home.netscape.com/NC-rdf#Name"); var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); while (arcs.hasMoreElements()) { var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) mPrefs.setCharPref("browser.search.defaultengine", engineRes.Value); } }
|
mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch);
|
mPrefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch);
|
function ensureDefaultEnginePrefs(aRDF,aDS) { mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch); var defaultName = mPrefs.getComplexValue("browser.search.defaultenginename" , Components.interfaces.nsIPrefLocalizedString); kNC_Root = aRDF.GetResource("NC:SearchEngineRoot"); kNC_child = aRDF.GetResource("http://home.netscape.com/NC-rdf#child"); kNC_Name = aRDF.GetResource("http://home.netscape.com/NC-rdf#Name"); var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); while (arcs.hasMoreElements()) { var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) mPrefs.setCharPref("browser.search.defaultengine", engineRes.Value); } }
|
var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); while (arcs.hasMoreElements()) { var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) prefbranch.setCharPref("browser.search.defaultengine", engineRes.Value); }
|
var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); while (arcs.hasMoreElements()) { var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) prefbranch.setCharPref("browser.search.defaultengine", engineRes.Value);
|
function ensureDefaultEnginePrefs(aRDF,aDS) { var prefbranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var defaultName = prefbranch.getComplexValue("browser.search.defaultenginename" , Components.interfaces.nsIPrefLocalizedString).data; var kNC_Root = aRDF.GetResource("NC:SearchEngineRoot"); var kNC_child = aRDF.GetResource("http://home.netscape.com/NC-rdf#child"); var kNC_Name = aRDF.GetResource("http://home.netscape.com/NC-rdf#Name"); var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); while (arcs.hasMoreElements()) { var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) prefbranch.setCharPref("browser.search.defaultengine", engineRes.Value); } }
|
}
|
function ensureDefaultEnginePrefs(aRDF,aDS) { var prefbranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var defaultName = prefbranch.getComplexValue("browser.search.defaultenginename" , Components.interfaces.nsIPrefLocalizedString).data; var kNC_Root = aRDF.GetResource("NC:SearchEngineRoot"); var kNC_child = aRDF.GetResource("http://home.netscape.com/NC-rdf#child"); var kNC_Name = aRDF.GetResource("http://home.netscape.com/NC-rdf#Name"); var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); while (arcs.hasMoreElements()) { var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) prefbranch.setCharPref("browser.search.defaultengine", engineRes.Value); } }
|
|
mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch);
|
mPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
function ensureSearchPref() { var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch); var ds = rdf.GetDataSource("rdf:internetsearch"); kNC_Name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); try { defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); } catch(ex) { ensureDefaultEnginePrefs(rdf, ds); defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); } }
|
function ensureSearchPref() {
|
function ensureSearchPref() { var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var prefbranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var ds = rdf.GetDataSource("rdf:internetsearch"); var kNC_Name = rdf.GetResource("http: var defaultEngine;
|
function ensureSearchPref() { var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var prefbranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var ds = rdf.GetDataSource("rdf:internetsearch"); var kNC_Name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); try { var defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } catch(ex) { ensureDefaultEnginePrefs(rdf, ds); defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } }
|
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var prefbranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var ds = rdf.GetDataSource("rdf:internetsearch"); var kNC_Name = rdf.GetResource("http: try { var defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } catch(ex) { ensureDefaultEnginePrefs(rdf, ds); defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } }
|
try { defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } catch(ex) { ensureDefaultEnginePrefs(rdf, ds); defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } }
|
function ensureSearchPref() { var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var prefbranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var ds = rdf.GetDataSource("rdf:internetsearch"); var kNC_Name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); try { var defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } catch(ex) { ensureDefaultEnginePrefs(rdf, ds); defaultEngine = prefbranch.getCharPref("browser.search.defaultengine"); } }
|
if (this._onEnterPP)
|
if (this._onEnterPP) {
|
enterPrintPreview: function () { var webBrowserPrint = this.getWebBrowserPrint(); var printSettings = this.getPrintSettings(); try { webBrowserPrint.printPreview(printSettings, null, this._webProgressPP.value); } catch (e) { // Pressing cancel is expressed as an NS_ERROR_ABORT return value, // causing an exception to be thrown which we catch here. // Unfortunately this will also consume helpful failures, so add a // dump(e); // if you need to debug } var printPreviewTB = document.getElementById("print-preview-toolbar"); if (printPreviewTB) { printPreviewTB.updateSettings(); return } // show the toolbar after we go into print preview mode so // that we can initialize the toolbar with total num pages printPreviewTB = document.createElementNS(XUL_NS, "toolbar"); printPreviewTB.setAttribute("printpreview", true); printPreviewTB.setAttribute("id", "print-preview-toolbar"); getBrowser().parentNode.insertBefore(printPreviewTB, getBrowser()); // Tab browser... if ("getStripVisibility" in getBrowser()) { this._chromeState.hadTabStrip = getBrowser().getStripVisibility(); getBrowser().setStripVisibilityTo(false); } // disable chrome shortcuts... window.addEventListener("keypress", this.onKeyPressPP, true); _content.focus(); // on Enter PP Call back if (this._onEnterPP) this._onEnterPP(); },
|
this._onEnterPP = null; }
|
enterPrintPreview: function () { var webBrowserPrint = this.getWebBrowserPrint(); var printSettings = this.getPrintSettings(); try { webBrowserPrint.printPreview(printSettings, null, this._webProgressPP.value); } catch (e) { // Pressing cancel is expressed as an NS_ERROR_ABORT return value, // causing an exception to be thrown which we catch here. // Unfortunately this will also consume helpful failures, so add a // dump(e); // if you need to debug } var printPreviewTB = document.getElementById("print-preview-toolbar"); if (printPreviewTB) { printPreviewTB.updateSettings(); return } // show the toolbar after we go into print preview mode so // that we can initialize the toolbar with total num pages printPreviewTB = document.createElementNS(XUL_NS, "toolbar"); printPreviewTB.setAttribute("printpreview", true); printPreviewTB.setAttribute("id", "print-preview-toolbar"); getBrowser().parentNode.insertBefore(printPreviewTB, getBrowser()); // Tab browser... if ("getStripVisibility" in getBrowser()) { this._chromeState.hadTabStrip = getBrowser().getStripVisibility(); getBrowser().setStripVisibilityTo(false); } // disable chrome shortcuts... window.addEventListener("keypress", this.onKeyPressPP, true); _content.focus(); // on Enter PP Call back if (this._onEnterPP) this._onEnterPP(); },
|
|
document.getElementById("addSynonym").setAttribute("style", "display: inline;"); document.getElementById("removeSynonym").setAttribute("style", "display: inline;");
|
function EntrySelected(){ // display caption above synonym tree var schemaId = document.getElementById("schematree").selectedItems[0].getAttribute("id"); var schemanumb =parseInt(schemaId.substring(5, schemaId.length)); var entryId = document.getElementById("entrytree").selectedItems[0].getAttribute("id"); var entrynumb =parseInt(entryId.substring(5, entryId.length)); var entryName = Decrypt(strings[entries[schemas[schemanumb]+entrynumb]+1]); var synonymText = document.getElementById("synonymtext"); synonymText.setAttribute("value", synonymText.getAttribute("value2") + entryName); // display buttons next to synonym tree document.getElementById("addSynonym").setAttribute("style", "display: inline;"); document.getElementById("removeSynonym").setAttribute("style", "display: inline;"); // enable certain buttons document.getElementById("removeEntry").setAttribute("disabled", "false") document.getElementById("addSynonym").setAttribute("disabled", "false")}
|
|
synonymText.setAttribute("value", synonymText.getAttribute("value2") + entryName);
|
synonymText.setAttribute("value", synonymText.getAttribute("value2") + entryName + synonymText.getAttribute("value4"));
|
function EntrySelected(){ // display caption above synonym tree var schemaId = document.getElementById("schematree").selectedItems[0].getAttribute("id"); var schemanumb =parseInt(schemaId.substring(5, schemaId.length)); var entryId = document.getElementById("entrytree").selectedItems[0].getAttribute("id"); var entrynumb =parseInt(entryId.substring(5, entryId.length)); var entryName = Decrypt(strings[entries[schemas[schemanumb]+entrynumb]+1]); var synonymText = document.getElementById("synonymtext"); synonymText.setAttribute("value", synonymText.getAttribute("value2") + entryName); // enable certain buttons document.getElementById("removeEntry").setAttribute("disabled", "false") document.getElementById("addSynonym").setAttribute("disabled", "false")}
|
if ( typeof p == "number" ) {
|
if (!isNaN(p)) {
|
function enumObject( o ) { this.pCount = 0; for ( var p in o ) { this.pCount++; if ( typeof p == "number" ) { eval( "this["+p+"] = o["+p+"]" ); } else { eval( "this." + p + " = o."+ p ); } } }
|
return false;
|
function ep_hook(e, hooks){ var h; if (typeof hooks == "undefined") hooks = this.hooks; hook_loop: for (h = hooks.length - 1; h >= 0; h--) { if (!hooks[h].enabled || !matchObject (e, hooks[h].pattern, hooks[h].neg)) continue hook_loop; e.hooks.push (hooks[h]); var rv = hooks[h].f(e); if ((typeof rv == "boolean") && (rv == false)) { dd ("hook #" + h + " '" + ((typeof hooks[h].name != "undefined") ? hooks[h].name : "") + "' stopped hook processing."); return true; } }}
|
|
if (0)
|
if (1)
|
function ep_routeevent (e){ var count = 0; this.currentEvent = e; e.level = 0; while (e.destObject) { e.level++; this.onHook (e); var destObject = e.destObject; e.destObject = (void 0); switch (typeof destObject[e.destMethod]) { case "function": if (0) try { destObject[e.destMethod] (e); } catch (ex) { dd ("Error routing event: " + ex + " in " + e.destMethod); } else destObject[e.destMethod] (e); if (count++ > this.MAX_EVENT_DEPTH) throw "Too many events in chain"; break; case "undefined": //dd ("** " + e.destMethod + " does not exist."); break; default: dd ("** " + e.destMethod + " is not a function."); } if ((e.type != "event-end") && (!e.destObject)) { e.lastSet = e.set; e.set = "eventpump"; e.lastType = e.type; e.type = "event-end"; e.destMethod = "onEventEnd"; e.destObject = this; } } delete this.currentEvent; return true; }
|
dd ("Error routing event: " + ex + " in " + e.destMethod + "\n" + dumpObjectTree(ex));
|
dd ("Error routing event: " + dumpObjectTree(ex) + " in " + e.destMethod + "\n" + ex);
|
function ep_routeevent (e){ var count = 0; this.currentEvent = e; e.level = 0; while (e.destObject) { e.level++; this.onHook (e); var destObject = e.destObject; e.destObject = (void 0); switch (typeof destObject[e.destMethod]) { case "function": if (1) try { destObject[e.destMethod] (e); } catch (ex) { dd ("Error routing event: " + ex + " in " + e.destMethod + "\n" + dumpObjectTree(ex)); } else destObject[e.destMethod] (e); if (count++ > this.MAX_EVENT_DEPTH) throw "Too many events in chain"; break; case "undefined": //dd ("** " + e.destMethod + " does not exist."); break; default: dd ("** " + e.destMethod + " is not a function."); } if ((e.type != "event-end") && (!e.destObject)) { e.lastSet = e.set; e.set = "eventpump"; e.lastType = e.type; e.type = "event-end"; e.destMethod = "onEventEnd"; e.destObject = this; } } delete this.currentEvent; return true; }
|
gDelayTestDriverEnd = false; jsTestDriverEnd();
|
function err( msg, page, line ) { var testcase; if (typeof(EXPECTED) == "undefined" || EXPECTED != "error") { /* * an unexpected exception occured */ writeLineToLog( "Test failed with the message: " + msg ); testcase = new TestCase(SECTION, "unknown", "unknown", "unknown"); testcase.passed = false; testcase.reason = "Error: " + msg + " Source File: " + page + " Line: " + line + "."; if (document.location.href.indexOf('-n.js') != -1) { // negative test testcase.passed = true; } return; } if (typeof SECTION == 'undefined') { SECTION = 'Unknown'; } if (typeof DESCRIPTION == 'undefined') { DESCRIPTION = 'Unknown'; } if (typeof EXPECTED == 'undefined') { EXPECTED = 'Unknown'; } testcase = new TestCase(SECTION, DESCRIPTION, EXPECTED, "error"); testcase.reason += "Error: " + msg + " Source File: " + page + " Line: " + line + "."; stopTest();}
|
|
ASSERT(false, message);
|
NS_ASSERT(false, SEARCH_LOG_PREFIX + message);
|
function ERROR(message, resultCode) { ASSERT(false, message); throw resultCode;}
|
default:
|
default: if (isNaN(err)) return ("[" + err + "] Unknown error.");
|
function errorToString( err ){ if (typeof(err) == "string") return err; if (err instanceof Error) return err.message; if (err instanceof Components.interfaces.nsIException) return err.toString(); // xxx todo: or just message? // numeric codes: switch (err) { case Components.results.NS_ERROR_INVALID_ARG: return "NS_ERROR_INVALID_ARG"; case Components.results.NS_ERROR_NO_INTERFACE: return "NS_ERROR_NO_INTERFACE"; case Components.results.NS_ERROR_NOT_IMPLEMENTED: return "NS_ERROR_NOT_IMPLEMENTED"; case Components.results.NS_ERROR_FAILURE: return "NS_ERROR_FAILURE"; default: // probe for WCAP error: try { return wcapErrorToString(err); } catch (exc) { // probe for netwerk error: try { return netErrorToString(err); } catch (exc) { return ("[" + err + "] Unknown error."); } } }}
|
return ("[" + err + "] Unknown error.");
|
return ("[0x" + err.toString(16) + "] Unknown error.");
|
function errorToString( err ){ if (typeof(err) == "string") return err; if (err instanceof Error) return err.message; if (err instanceof Components.interfaces.nsIException) return err.toString(); // xxx todo: or just message? // numeric codes: switch (err) { case Components.results.NS_ERROR_INVALID_ARG: return "NS_ERROR_INVALID_ARG"; case Components.results.NS_ERROR_NO_INTERFACE: return "NS_ERROR_NO_INTERFACE"; case Components.results.NS_ERROR_NOT_IMPLEMENTED: return "NS_ERROR_NOT_IMPLEMENTED"; case Components.results.NS_ERROR_FAILURE: return "NS_ERROR_FAILURE"; default: // probe for WCAP error: try { return wcapErrorToString(err); } catch (exc) { // probe for netwerk error: try { return netErrorToString(err); } catch (exc) { return ("[" + err + "] Unknown error."); } } }}
|
if (err instanceof String) return err;
|
function errorToString( err ){ if (err instanceof Error) return err.message; switch (err) { case NS_ERROR_OFFLINE: return "NS_ERROR_OFFLINE"; // xxx todo: there may be a more comprehensive API for these: case Components.results.NS_ERROR_INVALID_ARG: return "NS_ERROR_INVALID_ARG"; case Components.results.NS_ERROR_NO_INTERFACE: return "NS_ERROR_NO_INTERFACE"; case Components.results.NS_ERROR_NOT_IMPLEMENTED: return "NS_ERROR_NOT_IMPLEMENTED"; case Components.results.NS_ERROR_FAILURE: return "NS_ERROR_FAILURE"; default: // probe for WCAP error: try { return wcapErrorToString(err); } catch (exc) { return ("[" + err + "] Unknown error."); } }}
|
|
return fileName.replace(/[^\w\d.,#\-_]/g, encodeChar);
|
return fileName.replace(/[^\w\d.,#\-_%]/g, encodeChar);
|
function escapeFileName(fileName){ return fileName.replace(/[^\w\d.,#\-_]/g, encodeChar);}
|
return eval("(" + expr + ")");
|
return eval(expr);
|
function evalAttribute(node, attr) { var ex; var expr = node.getAttribute(attr); if (!expr) return null; try { return eval("(" + expr + ")"); } catch (ex) { dd ("caught exception evaling '" + node.getAttribute("id") + "'.'" + attr + "': '" + expr + "'\n" + ex); } return null; };
|
attr + "'");
|
attr + "'\n" + ex);
|
function evalIfAttribute (node, attr) { var ex; var expr = node.getAttribute(attr); if (!expr) return true; expr = expr.replace (/\Wor\W/gi, " || "); expr = expr.replace (/\Wand\W/gi, " && "); try { return eval("(" + expr + ")"); } catch (ex) { dd ("caught exception evaling '" + node.getAttribute("id") + "'.'" + attr + "'"); } return true; }
|
attr + "'\n" + ex);
|
attr + "': '" + expr + "'\n" + ex);
|
function evalIfAttribute (node, attr) { var ex; var expr = node.getAttribute(attr); if (!expr) return true; expr = expr.replace (/\Wand\W/gi, " && "); try { return eval("(" + expr + ")"); } catch (ex) { dd ("caught exception evaling '" + node.getAttribute("id") + "'.'" + attr + "'\n" + ex); } return true; };
|
ASSERT (console.currentFrameIndex < console.frames.length, "console.currentFrameIndex out of range");
|
function evalInTargetScope (script){ if (!console.frames) { display (MSG_ERR_NO_STACK, MT_ERROR); return false; } ASSERT (console.currentFrameIndex < console.frames.length, "console.currentFrameIndex out of range"); try { return console.frames[console.currentFrameIndex].eval (script, MSG_VAL_CONSOLE, 1); } catch (ex) { display (formatEvalException (ex), MT_ERROR); return null; }}
|
|
return console.frames[console.currentFrameIndex].eval (script, MSG_VAL_CONSOLE, 1);
|
return getCurrentFrame().eval (script, MSG_VAL_CONSOLE, 1);
|
function evalInTargetScope (script){ if (!console.frames) { display (MSG_ERR_NO_STACK, MT_ERROR); return false; } ASSERT (console.currentFrameIndex < console.frames.length, "console.currentFrameIndex out of range"); try { return console.frames[console.currentFrameIndex].eval (script, MSG_VAL_CONSOLE, 1); } catch (ex) { display (formatEvalException (ex), MT_ERROR); return null; }}
|
function EvalTest() { try { MY_EVAL( "RESULT = \"Failed: indirect call to eval was successful; should be an error\"" ); } catch ( e ) { RESULT = EXPECT; }
|
function EvalTest() { MY_EVAL( "RESULT = EXPECT" );
|
function EvalTest() { try { MY_EVAL( "RESULT = \"Failed: indirect call to eval was successful; should be an error\"" ); } catch ( e ) { RESULT = EXPECT; } testcases[tc++] = new TestCase( SECTION, "Call eval indirectly", EXPECT, RESULT );}
|
name = e.destObject.host + ":" + e.destObject.port;
|
case "dcc-file": name = e.destObject.localIP + ":" + e.destObject.port;
|
function event_tracer (e){ var name = ""; var data = ("debug" in e) ? e.debug : ""; switch (e.set) { case "server": name = e.destObject.connection.host; if (e.type == "rawdata") data = "'" + e.data + "'"; if (e.type == "senddata") { var nextLine = e.destObject.sendQueue[e.destObject.sendQueue.length - 1]; if ("logged" in nextLine) return true; /* don't print again */ if (nextLine) { data = "'" + nextLine.replace ("\n", "\\n") + "'"; nextLine.logged = true; } else data = "!!! Nothing to send !!!"; } break; case "network": case "channel": name = e.destObject.name; break; case "user": name = e.destObject.nick; break; case "httpdoc": name = e.destObject.server + e.destObject.path; if (e.destObject.state != "complete") data = "state: '" + e.destObject.state + "', received " + e.destObject.data.length; else dd ("document done:\n" + dumpObjectTree (this)); break; case "dcc-chat": name = e.destObject.host + ":" + e.destObject.port; if (e.type == "rawdata") data = "'" + e.data + "'"; break; case "client": if (e.type == "do-connect") data = "attempt: " + e.attempt + "/" + e.destObject.MAX_CONNECT_ATTEMPTS; break; default: break; } if (name) name = "[" + name + "]"; if (e.type == "info") data = "'" + e.msg + "'"; var str = "Level " + e.level + ": '" + e.type + "', " + e.set + name + "." + e.destMethod; if (data) str += "\ndata : " + data; dd (str); return true;}
|
var name=""; var data="";
|
var name = ""; var data = (e.debug) ? e.debug : "";
|
function event_tracer (e){ var name=""; var data=""; switch (e.set) { case "server": name = e.destObject.connection.host; if (e.type == "rawdata") data = "'" + e.data + "'"; if (e.type == "senddata") { var nextLine = e.destObject.sendQueue[e.destObject.sendQueue.length - 1]; if (nextLine) data = "'" + nextLine.replace ("\n", "\\n") + "' (may retry a few times)"; else data = "!!! Nothing to send !!!"; if (debugData.lastEventType == "senddata" && debugData.lastEventData == data) { /* don't keep printing this event */ return; } } break; case "network": case "channel": name = e.destObject.name; break; case "user": name = e.destObject.nick; break; case "httpdoc": name = e.destObject.server + e.destObject.path; if (e.destObject.state != "complete") data = "state: '" + e.destObject.state + "', received " + e.destObject.data.length; else dd ("document done:\n" + dumpObjectTree (this)); break; case "dcc-chat": name = e.destObject.host + ":" + e.destObject.port; if (e.type == "rawdata") data = "'" + e.data + "'"; break; case "client": if (e.type == "do-connect") data = "attempt: " + e.attempt + "/" + e.destObject.MAX_CONNECT_ATTEMPTS; break; default: break; } if (name) name = "[" + name + "]"; if (e.type == "info") data = "'" + e.msg + "'"; str = "Level " + e.level + ": '" + e.type + "', " + e.set + name + "." + e.destMethod; if (data) str += "\ndata : " + data; dd (str); debugData.lastEventType = e.type; debugData.lastEventData = data; return true;}
|
document.getElementById("menu-button").focus();
|
function eventHandlerMenu(e) { if( (e.keyCode==39 || e.keyCode==37) && (gShowingMenuPopup) ) { BrowserMenuPopupFalse(); } if(e.charCode==513) { document.getElementById("menu-button").focus(); e.preventBubble(); } var outnavTarget=document.commandDispatcher.focusedElement.getAttribute("accessrule"); if(outnavTarget!="" && (e.keyCode==40||e.keyCode==38) && !gShowingMenuPopup) { e.preventBubble(); if(e.keyCode==40) { ruleElement=findRuleById(document.getElementById(outnavTarget).getAttribute("accessnextrule"),"accessnextrule"); } if(e.keyCode==38) { ruleElement=findRuleById(document.getElementById(outnavTarget).getAttribute("accessprevrule"),"accessprevrule"); } var tempElement=ruleElement.getAttribute("accessfocus"); if(tempElement=="#tabContainer") { if(ruleElement.tabContainer) { ruleElement.selectedTab.focus(); } } else { document.getElementById(tempElement).focus(); } } /* * We may use onblur with content navigation tabbrowser to snav enable disable. */ }
|
|
}
|
},
|
exec : function(command, params) { }
|
var args = []; BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, []);
|
BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, args);
|
execCommand: function (aCommandID) { var selection = this.getSelection (); if (selection.length >= 1) var selectedItem = selection[0]; switch (aCommandID) { case "open": this.openRDFNode(selectedItem); break; case "openfolder": this.commands.openFolder(selectedItem); break; case "openfolderinnewwindow": this.openFolderInNewWindow(selectedItem); break; case "rename": // XXX - this is SO going to break if we ever do column re-ordering. this.commands.editCell(selectedItem, 0); break; case "editurl": this.commands.editCell(selectedItem, 1); break; case "setnewbookmarkfolder": case "setpersonaltoolbarfolder": case "setnewsearchfolder": var args = []; BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, []); // XXX - The containing node seems to be closed here and the // focus/selection is destroyed. this.selectElement(selectedItem); break; case "properties": this.showPropertiesForNode(selectedItem); break; case "find": this.findInBookmarks(); break; case "cut": this.copySelection (selection); this.deleteSelection (selection); break; case "copy": this.copySelection (selection); break; case "paste": this.paste (selection); break; case "delete": this.deleteSelection (selection); break; case "newfolder": var nfseln = this.getBestItem (); this.commands.createBookmarkItem("folder", nfseln); break; case "newbookmark": var folder = this.getSelectedFolder(); openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", null, null, folder, null); break; case "newseparator": nfseln = this.getBestItem (); var parentNode = this.findRDFNode(aSelectedItem, false); var args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(aSelectedItem), NC_NS_CMD + "newseparator", args); break; case "import": case "export": const isImport = aCommandID == "import"; try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = this.getLocaleString(isImport ? "SelectImport": "EnterExport"); kFilePicker.init(window, kTitle, kFilePickerIID[isImport ? "modeOpen" : "modeSave"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); if (!isImport) kFilePicker.defaultString = "bookmarks.html"; if (kFilePicker.show() != kFilePickerIID.returnCancel) { var fileName = kFilePicker.fileURL.spec; if (!fileName) break; } else break; } catch (e) { break; } var seln = this.getBestItem(); var args = [{ property: NC_NS + "URL", literal: fileName}]; BookmarksUtils.doBookmarksCommand(NODE_ID(seln), NC_NS_CMD + aCommandID, args); break; } },
|
var args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }];
|
args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }];
|
execCommand: function (aCommandID) { var selection = this.getSelection (); if (selection.length >= 1) var selectedItem = selection[0]; switch (aCommandID) { case "open": this.openRDFNode(selectedItem); break; case "openfolder": this.commands.openFolder(selectedItem); break; case "openfolderinnewwindow": this.openFolderInNewWindow(selectedItem); break; case "rename": // XXX - this is SO going to break if we ever do column re-ordering. this.commands.editCell(selectedItem, 0); break; case "editurl": this.commands.editCell(selectedItem, 1); break; case "setnewbookmarkfolder": case "setpersonaltoolbarfolder": case "setnewsearchfolder": var args = []; BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, []); // XXX - The containing node seems to be closed here and the // focus/selection is destroyed. this.selectElement(selectedItem); break; case "properties": this.showPropertiesForNode(selectedItem); break; case "find": this.findInBookmarks(); break; case "cut": this.copySelection (selection); this.deleteSelection (selection); break; case "copy": this.copySelection (selection); break; case "paste": this.paste (selection); break; case "delete": this.deleteSelection (selection); break; case "newfolder": var nfseln = this.getBestItem (); this.commands.createBookmarkItem("folder", nfseln); break; case "newbookmark": var folder = this.getSelectedFolder(); openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", null, null, folder, null); break; case "newseparator": nfseln = this.getBestItem (); var parentNode = this.findRDFNode(aSelectedItem, false); var args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(aSelectedItem), NC_NS_CMD + "newseparator", args); break; case "import": case "export": const isImport = aCommandID == "import"; try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = this.getLocaleString(isImport ? "SelectImport": "EnterExport"); kFilePicker.init(window, kTitle, kFilePickerIID[isImport ? "modeOpen" : "modeSave"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); if (!isImport) kFilePicker.defaultString = "bookmarks.html"; if (kFilePicker.show() != kFilePickerIID.returnCancel) { var fileName = kFilePicker.fileURL.spec; if (!fileName) break; } else break; } catch (e) { break; } var seln = this.getBestItem(); var args = [{ property: NC_NS + "URL", literal: fileName}]; BookmarksUtils.doBookmarksCommand(NODE_ID(seln), NC_NS_CMD + aCommandID, args); break; } },
|
var args = [{ property: NC_NS + "URL", literal: fileName}];
|
args = [{ property: NC_NS + "URL", literal: fileName}];
|
execCommand: function (aCommandID) { var selection = this.getSelection (); if (selection.length >= 1) var selectedItem = selection[0]; switch (aCommandID) { case "open": this.openRDFNode(selectedItem); break; case "openfolder": this.commands.openFolder(selectedItem); break; case "openfolderinnewwindow": this.openFolderInNewWindow(selectedItem); break; case "rename": // XXX - this is SO going to break if we ever do column re-ordering. this.commands.editCell(selectedItem, 0); break; case "editurl": this.commands.editCell(selectedItem, 1); break; case "setnewbookmarkfolder": case "setpersonaltoolbarfolder": case "setnewsearchfolder": var args = []; BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, []); // XXX - The containing node seems to be closed here and the // focus/selection is destroyed. this.selectElement(selectedItem); break; case "properties": this.showPropertiesForNode(selectedItem); break; case "find": this.findInBookmarks(); break; case "cut": this.copySelection (selection); this.deleteSelection (selection); break; case "copy": this.copySelection (selection); break; case "paste": this.paste (selection); break; case "delete": this.deleteSelection (selection); break; case "newfolder": var nfseln = this.getBestItem (); this.commands.createBookmarkItem("folder", nfseln); break; case "newbookmark": var folder = this.getSelectedFolder(); openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", null, null, folder, null); break; case "newseparator": nfseln = this.getBestItem (); var parentNode = this.findRDFNode(aSelectedItem, false); var args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(aSelectedItem), NC_NS_CMD + "newseparator", args); break; case "import": case "export": const isImport = aCommandID == "import"; try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = this.getLocaleString(isImport ? "SelectImport": "EnterExport"); kFilePicker.init(window, kTitle, kFilePickerIID[isImport ? "modeOpen" : "modeSave"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); if (!isImport) kFilePicker.defaultString = "bookmarks.html"; if (kFilePicker.show() != kFilePickerIID.returnCancel) { var fileName = kFilePicker.fileURL.spec; if (!fileName) break; } else break; } catch (e) { break; } var seln = this.getBestItem(); var args = [{ property: NC_NS + "URL", literal: fileName}]; BookmarksUtils.doBookmarksCommand(NODE_ID(seln), NC_NS_CMD + aCommandID, args); break; } },
|
this.deleteSelection (selection);
|
this.deleteSelection(selection); break; case "bm_fileBookmark": var rv = { selectedFolder: null }; openDialog("chrome: "centerscreen,chrome,modal=yes,dialog=no,resizable=yes", null, null, folder, null, "selectFolder", rv); if (rv.selectedFolder) { var additiveFlag = false; var selectedItems = [].concat(this.getSelection()) for (var i = 0; i < selectedItems.length; ++i) { var currItem = selectedItems[i]; var currURI = NODE_ID(currItem); var parent = gBookmarksShell.findRDFNode(currItem, false); gBookmarksShell.moveBookmark(currURI, NODE_ID(parent), rv.selectedFolder); gBookmarksShell.selectFolderItem(rv.selectedFolder, currURI, additiveFlag); if (!additiveFlag) additiveFlag = true; } gBookmarksShell.flushDataSource(); }
|
execCommand: function (aCommandID) { var args = []; var selection = this.getSelection (); if (selection.length >= 1) var selectedItem = selection[0]; switch (aCommandID) { case "open": this.open(null, selectedItem); break; case "openfolder": this.commands.openFolder(selectedItem); break; case "openfolderinnewwindow": this.openFolderInNewWindow(selectedItem); break; case "rename": // XXX - this is SO going to break if we ever do column re-ordering. this.commands.editCell(selectedItem, 0); break; case "editurl": this.commands.editCell(selectedItem, 1); break; case "setnewbookmarkfolder": case "setpersonaltoolbarfolder": case "setnewsearchfolder": BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, args); // XXX - The containing node seems to be closed here and the // focus/selection is destroyed. this.selectElement(selectedItem); break; case "properties": this.showPropertiesForNode(selectedItem); break; case "find": this.findInBookmarks(); break; case "bm_cut": this.copySelection (selection); this.deleteSelection (selection); break; case "bm_copy": this.copySelection (selection); break; case "bm_paste": this.paste (selection); break; case "bm_delete": this.deleteSelection (selection); break; case "newfolder": var nfseln = this.getBestItem (); this.commands.createBookmarkItem("folder", nfseln); break; case "newbookmark": var folder = this.getSelectedFolder(); openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", null, null, folder, null); break; case "newseparator": nfseln = this.getBestItem (); var parentNode = this.findRDFNode(nfseln, false); args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(nfseln), NC_NS_CMD + "newseparator", args); break; case "import": case "export": const isImport = aCommandID == "import"; try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = this.getLocaleString(isImport ? "SelectImport": "EnterExport"); kFilePicker.init(window, kTitle, kFilePickerIID[isImport ? "modeOpen" : "modeSave"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); if (!isImport) kFilePicker.defaultString = "bookmarks.html"; if (kFilePicker.show() != kFilePickerIID.returnCancel) { var fileName = kFilePicker.fileURL.spec; if (!fileName) break; } else break; } catch (e) { break; } var seln = this.getBestItem(); args = [{ property: NC_NS + "URL", literal: fileName}]; BookmarksUtils.doBookmarksCommand(NODE_ID(seln), NC_NS_CMD + aCommandID, args); break; } },
|
"centerscreen,chrome,dialog=no,resizable=no", null, null, folder, null);
|
"centerscreen,chrome,modal=yes,dialog=no,resizable=no", null, null, folder, null, "newBookmark");
|
execCommand: function (aCommandID) { var args = []; var selection = this.getSelection (); if (selection.length >= 1) var selectedItem = selection[0]; switch (aCommandID) { case "open": this.open(null, selectedItem); break; case "openfolder": this.commands.openFolder(selectedItem); break; case "openfolderinnewwindow": this.openFolderInNewWindow(selectedItem); break; case "rename": // XXX - this is SO going to break if we ever do column re-ordering. this.commands.editCell(selectedItem, 0); break; case "editurl": this.commands.editCell(selectedItem, 1); break; case "setnewbookmarkfolder": case "setpersonaltoolbarfolder": case "setnewsearchfolder": BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, args); // XXX - The containing node seems to be closed here and the // focus/selection is destroyed. this.selectElement(selectedItem); break; case "properties": this.showPropertiesForNode(selectedItem); break; case "find": this.findInBookmarks(); break; case "bm_cut": this.copySelection (selection); this.deleteSelection (selection); break; case "bm_copy": this.copySelection (selection); break; case "bm_paste": this.paste (selection); break; case "bm_delete": this.deleteSelection (selection); break; case "newfolder": var nfseln = this.getBestItem (); this.commands.createBookmarkItem("folder", nfseln); break; case "newbookmark": var folder = this.getSelectedFolder(); openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", null, null, folder, null); break; case "newseparator": nfseln = this.getBestItem (); var parentNode = this.findRDFNode(nfseln, false); args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(nfseln), NC_NS_CMD + "newseparator", args); break; case "import": case "export": const isImport = aCommandID == "import"; try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = this.getLocaleString(isImport ? "SelectImport": "EnterExport"); kFilePicker.init(window, kTitle, kFilePickerIID[isImport ? "modeOpen" : "modeSave"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); if (!isImport) kFilePicker.defaultString = "bookmarks.html"; if (kFilePicker.show() != kFilePickerIID.returnCancel) { var fileName = kFilePicker.fileURL.spec; if (!fileName) break; } else break; } catch (e) { break; } var seln = this.getBestItem(); args = [{ property: NC_NS + "URL", literal: fileName}]; BookmarksUtils.doBookmarksCommand(NODE_ID(seln), NC_NS_CMD + aCommandID, args); break; } },
|
var parentNode = this.findRDFNode(aSelectedItem, false); args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(aSelectedItem),
|
var parentNode = this.findRDFNode(nfseln, false); var args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(nfseln),
|
execCommand: function (aCommandID) { var args = []; var selection = this.getSelection (); if (selection.length >= 1) var selectedItem = selection[0]; switch (aCommandID) { case "open": this.openRDFNode(selectedItem); break; case "openfolder": this.commands.openFolder(selectedItem); break; case "openfolderinnewwindow": this.openFolderInNewWindow(selectedItem); break; case "rename": // XXX - this is SO going to break if we ever do column re-ordering. this.commands.editCell(selectedItem, 0); break; case "editurl": this.commands.editCell(selectedItem, 1); break; case "setnewbookmarkfolder": case "setpersonaltoolbarfolder": case "setnewsearchfolder": BookmarksUtils.doBookmarksCommand(NODE_ID(selectedItem), NC_NS_CMD + aCommandID, args); // XXX - The containing node seems to be closed here and the // focus/selection is destroyed. this.selectElement(selectedItem); break; case "properties": this.showPropertiesForNode(selectedItem); break; case "find": this.findInBookmarks(); break; case "cut": this.copySelection (selection); this.deleteSelection (selection); break; case "copy": this.copySelection (selection); break; case "paste": this.paste (selection); break; case "delete": this.deleteSelection (selection); break; case "newfolder": var nfseln = this.getBestItem (); this.commands.createBookmarkItem("folder", nfseln); break; case "newbookmark": var folder = this.getSelectedFolder(); openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", null, null, folder, null); break; case "newseparator": nfseln = this.getBestItem (); var parentNode = this.findRDFNode(aSelectedItem, false); args = [{ property: NC_NS + "parent", resource: NODE_ID(parentNode) }]; BookmarksUtils.doBookmarksCommand(NODE_ID(aSelectedItem), NC_NS_CMD + "newseparator", args); break; case "import": case "export": const isImport = aCommandID == "import"; try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = this.getLocaleString(isImport ? "SelectImport": "EnterExport"); kFilePicker.init(window, kTitle, kFilePickerIID[isImport ? "modeOpen" : "modeSave"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); if (!isImport) kFilePicker.defaultString = "bookmarks.html"; if (kFilePicker.show() != kFilePickerIID.returnCancel) { var fileName = kFilePicker.fileURL.spec; if (!fileName) break; } else break; } catch (e) { break; } var seln = this.getBestItem(); args = [{ property: NC_NS + "URL", literal: fileName}]; BookmarksUtils.doBookmarksCommand(NODE_ID(seln), NC_NS_CMD + aCommandID, args); break; } },
|
addToUrlbarHistory();
|
addToUrlbarHistory(gURLBar.value);
|
function executeUrlBarHistoryCommand( aTarget ) { var index = aTarget.getAttribute("index"); var label = aTarget.getAttribute("label"); if (index != "nothing_available" && label) { if (gURLBar) { gURLBar.value = label; addToUrlbarHistory(); BrowserLoadURL(); } else { var uri = getShortcutOrURI(label); loadURI(uri); } } }
|
var uri = getShortcutOrURI(label);
|
function executeUrlBarHistoryCommand( aTarget ) { var index = aTarget.getAttribute("index"); var label = aTarget.getAttribute("label"); if (index != "nothing_available" && label) { var uri = getShortcutOrURI(label); if (gURLBar) { gURLBar.value = uri; addToUrlbarHistory(); BrowserLoadURL(); } else loadURI(uri); } }
|
|
gURLBar.value = uri;
|
gURLBar.value = label;
|
function executeUrlBarHistoryCommand( aTarget ) { var index = aTarget.getAttribute("index"); var label = aTarget.getAttribute("label"); if (index != "nothing_available" && label) { var uri = getShortcutOrURI(label); if (gURLBar) { gURLBar.value = uri; addToUrlbarHistory(); BrowserLoadURL(); } else loadURI(uri); } }
|
else loadURI(uri);
|
function executeUrlBarHistoryCommand( aTarget ) { var index = aTarget.getAttribute("index"); var label = aTarget.getAttribute("label"); if (index != "nothing_available" && label) { var uri = getShortcutOrURI(label); if (gURLBar) { gURLBar.value = uri; addToUrlbarHistory(); BrowserLoadURL(); } else loadURI(uri); } }
|
|
var value = aTarget.getAttribute("value"); if (index != "nothing_available" && value)
|
var label = aTarget.getAttribute("label"); if (index != "nothing_available" && label)
|
function executeUrlBarHistoryCommand( aTarget ) { var index = aTarget.getAttribute("index"); var value = aTarget.getAttribute("value"); if (index != "nothing_available" && value) { loadURI(getShortcutOrURI(value)); } }
|
loadURI(getShortcutOrURI(value));
|
loadURI(getShortcutOrURI(label));
|
function executeUrlBarHistoryCommand( aTarget ) { var index = aTarget.getAttribute("index"); var value = aTarget.getAttribute("value"); if (index != "nothing_available" && value) { loadURI(getShortcutOrURI(value)); } }
|
if (this._onExitPP)
|
if (this._onExitPP) {
|
exitPrintPreview: function () { window.removeEventListener("keypress", this.onKeyPressPP, true); if ("getStripVisibility" in getBrowser()) getBrowser().setStripVisibilityTo(this._chromeState.hadTabStrip); var webBrowserPrint = this.getWebBrowserPrint(); webBrowserPrint.exitPrintPreview(); // remove the print preview toolbar var printPreviewTB = document.getElementById("print-preview-toolbar"); getBrowser().parentNode.removeChild(printPreviewTB); _content.focus(); // on Exit PP Call back if (this._onExitPP) this._onExitPP(); },
|
this._onExitPP = null; }
|
exitPrintPreview: function () { window.removeEventListener("keypress", this.onKeyPressPP, true); if ("getStripVisibility" in getBrowser()) getBrowser().setStripVisibilityTo(this._chromeState.hadTabStrip); var webBrowserPrint = this.getWebBrowserPrint(); webBrowserPrint.exitPrintPreview(); // remove the print preview toolbar var printPreviewTB = document.getElementById("print-preview-toolbar"); getBrowser().parentNode.removeChild(printPreviewTB); _content.focus(); // on Exit PP Call back if (this._onExitPP) this._onExitPP(); },
|
|
var isCollapsed = gBookmarkTree.collapsed; document.getElementById("expander").setAttribute("class", isCollapsed? "up":"down"); gBookmarkTree.collapsed = !isCollapsed;
|
var isCollapsed = !gBookmarksTree.collapsed; gBookmarksTree.collapsed = isCollapsed;
|
function expandTree(){ setFolderTreeHeight(); var isCollapsed = gBookmarkTree.collapsed; document.getElementById("expander").setAttribute("class", isCollapsed? "up":"down"); gBookmarkTree.collapsed = !isCollapsed; sizeToContent();}
|
document.documentElement.getButton("extra2").collapsed = isCollapsed; if (isCollapsed) document.documentElement.buttons = "accept,cancel"; else { document.documentElement.buttons = "accept,cancel,extra2"; gBookmarksTree.focus(); }
|
function expandTree(){ setFolderTreeHeight(); var isCollapsed = gBookmarkTree.collapsed; document.getElementById("expander").setAttribute("class", isCollapsed? "up":"down"); gBookmarkTree.collapsed = !isCollapsed; sizeToContent();}
|
|
var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); if (!aFile) return; aFile.initWithPath(fileName); if (!aFile.exists()) { aFile.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0644); }
|
exportBookmarks: function () { try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("EnterExport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeSave"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); kFilePicker.defaultString = "bookmarks.html"; var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.file.path; if (!fileName) return; } else return; } catch (e) { return; } var selection = RDF.GetResource("NC:BookmarksRoot"); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(selection, NC_NS_CMD+"export", args); },
|
|
"_blank", "chrome,titlebar,modal", args);
|
"_blank", "chrome,titlebar,modal,resizable", args);
|
function exportEntireCalendar(aCalendar) { var itemArray = []; var getListener = { onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) { saveEventsToFile(itemArray, aCalendar.name); }, onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) { for each (item in aItems) { itemArray.push(item); } } }; function getItemsFromCal(aCal) { aCal.getItems(Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS, 0, null, null, getListener); } if (!aCalendar) { var count = new Object(); var calendars = getCalendarManager().getCalendars(count); if (count.value == 1) { // There's only one calendar, so it's silly to ask what calendar // the user wants to import into. getItemsFromCal(calendars[0]); } else { // Ask what calendar to import into var args = new Object(); args.onOk = getItemsFromCal; args.promptText = getCalStringBundle().GetStringFromName("exportPrompt"); openDialog("chrome://calendar/content/chooseCalendarDialog.xul", "_blank", "chrome,titlebar,modal", args); } } else { getItemsFromCal(aCalendar); }}
|
var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE);
|
var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE);
|
exportOPML: function() { if (this.mRSSServer.rootFolder.hasSubFolders) { var opmlDoc = document.implementation.createDocument("","opml",null); var opmlRoot = opmlDoc.documentElement; opmlRoot.setAttribute("version","1.0"); this.generatePPSpace(opmlRoot," "); // Make the <head> element var head = opmlDoc.createElement("head"); this.generatePPSpace(head, " "); var title = opmlDoc.createElement("title"); title.appendChild(opmlDoc.createTextNode(this.mBundle.getString("subscribe-OPMLExportFileTitle"))); head.appendChild(title); this.generatePPSpace(head, " "); var dt = opmlDoc.createElement("dateCreated"); dt.appendChild(opmlDoc.createTextNode((new Date()).toGMTString())); head.appendChild(dt); this.generatePPSpace(head, " "); opmlRoot.appendChild(head); this.generatePPSpace(opmlRoot, " "); //add <outline>s to the <body> var body = opmlDoc.createElement("body"); this.generateOutline(this.mRSSServer.rootFolder, body, 4); this.generatePPSpace(body, " "); opmlRoot.appendChild(body); this.generatePPSpace(opmlRoot, ""); var serial=new XMLSerializer(); var rv = pickSaveAs(this.mBundle.getString("subscribe-OPMLExportTitle"),'$all', this.mBundle.getString("subscribe-OPMLExportFileName")); if(rv.reason == PICK_CANCEL) return; else if(rv) { //debug("opml:\n"+serial.serializeToString(opmlDoc)+"\n"); var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE); serial.serializeToStream(opmlDoc,file.outputStream,'utf-8'); file.close(); } } },
|
this.generatePPSpace(opmlRoot," ");
|
exportOPML: function() { if (this.mRSSServer.rootFolder.hasSubFolders) { var opmlDoc = document.implementation.createDocument("","opml",null); var opmlRoot = opmlDoc.documentElement; opmlRoot.setAttribute("version","1.0"); // Make the <head> element var head = opmlDoc.createElement("head"); var title = opmlDoc.createElement("title"); title.appendChild(opmlDoc.createTextNode(this.mBundle.getString("subscribe-OPMLExportFileTitle"))); head.appendChild(title); var dt = opmlDoc.createElement("dateCreated"); dt.appendChild(opmlDoc.createTextNode((new Date()).toGMTString())); head.appendChild(dt); opmlRoot.appendChild(head); //add <outline>s to the <body> var body = opmlDoc.createElement("body"); this.generateOutline(this.mRSSServer.rootFolder, body); opmlRoot.appendChild(body); var serial=new XMLSerializer(); var rv = pickSaveAs(this.mBundle.getString("subscribe-OPMLExportTitle"),'$all', this.mBundle.getString("subscribe-OPMLExportFileName")); if(rv.reason == PICK_CANCEL) return; else if(rv) { //debug("opml:\n"+serial.serializeToString(opmlDoc)+"\n"); var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE); serial.serializeToStream(opmlDoc,file.outputStream,opmlDoc.xmlEncoding); file.close(); } } },
|
|
this.generateOutline(this.mRSSServer.rootFolder, body);
|
this.generateOutline(this.mRSSServer.rootFolder, body, 4); this.generatePPSpace(body, " ");
|
exportOPML: function() { if (this.mRSSServer.rootFolder.hasSubFolders) { var opmlDoc = document.implementation.createDocument("","opml",null); var opmlRoot = opmlDoc.documentElement; opmlRoot.setAttribute("version","1.0"); // Make the <head> element var head = opmlDoc.createElement("head"); var title = opmlDoc.createElement("title"); title.appendChild(opmlDoc.createTextNode(this.mBundle.getString("subscribe-OPMLExportFileTitle"))); head.appendChild(title); var dt = opmlDoc.createElement("dateCreated"); dt.appendChild(opmlDoc.createTextNode((new Date()).toGMTString())); head.appendChild(dt); opmlRoot.appendChild(head); //add <outline>s to the <body> var body = opmlDoc.createElement("body"); this.generateOutline(this.mRSSServer.rootFolder, body); opmlRoot.appendChild(body); var serial=new XMLSerializer(); var rv = pickSaveAs(this.mBundle.getString("subscribe-OPMLExportTitle"),'$all', this.mBundle.getString("subscribe-OPMLExportFileName")); if(rv.reason == PICK_CANCEL) return; else if(rv) { //debug("opml:\n"+serial.serializeToString(opmlDoc)+"\n"); var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE); serial.serializeToStream(opmlDoc,file.outputStream,opmlDoc.xmlEncoding); file.close(); } } },
|
}
|
};
|
f = function (e) { e.replyTo.say (":/"); return false; }
|
dd (nodeList.length + "nodes");
|
function fcr_getkids (){ if (!("parentRecord" in this)) return; this.childData = new Array(); var doc = this.windowRecord.window.document; var loc = this.windowRecord.window.location; var nodeList = doc.getElementsByTagName("script"); dd (nodeList.length + "nodes"); for (var i = 0; i < nodeList.length; ++i) { var url = nodeList.item(i).getAttribute("src"); if (url) { if (url.search(/^\w+:/) == -1) { if (url[0] == "/") url = loc.protocol + "//" + loc.host + url; else url = this.windowRecord.baseURL + url; } else { this.baseURL = getPathFromURL(this.url); } this.appendChild(new FileRecord(url)); } }}
|
|
this.baseURL = getPathFromURL(this.url);
|
this.baseURL = getPathFromURL(url);
|
function fcr_getkids (){ if (!("parentRecord" in this)) return; this.childData = new Array(); var doc = this.windowRecord.window.document; var loc = this.windowRecord.window.location; var nodeList = doc.getElementsByTagName("script"); dd (nodeList.length + "nodes"); for (var i = 0; i < nodeList.length; ++i) { var url = nodeList.item(i).getAttribute("src"); if (url) { if (url.search(/^\w+:/) == -1) { if (url[0] == "/") url = loc.protocol + "//" + loc.host + url; else url = this.windowRecord.baseURL + url; } else { this.baseURL = getPathFromURL(this.url); } this.appendChild(new FileRecord(url)); } }}
|
function Feed(aResource)
|
function Feed(aResource, aRSSServer)
|
function Feed(aResource) { this.resource = aResource.QueryInterface(Components.interfaces.nsIRDFResource);}
|
this.server = aRSSServer;
|
function Feed(aResource) { this.resource = aResource.QueryInterface(Components.interfaces.nsIRDFResource);}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.