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 UND...
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); wi...
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/EdTab...
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) + "\...
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) + "\...
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" b...
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" b...
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 ...
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 ...
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 { dum...
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.s...
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 { dum...
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 edi...
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 { dum...
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 { dum...
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 { dum...
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 { dum...
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); sel...
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); sel...
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=...
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 autocomp...
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 wit...
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].removeAttribu...
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. docu...
}
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 ele...
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 ele...
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"); docum...
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 ele...
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) ...
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, "<ht...
encryptionStatus: function(aNestingLevel, aEncryptionStatus, aRecipientCert) { if (aNestingLevel > 1) { // we are not interested return; } gEncryptionStatus = aEncryptionStatus; gEncryptionCert = aRecipientCert; gSMIMEContainer.collapsed = false; gEncryptedUINode.collapsed = false; if...
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.interf...
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).origina...
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 a...
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 a...
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 a...
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 a...
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.GetResourc...
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:S...
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 k...
}
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 k...
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 =...
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...
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 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("htt...
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...
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, ...
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, ...
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 ent...
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 ent...
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[...
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"...
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 "f...
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...
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.result...
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.result...
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";...
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 + "'");
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 + ")"); ...
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 ("c...
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.currentFrameIn...
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.currentFrameIn...
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 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 = ...
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(...
}
},
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; ...
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; ...
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; ...
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.getSelectio...
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(selectedIt...
"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(selectedIt...
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(selectedI...
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(); } els...
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();...
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();...
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();...
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(); // rem...
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(); // rem...
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.getLocal...
"_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, ...
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...
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.createEleme...
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.createEleme...
}
};
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 < n...
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 < n...
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);}