rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
#ifdef MOZ_PLACES | #ifdef MOZ_PLACES_BOOKMARKS | function getShortcutOrURI(aURL, aPostDataRef){ // rjc: added support for URL shortcuts (3/30/1999) try { var shortcutURL = null;#ifdef MOZ_PLACES var bookmarkService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getService(nsCI.nsINavBookmarksService); var shortcutURI = bookmarkService.getURIForKeyword(aURL); if (shortcutURI) shortcutURL = shortcutURI.spec;#else shortcutURL = BMSVC.resolveKeyword(aURL, aPostDataRef);#endif if (!shortcutURL) { // rjc: add support for string substitution with shortcuts (4/4/2000) // (see bug # 29871 for details) var aOffset = aURL.indexOf(" "); if (aOffset > 0) { var cmd = aURL.substr(0, aOffset); var text = aURL.substr(aOffset+1);#ifdef MOZ_PLACES shortcutURI = bookmarkService.getURIForKeyword(cmd); if (shortcutURI) shortcutURL = shortcutURI.spec;#else shortcutURL = BMSVC.resolveKeyword(cmd, aPostDataRef);#endif if (shortcutURL && text) { var encodedText = null; var charset = ""; const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; var matches = shortcutURL.match(re); if (matches) { shortcutURL = matches[1]; charset = matches[2]; }#ifndef MOZ_PLACES // FIXME: Bug 327328, we don't have last charset in places yet. else if (/%s/.test(shortcutURL) || (aPostDataRef && /%s/.test(aPostDataRef.value))) { try { charset = BMSVC.getLastCharset(shortcutURL); } catch (ex) { } }#endif if (charset) encodedText = escape(convertFromUnicode(charset, text)); else // default case: charset=UTF-8 encodedText = encodeURIComponent(text); if (aPostDataRef && aPostDataRef.value) { // XXXben - currently we only support "application/x-www-form-urlencoded" // enctypes. aPostDataRef.value = unescape(aPostDataRef.value); if (aPostDataRef.value.match(/%[sS]/)) { aPostDataRef.value = getPostDataStream(aPostDataRef.value, text, encodedText, "application/x-www-form-urlencoded"); } else { shortcutURL = null; aPostDataRef.value = null; } } else { if (/%[sS]/.test(shortcutURL)) shortcutURL = shortcutURL.replace(/%s/g, encodedText) .replace(/%S/g, text); else shortcutURL = null; } } } } if (shortcutURL) aURL = shortcutURL; } catch (ex) { } return aURL;} |
#ifndef MOZ_PLACES | #ifndef MOZ_PLACES_BOOKMARKS | function getShortcutOrURI(aURL, aPostDataRef){ // rjc: added support for URL shortcuts (3/30/1999) try { var shortcutURL = null;#ifdef MOZ_PLACES var bookmarkService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getService(nsCI.nsINavBookmarksService); var shortcutURI = bookmarkService.getURIForKeyword(aURL); if (shortcutURI) shortcutURL = shortcutURI.spec;#else shortcutURL = BMSVC.resolveKeyword(aURL, aPostDataRef);#endif if (!shortcutURL) { // rjc: add support for string substitution with shortcuts (4/4/2000) // (see bug # 29871 for details) var aOffset = aURL.indexOf(" "); if (aOffset > 0) { var cmd = aURL.substr(0, aOffset); var text = aURL.substr(aOffset+1);#ifdef MOZ_PLACES shortcutURI = bookmarkService.getURIForKeyword(cmd); if (shortcutURI) shortcutURL = shortcutURI.spec;#else shortcutURL = BMSVC.resolveKeyword(cmd, aPostDataRef);#endif if (shortcutURL && text) { var encodedText = null; var charset = ""; const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; var matches = shortcutURL.match(re); if (matches) { shortcutURL = matches[1]; charset = matches[2]; }#ifndef MOZ_PLACES // FIXME: Bug 327328, we don't have last charset in places yet. else if (/%s/.test(shortcutURL) || (aPostDataRef && /%s/.test(aPostDataRef.value))) { try { charset = BMSVC.getLastCharset(shortcutURL); } catch (ex) { } }#endif if (charset) encodedText = escape(convertFromUnicode(charset, text)); else // default case: charset=UTF-8 encodedText = encodeURIComponent(text); if (aPostDataRef && aPostDataRef.value) { // XXXben - currently we only support "application/x-www-form-urlencoded" // enctypes. aPostDataRef.value = unescape(aPostDataRef.value); if (aPostDataRef.value.match(/%[sS]/)) { aPostDataRef.value = getPostDataStream(aPostDataRef.value, text, encodedText, "application/x-www-form-urlencoded"); } else { shortcutURL = null; aPostDataRef.value = null; } } else { if (/%[sS]/.test(shortcutURL)) shortcutURL = shortcutURL.replace(/%s/g, encodedText) .replace(/%S/g, text); else shortcutURL = null; } } } } if (shortcutURL) aURL = shortcutURL; } catch (ex) { } return aURL;} |
aOffset = shortcutURL.indexOf("%s"); if (aOffset >= 0) shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2); else shortcutURL = null; | shortcutURL = /%[sS]/.test(shortcutURL) ? shortcutURL.replace(/%s/g, encodeURIComponent(text)) .replace(/%S/g, text) : null; | function getShortcutOrURI(url){ // rjc: added support for URL shortcuts (3/30/1999) try { if (!gBookmarksService) gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"] .getService(Components.interfaces.nsIBookmarksService); var shortcutURL = gBookmarksService.resolveKeyword(url); if (!shortcutURL) { // rjc: add support for string substitution with shortcuts (4/4/2000) // (see bug # 29871 for details) var aOffset = url.indexOf(" "); if (aOffset > 0) { var cmd = url.substr(0, aOffset); var text = url.substr(aOffset+1); shortcutURL = gBookmarksService.resolveKeyword(cmd); if (shortcutURL && text) { aOffset = shortcutURL.indexOf("%s"); if (aOffset >= 0) shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2); else shortcutURL = null; } } } if (shortcutURL) url = shortcutURL; } catch (ex) { } return url;} |
*/ | function getShortcutOrURI(aURL, aPostDataRef){ // rjc: added support for URL shortcuts (3/30/1999) try { var shortcutURL = null;#ifdef MOZ_PLACES var bookmarkService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getService(nsCI.nsINavBookmarksService); var shortcutURI = bookmarkService.getURIForKeyword(aURL); if (shortcutURI) shortcutURL = shortcutURI.spec;#else shortcutURL = BMSVC.resolveKeyword(aURL, aPostDataRef);#endif if (!shortcutURL) { // rjc: add support for string substitution with shortcuts (4/4/2000) // (see bug # 29871 for details) var aOffset = aURL.indexOf(" "); if (aOffset > 0) { var cmd = aURL.substr(0, aOffset); var text = aURL.substr(aOffset+1);#ifdef MOZ_PLACES shortcutURI = bookmarkService.getURIForKeyword(cmd); if (shortcutURI) shortcutURL = shortcutURI.spec;#else shortcutURL = BMSVC.resolveKeyword(cmd, aPostDataRef);#endif if (shortcutURL && text) { var encodedText = null; var charset = ""; const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; var matches = shortcutURL.match(re); if (matches) { shortcutURL = matches[1]; charset = matches[2]; }#ifndef MOZ_PLACES // FIXME: Bug 327328, we don't have last charset in places yet. else if (/%s/.test(shortcutURL) || (aPostDataRef && /%s/.test(aPostDataRef.value))) { try { charset = BMSVC.getLastCharset(shortcutURL); } catch (ex) { } }#endif if (charset) encodedText = escape(convertFromUnicode(charset, text)); else // default case: charset=UTF-8 encodedText = encodeURIComponent(text); if (aPostDataRef && aPostDataRef.value) { // XXXben - currently we only support "application/x-www-form-urlencoded" // enctypes. aPostDataRef.value = unescape(aPostDataRef.value); if (aPostDataRef.value.match(/%[sS]/)) { aPostDataRef.value = getPostDataStream(aPostDataRef.value, text, encodedText, "application/x-www-form-urlencoded"); } else { shortcutURL = null; aPostDataRef.value = null; } } else { if (/%[sS]/.test(shortcutURL)) shortcutURL = shortcutURL.replace(/%s/g, encodedText) .replace(/%S/g, text); else shortcutURL = null; } } } } if (shortcutURL) aURL = shortcutURL; } catch (ex) { } return aURL;} |
|
var directory_service = Components.classes[DIR_SERV_PROGID].getService(); | var directory_service = Components.classes[DIR_SERV_CONTRACTID].getService(); | function getSidebarDatasourceURI(panels_file_id){ try { /* use the fileLocator to look in the profile directory * to find 'panels.rdf', which is the * database of the user's currently selected panels. */ var directory_service = Components.classes[DIR_SERV_PROGID].getService(); if (directory_service) directory_service = directory_service.QueryInterface(Components.interfaces.nsIProperties); /* if <profile>/panels.rdf doesn't exist, get will copy *bin/defaults/profile/panels.rdf to <profile>/panels.rdf */ var sidebar_file = directory_service.get(panels_file_id, Components.interfaces.nsIFile); if (!sidebar_file.exists()) { /* this should not happen, as GetFileLocation() should copy * defaults/panels.rdf to the users profile directory */ debug("sidebar file does not exist"); return null; } var file_url = Components.classes[STD_URL_PROGID].createInstance(Components.interfaces.nsIFileURL); file_url.file = sidebar_file; debug("sidebar uri is " + file_url.spec); return file_url.spec; } catch (ex) { /* this should not happen */ debug("caught " + ex + " getting sidebar datasource uri"); return null; }} |
var file_url = Components.classes[STD_URL_PROGID].createInstance(Components.interfaces.nsIFileURL); | var file_url = Components.classes[STD_URL_CONTRACTID].createInstance(Components.interfaces.nsIFileURL); | function getSidebarDatasourceURI(panels_file_id){ try { /* use the fileLocator to look in the profile directory * to find 'panels.rdf', which is the * database of the user's currently selected panels. */ var directory_service = Components.classes[DIR_SERV_PROGID].getService(); if (directory_service) directory_service = directory_service.QueryInterface(Components.interfaces.nsIProperties); /* if <profile>/panels.rdf doesn't exist, get will copy *bin/defaults/profile/panels.rdf to <profile>/panels.rdf */ var sidebar_file = directory_service.get(panels_file_id, Components.interfaces.nsIFile); if (!sidebar_file.exists()) { /* this should not happen, as GetFileLocation() should copy * defaults/panels.rdf to the users profile directory */ debug("sidebar file does not exist"); return null; } var file_url = Components.classes[STD_URL_PROGID].createInstance(Components.interfaces.nsIFileURL); file_url.file = sidebar_file; debug("sidebar uri is " + file_url.spec); return file_url.spec; } catch (ex) { /* this should not happen */ debug("caught " + ex + " getting sidebar datasource uri"); return null; }} |
directory_service = locator_service.QueryInterface(nsIProperties); | directory_service = directory_service.QueryInterface(Components.interfaces.nsIProperties); | function getSidebarDatasourceURI(panels_file_id){ try { /* use the fileLocator to look in the profile directory * to find 'panels.rdf', which is the * database of the user's currently selected panels. */ var directory_service = Components.classes[DIR_SERV_PROGID].getService(); if (directory_service) directory_service = locator_service.QueryInterface(nsIProperties); /* if <profile>/panels.rdf doesn't exist, get will copy *bin/defaults/profile/panels.rdf to <profile>/panels.rdf */ var sidebar_file = directory_service.get(panels_file_id, nsIFile); if (!sidebar_file.exists()) { /* this should not happen, as GetFileLocation() should copy * defaults/panels.rdf to the users profile directory */ debug("sidebar file does not exist"); return null; } var file_url = Components.classes[STD_URL_PROGID].createInstance(nsIFileURL); file_url.file = sidebar_file; debug("sidebar uri is " + file_url.spec); return file_url.spec; } catch (ex) { /* this should not happen */ debug("caught " + ex + " getting sidebar datasource uri"); return null; }} |
var sidebar_file = directory_service.get(panels_file_id, nsIFile); | var sidebar_file = directory_service.get(panels_file_id, Components.interfaces.nsIFile); | function getSidebarDatasourceURI(panels_file_id){ try { /* use the fileLocator to look in the profile directory * to find 'panels.rdf', which is the * database of the user's currently selected panels. */ var directory_service = Components.classes[DIR_SERV_PROGID].getService(); if (directory_service) directory_service = locator_service.QueryInterface(nsIProperties); /* if <profile>/panels.rdf doesn't exist, get will copy *bin/defaults/profile/panels.rdf to <profile>/panels.rdf */ var sidebar_file = directory_service.get(panels_file_id, nsIFile); if (!sidebar_file.exists()) { /* this should not happen, as GetFileLocation() should copy * defaults/panels.rdf to the users profile directory */ debug("sidebar file does not exist"); return null; } var file_url = Components.classes[STD_URL_PROGID].createInstance(nsIFileURL); file_url.file = sidebar_file; debug("sidebar uri is " + file_url.spec); return file_url.spec; } catch (ex) { /* this should not happen */ debug("caught " + ex + " getting sidebar datasource uri"); return null; }} |
var file_url = Components.classes[STD_URL_PROGID].createInstance(nsIFileURL); | var file_url = Components.classes[STD_URL_PROGID].createInstance(Components.interfaces.nsIFileURL); | function getSidebarDatasourceURI(panels_file_id){ try { /* use the fileLocator to look in the profile directory * to find 'panels.rdf', which is the * database of the user's currently selected panels. */ var directory_service = Components.classes[DIR_SERV_PROGID].getService(); if (directory_service) directory_service = locator_service.QueryInterface(nsIProperties); /* if <profile>/panels.rdf doesn't exist, get will copy *bin/defaults/profile/panels.rdf to <profile>/panels.rdf */ var sidebar_file = directory_service.get(panels_file_id, nsIFile); if (!sidebar_file.exists()) { /* this should not happen, as GetFileLocation() should copy * defaults/panels.rdf to the users profile directory */ debug("sidebar file does not exist"); return null; } var file_url = Components.classes[STD_URL_PROGID].createInstance(nsIFileURL); file_url.file = sidebar_file; debug("sidebar uri is " + file_url.spec); return file_url.spec; } catch (ex) { /* this should not happen */ debug("caught " + ex + " getting sidebar datasource uri"); return null; }} |
if (item.href != null) | if ("href" in item && item.href) | function getSource(item){ // Return the correct source without strict warnings if (item.href != null) return item.href; if (item.src != null) return item.src; return null;} |
if (item.src != null) | if ("src" in item && item.src) | function getSource(item){ // Return the correct source without strict warnings if (item.href != null) return item.href; if (item.src != null) return item.src; return null;} |
formsArray = framesArray[frame].document.forms; state = getStateFromFormsArray(formsArray, captureOrPrefill, threshhold); if (state == enable) { if (elementCount > threshhold) { gIsEncrypted = -1; return enable; | var frameDocument = framesArray[frame].document; if (frameDocument) { formsArray = frameDocument.forms; state = getStateFromFormsArray(formsArray, captureOrPrefill, threshhold); if (state == enable) { if (elementCount > threshhold) { gIsEncrypted = -1; return enable; } bestState = enable; } else if (state == disable && bestState == hide) { bestState = disable; | function getState(captureOrPrefill, threshhold) { if (!window._content || !window._content.document) { return hide; } var document = window._content.document; if (!("forms" in document)) { // this will occur if document is xul document instead of html document for example return hide; } // test for wallet service being available if (gWalletService == -1) gWalletService = Components.classes["@mozilla.org/wallet/wallet-service;1"] .getService(Components.interfaces.nsIWalletService); if (!gWalletService) { return hide; } var bestState = hide; var state; elementCount = 0; // process frames if any var formsArray; var framesArray = window._content.frames; if (framesArray.length != 0) { var frame; for (frame=0; frame<framesArray.length; ++frame) { formsArray = framesArray[frame].document.forms; state = getStateFromFormsArray(formsArray, captureOrPrefill, threshhold); if (state == enable) { if (elementCount > threshhold) { gIsEncrypted = -1; return enable; } bestState = enable; } else if (state == disable && bestState == hide) { bestState = disable; } } } // process top-level document formsArray = document.forms; state = getStateFromFormsArray(formsArray, captureOrPrefill, threshhold); gIsEncrypted = -1; if (state == enable) { if (elementCount > threshhold) { return enable; } bestState = enable; } else if (state == disable && bestState == hide) { bestState = disable; } // if we got here, then there was no text (or select) element with a value // or there were too few text (or select) elements if (elementCount > threshhold) { // no text (or select) element with a value return bestState; } // too few text (or select) elements return hide; } |
bestState = enable; } else if (state == disable && bestState == hide) { bestState = disable; | function getState(captureOrPrefill, threshhold) { if (!window._content || !window._content.document) { return hide; } var document = window._content.document; if (!("forms" in document)) { // this will occur if document is xul document instead of html document for example return hide; } // test for wallet service being available if (gWalletService == -1) gWalletService = Components.classes["@mozilla.org/wallet/wallet-service;1"] .getService(Components.interfaces.nsIWalletService); if (!gWalletService) { return hide; } var bestState = hide; var state; elementCount = 0; // process frames if any var formsArray; var framesArray = window._content.frames; if (framesArray.length != 0) { var frame; for (frame=0; frame<framesArray.length; ++frame) { formsArray = framesArray[frame].document.forms; state = getStateFromFormsArray(formsArray, captureOrPrefill, threshhold); if (state == enable) { if (elementCount > threshhold) { gIsEncrypted = -1; return enable; } bestState = enable; } else if (state == disable && bestState == hide) { bestState = disable; } } } // process top-level document formsArray = document.forms; state = getStateFromFormsArray(formsArray, captureOrPrefill, threshhold); gIsEncrypted = -1; if (state == enable) { if (elementCount > threshhold) { return enable; } bestState = enable; } else if (state == disable && bestState == hide) { bestState = disable; } // if we got here, then there was no text (or select) element with a value // or there were too few text (or select) elements if (elementCount > threshhold) { // no text (or select) element with a value return bestState; } // too few text (or select) elements return hide; } |
|
if ( !dialog.strings[ stringId ] ) { var elem = document.getElementById( "dialog.strings."+stringId ); if ( elem | if ( !( stringId in dialog.strings ) ) { var elem = document.getElementById( "dialog.strings."+stringId ); if ( elem | function getString( stringId ) { // Check if we've fetched this string already. if ( !dialog.strings[ stringId ] ) { // Try to get it. var elem = document.getElementById( "dialog.strings."+stringId ); if ( elem && elem.childNodes && elem.childNodes[0] && elem.childNodes[0].nodeValue ) { dialog.strings[ stringId ] = elem.childNodes[0].nodeValue; } else { // If unable to fetch string, use an empty string. dialog.strings[ stringId ] = ""; } } return dialog.strings[ stringId ];} |
elem.childNodes | elem.firstChild | function getString( stringId ) { // Check if we've fetched this string already. if ( !dialog.strings[ stringId ] ) { // Try to get it. var elem = document.getElementById( "dialog.strings."+stringId ); if ( elem && elem.childNodes && elem.childNodes[0] && elem.childNodes[0].nodeValue ) { dialog.strings[ stringId ] = elem.childNodes[0].nodeValue; } else { // If unable to fetch string, use an empty string. dialog.strings[ stringId ] = ""; } } return dialog.strings[ stringId ];} |
elem.childNodes[0] && elem.childNodes[0].nodeValue ) { dialog.strings[ stringId ] = elem.childNodes[0].nodeValue; } else { dialog.strings[ stringId ] = ""; } } return dialog.strings[ stringId ]; | elem.firstChild.nodeValue ) { dialog.strings[ stringId ] = elem.firstChild.nodeValue; } else { dialog.strings[ stringId ] = ""; } } return dialog.strings[ stringId ]; | function getString( stringId ) { // Check if we've fetched this string already. if ( !dialog.strings[ stringId ] ) { // Try to get it. var elem = document.getElementById( "dialog.strings."+stringId ); if ( elem && elem.childNodes && elem.childNodes[0] && elem.childNodes[0].nodeValue ) { dialog.strings[ stringId ] = elem.childNodes[0].nodeValue; } else { // If unable to fetch string, use an empty string. dialog.strings[ stringId ] = ""; } } return dialog.strings[ stringId ];} |
var appLocale = ls.GetApplicationLocale(); | var appLocale = ls.getApplicationLocale(); | function getStringBundle(){ const bundleURL = "chrome://communicator/locale/contentAreaCommands.properties"; const sbsContractID = "@mozilla.org/intl/stringbundle;1"; const sbsIID = Components.interfaces.nsIStringBundleService; const sbs = Components.classes[sbsContractID].getService(sbsIID); const lsContractID = "@mozilla.org/intl/nslocaleservice;1"; const lsIID = Components.interfaces.nsILocaleService; const ls = Components.classes[lsContractID].getService(lsIID); var appLocale = ls.GetApplicationLocale(); return sbs.createBundle(bundleURL, appLocale); } |
var stringBundleService = Components.classes["component: | var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(); | function getStringBundle(aURL) { var stringBundleService = Components.classes["component://netscape/intl/stringbundle"].getService(); stringBundleService = stringBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); var appLocale; var localeService = Components.classes["component://netscape/intl/nslocaleservice"].getService(); if (localeService) localeService = localeService.QueryInterface(Components.interfaces.nsILocaleService); if (localeService) appLocale = localeService.GetApplicationLocale(); var stringBundle = stringBundleService.CreateBundle(aURL, appLocale); if (stringBundle) return stringBundle.QueryInterface(Components.interfaces.nsIStringBundle);} |
var localeService = Components.classes["component: | var localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"].getService(); | function getStringBundle(aURL) { var stringBundleService = Components.classes["component://netscape/intl/stringbundle"].getService(); stringBundleService = stringBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); var appLocale; var localeService = Components.classes["component://netscape/intl/nslocaleservice"].getService(); if (localeService) localeService = localeService.QueryInterface(Components.interfaces.nsILocaleService); if (localeService) appLocale = localeService.GetApplicationLocale(); var stringBundle = stringBundleService.CreateBundle(aURL, appLocale); if (stringBundle) return stringBundle.QueryInterface(Components.interfaces.nsIStringBundle);} |
}, | } | getSupportedFlavours: function () { var flavourSet = new FlavourSet(); flavourSet.appendFlavour("text/x-moz-url"); flavourSet.appendFlavour("text/unicode"); flavourSet.appendFlavour("application/x-moz-file", "nsIFile"); return flavourSet; }, |
var flavourList = { }; flavourList["text/x-moz-url"] = { width: 2, iid: "nsISupportsWString" }; flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" }; flavourList["application/x-moz-file"] = { width: 2, iid: "nsIFile" }; return flavourList; | var flavourSet = new FlavourSet(); flavourSet.appendFlavour("application/x-moz-file", "nsIFile"); flavourSet.appendFlavour("text/x-moz-url"); flavourSet.appendFlavour("text/unicode"); return flavourSet; | getSupportedFlavours: function () { var flavourList = { }; flavourList["text/x-moz-url"] = { width: 2, iid: "nsISupportsWString" }; flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" }; flavourList["application/x-moz-file"] = { width: 2, iid: "nsIFile" }; return flavourList; }, |
browser.setAttribute ("onclick", "focusInput()"); | function getTabForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTabForObject **"); dd (getStackTrace()); return null; } switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCClient": name = source.name; break; case "IRCChannel": name = source.unicodeName; break; default: dd ("** INVALID OBJECT passed to getTabForObject **"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { if (!("messages" in source) || source.messages == null) createMessages(source); var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute ("href", source.getURL()); tb.setAttribute ("name", source.name); tb.setAttribute ("onclick", "onTabClick(" + id.quote() + ");"); tb.setAttribute ("crop", "right"); tb.setAttribute ("class", "tab-bottom view-button"); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild (tb); var browser = document.createElement ("browser"); browser.setAttribute ("class", "output-container"); browser.setAttribute ("type", "content"); browser.setAttribute ("flex", "1"); browser.setAttribute ("tooltip", "aHTMLTooltip"); browser.setAttribute ("context", "outputContext"); //browser.setAttribute ("onload", "scrollDown(true);"); browser.setAttribute ("onclick", "focusInput()"); browser.setAttribute ("ondragover", "nsDragAndDrop.dragOver(event, contentDropObserver);"); browser.setAttribute ("ondragdrop", "nsDragAndDrop.drop(event, contentDropObserver);"); browser.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, contentAreaDNDObserver);"); browser.source = source; source.frame = browser; client.deck.appendChild (browser); syncOutputFrame (browser); } return tb; } |
|
function gettabmatch_usr (line, wordStart, wordEnd, word, cursorpos) | function gettabmatch_usr (line, wordStart, wordEnd, word, cursorPos) | function gettabmatch_usr (line, wordStart, wordEnd, word, cursorpos){ if (wordStart == 0 && line[0] == client.COMMAND_CHAR) return client.performTabMatch (line, wordStart, wordEnd, word, cursorpos); if (!("users" in this)) return []; var users = this.users; var nicks = new Array(); for (var n in users) nicks.push (users[n].nick); var matches = matchEntry (word, nicks); if (matches.length == 1) { matches[0] = this.users[matches[0]].properNick; if (wordStart == 0) matches[0] += client.ADDRESSED_NICK_SEP; if (wordEnd == line.length) { /* add a space if the word is at the end of the line. */ matches[0] += " "; } } return matches;} |
if (wordStart == 0 && line[0] == client.COMMAND_CHAR) return client.performTabMatch (line, wordStart, wordEnd, word, cursorpos); if (!("users" in this)) return []; var users = this.users; var nicks = new Array(); for (var n in users) nicks.push (users[n].nick); var matches = matchEntry (word, nicks); if (matches.length == 1) | if (wordStart != 0 || line[0] != client.COMMAND_CHAR) return null; var matches = client.commands.listNames(word.substr(1)); if (matches.length == 1 && wordEnd == line.length) | function gettabmatch_usr (line, wordStart, wordEnd, word, cursorpos){ if (wordStart == 0 && line[0] == client.COMMAND_CHAR) return client.performTabMatch (line, wordStart, wordEnd, word, cursorpos); if (!("users" in this)) return []; var users = this.users; var nicks = new Array(); for (var n in users) nicks.push (users[n].nick); var matches = matchEntry (word, nicks); if (matches.length == 1) { matches[0] = this.users[matches[0]].properNick; if (wordStart == 0) matches[0] += client.ADDRESSED_NICK_SEP; if (wordEnd == line.length) { /* add a space if the word is at the end of the line. */ matches[0] += " "; } } return matches;} |
matches[0] = this.users[matches[0]].properNick; if (wordStart == 0) matches[0] += client.ADDRESSED_NICK_SEP; if (wordEnd == line.length) { matches[0] += " "; } | matches[0] = client.COMMAND_CHAR + matches[0] + " "; } else { for (var i in matches) matches[i] = client.COMMAND_CHAR + matches[i]; | function gettabmatch_usr (line, wordStart, wordEnd, word, cursorpos){ if (wordStart == 0 && line[0] == client.COMMAND_CHAR) return client.performTabMatch (line, wordStart, wordEnd, word, cursorpos); if (!("users" in this)) return []; var users = this.users; var nicks = new Array(); for (var n in users) nicks.push (users[n].nick); var matches = matchEntry (word, nicks); if (matches.length == 1) { matches[0] = this.users[matches[0]].properNick; if (wordStart == 0) matches[0] += client.ADDRESSED_NICK_SEP; if (wordEnd == line.length) { /* add a space if the word is at the end of the line. */ matches[0] += " "; } } return matches;} |
var taskTable = gEventSource.getAllToDos(); | taskTable = gEventSource.getAllToDos(); | function getTaskTable( ){ var taskTable; gICalLib.resetFilter(); if( document.getElementById( "only-completed-checkbox" ).getAttribute( "checked" ) == "true" ) { var now = new Date(); gICalLib.filter.completed.setTime( now ); } var taskTable = gEventSource.getAllToDos(); return( taskTable );} |
tb = document.createElement ("titledbutton"); | tb = document.createElement ("button"); | function getTBForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTBForObject **"); dd (getStackTrace()); return; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTBForObject **"); return; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) if (client.viewsArray[i].source == source) tb = client.viewsArray[i].tb; else if (client.viewsArray[i].tb.id == id) id = "tb[" + name + "<" + (++matches) + ">]"; if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar"); var tbi = document.createElement ("toolbaritem"); tbi.setAttribute ("onclick", "onTBIClick('" + id + "')"); tb = document.createElement ("titledbutton"); tb.setAttribute ("class", "activity-button"); tb.setAttribute ("id", id); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute ("value", name + "<" + matches + ">"); else tb.setAttribute ("value", name); tbi.appendChild (tb); views.appendChild (tbi); } return tb; } |
tb = document.createElement ("menubutton"); | tb = document.createElement ("tab"); | function getTBForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTBForObject **"); dd (getStackTrace()); return null; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTBForObject **"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("menubutton"); tb.setAttribute ("onclick", "onTBIClick('" + id + "');"); //tb.addEventListener("command", onTBIClickTempHandler, false); var aclass = (client.ICONS_IN_TOOLBAR) ? "activity-button-image" : "activity-button-text"; tb.setAttribute ("class", "menubutton " + aclass); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute ("value", name + "<" + matches + ">"); else tb.setAttribute ("value", name); views.appendChild (tb); } return tb; } |
var aclass = (client.ICONS_IN_TOOLBAR) ? "activity-button-image" : "activity-button-text"; tb.setAttribute ("class", "menubutton " + aclass); | tb.setAttribute ("class", "tab-bottom view-button"); | function getTBForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTBForObject **"); dd (getStackTrace()); return null; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTBForObject **"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("menubutton"); tb.setAttribute ("onclick", "onTBIClick('" + id + "');"); //tb.addEventListener("command", onTBIClickTempHandler, false); var aclass = (client.ICONS_IN_TOOLBAR) ? "activity-button-image" : "activity-button-text"; tb.setAttribute ("class", "menubutton " + aclass); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute ("value", name + "<" + matches + ">"); else tb.setAttribute ("value", name); views.appendChild (tb); } return tb; } |
function getText(id) | DWRUtil.getText = function(id) | function getText(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (!isHTMLSelectElement(ele)) { alert("getText() can only be used with select elements. Attempt to use: " + detailedTypeOf(ele)); throw ele; } // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].text; } else { return ""; }} |
alert("Element id: "+id+" not found."); | alert("getText() can't find an element with id: " + id + "."); | function getText(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (!isHTMLSelectElement(ele)) { alert("getText() can only be used with select elements. Attempt to use: " + detailedTypeOf(ele)); throw ele; } // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].text; } else { return ""; }} |
if (!isHTMLSelectElement(ele)) | if (!DWRUtil.isHTMLSelectElement(ele)) | function getText(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (!isHTMLSelectElement(ele)) { alert("getText() can only be used with select elements. Attempt to use: " + detailedTypeOf(ele)); throw ele; } // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].text; } else { return ""; }} |
alert("getText() can only be used with select elements. Attempt to use: " + detailedTypeOf(ele)); | alert("getText() can only be used with select elements. Attempt to use: " + DWRUtil.detailedTypeOf(ele)); | function getText(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (!isHTMLSelectElement(ele)) { alert("getText() can only be used with select elements. Attempt to use: " + detailedTypeOf(ele)); throw ele; } // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].text; } else { return ""; }} |
var splitter = document.getElementById('gray_horizontal_splitter'); | var splitter = document.getElementById('threadpane-splitter'); | function GetThreadAndMessagePaneSplitter(){ if(gThreadAndMessagePaneSplitter) return gThreadAndMessagePaneSplitter; var splitter = document.getElementById('gray_horizontal_splitter'); gThreadAndMessagePaneSplitter = splitter; return splitter;} |
if(!threadTree) dump('thread tree is null\n'); | function GetThreadTree(){ if (gThreadTree) return gThreadTree; var threadTree = document.getElementById('threadTree'); if(!threadTree) dump('thread tree is null\n'); gThreadTree = threadTree; return threadTree;} |
|
return false; | function getToDoFromEvent( event ){ var tree = document.getElementById( ToDoUnifinderTreeName ); var row = new Object(); tree.treeBoxObject.getCellAt( event.clientX, event.clientY, row, {}, {} ); if( row.value != -1 && row.value < tree.view.rowCount ) { return( tree.taskView.getCalendarTaskAtRow( row.value ) ); }} |
|
return gCalendarBundle.getString("statusNeedsAction"); | return calGetString('calendar', "statusNeedsAction"); | function getToDoStatusString(iCalToDo){ switch( iCalToDo.status ) { // Todo status keywords are specified in RFC2445sec4.8.1.11 case "NEEDS-ACTION": return gCalendarBundle.getString("statusNeedsAction"); case "IN-PROCESS": return gCalendarBundle.getString("statusInProcess"); case "CANCELLED": return gCalendarBundle.getString("statusCancelled"); case "COMPLETED": return gCalendarBundle.getString("statusCompleted"); default: return ""; }} |
return gCalendarBundle.getString("statusInProcess"); | return calGetString('calendar', "statusInProcess"); | function getToDoStatusString(iCalToDo){ switch( iCalToDo.status ) { // Todo status keywords are specified in RFC2445sec4.8.1.11 case "NEEDS-ACTION": return gCalendarBundle.getString("statusNeedsAction"); case "IN-PROCESS": return gCalendarBundle.getString("statusInProcess"); case "CANCELLED": return gCalendarBundle.getString("statusCancelled"); case "COMPLETED": return gCalendarBundle.getString("statusCompleted"); default: return ""; }} |
return gCalendarBundle.getString("statusCancelled"); | return calGetString('calendar', "statusCancelled"); | function getToDoStatusString(iCalToDo){ switch( iCalToDo.status ) { // Todo status keywords are specified in RFC2445sec4.8.1.11 case "NEEDS-ACTION": return gCalendarBundle.getString("statusNeedsAction"); case "IN-PROCESS": return gCalendarBundle.getString("statusInProcess"); case "CANCELLED": return gCalendarBundle.getString("statusCancelled"); case "COMPLETED": return gCalendarBundle.getString("statusCompleted"); default: return ""; }} |
return gCalendarBundle.getString("statusCompleted"); | return calGetString('calendar', "statusCompleted"); | function getToDoStatusString(iCalToDo){ switch( iCalToDo.status ) { // Todo status keywords are specified in RFC2445sec4.8.1.11 case "NEEDS-ACTION": return gCalendarBundle.getString("statusNeedsAction"); case "IN-PROCESS": return gCalendarBundle.getString("statusInProcess"); case "CANCELLED": return gCalendarBundle.getString("statusCancelled"); case "COMPLETED": return gCalendarBundle.getString("statusCompleted"); default: return ""; }} |
if (l.offsetParent) return (l.offsetTop + GetTop(l.offsetParent)) else return (l.offsetTop) | if (l.offsetParent) return (l.offsetTop + GetTop(l.offsetParent)); else return (l.offsetTop); | function GetTop(l) { if (l.offsetParent) return (l.offsetTop + GetTop(l.offsetParent)) else return (l.offsetTop)} |
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" ); if (topWindowOfType) { return topWindowOfType; } return null; | var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'] .getService(Components.interfaces.nsIWindowMediator); return windowManager.getMostRecentWindow("navigator:browser"); | function getTopWin(){ var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" ); if (topWindowOfType) { return topWindowOfType; } return null;} |
if (!url) | if (!urlspec) | function GetUsername(urlspec){ if (!url) return ""; var IOService = GetIOService(); if (!IOService) return ""; var username = ""; try { username = IOService.newURI(urlspec, null, null).username; } catch (e) {} return username;} |
var element = $(element); | element = $(element); | getValue: function(element) { var element = $(element); var method = element.tagName.toLowerCase(); var parameter = Form.Element.Serializers[method](element); if (parameter) return parameter[1]; } |
function getValue(id) | DWRUtil.getValue = function(id) | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLTextAreaElement(ele)) { return ele.value; } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
alert("Element id: "+id+" not found."); | alert("getValue() can't find an element with id: " + id + "."); | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLTextAreaElement(ele)) { return ele.value; } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
if (isHTMLSelectElement(ele)) | if (DWRUtil.isHTMLSelectElement(ele)) | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLTextAreaElement(ele)) { return ele.value; } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
if (isHTMLInputElement(ele)) | if (DWRUtil.isHTMLInputElement(ele)) | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLTextAreaElement(ele)) { return ele.value; } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
alert("Not sure how to setValue on a input element of type " + ele.type); | alert("Not sure how to getValue on a input element of type " + ele.type); | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLTextAreaElement(ele)) { return ele.value; } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
if (isHTMLTextAreaElement(ele)) | if (DWRUtil.isHTMLTextAreaElement(ele)) | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLTextAreaElement(ele)) { return ele.value; } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
if (isHTMLElement(ele)) | if (DWRUtil.isHTMLElement(ele)) | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); throw id; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLTextAreaElement(ele)) { return ele.value; } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
return; | throw id; | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); return; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": case "textarea": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
case "textarea": | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); return; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": case "textarea": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
|
} if (isHTMLTextAreaElement(ele)) { return ele.value; | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); return; } if (isHTMLSelectElement(ele)) { // This is a bit of a scam because it assumes single select // but I'm not sure how we should treat multi-select. var sel = ele.selectedIndex; if (sel != -1) { return ele.options[sel].value; } else { return ""; } } if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": case "textarea": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLElement(ele)) { return ele.innerHTML; } alert("Not sure how to getValue from a " + ele); return ele.innerHTML;} |
|
if (ele instanceof HTMLInputElement) | if (isHTMLSelectElement(ele)) | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); return; } if (ele instanceof HTMLInputElement) { return ele.value; } else if (ele instanceof HTMLSpanElement || ele instanceof HTMLDivElement) { return ele.innerHTML; } else { alert("Not sure how to getValue from a " + ele); }} |
return ele.value; | for (var i = 0; i < ele.options.length; i++) { if (ele.options[i].selected == true) { return ele.options[i].value; } } return ""; | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); return; } if (ele instanceof HTMLInputElement) { return ele.value; } else if (ele instanceof HTMLSpanElement || ele instanceof HTMLDivElement) { return ele.innerHTML; } else { alert("Not sure how to getValue from a " + ele); }} |
else if (ele instanceof HTMLSpanElement || ele instanceof HTMLDivElement) | if (isHTMLInputElement(ele)) { switch (ele.type) { case "check-box": case "radio": return ele.checked; case "hidden": case "text": case "textarea": return ele.value; default: alert("Not sure how to setValue on a input element of type " + ele.type); return ele.value; } } if (isHTMLElement(ele)) | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); return; } if (ele instanceof HTMLInputElement) { return ele.value; } else if (ele instanceof HTMLSpanElement || ele instanceof HTMLDivElement) { return ele.innerHTML; } else { alert("Not sure how to getValue from a " + ele); }} |
else { alert("Not sure how to getValue from a " + ele); } | alert("Not sure how to getValue from a " + ele); return ele.innerHTML; | function getValue(id){ var ele = document.getElementById(id); if (ele == null) { alert("Element id: "+id+" not found."); return; } if (ele instanceof HTMLInputElement) { return ele.value; } else if (ele instanceof HTMLSpanElement || ele instanceof HTMLDivElement) { return ele.innerHTML; } else { alert("Not sure how to getValue from a " + ele); }} |
function getValueText(linkNode) | function getValueText(node) | function getValueText(linkNode){ var valueText = ""; var length = linkNode.childNodes.length; for (var i = 0; i < length; i++) { var childNode = linkNode.childNodes[i]; var nodeType = childNode.nodeType; if (nodeType == Node.TEXT_NODE) valueText += " " + childNode.nodeValue; else if (nodeType == Node.ELEMENT_NODE) { if (childNode instanceof nsIImageElement) valueText += " " + getAltText(childNode); else valueText += " " + getValueText(childNode); } } return stripWS(valueText);} |
var length = linkNode.childNodes.length; | if (node instanceof nsIInputElement || node instanceof nsISelectElement || node instanceof nsITextareaElement) return valueText; var length = node.childNodes.length; | function getValueText(linkNode){ var valueText = ""; var length = linkNode.childNodes.length; for (var i = 0; i < length; i++) { var childNode = linkNode.childNodes[i]; var nodeType = childNode.nodeType; if (nodeType == Node.TEXT_NODE) valueText += " " + childNode.nodeValue; else if (nodeType == Node.ELEMENT_NODE) { if (childNode instanceof nsIImageElement) valueText += " " + getAltText(childNode); else valueText += " " + getValueText(childNode); } } return stripWS(valueText);} |
var childNode = linkNode.childNodes[i]; | var childNode = node.childNodes[i]; | function getValueText(linkNode){ var valueText = ""; var length = linkNode.childNodes.length; for (var i = 0; i < length; i++) { var childNode = linkNode.childNodes[i]; var nodeType = childNode.nodeType; if (nodeType == Node.TEXT_NODE) valueText += " " + childNode.nodeValue; else if (nodeType == Node.ELEMENT_NODE) { if (childNode instanceof nsIImageElement) valueText += " " + getAltText(childNode); else valueText += " " + getValueText(childNode); } } return stripWS(valueText);} |
if (childNode.nodeName.toLowerCase() == "img") | if (childNode instanceof nsIImageElement) | function getValueText(linkNode){ var valueText = ""; var length = linkNode.childNodes.length; for (var i = 0; i < length; i++) { var childNode = linkNode.childNodes[i]; var nodeType = childNode.nodeType; if (nodeType == Node.TEXT_NODE) valueText += " " + childNode.nodeValue; else if (nodeType == Node.ELEMENT_NODE) { if (childNode.nodeName.toLowerCase() == "img") valueText += " " + getAltText(childNode); else valueText += " " + getValueText(childNode); } } return stripWS(valueText);} |
return gBrowser.webNavigation; | return helpBrowser.webNavigation; | function getWebNavigation(){ return gBrowser.webNavigation;} |
return document.getElementById("content").webNavigation; | return getPPBrowser().webNavigation; | function getWebNavigation(){ try { return document.getElementById("content").webNavigation; } catch (e) { return null; }} |
var startTime = getDateTimeFieldValue( "start-date-text" ); | var startTime = document.getElementById( "start-date-picker" ).value; | function getWeekNumberOfMonth(){ //get the day number for today. var startTime = getDateTimeFieldValue( "start-date-text" ); var oldStartTime = startTime; var thisMonth = startTime.getMonth(); var monthToCompare = thisMonth; var weekNumber = 0; while( monthToCompare == thisMonth ) { startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) ); monthToCompare = startTime.getMonth(); weekNumber++; } return( weekNumber );} |
var startTime = document.getElementById( "start-date-picker" ).value; | var startTime = document.getElementById( "start-datetime" ).value; | function getWeekNumberOfMonth(){ //get the day number for today. var startTime = document.getElementById( "start-date-picker" ).value; var oldStartTime = startTime; var thisMonth = startTime.getMonth(); var monthToCompare = thisMonth; var weekNumber = 0; while( monthToCompare == thisMonth ) { startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) ); monthToCompare = startTime.getMonth(); weekNumber++; } return( weekNumber );} |
const WM_PROGID = "component: var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator"); | const WM_CONTRACTID = "@mozilla.org/rdf/datasource?name=window-mediator;1"; var wm = nsJSComponentManager.getService(WM_CONTRACTID, "nsIWindowMediator"); | getWindow: function (aWindowType) { const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator"; var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator"); return wm.getMostRecentWindow(aWindowType); } |
load_relative_url(url); | load_absolute_url(url); | function go_to (url) { if ( typeof sidebar != "undefined" && sidebar == 1 ) { load_relative_url(url); } else { document.location.href = url; }} |
var pref = Components.classes["component: | var pref = Components.classes["@mozilla.org/preferences;1"].getService(); | function goAboutDialog(){ var defaultAboutState = false; try { var pref = Components.classes["component://netscape/preferences"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); defaultAboutState = pref.GetBoolPref("browser.show_about_as_stupid_modal_window"); } catch(e) { defaultAboutState = false; } if( defaultAboutState ) window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550"); else window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'chrome://global/locale/about.html' );} |
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'chrome: | window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'about:' ); | function goAboutDialog(){ var defaultAboutState = false; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); defaultAboutState = pref.GetBoolPref("browser.show_about_as_stupid_modal_window"); } catch(e) { defaultAboutState = false; } if( defaultAboutState ) window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550"); else window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'chrome://global/locale/about.html' );} |
window.openDialog( "chrome: | window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'chrome: | function goAboutDialog(){ var defaultAboutState = false; try { var pref = Components.classes["component://netscape/preferences"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); defaultAboutState = pref.GetBoolPref("browser.show_about_as_stupid_modal_window"); } catch(e) { defaultAboutState = false; } if( defaultAboutState ) window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550"); else window.openDialog( "chrome://navigator/content/navigator.xul", "_blank", "chrome,all,dialog=no", 'chrome://global/content/about.html' );} |
var pref = Components.classes["component: | var pref = Components.classes["@mozilla.org/preferences;1"].getService(); | function goClickThrobber( urlPref ){ var url; try { var pref = Components.classes["component://netscape/preferences"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); url = pref.getLocalizedUnicharPref(urlPref); } catch(e) { url = null; } if ( url ) openTopWin(url);} |
var cmdController; try | if (controller instanceof Components.interfaces.nsICommandController) | function goDoCommandParams(command, params){ try { var controller = top.document.commandDispatcher.getControllerForCommand(command); if (controller && controller.isCommandEnabled(command)) { var cmdController; try { cmdController = controller.QueryInterface(Components.interfaces.nsICommandController); } catch(e) {} if (cmdController) { cmdController.doCommandWithParams(command, params); // the following two lines should be removed when we implement observers if (params) cmdController.getCommandStateWithParams(command, params); } else { controller.doCommand(command); } ResetStructToolbar(); } } catch (e) { dump("An error occurred executing the "+command+" command\n"); }} |
cmdController = controller.QueryInterface(Components.interfaces.nsICommandController); } catch(e) {} if (cmdController) { cmdController.doCommandWithParams(command, params); | controller.doCommandWithParams(command, params); | function goDoCommandParams(command, params){ try { var controller = top.document.commandDispatcher.getControllerForCommand(command); if (controller && controller.isCommandEnabled(command)) { var cmdController; try { cmdController = controller.QueryInterface(Components.interfaces.nsICommandController); } catch(e) {} if (cmdController) { cmdController.doCommandWithParams(command, params); // the following two lines should be removed when we implement observers if (params) cmdController.getCommandStateWithParams(command, params); } else { controller.doCommand(command); } ResetStructToolbar(); } } catch (e) { dump("An error occurred executing the "+command+" command\n"); }} |
cmdController.getCommandStateWithParams(command, params); | controller.getCommandStateWithParams(command, params); | function goDoCommandParams(command, params){ try { var controller = top.document.commandDispatcher.getControllerForCommand(command); if (controller && controller.isCommandEnabled(command)) { var cmdController; try { cmdController = controller.QueryInterface(Components.interfaces.nsICommandController); } catch(e) {} if (cmdController) { cmdController.doCommandWithParams(command, params); // the following two lines should be removed when we implement observers if (params) cmdController.getCommandStateWithParams(command, params); } else { controller.doCommand(command); } ResetStructToolbar(); } } catch (e) { dump("An error occurred executing the "+command+" command\n"); }} |
"chrome,resizeable=no,modal", | "chrome,resizeable=no,modal,titlebar", | function goEditCardDialog(abURI, card, okCallback){ window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul", "", "chrome,resizeable=no,modal", {abURI:abURI, card:card, okCallback:okCallback});} |
"chrome,resizeable=no", | "chrome,titlebar,resizeable=no", | function goEditListDialog(abURI, listURI){ window.openDialog("chrome://messenger/content/addressbook/abEditListDialog.xul", "", "chrome,resizeable=no", {abURI:abURI, listURI:listURI});} |
window.openDialog( "chrome: | window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); | function goHelpMenu( url ){ /* note that this chrome url should probably change to not have all of the navigator controls */ /* also, do we want to limit the number of help windows that can be spawned? */ window.openDialog( "chrome://navigator/content/navigator.xul", "_blank", "chrome,all,dialog=no", url );} |
loadURI("chrome: | displayTopic(defaultTopic); | function goHome() { // load "Welcome" page loadURI("chrome://help/locale/welcome_help.html");} |
printingPromptService.showPageSetup(domwin, printSettings); | printingPromptService.showPageSetup(domwin, printSettings, null); | function goPageSetup(domwin, printSettings){ try { if (printSettings == null) { alert("PrintSettings arg is null!"); } // This code calls the printoptions service to bring up the printoptions // dialog. This will be an xp dialog if the platform did not override // the ShowPrintSetupDialog method. var printingPromptService = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"] .getService(Components.interfaces.nsIPrintingPromptService); printingPromptService.showPageSetup(domwin, printSettings); return true; } catch(e) { return false; }} |
var pref = Components.classes["component: | var pref = Components.classes["@mozilla.org/preferences;1"].getService(); | function goPreferences(id, paneURL, paneID){ var prefWindowModalityPref; try { var pref = Components.classes["component://netscape/preferences"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); if( pref ) prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = window.openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, paneID);} |
function goPreferences(id, paneURL, paneID) | function goPreferences(containerID, paneURL, itemID) | function goPreferences(id, paneURL, paneID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); if( pref ) prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = window.openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, paneID);} |
var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); if( pref ) prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); | var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); | function goPreferences(id, paneURL, paneID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); if( pref ) prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = window.openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, paneID);} |
var prefWindow = window.openDialog("chrome: | var prefWindow = openDialog("chrome: | function goPreferences(id, paneURL, paneID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); if( pref ) prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = window.openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, paneID);} |
var prefWindowModalityPref; | var modal, resizable; var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); | function goPreferences(containerID, paneURL, itemID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, containerID, itemID);} |
var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); | modal = pref.GetBoolPref( "browser.prefWindowModal"); | function goPreferences(containerID, paneURL, itemID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, containerID, itemID);} |
catch(e) { prefWindowModalityPref = true; | catch (e) { modal = true; | function goPreferences(containerID, paneURL, itemID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, containerID, itemID);} |
var modality = prefWindowModalityPref ? "yes" : "no"; | try { resizable = pref.GetBoolPref("xul.debug.box"); } catch (e) { resizable = false; } | function goPreferences(containerID, paneURL, itemID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, containerID, itemID);} |
var prefWindow = openDialog("chrome: | var modality = modal ? "yes" : "no"; var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,modal=" + modality + ",resizable=" + resizability; openDialog("chrome: features, paneURL, containerID, itemID); | function goPreferences(containerID, paneURL, itemID){ var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, containerID, itemID);} |
var modal = "yes"; if (!pref.GetBoolPref("browser.prefWindowModal")) modal = "no"; var prefWindow = window.openDialog("chrome: | var prefWindow = window.openDialog("chrome: | function goPreferences(id, pane){ var modal = "yes"; if (!pref.GetBoolPref("browser.prefWindowModal")) modal = "no"; var prefWindow = window.openDialog("chrome://pref/content/pref.xul","PrefWindow", "chrome,modal=" + modal + ",resizable=yes", pane);} |
var ObserverService = Components.classes["component: | var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); | function goQuitApplication(){ var ObserverService = Components.classes["component://netscape/observer-service"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); domWindow.focus(); if ( domWindow.tryToClose == null ) { // dump(" window.close \n"); domWindow.close(); } else { // dump(" try to close \n" ); if ( !domWindow.tryToClose() ) return false; } }; // call appshell exit var appShell = Components.classes['component://netscape/appshell/appShellService'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;} |
var windowManager = Components.classes['component: | var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); | function goQuitApplication(){ var ObserverService = Components.classes["component://netscape/observer-service"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); domWindow.focus(); if ( domWindow.tryToClose == null ) { // dump(" window.close \n"); domWindow.close(); } else { // dump(" try to close \n" ); if ( !domWindow.tryToClose() ) return false; } }; // call appshell exit var appShell = Components.classes['component://netscape/appshell/appShellService'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;} |
var appShell = Components.classes['component: | var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); | function goQuitApplication(){ var ObserverService = Components.classes["component://netscape/observer-service"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); domWindow.focus(); if ( domWindow.tryToClose == null ) { // dump(" window.close \n"); domWindow.close(); } else { // dump(" try to close \n" ); if ( !domWindow.tryToClose() ) return false; } }; // call appshell exit var appShell = Components.classes['component://netscape/appshell/appShellService'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;} |
var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); | function goQuitApplication(){ var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); if (!("tryToClose" in domWindow)) { // dump(" window.close \n"); domWindow.close(); } else { // dump(" try to close \n" ); if ( !domWindow.tryToClose() ) return false; } }; // call appshell exit var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;} |
|
if (!nativeAppSupport || !nativeAppSupport.isServerMode) appShell.quit(Components.interfaces.nsIAppShellService.eAttemptQuit); | appShell.quit(Components.interfaces.nsIAppShellService.eAttemptQuit); | function goQuitApplication(){ if (!canQuitApplication()) return; var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); var nativeAppSupport = null; try { nativeAppSupport = appShell.nativeAppSupport; } catch ( ex ) { } while ( enumerator.hasMoreElements() ) { var domWindow = enumerator.getNext(); if (("tryToClose" in domWindow) && !domWindow.tryToClose()) return false; domWindow.close(); }; if (!nativeAppSupport || !nativeAppSupport.isServerMode) appShell.quit(Components.interfaces.nsIAppShellService.eAttemptQuit); return true;} |
if (filePickerMode == nsIFilePicker.modeGetFolder) { textInput.value = ""; } | function gotoDirectory(directory) { window.setCursor("wait"); try { populateAncestorList(directory); treeView.setDirectory(directory); document.getElementById("errorShower").selectedIndex = 0; } catch(ex) { document.getElementById("errorShower").selectedIndex = 1; } window.setCursor("auto"); treeView.QueryInterface(nsITreeView).selection.clearSelection(); textInput.focus(); sfile = directory;} |
|
element.checked = isHidden; | element.setAttribute("checked", isHidden ? "true" : "false"); | function goToggleToolbar( id, elementID ){ var toolbar = document.getElementById(id); var element = document.getElementById(elementID); if (toolbar) { var isHidden = toolbar.hidden; toolbar.hidden = !isHidden; document.persist(id, 'hidden'); if (element) { element.checked = isHidden; document.persist(elementID, 'checked'); } }} |
var id = event.target.getAttribute("id"); | var id = aEvent.target.getAttribute("id"); | function gotoHistoryIndex( aEvent ) { var index = aEvent.target.getAttribute("index"); if (index) { appCore.gotoHistoryIndex(index); return true; } else { var id = event.target.getAttribute("id"); if (id == "menuitem-back") BrowserBack(); else if (id == "menuitem-forward") BrowserForward(); } } |
*/ | function gotoHistoryIndex(event) { dump("In gotoHistoryIndex\n"); var index = event.target.getAttribute("index"); if (index) { dump("gotoHistoryIndex:: Index = " + index); appCore.gotoHistoryIndex(index); return true; } else { var id = event.target.getAttribute("id"); if (id == "menuitem-back") BrowserBack(); else if (id == "menuitem-forward") BrowserForward(); } } |
|
function gotoHistoryIndex( aEvent ) { var index = aEvent.target.getAttribute("index"); if (index) { appCore.gotoHistoryIndex(index); return true; } return false; | function gotoHistoryIndex(aEvent) { var index = aEvent.target.getAttribute("index"); if (index) { getWebNavigation().gotoIndex(index); return true; | function gotoHistoryIndex( aEvent ) { var index = aEvent.target.getAttribute("index"); if (index) { appCore.gotoHistoryIndex(index); return true; } return false; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.