rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
var canDetach = !IsNewsMessage(uri) && (!IsImapMessage(uri) || CheckOnline());
var canDetach = !IsNewsMessage(uri) && (!IsImapMessage(uri) || MailOfflineMgr.isOnline());
function CanDetachAttachments(){ var uri = GetLoadedMessage(); var canDetach = !IsNewsMessage(uri) && (!IsImapMessage(uri) || CheckOnline()); if (canDetach && ("content-type" in currentHeaderData)) { var contentType = currentHeaderData["content-type"].headerValue; canDetach = contentType.indexOf("application/x-pkcs7-mime") < 0 && contentType.indexOf("application/x-pkcs7-signature") < 0; } return canDetach;}
canDrop: function(index) { return false; },
canDrop: function(targetIndex, orientation) { var sourceIndex = this.getSourceIndexFromDrag(); return sourceIndex != -1 && sourceIndex != targetIndex && (orientation == Ci.nsITreeView.DROP_BEFORE || orientation == Ci.nsITreeView.DROP_AFTER); },
canDrop: function(index) { return false; },
return false; var srcDirectory = GetDirectoryFromURI(srcURI); var dragSession = dragService.getCurrentSession(); if (!dragSession) return false; if (!(srcDirectory.operations & srcDirectory.opWrite) && dragSession.dragAction != Components.interfaces. nsIDragService.DRAGDROP_ACTION_COPY)
canDrop: function(index, orientation) { if (orientation != Components.interfaces.nsITreeView.DROP_ON) return false; var targetResource = dirTree.builderView.getResourceAtIndex(index); var targetURI = targetResource.Value; var srcURI = GetSelectedDirectory(); if (targetURI == srcURI) return false; // determine if we dragging from a mailing list on a directory x to the parent (directory x). // if so, don't allow the drop var result = srcURI.split(targetURI); if (result != srcURI) return false; // check if we can write to the target directory // LDAP is readonly var targetDirectory = GetDirectoryFromURI(targetURI); return (targetDirectory.isMailList || (targetDirectory.operations & targetDirectory.opWrite)); },
return target.id && target.localName != "menupopup" && target.localName != "toolbar" && target.localName != "menuseparator" && target.localName != "toolbarseparator" &
var bt = document.getElementById("bookmarks-toolbar"); return bt.isBTBookmark(target.id) &&
canDrop: function (aEvent, aDragSession) { var target = aEvent.originalTarget; return target.id && target.localName != "menupopup" && target.localName != "toolbar" && target.localName != "menuseparator" && target.localName != "toolbarseparator" & target.id != "NC:SystemBookmarksStaticRoot" && target.id.substring(0,5) != "find:"; },
target.id.substring(0,5) != "find:";
target.id.substring(0,5) != "find:" || target.id == "bookmarks-menu" || target.getAttribute("class") == "chevron" || target.localName == "hbox";
canDrop: function (aEvent, aDragSession) { var target = aEvent.originalTarget; return target.id && target.localName != "menupopup" && target.localName != "toolbar" && target.localName != "menuseparator" && target.localName != "toolbarseparator" & target.id != "NC:SystemBookmarksStaticRoot" && target.id.substring(0,5) != "find:"; },
canHandleContent: function(contentType, command, desiredContentType)
canHandleContent: function(contentType, isContentPreferred, desiredContentType)
canHandleContent: function(contentType, command, desiredContentType) { var docShell = this.contentWindow.docShell; var contentListener; try { contentListener = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIURIContentListener); } catch (ex) { dump(ex); } if (!contentListener) return false; return contentListener.canHandleContent(contentType, command, desiredContentType); },
return contentListener.canHandleContent(contentType, command, desiredContentType);
return contentListener.canHandleContent(contentType, isContentPreferred, desiredContentType);
canHandleContent: function(contentType, command, desiredContentType) { var docShell = this.contentWindow.docShell; var contentListener; try { contentListener = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIURIContentListener); } catch (ex) { dump(ex); } if (!contentListener) return false; return contentListener.canHandleContent(contentType, command, desiredContentType); },
optgroupObject.prototype.canMoveDown = function canMoveDown() { return gDialog.lastChild() > treeSelection.currentIndex; }
canMoveDown: function canMoveDown() { return false; },
optgroupObject.prototype.canMoveDown = function canMoveDown(){ return gDialog.lastChild() > treeSelection.currentIndex;}
gURLBar.value = "http:
url = "http:
function canonizeUrl(aTriggeringEvent){ if (!gURLBar) return; if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey && 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey) // Tack http://www. and .org on. gURLBar.value = "http://www." + gURLBar.value + ".org/"; else if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey) // Tack www. and .com on. gURLBar.value = "http://www." + gURLBar.value + ".com/"; else if (aTriggeringEvent && 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey) // Tack www. and .org on. gURLBar.value = "http://www." + gURLBar.value + ".net/";}
gURLBar.value = "http:
url = "http: gURLBar.value = getShortcutOrURI(url);
function canonizeUrl(aTriggeringEvent){ if (!gURLBar) return; if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey && 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey) // Tack http://www. and .org on. gURLBar.value = "http://www." + gURLBar.value + ".org/"; else if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey) // Tack www. and .com on. gURLBar.value = "http://www." + gURLBar.value + ".com/"; else if (aTriggeringEvent && 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey) // Tack www. and .org on. gURLBar.value = "http://www." + gURLBar.value + ".net/";}
url = "http:
var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http: url.substring(firstSlash + 1, url.length); else url = "http:
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;
if (!/^(www|http)|\/\s*$/i.test(url) && (aTriggeringEvent instanceof KeyEvent)) {
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;
var accel = aTriggeringEvent.metaKey;
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;
var accel = aTriggeringEvent.ctrlKey;
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey;
var shift = aTriggeringEvent.shiftKey;
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
if (accelPressed && shiftPressed) suffix = ".org/";
var suffix = "";
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; }
switch (true) { case (accel && shift): suffix = ".org/"; break; case (shift): suffix = ".net/"; break; case (accel): try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != "/") suffix += "/"; } catch(e) { suffix = ".com/"; } break;
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
else if (shiftPressed) suffix = ".net/";
if (suffix) { url = url.replace(/^\s+/, "").replace(/\s+$/, "");
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
if (suffix != null) { url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, "");
function canonizeUrl(aTriggeringEvent, aPostDataRef){ if (!gURLBar || !gURLBar.value) return; var url = gURLBar.value; // Prevent suffix when already exists www , http , / if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { var suffix = null;#ifdef XP_MACOSX var accelPressed = 'metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey;#else var accelPressed = 'ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey;#endif var shiftPressed = 'shiftKey' in aTriggeringEvent && aTriggeringEvent.shiftKey; if (accelPressed && shiftPressed) suffix = ".org/"; else if (accelPressed) { try { suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); if (suffix.charAt(suffix.length - 1) != '/') suffix += "/"; } catch(e) { suffix = ".com/"; } } else if (shiftPressed) suffix = ".net/"; if (suffix != null) { // trim leading/trailing spaces (bug 233205) url = url.replace( /^\s+/, ""); url = url.replace( /\s+$/, ""); // Tack www. and suffix on. If user has appended directories, insert // suffix before them (bug 279035). Be careful not to get two slashes. var firstSlash = url.indexOf("/"); if (firstSlash >= 0) url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1, url.length); else url = "http://www." + url + suffix; } } gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
return true; }
return true; },
canUnload: function(compMgr) { return true; }
dump("*** Unloading Proxy Auto Config...\n");
pacModule.canUnload = function (compMgr) { dump("*** Unloading Proxy Auto Config...\n"); return true; }
if ("parentNode" in aEvent.target && aEvent.target.parentNode.hasAttribute("message")) { alertMessage(aEvent.target.parentNode.getAttribute("message"));
if (aEvent.target.hasAttribute("message")) { alertMessage(aEvent.target.getAttribute("message")); return true;
function captureContentClick(aEvent){ if ("parentNode" in aEvent.target && aEvent.target.parentNode.hasAttribute("message")) { alertMessage(aEvent.target.parentNode.getAttribute("message")); }}
return contentAreaClick(aEvent);
function captureContentClick(aEvent){ if ("parentNode" in aEvent.target && aEvent.target.parentNode.hasAttribute("message")) { alertMessage(aEvent.target.parentNode.getAttribute("message")); }}
failures.innerHTML += "Unknown Test<br/>&nbsp;&nbsp;Error: " + data + "<br/>";
failures.innerHTML += "Unknown Failure:&nbsp; " + data + "<br/>";
function catchFailure(data) { // which test have we just run? failures.innerHTML += "Unknown Test<br/>&nbsp;&nbsp;Error: " + data + "<br/>"; failcount++; failreport.innerHTML = failcount;}
return this;
function CBSConnection (binary){ /* Since 2003-01-17 18:14, Mozilla has had this contract ID for the STS. * Prior to that it didn't have one, so we also include the CID for the * STS back then - DO NOT UPDATE THE ID if it changes in Mozilla. */ const sockClassByName = Components.classes["@mozilla.org/network/socket-transport-service;1"]; const sockClassByID = Components.classesByID["{c07e81e0-ef12-11d2-92b6-00105a1b0d64}"]; var sockServiceClass = (sockClassByName || sockClassByID); if (!sockServiceClass) throw ("Couldn't get socket service class."); var sockService = sockServiceClass.getService(); if (!sockService) throw ("Couldn't get socket service."); this._sockService = sockService.QueryInterface (Components.interfaces.nsISocketTransportService); /* Note: as part of the mess from bug 315288 and bug 316178, ChatZilla now * uses the *binary* stream interfaces for all network * communications. * * However, these interfaces do not exist prior to 1999-11-05. To * make matters worse, an incompatible change to the "readBytes" * method of this interface was made on 2003-03-13; luckly, this * change also added a "readByteArray" method, which we will check * for below, to determin if we can use the binary streams. */ // We want to check for working binary streams only the first time. if (CBSConnection.prototype.workingBinaryStreams == -1) { CBSConnection.prototype.workingBinaryStreams = false; if (typeof nsIBinaryInputStream != "undefined") { var isCls = Components.classes["@mozilla.org/binaryinputstream;1"]; var inputStream = isCls.createInstance(nsIBinaryInputStream); if ("readByteArray" in inputStream) CBSConnection.prototype.workingBinaryStreams = true; } } this.wrappedJSObject = this; if (typeof binary != "undefined") this.binaryMode = binary; else this.binaryMode = this.workingBinaryStreams; if (!ASSERT(!this.binaryMode || this.workingBinaryStreams, "Unable to use binary streams in this build.")) { return null; }}
str = str.replace(/%descrptionline%/g, "");
str = str.replace(/%descriptionline%/g, "");
function CCKWriteInstallRDF(destdir){ var idline = "<em:id>%id%</em:id>"; var nameline = "<em:name>%name%</em:name>"; var versionline = "<em:version>%version%</em:version>"; var descriptionline = "<em:description>%description%</em:description>"; var creatorline = "<em:creator>%creator%</em:creator>"; var homepageURLline = "<em:homepageURL>%homepageURL%</em:homepageURL>"; var updateURLline = "<em:updateURL>%updateURL%</em:updateURL>"; var iconURLline = "<em:iconURL>chrome://cck/content/%iconURL%</em:iconURL>"; var file = destdir.clone(); file.append("install.rdf"); try { file.remove(false); } catch (ex) { } var fos = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); var cos = Components.classes["@mozilla.org/intl/converter-output-stream;1"] .createInstance(Components.interfaces.nsIConverterOutputStream); fos.init(file, -1, -1, false); cos.init(fos, null, 0, null); var ioService=Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var scriptableStream=Components .classes["@mozilla.org/scriptableinputstream;1"] .getService(Components.interfaces.nsIScriptableInputStream); var channel=ioService.newChannel("chrome://cckwizard/content/srcfiles/install.rdf.in",null,null); var input=channel.open(); scriptableStream.init(input); var str=scriptableStream.read(input.available()); scriptableStream.close(); input.close(); var id = document.getElementById("id").value; if (id && (id.length > 0)) { str = str.replace(/%idline%/g, idline); str = str.replace(/%id%/g, document.getElementById("id").value); } var name = document.getElementById("name").value; if (name && (name.length > 0)) { str = str.replace(/%nameline%/g, nameline); str = str.replace(/%name%/g, htmlEscape(document.getElementById("name").value)); } else { str = str.replace(/%nameline%/g, ""); } var version = document.getElementById("version").value; if (version && (version.length > 0)) { str = str.replace(/%versionline%/g, versionline); str = str.replace(/%version%/g, document.getElementById("version").value); } else { str = str.replace(/%versionline%/g, ""); } var description = document.getElementById("description").value; if (description && (description.length > 0)) { str = str.replace(/%descriptionline%/g, descriptionline); str = str.replace(/%description%/g, htmlEscape(document.getElementById("description").value)); } else { str = str.replace(/%descrptionline%/g, ""); } var creator = document.getElementById("creator").value; if (creator && (creator.length > 0)) { str = str.replace(/%creatorline%/g, creatorline); str = str.replace(/%creator%/g, htmlEscape(document.getElementById("creator").value)); } else { str = str.replace(/%creatorline%/g, ""); } var homepageURL = document.getElementById("homepageURL").value; if (homepageURL && (homepageURL.length > 0)) { str = str.replace(/%homepageURLline%/g, homepageURLline); str = str.replace(/%homepageURL%/g, document.getElementById("homepageURL").value); } else { str = str.replace(/%homepageURLline%/g, ""); } var updateURL = document.getElementById("updateURL").value; if (updateURL && (updateURL.length > 0)) { str = str.replace(/%updateURLline%/g, updateURLline); str = str.replace(/%updateURL%/g, document.getElementById("updateURL").value); } else { str = str.replace(/%updateURLline%/g, ""); } var iconURL = document.getElementById("iconURL").value; if (iconURL && (iconURL.length > 0)) { var sourcefile = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); sourcefile.initWithPath(iconURL); str = str.replace(/%iconURLline%/g, iconURLline); str = str.replace(/%iconURL%/g, sourcefile.leafName); } else { str = str.replace(/%iconURLline%/g, ""); } cos.writeString(str); cos.close(); fos.close();}
s.left = parseInt(($.css(p,"width") - $.css(this,"width"))/2, 10) + "px"; s.top = parseInt(($.css(p,"height") - $.css(this,"height"))/2, 10) + "px";
s.left = (($.css(p,"width") - $.css(this,"width"))/2) + "px"; s.top = (($.css(p,"height") - $.css(this,"height"))/2) + "px";
$.fn.center = function(f) { return this.each(function(){ if ( !f && this.nodeName == 'IMG' && !this.offsetWidth && !this.offsetHeight ) { var self = this; setTimeout(function(){ $(self).center(true); }, 13); } else { var s = this.style; var p = this.parentNode; if ( $.css(p,"position") == 'static' ) { p.style.position = 'relative'; } s.position = 'absolute'; s.left = parseInt(($.css(p,"width") - $.css(this,"width"))/2, 10) + "px"; s.top = parseInt(($.css(p,"height") - $.css(this,"height"))/2, 10) + "px"; } });};
return this.users[this.parent.me.canonicalName].isHalfOp;
return this.active && this.users[this.parent.me.canonicalName].isHalfOp;
function chan_amhalfop(){ return this.users[this.parent.me.canonicalName].isHalfOp;}
return this.users[this.parent.me.canonicalName].isOp;
return this.active && this.users[this.parent.me.canonicalName].isOp;
function chan_amop(){ return this.users[this.parent.me.canonicalName].isOp;}
return this.parent.users[this.parent.parent.me.canonicalName].isVoice;
return this.active && this.users[this.parent.me.canonicalName].isVoice;
function chan_amvoice(){ return this.parent.users[this.parent.parent.me.canonicalName].isVoice;}
if (typeof msg == "undefined") msg = ""; if (typeof type == "undefined") type = "PRIVMSG";
msg = msg || ""; type = type || "PRIVMSG";
function chan_ctcpto (code, msg, type){ if (typeof msg == "undefined") msg = ""; if (typeof type == "undefined") type = "PRIVMSG"; this.parent.messageTo(type, this.encodedName, fromUnicode(msg, this), code);}
this.parent.messageTo (type, this.encodedName, msg, code);
this.parent.messageTo(type, this.encodedName, fromUnicode(msg, this), code);
function chan_ctcpto (code, msg, type){ if (typeof msg == "undefined") msg = ""; if (typeof type == "undefined") type = "PRIVMSG"; this.parent.messageTo (type, this.encodedName, msg, code);}
return this.parent.parent.getURL() + this.name + "/";
var target; if (this.name[0] == "#") target = this.name.substr(1); else target = escape(this.name); return this.parent.parent.getURL() + target;
function chan_geturl (){ return this.parent.parent.getURL() + this.name + "/";}
target = escape(this.normalizedName.substr(1));
target = ecmaEscape(this.normalizedName.substr(1));
function chan_geturl (){ var target; if (this.normalizedName[0] == "#") target = escape(this.normalizedName.substr(1)); else target = escape(this.normalizedName); return this.parent.parent.getURL(target);}
target = escape(this.normalizedName);
target = ecmaEscape(this.normalizedName);
function chan_geturl (){ var target; if (this.normalizedName[0] == "#") target = escape(this.normalizedName.substr(1)); else target = escape(this.normalizedName); return this.parent.parent.getURL(target);}
if (this.key) str += "k"; if (this.limit != -1) str += "l " + this.limit;
function chan_modestr (f){ var str = ""; if (this.invite) str += "i"; if (this.moderated) str += "m"; if (!this.publicMessages) str += "n"; if (!this.publicTopic) str += "t"; if (this.pvt) str += "p"; if (str) str = "+" + str; return str; }
this.parent.noticeTo (this.encodedName, msg);
this.parent.noticeTo(this.encodedName, fromUnicode(msg, this));
function chan_notice (msg){ this.parent.noticeTo (this.encodedName, msg);}
this.parent.actTo (this.encodedName, msg);
this.parent.actTo(this.encodedName, fromUnicode(msg, this));
function chan_say (msg){ this.parent.actTo (this.encodedName, msg);}
modifier + "p\n");
modifier + "s\n");
function chan_secret (f){ if (!this.parent.users[this.parent.parent.me.nick].isOp) return false; var modifier = (f) ? "+" : "-"; this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " + modifier + "p\n"); return true; }
this.parent.sendData ("TOPIC " + this.encodedName + " :" + str + "\n");
this.parent.sendData ("TOPIC " + this.encodedName + " :" + fromUnicode(str, this) + "\n");
function chan_topic (str){ this.parent.sendData ("TOPIC " + this.encodedName + " :" + str + "\n");}
this.opCount = 0; this.voiceCount = 0;
function chan_userslen (){ var i = 0; for (var p in this.users) i++; return i; }
}
function chan_userslen (){ var i = 0; for (var p in this.users) i++; return i; }
window.title = aCaption;
function ChangeCaption( aCaption ){ var caption = document.getElementById( "header" ); caption.setAttribute( "value", aCaption );}
node.setAttribute("id", "main-css");
node.setAttribute("id", id);
function changeCSS(url, id){ if (!id) id = "main-css"; node = document.getElementById(id); if (!node) { node = document.createElement("link"); node.setAttribute("id", "main-css"); node.setAttribute("rel", "stylesheet"); node.setAttribute("type", "text/css"); var head = document.getElementsByTagName("head")[0]; head.appendChild(node); } else { if (node.getAttribute("href") == url) return; } node.setAttribute("href", url); window.scrollTo(0, window.document.height);}
document.getElementById("allowWindowOpen").disabled = state;
function changeDisabledState(state){ //Set the states of the groupbox children state based on the "javascript enabled" checkbox value document.getElementById("allowScripts").disabled = state; document.getElementById("allowWindowMoveResize").disabled = state; document.getElementById("allowWindowOpen").disabled = state; document.getElementById("allowImageSrcChange").disabled = state; document.getElementById("allowDocumentCookieSet").disabled = state; document.getElementById("allowDocumentCookieGet").disabled = state; document.getElementById("allowWindowStatusChange").disabled = state; document.getElementById("allowWindowFlip").disabled = state; document.getElementById("allowHideStatusBar").disabled = state;}
document.getElementById("allowHideStatusBar").disabled = state;
function changeDisabledState(state){ //Set the states of the groupbox children state based on the "javascript enabled" checkbox value document.getElementById("allowScripts").disabled = state; document.getElementById("allowTargetNew").disabled = state; document.getElementById("allowWindowMoveResize").disabled = state; document.getElementById("allowWindowOpen").disabled = state; document.getElementById("allowImageSrcChange").disabled = state; document.getElementById("allowDocumentCookieSet").disabled = state; document.getElementById("allowDocumentCookieGet").disabled = state; document.getElementById("allowWindowStatusChange").disabled = state; document.getElementById("allowWindowFlip").disabled = state;}
document.getElementById("allowTargetNew").disabled = state;
function changeDisabledState(state){ //Set the states of the groupbox children state based on the "javascript enabled" checkbox value document.getElementById("allowScripts").disabled = state; document.getElementById("allowWindowMoveResize").disabled = state; document.getElementById("allowWindowOpen").disabled = state; document.getElementById("allowImageSrcChange").disabled = state; document.getElementById("allowDocumentCookieSet").disabled = state; document.getElementById("allowDocumentCookieGet").disabled = state; document.getElementById("allowWindowStatusChange").disabled = state; document.getElementById("allowWindowFlip").disabled = state;}
document.getElementById("allowContextmenuDisable").disabled = state;
function changeDisabledState(state){ //Set the states of the groupbox children state based on the "javascript enabled" checkbox value document.getElementById("allowScripts").disabled = state; document.getElementById("allowWindowMoveResize").disabled = state; document.getElementById("allowImageSrcChange").disabled = state; document.getElementById("allowWindowStatusChange").disabled = state; document.getElementById("allowWindowFlip").disabled = state; document.getElementById("allowHideStatusBar").disabled = state;}
document.getElementById('allowScriptsDescription').disabled = state; document.getElementById('allowWindowMoveResize').disabled = state; document.getElementById('allowWindowOpen').disabled = state; document.getElementById('allowImageSrcChange').disabled = state; document.getElementById('allowDocumentCookieSet').disabled = state; document.getElementById('allowDocumentCookieGet').disabled = state; document.getElementById('allowWindowStatusChange').disabled = state; document.getElementById('allowWindowFlip').disabled = state;
document.getElementById("allowScriptsDescription").disabled = state; document.getElementById("allowWindowMoveResize").disabled = state; document.getElementById("allowWindowOpen").disabled = state; document.getElementById("allowImageSrcChange").disabled = state; document.getElementById("allowDocumentCookieSet").disabled = state; document.getElementById("allowDocumentCookieGet").disabled = state; document.getElementById("allowWindowStatusChange").disabled = state; document.getElementById("allowWindowFlip").disabled = state;
function changeDisabledState(state){ // set the groupbox children's state based on the "javascript enabled" checkbox value document.getElementById('allowScriptsDescription').disabled = state; document.getElementById('allowWindowMoveResize').disabled = state; document.getElementById('allowWindowOpen').disabled = state; document.getElementById('allowImageSrcChange').disabled = state; document.getElementById('allowDocumentCookieSet').disabled = state; document.getElementById('allowDocumentCookieGet').disabled = state; document.getElementById('allowWindowStatusChange').disabled = state; document.getElementById('allowWindowFlip').disabled = state;}
ChangeFolderByURI(uri, isThreaded == "true", sortResource, sortDirection);
ChangeFolderByURI(uri, isThreaded == "true", sortResource, sortDirection, viewType);
function ChangeFolderByDOMNode(folderNode){ if (folderNode.getAttribute('NoSelect') == "true" ) { ClearThreadPane(); return; } var uri = folderNode.getAttribute('id'); dump(uri + "\n"); var isThreaded = folderNode.getAttribute('threaded'); if ((isThreaded == "") && isNewsURI(uri)) { isThreaded = "true"; } var sortResource = folderNode.getAttribute('sortResource'); if(!sortResource) sortResource = ""; var sortDirection = folderNode.getAttribute('sortDirection'); if (uri) ChangeFolderByURI(uri, isThreaded == "true", sortResource, sortDirection);}
SetBusyCursor(window, false);
function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection, viewType){ dump('In ChangeFolderByURI uri = ' + uri + "\n"); if (uri == gCurrentLoadingFolderURI) return; var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); try { setTitleFromFolder(msgfolder, null); } catch (ex) { dump("error setting title: " + ex + "\n"); } //if it's a server, clear the threadpane and don't bother trying to load. if(msgfolder.isServer) { ClearThreadPane(); // Load AccountCentral page here. ShowAccountCentral(); return; } // If the user clicks on msgfolder, time to display thread pane and message pane. // Hide AccountCentral page if (gAccountCentralLoaded) { HideAccountCentral(); } if (showPerformance) { gBeforeFolderLoadTime = new Date(); } gCurrentLoadingFolderURI = uri; gNextMessageAfterDelete = null; // forget what message to select, if any if(msgfolder.manyHeadersToDownload()) { try { SetBusyCursor(window, true); gCurrentFolderToReroot = uri; gCurrentLoadingFolderIsThreaded = isThreaded; gCurrentLoadingFolderSortID = sortID; gCurrentLoadingFolderSortDirection = sortDirection; gCurrentLoadingFolderViewType = viewType; msgfolder.startFolderLoading(); msgfolder.updateFolder(msgWindow); } catch(ex) { dump("Error loading with many headers to download: " + ex + "\n"); } } else { SetBusyCursor(window, true); gCurrentFolderToReroot = ""; gCurrentLoadingFolderIsThreaded = false; gCurrentLoadingFolderSortID = ""; gCurrentLoadingFolderViewType = ""; RerootFolder(uri, msgfolder, isThreaded, sortID, sortDirection, viewType); //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //notification before folder has actually changed. msgfolder.updateFolder(msgWindow); }}
if(msgfolder.manyHeadersToDownload)
var showMessagesAfterLoading; try { var server = msgfolder.server; if (server.redirectorType) { var prefString = server.type + "." + server.redirectorType + ".showMessagesAfterLoading"; showMessagesAfterLoading = gPrefs.getBoolPref(prefString); } else showMessagesAfterLoading = false; } catch (ex) { showMessagesAfterLoading = false; } if (msgfolder.manyHeadersToDownload || showMessagesAfterLoading)
function ChangeFolderByURI(uri, viewType, viewFlags, sortType, sortOrder){ //dump("In ChangeFolderByURI uri = " + uri + " sortType = " + sortType + "\n"); if (uri == gCurrentLoadingFolderURI) return; var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); try { setTitleFromFolder(msgfolder, null); } catch (ex) { dump("error setting title: " + ex + "\n"); } //if it's a server, clear the threadpane and don't bother trying to load. if(msgfolder.isServer) { msgWindow.openFolder = null; ClearThreadPane(); // Load AccountCentral page here. ShowAccountCentral(); return; } else { if (msgfolder.server.displayStartupPage) { gDisplayStartupPage = true; msgfolder.server.displayStartupPage = false; } } // If the user clicks on msgfolder, time to display thread pane and message pane. // Hide AccountCentral page if (gAccountCentralLoaded) { HideAccountCentral(); } if (gFakeAccountPageLoaded) { HideFakeAccountPage(); } gCurrentLoadingFolderURI = uri; gNextMessageAfterDelete = null; // forget what message to select, if any gCurrentFolderToReroot = uri; gCurrentLoadingFolderViewFlags = viewFlags; gCurrentLoadingFolderViewType = viewType; gCurrentLoadingFolderSortType = sortType; gCurrentLoadingFolderSortOrder = sortOrder; if(msgfolder.manyHeadersToDownload) { gRerootOnFolderLoad = true; try { SetBusyCursor(window, true); msgfolder.startFolderLoading(); msgfolder.updateFolder(msgWindow); } catch(ex) { SetBusyCursor(window, false); dump("Error loading with many headers to download: " + ex + "\n"); } } else { SetBusyCursor(window, true); RerootFolder(uri, msgfolder, viewType, viewFlags, sortType, sortOrder); gRerootOnFolderLoad = false; msgfolder.startFolderLoading(); //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //notification before folder has actually changed. msgfolder.updateFolder(msgWindow); }}
if(msgfolder.isServer) { ClearThreadPane(); return; }
function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection){ dump('In ChangeFolderByURI\n'); var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); try { setTitleFromFolder(msgfolder, null); } catch (ex) { dump("error setting title: " + ex + "\n"); } gBeforeFolderLoadTime = new Date(); gCurrentLoadingFolderURI = uri; if(msgfolder.manyHeadersToDownload()) { try { gCurrentFolderToReroot = uri; gCurrentLoadingFolderIsThreaded = isThreaded; gCurrentLoadingFolderSortID = sortID; gCurrentLoadingFolderSortDirection = sortDirection; msgfolder.startFolderLoading(); msgfolder.updateFolder(msgWindow); } catch(ex) { dump("Error loading with many headers to download: " + ex + "\n"); } } else { gCurrentFolderToReroot = ""; gCurrentLoadingFolderIsThreaded = false; gCurrentLoadingFolderSortID = ""; RerootFolder(uri, msgfolder, isThreaded, sortID, sortDirection); //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //notification before folder has actually changed. msgfolder.updateFolder(msgWindow); }}
viewDebug("In ChangeFolderByURI uri = " + uri + " sortType = " + sortType + "\n");
function ChangeFolderByURI(uri, viewType, viewFlags, sortType, sortOrder){ //dump("In ChangeFolderByURI uri = " + uri + " sortType = " + sortType + "\n"); if (uri == gCurrentLoadingFolderURI) return; // hook for extra toolbar items var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.notifyObservers(window, "mail:setupToolbarItems", uri); var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); try { setTitleFromFolder(msgfolder, null); } catch (ex) { dump("error setting title: " + ex + "\n"); } //if it's a server, clear the threadpane and don't bother trying to load. if(msgfolder.isServer) { msgWindow.openFolder = null; ClearThreadPane(); // Load AccountCentral page here. ShowAccountCentral(); return; } else { if (msgfolder.server.displayStartupPage) { gDisplayStartupPage = true; msgfolder.server.displayStartupPage = false; } } // If the user clicks on msgfolder, time to display thread pane and message pane. // Hide AccountCentral page if (gAccountCentralLoaded) { HideAccountCentral(); } if (gFakeAccountPageLoaded) { HideFakeAccountPage(); } gCurrentLoadingFolderURI = uri; gNextMessageAfterDelete = null; // forget what message to select, if any gCurrentFolderToReroot = uri; gCurrentLoadingFolderViewFlags = viewFlags; gCurrentLoadingFolderViewType = viewType; gCurrentLoadingFolderSortType = sortType; gCurrentLoadingFolderSortOrder = sortOrder; var showMessagesAfterLoading; try { var server = msgfolder.server; if (gPrefBranch.getBoolPref("mail.password_protect_local_cache")) { showMessagesAfterLoading = server.passwordPromptRequired; // servers w/o passwords (like local mail) will always be non-authenticated. // So we need to use the account manager for that case. } else if (server.redirectorType) { var prefString = server.type + "." + server.redirectorType + ".showMessagesAfterLoading"; showMessagesAfterLoading = gPrefBranch.getBoolPref(prefString); } else showMessagesAfterLoading = false; } catch (ex) { showMessagesAfterLoading = false; } if (viewType != nsMsgViewType.eShowVirtualFolderResults && (msgfolder.manyHeadersToDownload || showMessagesAfterLoading)) { gRerootOnFolderLoad = true; try { ClearThreadPane(); SetBusyCursor(window, true); msgfolder.startFolderLoading(); msgfolder.updateFolder(msgWindow); } catch(ex) { SetBusyCursor(window, false); dump("Error loading with many headers to download: " + ex + "\n"); } } else { if (viewType != nsMsgViewType.eShowVirtualFolderResults) SetBusyCursor(window, true); RerootFolder(uri, msgfolder, viewType, viewFlags, sortType, sortOrder); gRerootOnFolderLoad = false; msgfolder.startFolderLoading(); //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //notification before folder has actually changed. if (viewType != nsMsgViewType.eShowVirtualFolderResults) msgfolder.updateFolder(msgWindow); }}
SetBusyCursor(window, true);
function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection){ dump('In ChangeFolderByURI\n'); var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); try { setTitleFromFolder(msgfolder, null); } catch (ex) { dump("error setting title: " + ex + "\n"); } //if it's a server, clear the threadpane and don't bother trying to load. if(msgfolder.isServer) { ClearThreadPane(); return; } gBeforeFolderLoadTime = new Date(); gCurrentLoadingFolderURI = uri; if(msgfolder.manyHeadersToDownload()) { try { gCurrentFolderToReroot = uri; gCurrentLoadingFolderIsThreaded = isThreaded; gCurrentLoadingFolderSortID = sortID; gCurrentLoadingFolderSortDirection = sortDirection; msgfolder.startFolderLoading(); msgfolder.updateFolder(msgWindow); } catch(ex) { dump("Error loading with many headers to download: " + ex + "\n"); } } else { gCurrentFolderToReroot = ""; gCurrentLoadingFolderIsThreaded = false; gCurrentLoadingFolderSortID = ""; RerootFolder(uri, msgfolder, isThreaded, sortID, sortDirection); //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //notification before folder has actually changed. msgfolder.updateFolder(msgWindow); }}
function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection)
function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection, viewType)
function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection){ dump('In ChangeFolderByURI uri = ' + uri + "\n"); if (uri == gCurrentLoadingFolderURI) return; var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); try { setTitleFromFolder(msgfolder, null); } catch (ex) { dump("error setting title: " + ex + "\n"); } //if it's a server, clear the threadpane and don't bother trying to load. if(msgfolder.isServer) { ClearThreadPane(); return; } gBeforeFolderLoadTime = new Date(); gCurrentLoadingFolderURI = uri; gNextMessageAfterDelete = null; // forget what message to select, if any if(msgfolder.manyHeadersToDownload()) { try { SetBusyCursor(window, true); gCurrentFolderToReroot = uri; gCurrentLoadingFolderIsThreaded = isThreaded; gCurrentLoadingFolderSortID = sortID; gCurrentLoadingFolderSortDirection = sortDirection; msgfolder.startFolderLoading(); msgfolder.updateFolder(msgWindow); } catch(ex) { dump("Error loading with many headers to download: " + ex + "\n"); } } else { SetBusyCursor(window, true); gCurrentFolderToReroot = ""; gCurrentLoadingFolderIsThreaded = false; gCurrentLoadingFolderSortID = ""; RerootFolder(uri, msgfolder, isThreaded, sortID, sortDirection); //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //notification before folder has actually changed. msgfolder.updateFolder(msgWindow); }}
RerootFolder(uri, msgfolder, isThreaded, sortID, sortDirection);
gCurrentLoadingFolderViewType = ""; RerootFolder(uri, msgfolder, isThreaded, sortID, sortDirection, viewType);
function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection){ dump('In ChangeFolderByURI uri = ' + uri + "\n"); if (uri == gCurrentLoadingFolderURI) return; var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); try { setTitleFromFolder(msgfolder, null); } catch (ex) { dump("error setting title: " + ex + "\n"); } //if it's a server, clear the threadpane and don't bother trying to load. if(msgfolder.isServer) { ClearThreadPane(); return; } gBeforeFolderLoadTime = new Date(); gCurrentLoadingFolderURI = uri; gNextMessageAfterDelete = null; // forget what message to select, if any if(msgfolder.manyHeadersToDownload()) { try { SetBusyCursor(window, true); gCurrentFolderToReroot = uri; gCurrentLoadingFolderIsThreaded = isThreaded; gCurrentLoadingFolderSortID = sortID; gCurrentLoadingFolderSortDirection = sortDirection; msgfolder.startFolderLoading(); msgfolder.updateFolder(msgWindow); } catch(ex) { dump("Error loading with many headers to download: " + ex + "\n"); } } else { SetBusyCursor(window, true); gCurrentFolderToReroot = ""; gCurrentLoadingFolderIsThreaded = false; gCurrentLoadingFolderSortID = ""; RerootFolder(uri, msgfolder, isThreaded, sortID, sortDirection); //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //notification before folder has actually changed. msgfolder.updateFolder(msgWindow); }}
UnselectNamedAnchor(); UnselectHeadings();
if (gClearListSelections) { UnselectNamedAnchor(); UnselectHeadings(); }
function ChangeLocation(){ // Unselect the treelists UnselectNamedAnchor(); UnselectHeadings(); // Set OK button enable state ChangeText();}
val /= gDoingMetric ? 100 : 10; var style = attr + ":" + val + unitString() + ";";
var style = attr + ":" + (val/10) + unitString() + ";";
function changeMargin( node ){ // Correct invalid input. checkDouble(node); // Reset the margin height/width for this node. var val = node.value; var nodeToStyle; var attr="width"; if ( node == gDialog.topInput ) { nodeToStyle = gDialog.marginTop; val = checkMargin( val, gPageHeight, gDialog.bottomInput ); attr = "height"; } else if ( node == gDialog.bottomInput ) { nodeToStyle = gDialog.marginBottom; val = checkMargin( val, gPageHeight, gDialog.topInput ); attr = "height"; } else if ( node == gDialog.leftInput ) { nodeToStyle = gDialog.marginLeft; val = checkMargin( val, gPageWidth, gDialog.rightInput ); } else { nodeToStyle = gDialog.marginRight; val = checkMargin( val, gPageWidth, gDialog.leftInput ); } val /= gDoingMetric ? 100 : 10; var style = attr + ":" + val + unitString() + ";"; nodeToStyle.setAttribute( "style", style );}
gDBView.reloadMessage();
gDBView.loadMessageByUrl("about:blank"); gDBView.selectionChanged();
function ChangeMessagePaneVisibility(now_hidden){ // we also have to hide the File/Attachments menuitem var node = document.getElementById("fileAttachmentMenu"); if (node) node.hidden = now_hidden; if (gDBView) { // clear the subject, collapsing won't automatically do this setTitleFromFolder(GetThreadPaneFolder(), null); // the collapsed state is the state after we released the mouse // so we take it as it is gDBView.suppressMsgDisplay = now_hidden; // set the subject, uncollapsing won't automatically do this gDBView.reloadMessage(); } var event = document.createEvent('Events'); if (now_hidden) { event.initEvent('messagepane-hide', false, true); } else { event.initEvent('messagepane-unhide', false, true); } document.getElementById("messengerWindow").dispatchEvent(event);}
var mimeSource = gRDF.GetResource(aMIMEString); var valueProperty = gRDF.GetResource(NC_RDF(aPropertyString));
var mimeSource = gRDF.GetUnicodeResource(aMIMEString); var valueProperty = gRDF.GetUnicodeResource(NC_RDF(aPropertyString));
function changeMIMEStuff(aMIMEString, aPropertyString, aValueString){ var mimeSource = gRDF.GetResource(aMIMEString); var valueProperty = gRDF.GetResource(NC_RDF(aPropertyString)); var mimeLiteral = gRDF.GetLiteral(aValueString); var currentValue = gDS.GetTarget(mimeSource, valueProperty, true); if (currentValue) { gDS.Change(mimeSource, valueProperty, currentValue, mimeLiteral); } else { gDS.Assert(mimeSource, valueProperty, mimeLiteral, true); } }
nameInput.value = PrepareStringForURL(nameInput.value.replace(/\s+/g, "_"));
nameInput.value = ConvertToCDATAString(nameInput.value);
function ChangeName(){ if (nameInput.value.length > 0) { // Replace spaces with "_" and strip other non-URL characters // Note: we could use ConvertAndEscape, but then we'd // have to UnEscapeAndConvert beforehand - too messy! nameInput.value = PrepareStringForURL(nameInput.value.replace(/\s+/g, "_")); }}
wallet = Components.classes['component:
wallet = Components.classes['@mozilla.org/wallet;1'];
function changePasswords(){ wallet = Components.classes['component://netscape/wallet']; wallet = wallet.getService(); wallet = wallet.QueryInterface(Components.interfaces.nsIWalletService); wallet.WALLET_ChangePassword();}
timeout = "0";
timeout = "1";
function changePasswordSettings(){ var askTimes = 0; var timeout = internal_token.getAskPasswordTimeout(); var timeoutField = document.getElementById("passwordTimeout"); var radiogroup = document.getElementById("passwordAskTimes"); switch ( radiogroup.value ) { case "0": timeoutField.setAttribute("disabled", true); askTimes = nsIPK11Token.ASK_FIRST_TIME; break; case "1": timeoutField.setAttribute("disabled", true); askTimes = nsIPK11Token.ASK_EVERY_TIME; break; case "2": timeoutField.removeAttribute("disabled"); timeoutField.focus(); timeout = timeoutField.value; var re = new RegExp("^[0-9]+$"); if (!re.test(timeout)) { timeout = "0"; } askTimes = nsIPK11Token.ASK_EXPIRE_TIME; break; } internal_token.setAskPasswordDefaults(askTimes, timeout);}
{ if (gHighlightedMessageText) removeHighlighting();
function changeQuickSearchMode(aMenuItem){ viewDebug("changing quick search mode\n"); // extract the label and set the search input to match it var oldSearchMode = gSearchInput.searchMode; gSearchInput.searchMode = aMenuItem.value; if (gSearchInput.value == "" || gSearchInput.showingSearchCriteria) { gSearchInput.showingSearchCriteria = true; if (gSearchInput.value) // gSearchInput.setSearchCriteriaText(); } // if the search box is empty, set showing search criteria to true so it shows up when focus moves out of the box if (!gSearchInput.value) gSearchInput.showingSearchCriteria = true; else if (gSearchInput.showingSearchCriteria) // if we are showing criteria text and the box isn't empty, change the criteria text gSearchInput.setSearchCriteriaText(); else if (oldSearchMode != gSearchInput.searchMode) // the search mode just changed so we need to redo the quick search { if (gHighlightedMessageText) removeHighlighting(); // remove any existing highlighting in the message before switching gears onEnterInSearchBar(); }}
}
function changeQuickSearchMode(aMenuItem){ viewDebug("changing quick search mode\n"); // extract the label and set the search input to match it var oldSearchMode = gSearchInput.searchMode; gSearchInput.searchMode = aMenuItem.value; if (gSearchInput.value == "" || gSearchInput.showingSearchCriteria) { gSearchInput.showingSearchCriteria = true; if (gSearchInput.value) // gSearchInput.setSearchCriteriaText(); } // if the search box is empty, set showing search criteria to true so it shows up when focus moves out of the box if (!gSearchInput.value) gSearchInput.showingSearchCriteria = true; else if (gSearchInput.showingSearchCriteria) // if we are showing criteria text and the box isn't empty, change the criteria text gSearchInput.setSearchCriteriaText(); else if (oldSearchMode != gSearchInput.searchMode) // the search mode just changed so we need to redo the quick search { if (gHighlightedMessageText) removeHighlighting(); // remove any existing highlighting in the message before switching gears onEnterInSearchBar(); }}
SetElementEnabledById("ok", enable);
SetElementEnabled(gDialog.OkButton, enable);
function ChangeRowOrColumn(id){ // Allow only integers forceInteger(id); // Enable OK only if both rows and columns have a value > 0 var enable = gDialog.rowsInput.value.length > 0 && gDialog.rowsInput.value > 0 && gDialog.columnsInput.value.length > 0 && gDialog.columnsInput.value > 0; SetElementEnabledById("ok", enable); SetElementEnabledById("AdvancedEditButton1", enable);}
var rv = { newdpi : 0 };
var rv = { newdpi : -1 };
function changeScreenResolution() { var screenResolution = document.getElementById("screenResolution"); var userResolution = document.getElementById("userResolution"); var previousSelection = screenResolution.getElementsByAttribute("current", "true")[0]; if (screenResolution.value == "other") { // If the user selects "Other..." we bring up the calibrate screen dialog var rv = { newdpi : 0 }; var calscreen = window.openDialog("chrome://communicator/content/pref/pref-calibrate-screen.xul", "_blank", "modal,chrome,centerscreen,resizable=no,titlebar", rv); if (rv.newdpi != -1) { // They have entered values, and we have a DPI value back var dpi = screenResolution.getAttribute( "dpi" ); setResolution ( rv.newdpi ); previousSelection.removeAttribute("current"); screenResolution.selectedItem.setAttribute("current", "true"); } else { // They've cancelled. We can't leave "Other..." selected, so... // we re-select the previously selected item. screenResolution.selectedItem = previousSelection; } } else if (!(screenResolution.value == userResolution.value)) { // User has selected one of the hard-coded resolutions userResolution.setAttribute("hidden", "true"); previousSelection.removeAttribute("current"); screenResolution.selectedItem.setAttribute("current", "true"); } }
calscreen = window.openDialog("chrome:
var calscreen = window.openDialog("chrome:
function changeScreenResolution() { var screenResolution = document.getElementById("screenResolution"); var userResolution = document.getElementById("userResolution"); var previousSelection = screenResolution.getElementsByAttribute("current", "true")[0]; if (screenResolution.value == "other") { // If the user selects "Other..." we bring up the calibrate screen dialog var rv = { newdpi : 0 }; calscreen = window.openDialog("chrome://communicator/content/pref/pref-calibrate-screen.xul", "_blank", "modal,chrome,centerscreen,resizable=no,titlebar", rv); if (rv.newdpi != -1) { // They have entered values, and we have a DPI value back var dpi = screenResolution.getAttribute( "dpi" ); setResolution ( rv.newdpi ); previousSelection.removeAttribute("current"); screenResolution.selectedItem.setAttribute("current", "true"); } else { // They've cancelled. We can't leave "Other..." selected, so... // we re-select the previously selected item. screenResolution.selectedItem = previousSelection; } } else if (!(screenResolution.value == userResolution.value)) { // User has selected one of the hard-coded resolutions userResolution.setAttribute("hidden", "true"); previousSelection.removeAttribute("current"); screenResolution.selectedItem.setAttribute("current", "true"); } }
if(messageView.viewType == viewShowUnread) return;
function ChangeThreadView(){ var folder = GetSelectedFolder(); var threadColumn = document.getElementById('ThreadColumnHeader'); if(threadColumn) { var currentView = threadColumn.getAttribute('currentView'); if(currentView== 'threaded') { ShowThreads(false); if(folder) folder.setAttribute('threaded', "false"); SetTemplateTreeItemOpen(false); } else if(currentView == 'unthreaded') { //if we're in unread messages view, don't allow to go into threaded mode because //we don't support it. if(messageView.viewType == viewShowUnread) return; ShowThreads(true); if(folder) folder.setAttribute('threaded', "true"); } RefreshThreadTreeView(); }}
var title;
function changeTitleBar(componentType){ // Sanity check input if ( componentType == "event" || componentType == "todo" ) { var args = window.arguments[0]; // Is this a NEW event/todo, or are we EDITing an existing event/todo? if( "new" == args.mode ) title = document.getElementById( "data-"+componentType+"-title-new" ).getAttribute("value"); else title = document.getElementById( "data-"+componentType+"-title-edit" ).getAttribute("value"); debug("changeTitleBar: "+title); document.title = title; } else { dump("changeTitleBar: ERROR! Tried to change titlebar to invalid value: "+componentType+"\n"); }}
if($.inArray(OSC.state.sel_sig_name, ['ch1', 'ch2', 'math']) < 0) {
if($.inArray(OSC.state.sel_sig_name, ['ch1', 'ch2', 'math', 'output1', 'output2']) < 0) {
OSC.changeYZoom = function(direction, curr_scale, send_changes) { // Output 1/2 signals do not have zoom if($.inArray(OSC.state.sel_sig_name, ['ch1', 'ch2', 'math']) < 0) { return; } var curr_scale = (curr_scale === undefined ? OSC.params.orig['OSC_' + OSC.state.sel_sig_name.toUpperCase() + '_SCALE'].value : curr_scale); var new_scale; for(var i=0; i < OSC.voltage_steps.length - 1; i++) { if(OSC.state.fine && (curr_scale == OSC.voltage_steps[i] || (curr_scale > OSC.voltage_steps[i] && curr_scale < OSC.voltage_steps[i + 1]) || (curr_scale == OSC.voltage_steps[i + 1] && direction == '-'))) { new_scale = curr_scale + (OSC.voltage_steps[i + 1] / 100) * (direction == '-' ? -1 : 1); // Do not allow values smaller than the lowest possible one if(new_scale < OSC.voltage_steps[0]) { new_scale = OSC.voltage_steps[0]; } break; } if(!OSC.state.fine && curr_scale == OSC.voltage_steps[i]) { new_scale = OSC.voltage_steps[direction == '-' ? (i > 0 ? i - 1 : 0) : i + 1]; break; } else if(!OSC.state.fine && ((curr_scale > OSC.voltage_steps[i] && curr_scale < OSC.voltage_steps[i + 1]) || (curr_scale == OSC.voltage_steps[i + 1] && i == OSC.voltage_steps.length - 2))) { new_scale = OSC.voltage_steps[direction == '-' ? i : i + 1]; break; } } if(new_scale !== undefined && new_scale > 0 && new_scale != curr_scale) { // Fix float length new_scale = parseFloat(new_scale.toFixed(OSC.state.fine ? 5 : 3)); if(send_changes !== false) { OSC.params.local['OSC_' + OSC.state.sel_sig_name.toUpperCase() + '_SCALE'] = { value: new_scale }; OSC.sendParams(); } return new_scale; } return null; };
gPrevCharset = gLastBrowserCharset;
function charsetLoadListener (event){ var charset = window._content.document.characterSet; if (charset.length > 0 && (charset != gLastBrowserCharset)) { gCharsetMenu.SetCurrentCharset(charset); gLastBrowserCharset = charset; }}
var charset = window.content.document.characterSet;
var charset = window._content.document.characterSet;
function charsetLoadListener (event){ var menu = Components.classes['component://netscape/rdf/datasource?name=charset-menu']; if (menu) { menu = menu.getService(); menu = menu.QueryInterface(Components.interfaces.nsICurrentCharsetListener); } var charset = window.content.document.characterSet; if (menu) { menu.SetCurrentCharset(charset); } // XXX you know, here I could also set the checkmark, for the case when a // doc finishes loading after the menu is already diplayed. But I get a // weird assertion!}
var menu = Components.classes['component:
var menu = Components.classes['@mozilla.org/rdf/datasource;1?name=charset-menu'];
function charsetLoadListener (event){ var menu = Components.classes['component://netscape/rdf/datasource?name=charset-menu']; if (menu) { menu = menu.getService(); menu = menu.QueryInterface(Components.interfaces.nsICurrentCharsetListener); } var charset = window._content.document.characterSet; if (menu) { menu.SetCurrentCharset(charset); } // XXX you know, here I could also set the checkmark, for the case when a // doc finishes loading after the menu is already diplayed. But I get a // weird assertion!}
if(document.formmsg.all)
if(document.cmd.all)
function CheckAll(){ if(document.formmsg.all) { var c = document.formmsg.all.checked; } for (var i=0;i<document.formmsg.elements.length;i++) { var e = document.formmsg.elements[i]; if(e.name != 'all') e.checked = c; }}
var c = document.formmsg.all.checked;
var c = document.cmd.all.checked;
function CheckAll(){ if(document.formmsg.all) { var c = document.formmsg.all.checked; } for (var i=0;i<document.formmsg.elements.length;i++) { var e = document.formmsg.elements[i]; if(e.name != 'all') e.checked = c; }}
for (var i=0;i<document.formmsg.elements.length;i++)
for (var i=0;i<document.cmd.elements.length;i++)
function CheckAll(){ if(document.formmsg.all) { var c = document.formmsg.all.checked; } for (var i=0;i<document.formmsg.elements.length;i++) { var e = document.formmsg.elements[i]; if(e.name != 'all') e.checked = c; }}
var e = document.formmsg.elements[i];
var e = document.cmd.elements[i];
function CheckAll(){ if(document.formmsg.all) { var c = document.formmsg.all.checked; } for (var i=0;i<document.formmsg.elements.length;i++) { var e = document.formmsg.elements[i]; if(e.name != 'all') e.checked = c; }}
promptService.confirmEx(window, dialogTitle, dialogMsg, promptFlags, button1Title, null, button3Title, null, {value:0}, result);
result = promptService.confirmEx( window, dialogTitle, dialogMsg, promptFlags, button1Title, null, button3Title, null, {value:0} );
function CheckAndSaveDocument(command, allowDontSave){ try { // if we don't have an editorShell or an editorDocument, bail if (!window.editorShell && !window.editorShell.editorDocument) return true; } catch (e) { return true; } var document = editorShell.editorDocument; if (!editorShell.documentModified && !gHTMLSourceChanged) return true; // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); var scheme = GetScheme(GetDocumentUrl()); var doPublish = (scheme && scheme != "file"); var strID; switch (command) { case "cmd_close": strID = "BeforeClosing"; break; case "cmd_preview": strID = "BeforePreview"; break; case "cmd_editSendPage": strID = "SendPageReason"; break; case "cmd_validate": strID = "BeforeValidate"; break; } var reasonToSave = strID ? GetString(strID) : ""; var title = window.editorShell.editorDocument.title; if (!title) title = GetString("untitled"); var dialogTitle = GetString(doPublish ? "PublishPage" : "SaveDocument"); var dialogMsg = GetString("SaveFilePrompt"); dialogMsg = (dialogMsg.replace(/%title%/,title)).replace(/%reason%/,reasonToSave); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService); var result = {value:0}; var promptFlags = promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1; var button1Title = null; var button3Title = null; if (doPublish) { promptFlags += promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0; button1Title = GetString("Publish"); button3Title = GetString("DontPublish"); } else { promptFlags += promptService.BUTTON_TITLE_SAVE * promptService.BUTTON_POS_0; } // If allowing "Don't..." button, add that if (allowDontSave) promptFlags += doPublish ? (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2) : (promptService.BUTTON_TITLE_DONT_SAVE * promptService.BUTTON_POS_2); promptService.confirmEx(window, dialogTitle, dialogMsg, promptFlags, button1Title, null, button3Title, null, {value:0}, result); if (result.value == 0) { // Save, but first finish HTML source mode if (gHTMLSourceChanged) FinishHTMLSource(); if (doPublish) { // We save the command the user wanted to do in a global // and return as if user canceled because publishing is asynchronous // This command will be fired when publishing finishes gCommandAfterPublishing = command; goDoCommand("cmd_publish"); return false; } // Save to local disk var success = SaveDocument(false, false, editorShell.contentsMIMEType); return success; } if (result.value == 2) // "Don't Save" return true; // Default or result.value == 1 (Cancel) return false;}
commonDialogsService.UniversalDialog(
promptService.UniversalDialog(
function CheckAndSaveDocument(reasonToSave, allowDontSave){ var document = editorShell.editorDocument; if (!editorShell.documentModified) return true; // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); var title = window.editorShell.editorDocument.title; if (!title) title = GetString("untitled"); var dialogTitle = window.editorShell.GetString("SaveDocument"); var dialogMsg = window.editorShell.GetString("SaveFilePrompt"); dialogMsg = (dialogMsg.replace(/%title%/,title)).replace(/%reason%/,reasonToSave); var result = {value:0}; commonDialogsService.UniversalDialog( window, null, dialogTitle, dialogMsg, null, window.editorShell.GetString("Save"), // Save Button window.editorShell.GetString("Cancel"), // Cancel Button (allowDontSave ? window.editorShell.GetString("DontSave") : null), // Don't Save Button null, null, null, {value:0}, {value:0}, "chrome://global/skin/question-icon.gif", {value:"false"}, (allowDontSave ? 3 : 2), 0, 0, result ); if (result.value == 0) { // Save var success = window.editorShell.saveDocument(false, false, window.gDefaultSaveMimeType); return success; } if (result.value == 2) // "Don't Save" return true; // Default or result.value == 1 (Cancel) return false;}
promptService.universalDialog( window, null, dialogTitle, dialogMsg, null, window.editorShell.GetString("Save"), window.editorShell.GetString("Cancel"), (allowDontSave ? window.editorShell.GetString("DontSave") : null), null, null, null, {value:0}, {value:0}, "question-icon", {value:"false"}, (allowDontSave ? 3 : 2), 0, 0, result );
promptService.confirmEx(window, dialogTitle, dialogMsg, (promptService.BUTTON_TITLE_SAVE * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), (allowDontSave ? window.editorShell.GetString("DontSave") : null), null, {value:0}, result);
function CheckAndSaveDocument(reasonToSave, allowDontSave){ var document = editorShell.editorDocument; if (!editorShell.documentModified) return true; // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); var title = window.editorShell.editorDocument.title; if (!title) title = GetString("untitled"); var dialogTitle = window.editorShell.GetString("SaveDocument"); var dialogMsg = window.editorShell.GetString("SaveFilePrompt"); dialogMsg = (dialogMsg.replace(/%title%/,title)).replace(/%reason%/,reasonToSave); var result = {value:0}; promptService.universalDialog( window, null, dialogTitle, dialogMsg, null, window.editorShell.GetString("Save"), // Save Button window.editorShell.GetString("Cancel"), // Cancel Button (allowDontSave ? window.editorShell.GetString("DontSave") : null), // Don't Save Button null, null, null, {value:0}, {value:0}, "question-icon", {value:"false"}, (allowDontSave ? 3 : 2), 0, 0, result ); if (result.value == 0) { // Save var success = window.editorShell.saveDocument(false, false, window.gDefaultSaveMimeType); return success; } if (result.value == 2) // "Don't Save" return true; // Default or result.value == 1 (Cancel) return false;}
if (gHTMLSourceChanged) FinishHTMLSource();
if (gHTMLSourceChanged) { try { FinishHTMLSource(); } catch (e) { return false;} }
function CheckAndSaveDocument(command, allowDontSave){ var document; try { // if we don't have an editor or an document, bail if (!gEditor) return true; document = gEditor.document; if (!document) return true; } catch (e) { return true; } if (!gEditor.documentModified && !gHTMLSourceChanged) return true; // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); var scheme = GetScheme(GetDocumentUrl()); var doPublish = (scheme && scheme != "file"); var strID; switch (command) { case "cmd_close": strID = "BeforeClosing"; break; case "cmd_preview": strID = "BeforePreview"; break; case "cmd_editSendPage": strID = "SendPageReason"; break; case "cmd_validate": strID = "BeforeValidate"; break; } var reasonToSave = strID ? GetString(strID) : ""; var title = document.title; if (!title) title = GetString("untitled"); var dialogTitle = GetString(doPublish ? "PublishPage" : "SaveDocument"); var dialogMsg = GetString("SaveFilePrompt"); dialogMsg = (dialogMsg.replace(/%title%/,title)).replace(/%reason%/,reasonToSave); var promptService = GetPromptService(); if (!promptService) return false; var result = {value:0}; var promptFlags = promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1; var button1Title = null; var button3Title = null; if (doPublish) { promptFlags += promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0; button1Title = GetString("Publish"); button3Title = GetString("DontPublish"); } else { promptFlags += promptService.BUTTON_TITLE_SAVE * promptService.BUTTON_POS_0; } // If allowing "Don't..." button, add that if (allowDontSave) promptFlags += doPublish ? (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2) : (promptService.BUTTON_TITLE_DONT_SAVE * promptService.BUTTON_POS_2); result = promptService.confirmEx(window, dialogTitle, dialogMsg, promptFlags, button1Title, null, button3Title, null, {value:0}); if (result == 0) { // Save, but first finish HTML source mode if (gHTMLSourceChanged) FinishHTMLSource(); if (doPublish) { // We save the command the user wanted to do in a global // and return as if user canceled because publishing is asynchronous // This command will be fired when publishing finishes gCommandAfterPublishing = command; goDoCommand("cmd_publish"); return false; } // Save to local disk var contentsMIMEType; if (gIsHTMLEditor) contentsMIMEType = "text/html"; else contentsMIMEType = "text/plain"; var success = SaveDocument(false, false, contentsMIMEType); return success; } if (result == 2) // "Don't Save" return true; // Default or result == 1 (Cancel) return false;}
if( ThisToDo.percent == 0 ) ThisToDo.status = ThisToDo.ICAL_STATUS_NEEDSACTION; else ThisToDo.status = ThisToDo.ICAL_STATUS_INPROCESS; }
function checkboxClick( event ){ var ThisToDo = event.currentTarget.parentNode.parentNode.toDo; if( event.currentTarget.checked == true ) { var completedTime = new Date(); ThisToDo.completed.setTime( completedTime ); } else ThisToDo.completed.clear(); gICalLib.modifyTodo( ThisToDo ); toDoUnifinderRefesh();}
#else finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishTextMac"); #endif
function checkCurrentInput(currentInput){ var finishButton = document.documentElement.getButton("finish"); var finishText = document.getElementById("finishText"); var canAdvance; var errorMessage = checkProfileName(currentInput); if (!errorMessage) { finishText.className = ""; finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishText"); canAdvance = true; } else { finishText.className = "error"; finishText.firstChild.data = errorMessage; canAdvance = false; } document.documentElement.canAdvance = canAdvance; finishButton.disabled = !canAdvance; updateProfileDisplay();}
globals.debug( "checkData" );
function checkData(){ netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); globals.debug( "checkData" ); // * skip if we're in edit mode if ( globals.document.vars.editMode.value != "yes" ) { globals.debug( "not editing" ); if ( document.forms != null && document.forms[ 0 ] != null && document.forms[ 0 ].popList != null ) { globals.debug( "top case" ); selectedIndex = document.forms[ 0 ].popList.selectedIndex; } else { selectedIndex = -1; } globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex ); // * check for toll calls when not in international mode if ( globals.document.vars.intlMode.value != "yes" ) { ispPhoneNumber = new String( plugin.GetISPModemNumber( globals.selectedISP, selectedIndex ) ); areaCode = globals.getAreaCode( ispPhoneNumber ); if ( areaCode != "" ) { globals.debug( "areaCode: " + areaCode );s if ( areaCode != "800" && areaCode != "888" ) if ( confirm( "The area code to call this ISP is " + areaCode + ". This might be a toll call from your area code. Do you wish to continue?" ) == false ) return false; } } globals.debug( "calling createConfigIAS" ); plugin.CreateConfigIAS( globals.selectedISP, selectedIndex ); globals.debug( "opening support window" ); if ( !globals.supportWindow || globals.supportWindow == null || !globals.supportWindow.document || globals.supportWindow.document == null || globals.supportWindow.closed ) { globals.supportWindow = top.open( "", "supportNumber", "alwaysRaised,dependent=yes,innerHeight=13,innerWidth=550,titleBar=no" ); globals.supportWindow.moveBy( 2, -18 ); globals.supportWindow.opener.focus(); } ispSupportNumber = plugin.GetISPSupportPhoneNumber( globals.selectedISP ); ispSupportName = globals.getSelectedISPName(); if ( ispSupportNumber != null && ispSupportNumber != "" ) globals.supportWindow.document.writeln( "<LAYER PAGEX='0' PAGEY='1'><P><CENTER><FONT FACE='PrimaSans BT' SIZE=-1>For problems, please call " + ispSupportName + " at <B>" + ispSupportNumber + "</B></FONT></CENTER></P></LAYER>" ); return true; } else return false;}
globals.debug( "not editing" );
function checkData(){ netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); globals.debug( "checkData" ); // * skip if we're in edit mode if ( globals.document.vars.editMode.value != "yes" ) { globals.debug( "not editing" ); if ( document.forms != null && document.forms[ 0 ] != null && document.forms[ 0 ].popList != null ) { globals.debug( "top case" ); selectedIndex = document.forms[ 0 ].popList.selectedIndex; } else { selectedIndex = -1; } globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex ); // * check for toll calls when not in international mode if ( globals.document.vars.intlMode.value != "yes" ) { ispPhoneNumber = new String( plugin.GetISPModemNumber( globals.selectedISP, selectedIndex ) ); areaCode = globals.getAreaCode( ispPhoneNumber ); if ( areaCode != "" ) { globals.debug( "areaCode: " + areaCode );s if ( areaCode != "800" && areaCode != "888" ) if ( confirm( "The area code to call this ISP is " + areaCode + ". This might be a toll call from your area code. Do you wish to continue?" ) == false ) return false; } } globals.debug( "calling createConfigIAS" ); plugin.CreateConfigIAS( globals.selectedISP, selectedIndex ); globals.debug( "opening support window" ); if ( !globals.supportWindow || globals.supportWindow == null || !globals.supportWindow.document || globals.supportWindow.document == null || globals.supportWindow.closed ) { globals.supportWindow = top.open( "", "supportNumber", "alwaysRaised,dependent=yes,innerHeight=13,innerWidth=550,titleBar=no" ); globals.supportWindow.moveBy( 2, -18 ); globals.supportWindow.opener.focus(); } ispSupportNumber = plugin.GetISPSupportPhoneNumber( globals.selectedISP ); ispSupportName = globals.getSelectedISPName(); if ( ispSupportNumber != null && ispSupportNumber != "" ) globals.supportWindow.document.writeln( "<LAYER PAGEX='0' PAGEY='1'><P><CENTER><FONT FACE='PrimaSans BT' SIZE=-1>For problems, please call " + ispSupportName + " at <B>" + ispSupportNumber + "</B></FONT></CENTER></P></LAYER>" ); return true; } else return false;}
globals.debug( "top case" );
function checkData(){ netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); globals.debug( "checkData" ); // * skip if we're in edit mode if ( globals.document.vars.editMode.value != "yes" ) { globals.debug( "not editing" ); if ( document.forms != null && document.forms[ 0 ] != null && document.forms[ 0 ].popList != null ) { globals.debug( "top case" ); selectedIndex = document.forms[ 0 ].popList.selectedIndex; } else { selectedIndex = -1; } globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex ); // * check for toll calls when not in international mode if ( globals.document.vars.intlMode.value != "yes" ) { ispPhoneNumber = new String( plugin.GetISPModemNumber( globals.selectedISP, selectedIndex ) ); areaCode = globals.getAreaCode( ispPhoneNumber ); if ( areaCode != "" ) { globals.debug( "areaCode: " + areaCode );s if ( areaCode != "800" && areaCode != "888" ) if ( confirm( "The area code to call this ISP is " + areaCode + ". This might be a toll call from your area code. Do you wish to continue?" ) == false ) return false; } } globals.debug( "calling createConfigIAS" ); plugin.CreateConfigIAS( globals.selectedISP, selectedIndex ); globals.debug( "opening support window" ); if ( !globals.supportWindow || globals.supportWindow == null || !globals.supportWindow.document || globals.supportWindow.document == null || globals.supportWindow.closed ) { globals.supportWindow = top.open( "", "supportNumber", "alwaysRaised,dependent=yes,innerHeight=13,innerWidth=550,titleBar=no" ); globals.supportWindow.moveBy( 2, -18 ); globals.supportWindow.opener.focus(); } ispSupportNumber = plugin.GetISPSupportPhoneNumber( globals.selectedISP ); ispSupportName = globals.getSelectedISPName(); if ( ispSupportNumber != null && ispSupportNumber != "" ) globals.supportWindow.document.writeln( "<LAYER PAGEX='0' PAGEY='1'><P><CENTER><FONT FACE='PrimaSans BT' SIZE=-1>For problems, please call " + ispSupportName + " at <B>" + ispSupportNumber + "</B></FONT></CENTER></P></LAYER>" ); return true; } else return false;}
globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex );
function checkData(){ netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); globals.debug( "checkData" ); // * skip if we're in edit mode if ( globals.document.vars.editMode.value != "yes" ) { globals.debug( "not editing" ); if ( document.forms != null && document.forms[ 0 ] != null && document.forms[ 0 ].popList != null ) { globals.debug( "top case" ); selectedIndex = document.forms[ 0 ].popList.selectedIndex; } else { selectedIndex = -1; } globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex ); // * check for toll calls when not in international mode if ( globals.document.vars.intlMode.value != "yes" ) { ispPhoneNumber = new String( plugin.GetISPModemNumber( globals.selectedISP, selectedIndex ) ); areaCode = globals.getAreaCode( ispPhoneNumber ); if ( areaCode != "" ) { globals.debug( "areaCode: " + areaCode );s if ( areaCode != "800" && areaCode != "888" ) if ( confirm( "The area code to call this ISP is " + areaCode + ". This might be a toll call from your area code. Do you wish to continue?" ) == false ) return false; } } globals.debug( "calling createConfigIAS" ); plugin.CreateConfigIAS( globals.selectedISP, selectedIndex ); globals.debug( "opening support window" ); if ( !globals.supportWindow || globals.supportWindow == null || !globals.supportWindow.document || globals.supportWindow.document == null || globals.supportWindow.closed ) { globals.supportWindow = top.open( "", "supportNumber", "alwaysRaised,dependent=yes,innerHeight=13,innerWidth=550,titleBar=no" ); globals.supportWindow.moveBy( 2, -18 ); globals.supportWindow.opener.focus(); } ispSupportNumber = plugin.GetISPSupportPhoneNumber( globals.selectedISP ); ispSupportName = globals.getSelectedISPName(); if ( ispSupportNumber != null && ispSupportNumber != "" ) globals.supportWindow.document.writeln( "<LAYER PAGEX='0' PAGEY='1'><P><CENTER><FONT FACE='PrimaSans BT' SIZE=-1>For problems, please call " + ispSupportName + " at <B>" + ispSupportNumber + "</B></FONT></CENTER></P></LAYER>" ); return true; } else return false;}
globals.debug( "areaCode: " + areaCode );s
function checkData(){ netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); globals.debug( "checkData" ); // * skip if we're in edit mode if ( globals.document.vars.editMode.value != "yes" ) { globals.debug( "not editing" ); if ( document.forms != null && document.forms[ 0 ] != null && document.forms[ 0 ].popList != null ) { globals.debug( "top case" ); selectedIndex = document.forms[ 0 ].popList.selectedIndex; } else { selectedIndex = -1; } globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex ); // * check for toll calls when not in international mode if ( globals.document.vars.intlMode.value != "yes" ) { ispPhoneNumber = new String( plugin.GetISPModemNumber( globals.selectedISP, selectedIndex ) ); areaCode = globals.getAreaCode( ispPhoneNumber ); if ( areaCode != "" ) { globals.debug( "areaCode: " + areaCode );s if ( areaCode != "800" && areaCode != "888" ) if ( confirm( "The area code to call this ISP is " + areaCode + ". This might be a toll call from your area code. Do you wish to continue?" ) == false ) return false; } } globals.debug( "calling createConfigIAS" ); plugin.CreateConfigIAS( globals.selectedISP, selectedIndex ); globals.debug( "opening support window" ); if ( !globals.supportWindow || globals.supportWindow == null || !globals.supportWindow.document || globals.supportWindow.document == null || globals.supportWindow.closed ) { globals.supportWindow = top.open( "", "supportNumber", "alwaysRaised,dependent=yes,innerHeight=13,innerWidth=550,titleBar=no" ); globals.supportWindow.moveBy( 2, -18 ); globals.supportWindow.opener.focus(); } ispSupportNumber = plugin.GetISPSupportPhoneNumber( globals.selectedISP ); ispSupportName = globals.getSelectedISPName(); if ( ispSupportNumber != null && ispSupportNumber != "" ) globals.supportWindow.document.writeln( "<LAYER PAGEX='0' PAGEY='1'><P><CENTER><FONT FACE='PrimaSans BT' SIZE=-1>For problems, please call " + ispSupportName + " at <B>" + ispSupportNumber + "</B></FONT></CENTER></P></LAYER>" ); return true; } else return false;}
globals.debug( "calling createConfigIAS" );
function checkData(){ netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); globals.debug( "checkData" ); // * skip if we're in edit mode if ( globals.document.vars.editMode.value != "yes" ) { globals.debug( "not editing" ); if ( document.forms != null && document.forms[ 0 ] != null && document.forms[ 0 ].popList != null ) { globals.debug( "top case" ); selectedIndex = document.forms[ 0 ].popList.selectedIndex; } else { selectedIndex = -1; } globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex ); // * check for toll calls when not in international mode if ( globals.document.vars.intlMode.value != "yes" ) { ispPhoneNumber = new String( plugin.GetISPModemNumber( globals.selectedISP, selectedIndex ) ); areaCode = globals.getAreaCode( ispPhoneNumber ); if ( areaCode != "" ) { globals.debug( "areaCode: " + areaCode );s if ( areaCode != "800" && areaCode != "888" ) if ( confirm( "The area code to call this ISP is " + areaCode + ". This might be a toll call from your area code. Do you wish to continue?" ) == false ) return false; } } globals.debug( "calling createConfigIAS" ); plugin.CreateConfigIAS( globals.selectedISP, selectedIndex ); globals.debug( "opening support window" ); if ( !globals.supportWindow || globals.supportWindow == null || !globals.supportWindow.document || globals.supportWindow.document == null || globals.supportWindow.closed ) { globals.supportWindow = top.open( "", "supportNumber", "alwaysRaised,dependent=yes,innerHeight=13,innerWidth=550,titleBar=no" ); globals.supportWindow.moveBy( 2, -18 ); globals.supportWindow.opener.focus(); } ispSupportNumber = plugin.GetISPSupportPhoneNumber( globals.selectedISP ); ispSupportName = globals.getSelectedISPName(); if ( ispSupportNumber != null && ispSupportNumber != "" ) globals.supportWindow.document.writeln( "<LAYER PAGEX='0' PAGEY='1'><P><CENTER><FONT FACE='PrimaSans BT' SIZE=-1>For problems, please call " + ispSupportName + " at <B>" + ispSupportNumber + "</B></FONT></CENTER></P></LAYER>" ); return true; } else return false;}
globals.debug( "opening support window" );
function checkData(){ netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); globals.debug( "checkData" ); // * skip if we're in edit mode if ( globals.document.vars.editMode.value != "yes" ) { globals.debug( "not editing" ); if ( document.forms != null && document.forms[ 0 ] != null && document.forms[ 0 ].popList != null ) { globals.debug( "top case" ); selectedIndex = document.forms[ 0 ].popList.selectedIndex; } else { selectedIndex = -1; } globals.debug( "selectedISP: " + globals.selectedISP ); globals.debug( "selectedIndex: " + selectedIndex ); // * check for toll calls when not in international mode if ( globals.document.vars.intlMode.value != "yes" ) { ispPhoneNumber = new String( plugin.GetISPModemNumber( globals.selectedISP, selectedIndex ) ); areaCode = globals.getAreaCode( ispPhoneNumber ); if ( areaCode != "" ) { globals.debug( "areaCode: " + areaCode );s if ( areaCode != "800" && areaCode != "888" ) if ( confirm( "The area code to call this ISP is " + areaCode + ". This might be a toll call from your area code. Do you wish to continue?" ) == false ) return false; } } globals.debug( "calling createConfigIAS" ); plugin.CreateConfigIAS( globals.selectedISP, selectedIndex ); globals.debug( "opening support window" ); if ( !globals.supportWindow || globals.supportWindow == null || !globals.supportWindow.document || globals.supportWindow.document == null || globals.supportWindow.closed ) { globals.supportWindow = top.open( "", "supportNumber", "alwaysRaised,dependent=yes,innerHeight=13,innerWidth=550,titleBar=no" ); globals.supportWindow.moveBy( 2, -18 ); globals.supportWindow.opener.focus(); } ispSupportNumber = plugin.GetISPSupportPhoneNumber( globals.selectedISP ); ispSupportName = globals.getSelectedISPName(); if ( ispSupportNumber != null && ispSupportNumber != "" ) globals.supportWindow.document.writeln( "<LAYER PAGEX='0' PAGEY='1'><P><CENTER><FONT FACE='PrimaSans BT' SIZE=-1>For problems, please call " + ispSupportName + " at <B>" + ispSupportNumber + "</B></FONT></CENTER></P></LAYER>" ); return true; } else return false;}
var brandShortName = this.mBrandBundle.getString("brandRealShortName");
var brandShortName = this.mBrandBundle.getString("brandShortName");
checkDefaultMailNow: function (isNews) { var mapiReg = Components.classes["@mozilla.org/mapiregistry;1"] .getService(Components.interfaces.nsIMapiRegistry); var brandShortName = this.mBrandBundle.getString("brandRealShortName"); var promptTitle = this.mMapiBundle.getFormattedString("dialogTitle", [brandShortName]); var promptMessage; var IPS = Components.interfaces.nsIPromptService; var prompt = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(IPS); var isDefault; var str; if (isNews) { isDefault = mapiReg.isDefaultNewsClient; str = "News"; } else { isDefault = mapiReg.isDefaultMailClient; str = "Mail"; } if (!isDefault) { promptMessage = this.mMapiBundle.getFormattedString("setDefault" + str, [brandShortName]); var rv = prompt.confirmEx(window, promptTitle, promptMessage, (IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) + (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1), null, null, null, null, { }); if (rv == 0) { if (isNews) mapiReg.isDefaultNewsClient = true; else mapiReg.isDefaultMailClient = true; } } else { promptMessage = this.mMapiBundle.getFormattedString("alreadyDefault" + str, [brandShortName]); prompt.alert(window, promptTitle, promptMessage); } },
var startDate = document.getElementById( "start-date-picker" ).value; var dueDate = document.getElementById( "due-date-picker" ).value;
var startDate = document.getElementById( "start-datetime" ).value; var dueDate = document.getElementById( "due-datetime" ).value;
function checkDueDate(){ // Bad to get into floats. var startDate = document.getElementById( "start-date-picker" ).value; var dueDate = document.getElementById( "due-date-picker" ).value; if( startDate.getFullYear() == dueDate.getFullYear() && startDate.getMonth() == dueDate.getMonth() && startDate.getDay() == dueDate.getDay() ) return( 0 ); else if ( dueDate < startDate) return -1; else if (dueDate > startDate) return 1;}
var startDate = document.getElementById( "start-date-picker" ).value; var endDate = document.getElementById( "end-date-picker" ).value;
var startDate = document.getElementById( "start-datetime" ).value; var endDate = document.getElementById( "end-datetime" ).value;
function checkEndDate(){ // Bad to get into floats. var startDate = document.getElementById( "start-date-picker" ).value; var endDate = document.getElementById( "end-date-picker" ).value; if( startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth() && startDate.getDay() == endDate.getDay() ) return( 0 ); else if ( endDate < startDate) return -1; else if (endDate > startDate) return 1;}
var startDate = document.getElementById( "start-datetime" ).value; var endDate = document.getElementById( "end-datetime" ).value; if( startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth() && startDate.getDay() == endDate.getDay() ) return( 0 ); else if ( endDate < startDate)
if( gStartDate.getFullYear() == gEndDate.getFullYear() && gStartDate.getMonth() == gEndDate.getMonth() && gStartDate.getDay() == gEndDate.getDay() ) { if( getFieldValue( "all-day-event-checkbox", "checked" ) ) { return( -1 ) } else { return( 0 ); } } else if ( gEndDate < gStartDate) {
function checkEndDate(){ var startDate = document.getElementById( "start-datetime" ).value; var endDate = document.getElementById( "end-datetime" ).value; if( startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth() && startDate.getDay() == endDate.getDay() ) return( 0 ); else if ( endDate < startDate) return -1; else if (endDate > startDate) return 1;}
else if (endDate > startDate)
} else if ( gEndDate > gStartDate) {
function checkEndDate(){ var startDate = document.getElementById( "start-datetime" ).value; var endDate = document.getElementById( "end-datetime" ).value; if( startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth() && startDate.getDay() == endDate.getDay() ) return( 0 ); else if ( endDate < startDate) return -1; else if (endDate > startDate) return 1;}
}
function checkEndDate(){ var startDate = document.getElementById( "start-datetime" ).value; var endDate = document.getElementById( "end-datetime" ).value; if( startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth() && startDate.getDay() == endDate.getDay() ) return( 0 ); else if ( endDate < startDate) return -1; else if (endDate > startDate) return 1;}
var prefInt = null; var strDefaultSearchEngineName; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); strDefaultSearchEngineName = prefInt.getLocalizedUnicharPref("browser.search.defaultenginename"); }
var strDefaultSearchEngineName = parent.hPrefWindow.getPref("localizedstring", "browser.search.defaultenginename");
function checkEngine(){ var engineList = document.getElementById("engineList"); var engineValue = engineList.label; //nothing is selected if (!engineValue) { try { var prefInt = null; //Preferences Interface var strDefaultSearchEngineName; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); strDefaultSearchEngineName = prefInt.getLocalizedUnicharPref("browser.search.defaultenginename"); } var engineListSelection = engineList.getElementsByAttribute( "label", strDefaultSearchEngineName ); var selectedItem = engineListSelection.length ? engineListSelection[0] : null; if (selectedItem) { //select a locale-dependent predefined search engine in absence of a user default engineList.selectedItem = selectedItem; } else { //select the first listed search engine engineList.selectedIndex = 1; } } catch(e) { //select the first listed search engine engineList.selectedIndex = 1; } }}
var prefInt = null; var strDefaultSearchEngineName; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); strDefaultSearchEngineName = prefInt.getLocalizedUnicharPref("browser.search.defaultenginename"); }
var strDefaultSearchEngineName = parent.hPrefWindow.pref.getLocalizedUnicharPref("browser.search.defaultenginename");
function checkEngine(){ var engineList = document.getElementById("engineList"); var engineValue = engineList.label; //nothing is selected if (!engineValue) { try { var prefInt = null; //Preferences Interface var strDefaultSearchEngineName; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); strDefaultSearchEngineName = prefInt.getLocalizedUnicharPref("browser.search.defaultenginename"); } var engineListSelection = engineList.getElementsByAttribute( "label", strDefaultSearchEngineName ); var selectedItem = engineListSelection.length ? engineListSelection[0] : null; if (selectedItem) { //select a locale-dependent predefined search engine in absence of a user default engineList.selectedItem = selectedItem; } else { //select the first listed search engine engineList.selectedIndex = 1; } } catch(e) { //select the first listed search engine engineList.selectedIndex = 1; } }}