rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
if ((msgFolder.flags & flags) == 0) {
if (!msgFolder || ((msgFolder.flags & flags) == 0)) {
function IsSpecialFolder(msgFolder, flags){ if ((msgFolder.flags & flags) == 0) { return false; } else { return true; }}
var selectedFolder = GetThreadPaneFolder(); if (!selectedFolder) return false; if ((selectedFolder.flags & flags) == 0) {
var selectedFolder = GetThreadPaneFolder(); if (!selectedFolder || ((selectedFolder.flags & flags) == 0)) {
function IsSpecialFolderSelected(flags){ var selectedFolder = GetThreadPaneFolder(); if (!selectedFolder) return false; if ((selectedFolder.flags & flags) == 0) { return false; } else { return true; }}
if (gSoughtSpellChecker) return gHaveSpellChecker; var spellcheckerClass = Components.classes["@mozilla.org/spellchecker;1"]; gHaveSpellChecker = (spellcheckerClass != null); gSoughtSpellChecker = true; return gHaveSpellChecker;
return "@mozilla.org/spellchecker;1" in Components.classes;
function IsSpellCheckerInstalled(){ if (gSoughtSpellChecker) return gHaveSpellChecker; var spellcheckerClass = Components.classes["@mozilla.org/spellchecker;1"]; gHaveSpellChecker = (spellcheckerClass != null); gSoughtSpellChecker = true; //dump("Have SpellChecker = "+gHaveSpellChecker+"\n"); return gHaveSpellChecker;}
"failed: " + status );
"failed: " + errorToString(status) );
function issueSyncRequest( url, receiverFunc, bLogging ){ if (bLogging == undefined) bLogging = true; if (bLogging && LOG_LEVEL > 0) { logMessage( "issueSyncRequest( \"" + url + "\" )", "opening channel." ); } var channel = getIoService().newChannel( url, "" /* charset */, null /* baseURI */ ); channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE; var timer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); timer.initWithCallback( { // nsITimerCallback: notify: function( timer_ ) { if (channel.isPending()) channel.cancel(NS_BINDING_FAILED); } }, SYNC_REQUESTS_TIMEOUT * 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT ); var stream = channel.open(); timer.cancel(); var status = channel.status; if (status == Components.results.NS_OK) { var charset = channel.contentCharset; if (!charset || charset == "") charset = "UTF-8"; var str = streamToString( stream, charset ); if (bLogging && LOG_LEVEL > 1) { logMessage( "issueSyncRequest( \"" + url + "\" )", "returned: " + str ); } if (receiverFunc) { receiverFunc( str ); } return str; } else if (bLogging && LOG_LEVEL > 0) { logMessage( "issueSyncRequest( \"" + url + "\" )", "failed: " + status ); } throw new Components.Exception( bLogging ? ("issueSyncRequest( \"" + url + "\" ) failed.") : "issueSyncRequest() failed.", status );}
if (node.tagName.toUpperCase() == "INPUT") {
if (node.nodeType != Node.ELEMENT_NODE) return false; if (node.localName.toUpperCase() == "INPUT") {
isTargetATextBox : function ( node ) { if (node.tagName.toUpperCase() == "INPUT") { var attrib = node.getAttribute("type").toUpperCase(); return( (attrib != "IMAGE") && (attrib != "PASSWORD") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "FILE") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.tagName.toUpperCase() == "TEXTAREA"); } }
return(node.tagName.toUpperCase() == "TEXTAREA");
return(node.localName.toUpperCase() == "TEXTAREA");
isTargetATextBox : function ( node ) { if (node.tagName.toUpperCase() == "INPUT") { var attrib = node.getAttribute("type").toUpperCase(); return( (attrib != "IMAGE") && (attrib != "PASSWORD") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "FILE") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.tagName.toUpperCase() == "TEXTAREA"); } }
if (node.nodeType != Node.ELEMENT_NODE) return false;
if (node instanceof HTMLInputElement) return (node.type == "text" || node.type == "password")
isTargetATextBox : function ( node ) { if (node.nodeType != Node.ELEMENT_NODE) return false; if (node.localName.toUpperCase() == "INPUT") { var attrib = ""; var type = node.getAttribute("type"); if (type) attrib = type.toUpperCase(); return( (attrib != "IMAGE") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "FILE") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.localName.toUpperCase() == "TEXTAREA"); } },
if (node.localName.toUpperCase() == "INPUT") { var attrib = ""; var type = node.getAttribute("type"); if (type) attrib = type.toUpperCase(); return( (attrib != "IMAGE") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "FILE") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.localName.toUpperCase() == "TEXTAREA"); }
return (node instanceof HTMLTextAreaElement);
isTargetATextBox : function ( node ) { if (node.nodeType != Node.ELEMENT_NODE) return false; if (node.localName.toUpperCase() == "INPUT") { var attrib = ""; var type = node.getAttribute("type"); if (type) attrib = type.toUpperCase(); return( (attrib != "IMAGE") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "FILE") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.localName.toUpperCase() == "TEXTAREA"); } },
if (node.nodeType != Node.ELEMENT_NODE) return false;
if (node instanceof HTMLInputElement) return (node.type == "text" || node.type == "password")
isTargetATextBox : function ( node ) { if (node.nodeType != Node.ELEMENT_NODE) return false; if (node.localName.toUpperCase() == "INPUT") { var attrib = ""; var type = node.getAttribute("type"); if (type) attrib = type.toUpperCase(); return( (attrib != "IMAGE") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.localName.toUpperCase() == "TEXTAREA"); } },
if (node.localName.toUpperCase() == "INPUT") { var attrib = ""; var type = node.getAttribute("type"); if (type) attrib = type.toUpperCase(); return( (attrib != "IMAGE") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.localName.toUpperCase() == "TEXTAREA"); }
return (node instanceof HTMLTextAreaElement);
isTargetATextBox : function ( node ) { if (node.nodeType != Node.ELEMENT_NODE) return false; if (node.localName.toUpperCase() == "INPUT") { var attrib = ""; var type = node.getAttribute("type"); if (type) attrib = type.toUpperCase(); return( (attrib != "IMAGE") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.localName.toUpperCase() == "TEXTAREA"); } },
var attrib = node.getAttribute("type").toUpperCase();
var attrib = ""; var type = node.getAttribute("type"); if (type) attrib = type.toUpperCase();
isTargetATextBox : function ( node ) { if (node.nodeType != Node.ELEMENT_NODE) return false; if (node.localName.toUpperCase() == "INPUT") { var attrib = node.getAttribute("type").toUpperCase(); return( (attrib != "IMAGE") && (attrib != "PASSWORD") && (attrib != "CHECKBOX") && (attrib != "RADIO") && (attrib != "SUBMIT") && (attrib != "RESET") && (attrib != "FILE") && (attrib != "HIDDEN") && (attrib != "RESET") && (attrib != "BUTTON") ); } else { return(node.localName.toUpperCase() == "TEXTAREA"); } },
const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1"; const nsIXULAppInfo = Components.interfaces.nsIXULAppInfo;
function isThunderbird(){ var cls = Components.classes[XULAPPINFO_CONTRACTID]; if (!cls) return false; var appinfo; try { // This throws when it gets upset. appinfo = cls.getService(nsIXULAppInfo); } catch(ex) {} if (!appinfo) return false; return (appinfo.ID == "{3550f703-e582-4d05-9a08-453d09bdfdc6}");}
if (val.substring(0, 3) == "NC:") status.value = "";
if (val.substring(0, 3) == "NC:") status.label = "";
function itemSelect(){ var tree = document.getElementById("findresultstree"); if (tree.selectedItems.length == 1) { var status = document.getElementById("statusbar-display"); var val = getAbsoluteID("findresultstree", tree.selectedItems[0]); // Ignore "NC:" urls. if (val.substring(0, 3) == "NC:") status.value = ""; else status.value = val; }}
status.value = val;
status.label = val;
function itemSelect(){ var tree = document.getElementById("findresultstree"); if (tree.selectedItems.length == 1) { var status = document.getElementById("statusbar-display"); var val = getAbsoluteID("findresultstree", tree.selectedItems[0]); // Ignore "NC:" urls. if (val.substring(0, 3) == "NC:") status.value = ""; else status.value = val; }}
testcases[testcases.length] = new TestCase( SECTION, expectedResult +" == "+actualResult, expectedResult, actualResult );
new TestCase( SECTION, expectedResult +" == "+actualResult, expectedResult, actualResult );
function javaEquals(expectedResult, actualResult, message) { testcases[testcases.length] = new TestCase( SECTION, expectedResult +" == "+actualResult, expectedResult, actualResult );}
function javascriptEnabledChange(state){ changeDisabledState(!state);
function javascriptEnabledChange(){ if (document.getElementById('javascriptAllowMailNews')){ if (!document.getElementById('javascriptAllowNavigator').checked && !document.getElementById('javascriptAllowMailNews').checked) changeDisabledState(true); else changeDisabledState(false); } else { changeDisabledState(!document.getElementById('javascriptAllowNavigator').checked); }
function javascriptEnabledChange(state){ changeDisabledState(!state);}
var preferences = Components.classes['@mozilla.org/preferences;1'];
var preferences = Components.classes['@mozilla.org/preferences-service;1'];
function JavaScriptOptions(){ this.orig = {}; this.orig.strict = this.strict = false; this.orig.werror = this.werror = false; this.privileges = 'UniversalXPConnect UniversalPreferencesRead ' + 'UniversalPreferencesWrite'; if (typeof options == 'function') { // shell var optString = options(); if (optString) { var optList = optString.split(','); for (var iOpt = 0; iOpt < optList.length; iOpt++) { optName = optList[iOpt]; this[optName] = true; } } } else if (typeof document != 'undefined') { // browser netscape.security.PrivilegeManager.enablePrivilege(this.privileges); var preferences = Components.classes['@mozilla.org/preferences;1']; if (!preferences) { throw 'JavaScriptOptions: unable to get @mozilla.org/preference;1'; } var prefService = preferences. getService(Components.interfaces.nsIPrefService); if (!prefService) { throw 'JavaScriptOptions: unable to get nsIPrefService'; } var pref = prefService.getBranch(''); if (!pref) { throw 'JavaScriptOptions: unable to get prefService branch'; } try { this.orig.strict = this.strict = pref.getBoolPref('javascript.options.strict'); } catch(e) { } try { this.orig.werror = this.werror = pref.getBoolPref('javascript.options.werror'); } catch(e) { } }}
throw 'JavaScriptOptions: unable to get @mozilla.org/preference;1';
throw 'JavaScriptOptions: unable to get @mozilla.org/preferences-service;1';
function JavaScriptOptions(){ this.orig = {}; this.orig.strict = this.strict = false; this.orig.werror = this.werror = false; this.privileges = 'UniversalXPConnect UniversalPreferencesRead ' + 'UniversalPreferencesWrite'; if (typeof options == 'function') { // shell var optString = options(); if (optString) { var optList = optString.split(','); for (var iOpt = 0; iOpt < optList.length; iOpt++) { optName = optList[iOpt]; this[optName] = true; } } } else if (typeof document != 'undefined') { // browser netscape.security.PrivilegeManager.enablePrivilege(this.privileges); var preferences = Components.classes['@mozilla.org/preferences;1']; if (!preferences) { throw 'JavaScriptOptions: unable to get @mozilla.org/preference;1'; } var prefService = preferences. getService(Components.interfaces.nsIPrefService); if (!prefService) { throw 'JavaScriptOptions: unable to get nsIPrefService'; } var pref = prefService.getBranch(''); if (!pref) { throw 'JavaScriptOptions: unable to get prefService branch'; } try { this.orig.strict = this.strict = pref.getBoolPref('javascript.options.strict'); } catch(e) { } try { this.orig.werror = this.werror = pref.getBoolPref('javascript.options.werror'); } catch(e) { } }}
print( this.string );
writeLineToLog( this.string );
function JavaValue( value ) { // java.lang.Object.getClass() returns the Java Object's class. this.javaclass = value.getClass();// __proto__ of Java objects is not supported in LC2.// Object.prototype.toString will show its JavaScript wrapper object.// value.__proto__.getJSClass = Object.prototype.toString;// this.jsclass = value.getJSClass(); this.string = value + ""; print( this.string ); this.value = value.booleanValue(); this.type = typeof value; return this;}
if (isURLFiltered (fileName)) return true;
function jsdErrorHook (message, fileName, line, pos, flags, exception){ try { var flagstr; flagstr = (flags && jsdIErrorHook.REPORT_EXCEPTION) ? "x" : "-"; flagstr += (flags && jsdIErrorHook.REPORT_STRICT) ? "s" : "-"; //dd ("===\n" + message + "\n" + fileName + "@" + // line + ":" + pos + "; " + flagstr); var msn = (flags & jsdIErrorHook.REPORT_WARNING) ? MSN_ERPT_WARN : MSN_ERPT_ERROR; if (console.errorMode != EMODE_IGNORE) display (getMsg(msn, [message, flagstr, fileName, line, pos]), MT_ETRACE); if (console.errorMode == EMODE_BREAK) return false; return true; } catch (ex) { dd ("error in error hook: " + ex); } return true;}
frame.script.fileName == MSG_VAL_CONSOLE)
frame.script.fileName == MSG_VAL_CONSOLE || !ASSERT(!(frame.script.flags & SCRIPT_NODEBUG), "Stopped in a script marked as don't debug") || !ASSERT(!isURLFiltered(frame.script.fileName), "stopped in a filtered URL"))
function jsdExecutionHook (frame, type, rv){ var hookReturn = jsdIExecutionHook.RETURN_CONTINUE; if (!ASSERT(!("frames" in console), "Execution hook called while stopped") || frame.isNative || !ASSERT(frame.script, "Execution hook called with no script") || frame.script.fileName == MSG_VAL_CONSOLE) { return hookReturn; } var targetWindow = null; var wasModal = false; var cx; try { cx = frame.executionContext; } catch (ex) { dd ("no context"); cx = null; } var targetWasEnabled = true; var debuggerWasEnabled = console.baseWindow.enabled; console.baseWindow.enabled = true; if (!ASSERT(cx, "no cx in execution hook")) return hookReturn; var glob = cx.globalObject; if (!ASSERT(glob, "no glob in execution hook")) return hookReturn; console.targetWindow = getBaseWindowFromWindow(glob.getWrappedValue()); targetWasEnabled = console.targetWindow.enabled; if (console.targetWindow != console.baseWindow) { cx.scriptsEnabled = false; console.targetWindow.enabled = false; } try { //dd ("debug trap " + formatFrame(frame)); hookReturn = debugTrap(frame, type, rv); //dd ("debug trap returned " + hookReturn); } catch (ex) { display (MSG_ERR_INTERNAL_BPT, MT_ERROR); display (formatException(ex), MT_ERROR); } if (console.targetWindow && console.targetWindow != console.baseWindow) { console.targetWindow.enabled = targetWasEnabled; cx.scriptsEnabled = true; } console.baseWindow.enabled = debuggerWasEnabled; delete console.frames; delete console.targetWindow; if ("__exitAfterContinue__" in console) window.close(); return hookReturn;}
window.openDialog("chrome: "chrome,menubar,toolbar,resizable,dialog=no", args); }
openDebuggerWindow(args); }
function jsdh_handle(contentType, windowTarget, request){ var e; var channel = request.QueryInterface(nsIChannel); // prevent someone from invoking the debugger remotely by serving // up any old file with the x-application-jsd content type. if (channel.URI.spec != "x-jsd:debugger") { debug ("Not handling content from unknown location ``" + channel.URI.spec + "''"); return; } var window = findDebuggerWindow() if (window) { window.focus(); } else { var ass = Components.classes[ASS_CONTRACTID].getService(nsIAppShellService); window = ass.hiddenDOMWindow; var args = new Object(); args.url = channel.URI.spec; window.openDialog("chrome://venkman/content/venkman.xul", "_blank", "chrome,menubar,toolbar,resizable,dialog=no", args); }}
testcases[testcases.length] = new TestCase( SECTION, expectedResult +" == "+actualResult, expectedResult, actualResult );
new TestCase( SECTION, expectedResult +" == "+actualResult, expectedResult, actualResult );
function jsEquals(expectedResult, actualResult, message) { testcases[testcases.length] = new TestCase( SECTION, expectedResult +" == "+actualResult, expectedResult, actualResult );}
var arrayOfPrefs = pref_string.split(', ');
var arrayOfPrefs = pref_string.split(separatorRe);
function LangAlreadyActive(langId){ var found = false; try { var arrayOfPrefs = pref_string.split(', '); if (arrayOfPrefs) for (var i = 0; i < arrayOfPrefs.length; i++) { if (arrayOfPrefs[i] == langId) { found = true; break; } } return found; } catch(ex){ return false; }}
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
function LastToClose(){ 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 ); var count = 0; while ( enumerator.hasMoreElements() && count < 2 ) { var windowToClose = enumerator.getNext(); count++; } if (count == 1) return true; else return false;}
window.open( UrlToGoTo, "calendar-opened-window" );
var navWindow; try { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); navWindow = wm.getMostRecentWindow("navigator:browser"); } catch (ex) { } if (navWindow) { if ("delayedOpenTab" in navWindow) navWindow.delayedOpenTab(UrlToGoTo); else if ("loadURI" in navWindow) navWindow.loadURI(UrlToGoTo); else navWindow._content.location.href = UrlToGoTo; } else { var ass = Components.classes["@mozilla.org/appshell/appShellService;1"].getService(Components.interfaces.nsIAppShellService); w = ass.hiddenDOMWindow; w.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", UrlToGoTo ); }
function launchBrowser(){ if( launch == false ) //stops them from clicking on it twice return; launch = false; //get the URL from the text box var UrlToGoTo = document.getElementById( "uri-field" ).value; if( UrlToGoTo.length < 4 ) //it has to be > 4, since it needs at least 1 letter, a . and a two letter domain name. return; //check if it has a : in it if( UrlToGoTo.indexOf( ":" ) == -1 ) UrlToGoTo = "http://"+UrlToGoTo; //launch the browser to that URL window.open( UrlToGoTo, "calendar-opened-window" ); launch = true;}
window.open( UrlToGoTo, "calendar-opened-window" );
opener.window.open( UrlToGoTo, "calendar-opened-window" );
function launchBrowser(){ //get the URL from the text box var UrlToGoTo = document.getElementById( "uri-field" ).value; //launch the browser to that URL window.open( UrlToGoTo, "calendar-opened-window" );}
fp.init(window, "Save As", nsIFilePicker.modeSave);
fp.init(window, "Open", nsIFilePicker.modeOpen);
function launchFilePicker(){ // No show the 'Save As' dialog and ask for a filename to save to const nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); // caller can force disable of sand box, even if ON globally fp.init(window, "Save As", nsIFilePicker.modeSave); var ServerName = document.getElementById( "server-name-textbox" ).value; if( ServerName == "" ) fp.defaultString = "MozillaCalendarFile.ics"; else fp.defaultString = "MozillaCalendar"+ServerName+".ics"; fp.defaultExtension = "ics"; const filterCalendar = "Calendar Files"; const extensionCalendar = ".ics"; fp.appendFilter( filterCalendar, "*" + extensionCalendar ); fp.show(); if (fp.file && fp.file.path.length > 0) { document.getElementById( "server-path-textbox" ).value = fp.file.path; gCalendarObject.path = fp.file.path; }}
selectedItem = dataEls.length ? dataEls[0] : defaultItem;
selectedItem = dataEls.item(0) ? dataEls.item(0) : defaultItem;
function lazyAppendFontNames( i ) { // schedule the build of the next font list if (i+1 < fontTypes.length) { window.setTimeout(lazyAppendFontNames, 100, i+1); } // now build and populate the fonts for the requested font type var defaultItem = null; var selectElement = new listElement( fontTypes[i] ); selectElement.clearList(); try { defaultItem = selectElement.appendFontNames( languageList.value, fontTypes[i] ); } catch(e) { dump("pref-fonts.js: " + e + "\nFailed to build the font list for " + fontTypes[i] + "\n"); return; } // now set the selected font item for the drop down list if (!defaultItem) return; // nothing to select, so no need to bother // the item returned by default is our last resort fall-back var selectedItem = defaultItem; if( languageList.value in languageData ) { // data exists for this language, pre-select items based on this information var dataVal = languageData[languageList.value].types[fontTypes[i]]; if (!dataVal.length) // special blank means the default { selectedItem = defaultItem; } else { var dataEls = selectElement.listElement.getElementsByAttribute( "value", dataVal ); selectedItem = dataEls.length ? dataEls[0] : defaultItem; } } else { try { var fontPrefString = "font.name." + fontTypes[i] + "." + languageList.value; var selectVal = parent.hPrefWindow.pref.getComplexValue( fontPrefString, Components.interfaces.nsISupportsString ).data; var dataEls = selectElement.listElement.getElementsByAttribute( "value", selectVal ); // we need to honor name-list in case name is unavailable if (!dataEls.length) { var fontListPrefString = "font.name-list." + fontTypes[i] + "." + languageList.value; var nameList = parent.hPrefWindow.pref.getComplexValue( fontListPrefString, Components.interfaces.nsISupportsString ).data; var fontNames = nameList.split(","); var stripWhitespace = /^\s*(.*)\s*$/; for (j = 0; j < fontNames.length; j++) { selectVal = fontNames[j].replace(stripWhitespace, "$1"); dataEls = selectElement.listElement.getElementsByAttribute("value", selectVal); if (dataEls.length) break; // exit loop if we find one } } selectedItem = dataEls.length ? dataEls[0] : defaultItem; } catch(e) { selectedItem = defaultItem; } } selectElement.listElement.selectedItem = selectedItem; selectElement.listElement.removeAttribute( "disabled" ); }
if (!dataEls.length) {
if (!dataEls.item(0)) {
function lazyAppendFontNames( i ) { // schedule the build of the next font list if (i+1 < fontTypes.length) { window.setTimeout(lazyAppendFontNames, 100, i+1); } // now build and populate the fonts for the requested font type var defaultItem = null; var selectElement = new listElement( fontTypes[i] ); selectElement.clearList(); try { defaultItem = selectElement.appendFontNames( languageList.value, fontTypes[i] ); } catch(e) { dump("pref-fonts.js: " + e + "\nFailed to build the font list for " + fontTypes[i] + "\n"); return; } // now set the selected font item for the drop down list if (!defaultItem) return; // nothing to select, so no need to bother // the item returned by default is our last resort fall-back var selectedItem = defaultItem; if( languageList.value in languageData ) { // data exists for this language, pre-select items based on this information var dataVal = languageData[languageList.value].types[fontTypes[i]]; if (!dataVal.length) // special blank means the default { selectedItem = defaultItem; } else { var dataEls = selectElement.listElement.getElementsByAttribute( "value", dataVal ); selectedItem = dataEls.length ? dataEls[0] : defaultItem; } } else { try { var fontPrefString = "font.name." + fontTypes[i] + "." + languageList.value; var selectVal = parent.hPrefWindow.pref.getComplexValue( fontPrefString, Components.interfaces.nsISupportsString ).data; var dataEls = selectElement.listElement.getElementsByAttribute( "value", selectVal ); // we need to honor name-list in case name is unavailable if (!dataEls.length) { var fontListPrefString = "font.name-list." + fontTypes[i] + "." + languageList.value; var nameList = parent.hPrefWindow.pref.getComplexValue( fontListPrefString, Components.interfaces.nsISupportsString ).data; var fontNames = nameList.split(","); var stripWhitespace = /^\s*(.*)\s*$/; for (j = 0; j < fontNames.length; j++) { selectVal = fontNames[j].replace(stripWhitespace, "$1"); dataEls = selectElement.listElement.getElementsByAttribute("value", selectVal); if (dataEls.length) break; // exit loop if we find one } } selectedItem = dataEls.length ? dataEls[0] : defaultItem; } catch(e) { selectedItem = defaultItem; } } selectElement.listElement.selectedItem = selectedItem; selectElement.listElement.removeAttribute( "disabled" ); }
if (dataEls.length)
if (dataEls.item(0))
function lazyAppendFontNames( i ) { // schedule the build of the next font list if (i+1 < fontTypes.length) { window.setTimeout(lazyAppendFontNames, 100, i+1); } // now build and populate the fonts for the requested font type var defaultItem = null; var selectElement = new listElement( fontTypes[i] ); selectElement.clearList(); try { defaultItem = selectElement.appendFontNames( languageList.value, fontTypes[i] ); } catch(e) { dump("pref-fonts.js: " + e + "\nFailed to build the font list for " + fontTypes[i] + "\n"); return; } // now set the selected font item for the drop down list if (!defaultItem) return; // nothing to select, so no need to bother // the item returned by default is our last resort fall-back var selectedItem = defaultItem; if( languageList.value in languageData ) { // data exists for this language, pre-select items based on this information var dataVal = languageData[languageList.value].types[fontTypes[i]]; if (!dataVal.length) // special blank means the default { selectedItem = defaultItem; } else { var dataEls = selectElement.listElement.getElementsByAttribute( "value", dataVal ); selectedItem = dataEls.length ? dataEls[0] : defaultItem; } } else { try { var fontPrefString = "font.name." + fontTypes[i] + "." + languageList.value; var selectVal = parent.hPrefWindow.pref.getComplexValue( fontPrefString, Components.interfaces.nsISupportsString ).data; var dataEls = selectElement.listElement.getElementsByAttribute( "value", selectVal ); // we need to honor name-list in case name is unavailable if (!dataEls.length) { var fontListPrefString = "font.name-list." + fontTypes[i] + "." + languageList.value; var nameList = parent.hPrefWindow.pref.getComplexValue( fontListPrefString, Components.interfaces.nsISupportsString ).data; var fontNames = nameList.split(","); var stripWhitespace = /^\s*(.*)\s*$/; for (j = 0; j < fontNames.length; j++) { selectVal = fontNames[j].replace(stripWhitespace, "$1"); dataEls = selectElement.listElement.getElementsByAttribute("value", selectVal); if (dataEls.length) break; // exit loop if we find one } } selectedItem = dataEls.length ? dataEls[0] : defaultItem; } catch(e) { selectedItem = defaultItem; } } selectElement.listElement.selectedItem = selectedItem; selectElement.listElement.removeAttribute( "disabled" ); }
var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); }
function linkNodeForClickEvent(event) { var target = event.target; var linkNode; var linkNodeText; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } return linkNode; }
switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": break; default: linkNode = findParentNode(event.originalTarget, "a"); if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break;
if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if (!(target instanceof HTMLInputElement)) { linkNode = findParentNode(event.originalTarget, "a"); if (linkNode && !linkNode.hasAttribute("href")) linkNode = null;
function linkNodeForClickEvent(event) { var target = event.target; var linkNode; var linkNodeText; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } return linkNode; }
if (this.link.href) { text = this.link.href;
var wrapper = new XPCNativeWrapper(this.link, "href", "baseURI", "getAttributeNS()"); if (wrapper.href) { text = wrapper.href;
linkText : function () { var text = gatherTextUnder( this.link ); if (!text || !text.match(/\S/)) { text = this.link.getAttribute("title"); if (!text || !text.match(/\S/)) { text = this.link.getAttribute("alt"); if (!text || !text.match(/\S/)) { if (this.link.href) { text = this.link.href; } else { text = getAttributeNS("http://www.w3.org/1999/xlink", "href"); if (text && text.match(/\S/)) { text = makeURLAbsolute(this.link.baseURI, text); } } } } } return text; },
text = getAttributeNS("http:
text = wrapper.getAttributeNS("http: "href");
linkText : function () { var text = gatherTextUnder( this.link ); if (!text || !text.match(/\S/)) { text = this.link.getAttribute("title"); if (!text || !text.match(/\S/)) { text = this.link.getAttribute("alt"); if (!text || !text.match(/\S/)) { if (this.link.href) { text = this.link.href; } else { text = getAttributeNS("http://www.w3.org/1999/xlink", "href"); if (text && text.match(/\S/)) { text = makeURLAbsolute(this.link.baseURI, text); } } } } } return text; },
text = makeURLAbsolute(this.link.baseURI, text);
text = makeURLAbsolute(wrapper.baseURI, text);
linkText : function () { var text = gatherTextUnder( this.link ); if (!text || !text.match(/\S/)) { text = this.link.getAttribute("title"); if (!text || !text.match(/\S/)) { text = this.link.getAttribute("alt"); if (!text || !text.match(/\S/)) { if (this.link.href) { text = this.link.href; } else { text = getAttributeNS("http://www.w3.org/1999/xlink", "href"); if (text && text.match(/\S/)) { text = makeURLAbsolute(this.link.baseURI, text); } } } } } return text; },
if (!text || !text.match(/\S/)) { text = this.link.getAttribute("title"); if (!text || !text.match(/\S/)) { text = this.link.getAttribute("alt"); if (!text || !text.match(/\S/)) { if (this.link.href) { text = this.link.href; } else { text = getAttributeNS("http: if (text && text.match(/\S/)) { text = this.makeURLAbsolute(this.link.baseURI, text); } } } } }
linkText : function () { var text = gatherTextUnder( this.link ); return text; },
this.knownLinks = null;
function LinkToolbarMenu (linkType) { this.constructor(linkType); this.knownLinks = null; this.clear = function() { this.disableParentMenuButton(); this.getXULElement().setAttribute("disabled", "true"); clearPopup(this.getPopup()); this.knownLinks = null; } function clearPopup(popup) { while (popup.hasChildNodes()) popup.removeChild(popup.lastChild); } this.getPopup = function() { return document.getElementById(this.xulPopupId); } this.displayLink = function(linkElement) { if (this.isAlreadyAdded(linkElement)) return false; this.getKnownLinks()[linkElement.href] = true; this.addMenuItem(linkElement); this.getXULElement().removeAttribute("disabled"); this.enableParentMenuButton(); return true; } this.isAlreadyAdded = function(linkElement) { return this.getKnownLinks()[linkElement.href]; } this.getKnownLinks = function() { if (!this.knownLinks) this.knownLinks = new Array(); return this.knownLinks; } function match(first, second) { if (!first && !second) return true; if (!first || !second) return false; return first == second; } this.addMenuItem = function(linkElement) { this.getPopup().appendChild(this.createMenuItem(linkElement)); } this.createMenuItem = function(linkElement) { // XXX: clone a prototypical XUL element instead of hardcoding these // attributes var menuitem = document.createElement("menuitem"); menuitem.setAttribute("label", linkElement.getLabel()); menuitem.setAttribute("href", linkElement.href); menuitem.setAttribute("class", "menuitem-iconic bookmark-item"); menuitem.setAttribute("rdf:type", "rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#linkType"); return menuitem; }}
if (this.isAlreadyAdded(linkElement)) return false; this.getKnownLinks()[linkElement.href] = true;
function LinkToolbarMenu (linkType) { this.constructor(linkType); this.knownLinks = null; this.clear = function() { this.disableParentMenuButton(); this.getXULElement().setAttribute("disabled", "true"); clearPopup(this.getPopup()); this.knownLinks = null; } function clearPopup(popup) { while (popup.hasChildNodes()) popup.removeChild(popup.lastChild); } this.getPopup = function() { return document.getElementById(this.xulPopupId); } this.displayLink = function(linkElement) { if (this.isAlreadyAdded(linkElement)) return false; this.getKnownLinks()[linkElement.href] = true; this.addMenuItem(linkElement); this.getXULElement().removeAttribute("disabled"); this.enableParentMenuButton(); return true; } this.isAlreadyAdded = function(linkElement) { return this.getKnownLinks()[linkElement.href]; } this.getKnownLinks = function() { if (!this.knownLinks) this.knownLinks = new Array(); return this.knownLinks; } function match(first, second) { if (!first && !second) return true; if (!first || !second) return false; return first == second; } this.addMenuItem = function(linkElement) { this.getPopup().appendChild(this.createMenuItem(linkElement)); } this.createMenuItem = function(linkElement) { // XXX: clone a prototypical XUL element instead of hardcoding these // attributes var menuitem = document.createElement("menuitem"); menuitem.setAttribute("label", linkElement.getLabel()); menuitem.setAttribute("href", linkElement.href); menuitem.setAttribute("class", "menuitem-iconic bookmark-item"); menuitem.setAttribute("rdf:type", "rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#linkType"); return menuitem; }}
this.isAlreadyAdded = function(linkElement) { return this.getKnownLinks()[linkElement.href]; } this.getKnownLinks = function() { if (!this.knownLinks) this.knownLinks = new Array(); return this.knownLinks; }
function LinkToolbarMenu (linkType) { this.constructor(linkType); this.knownLinks = null; this.clear = function() { this.disableParentMenuButton(); this.getXULElement().setAttribute("disabled", "true"); clearPopup(this.getPopup()); this.knownLinks = null; } function clearPopup(popup) { while (popup.hasChildNodes()) popup.removeChild(popup.lastChild); } this.getPopup = function() { return document.getElementById(this.xulPopupId); } this.displayLink = function(linkElement) { if (this.isAlreadyAdded(linkElement)) return false; this.getKnownLinks()[linkElement.href] = true; this.addMenuItem(linkElement); this.getXULElement().removeAttribute("disabled"); this.enableParentMenuButton(); return true; } this.isAlreadyAdded = function(linkElement) { return this.getKnownLinks()[linkElement.href]; } this.getKnownLinks = function() { if (!this.knownLinks) this.knownLinks = new Array(); return this.knownLinks; } function match(first, second) { if (!first && !second) return true; if (!first || !second) return false; return first == second; } this.addMenuItem = function(linkElement) { this.getPopup().appendChild(this.createMenuItem(linkElement)); } this.createMenuItem = function(linkElement) { // XXX: clone a prototypical XUL element instead of hardcoding these // attributes var menuitem = document.createElement("menuitem"); menuitem.setAttribute("label", linkElement.getLabel()); menuitem.setAttribute("href", linkElement.href); menuitem.setAttribute("class", "menuitem-iconic bookmark-item"); menuitem.setAttribute("rdf:type", "rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#linkType"); return menuitem; }}
if (this.link.href) { return this.link.href;
var wrapper = new XPCNativeWrapper(this.link, "href", "baseURI", "getAttributeNS()"); if (wrapper.href) { return wrapper.href;
linkURL : function () { if (this.link.href) { return this.link.href; } var href = this.link.getAttributeNS("http://www.w3.org/1999/xlink","href"); if (!href || !href.match(/\S/)) { throw "Empty href"; // Without this we try to save as the current doc, for example, HTML case also throws if empty } href = makeURLAbsolute(this.link.baseURI,href); return href; },
var href = this.link.getAttributeNS("http:
var href = wrapper.getAttributeNS("http: "href");
linkURL : function () { if (this.link.href) { return this.link.href; } var href = this.link.getAttributeNS("http://www.w3.org/1999/xlink","href"); if (!href || !href.match(/\S/)) { throw "Empty href"; // Without this we try to save as the current doc, for example, HTML case also throws if empty } href = makeURLAbsolute(this.link.baseURI,href); return href; },
href = makeURLAbsolute(this.link.baseURI,href);
href = makeURLAbsolute(wrapper.baseURI, href);
linkURL : function () { if (this.link.href) { return this.link.href; } var href = this.link.getAttributeNS("http://www.w3.org/1999/xlink","href"); if (!href || !href.match(/\S/)) { throw "Empty href"; // Without this we try to save as the current doc, for example, HTML case also throws if empty } href = makeURLAbsolute(this.link.baseURI,href); return href; },
href = this.makeURLAbsolute(this.link.baseURI,href);
linkURL : function () { if (this.link.href) { return this.link.href; } var href = this.link.getAttributeNS("http://www.w3.org/1999/xlink","href"); if (href == "") { throw "Empty href"; // Without this we try to save as the current doc, for example, HTML case also throws if empty } href = this.makeURLAbsolute(this.link.baseURI,href); return href; },
if (href == "") {
if (!href || !href.match(/\S/)) {
linkURL : function () { if (this.link.href) { return this.link.href; } var href = this.link.getAttributeNS("http://www.w3.org/1999/xlink","href"); if (href == "") { throw "Empty href"; // Without this we try to save as the current doc, for example, HTML case also throws if empty } href = this.makeURLAbsolute(this.link.baseURI,href); return href; },
body = document.getElementById("fieldBody"); count = top.fieldMap.mapSize;
var body = document.getElementById("fieldBody"); var count = top.fieldMap.mapSize;
function ListFields() { if (top.fieldMap == null) return; body = document.getElementById("fieldBody"); count = top.fieldMap.mapSize; var index; var i; for (i = 0; i < count; i++) { index = top.fieldMap.GetFieldMap( i); AddFieldToList( body, top.fieldMap.GetFieldDescription( index), index, top.fieldMap.GetFieldActive( i)); } count = top.fieldMap.numMozFields; for (i = 0; i < count; i++) { if (!IndexInMap( i)) AddFieldToList( body, top.fieldMap.GetFieldDescription( i), i, false); }}
if (top.fieldMap == null) return; var body = document.getElementById("fieldBody"); var count = top.fieldMap.mapSize; var index; var i; for (i = 0; i < count; i++) { index = top.fieldMap.GetFieldMap( i); AddFieldToList( body, top.fieldMap.GetFieldDescription( index), index, top.fieldMap.GetFieldActive( i)); }
if (top.fieldMap == null) return;
function ListFields() { if (top.fieldMap == null) return; var body = document.getElementById("fieldBody"); var count = top.fieldMap.mapSize; var index; var i; for (i = 0; i < count; i++) { index = top.fieldMap.GetFieldMap( i); AddFieldToList( body, top.fieldMap.GetFieldDescription( index), index, top.fieldMap.GetFieldActive( i)); } count = top.fieldMap.numMozFields; for (i = 0; i < count; i++) { if (!IndexInMap( i)) AddFieldToList( body, top.fieldMap.GetFieldDescription( i), i, false); }}
count = top.fieldMap.numMozFields; for (i = 0; i < count; i++) { if (!IndexInMap( i)) AddFieldToList( body, top.fieldMap.GetFieldDescription( i), i, false); }
var body = document.getElementById("fieldBody"); var count = top.fieldMap.mapSize; var index; var i; for (i = 0; i < count; i++) { index = top.fieldMap.GetFieldMap( i); AddFieldToList( body, top.fieldMap.GetFieldDescription( index), index, top.fieldMap.GetFieldActive( i)); } count = top.fieldMap.numMozFields; for (i = 0; i < count; i++) { if (!IndexInMap( i)) AddFieldToList( body, top.fieldMap.GetFieldDescription( i), i, false); }
function ListFields() { if (top.fieldMap == null) return; var body = document.getElementById("fieldBody"); var count = top.fieldMap.mapSize; var index; var i; for (i = 0; i < count; i++) { index = top.fieldMap.GetFieldMap( i); AddFieldToList( body, top.fieldMap.GetFieldDescription( index), index, top.fieldMap.GetFieldActive( i)); } count = top.fieldMap.numMozFields; for (i = 0; i < count; i++) { if (!IndexInMap( i)) AddFieldToList( body, top.fieldMap.GetFieldDescription( i), i, false); }}
var max = body.childNodes.length - 1; while (max >= 0) { body.removeChild( body.childNodes[max]); max--;
while (body.hasChildNodes()) { body.removeChild(body.lastChild);
function ListModules() { if (top.importService == null) return; var body = document.getElementById( "moduleList"); var max = body.childNodes.length - 1; while (max >= 0) { body.removeChild( body.childNodes[max]); max--; } var count = top.importService.GetModuleCount(top.importType); var i; var moduleArray = new Array(count); for (i = 0; i < count; i++) { moduleArray[i] = {name:top.importService.GetModuleName(top.importType, i), index:i }; } // sort the array of modules by name, so that they'll show up in the right order moduleArray.sort(CompareImportModuleName); for (i = 0; i < count; i++) { AddModuleToList(moduleArray[i].name, moduleArray[i].index); }}
if ("disablePlugin" in plugin.scope)
if ((plugin.API > 0) || ("disablePlugin" in plugin.scope))
function listPlugin(plugin, i) { var enabled; if ("disablePlugin" in plugin.scope) enabled = plugin.enabled; else enabled = MSG_ALWAYS; display(getMsg(MSG_FMT_PLUGIN1, [i, plugin.url])); display(getMsg(MSG_FMT_PLUGIN2, [plugin.id, plugin.version, enabled, plugin.status])); display(getMsg(MSG_FMT_PLUGIN3, plugin.description)); }
BookmarksUtils.addLivemark(wincontent.document.baseURI, data, title);
var description = BookmarksUtils.getDescriptionFromDocument(wincontent.document); BookmarksUtils.addLivemark(wincontent.document.baseURI, data, title, description);
function livemarkAddMark(wincontent, data) { var title = wincontent.document.title; BookmarksUtils.addLivemark(wincontent.document.baseURI, data, title);}
livemarkLinks.push({ href: event.target.href, type: event.target.type, title: event.target.title});
var wrapper = new XPCNativeWrapper(event.target, "href", "type", "title"); livemarkLinks.push({ href: wrapper.href, type: wrapper.type, title: wrapper.title});
function livemarkOnLinkAdded(event){ if (!gLivemarksButton) gLivemarksButton = document.getElementById("livemark-button"); // from tabbrowser.xml // mechanism for reading properties of the underlying XPCOM object // (ignoring potential getters/setters added by malicious content) var safeGetProperty = function(obj, propname) { return Components.lookupMethod(obj, propname).call(obj); } var etype = event.target.type; var etitle = event.target.title; if (etype == "application/rss+xml" || etype == "application/atom+xml" || etype == "application/x.atom+xml" || // this is, apparently, the "official" Atom type. etitle == "rss" || etitle == "RSS" || etitle == "Atom") { const targetDoc = safeGetProperty(event.target, "ownerDocument"); // find which tab this is for, and set the attribute on the browser // should there be a getTabForDocument method on tabbedbrowser? var browserForLink = null; if (gBrowser.mTabbedMode) { // var browserIndex = gBrowser.getBrowserIndexForDocument(targetDoc); // if (browserIndex == -1) // return; // browserForLink = gBrowser.getBrowserAtIndex(browserIndex); for (var i = 0; i < gBrowser.mPanelContainer.childNodes.length; i++) { if (gBrowser.mPanelContainer.childNodes[i].contentDocument == targetDoc) { browserForLink = gBrowser.mPanelContainer.childNodes[i]; break; } } } else if (gBrowser.mCurrentBrowser.contentDocument == targetDoc) { browserForLink = gBrowser.mCurrentBrowser; } if (!browserForLink) { // ??? this really shouldn't happen.. return; } var livemarkLinks = []; if (browserForLink.livemarkLinks != null) { livemarkLinks = browserForLink.livemarkLinks; } livemarkLinks.push({ href: event.target.href, type: event.target.type, title: event.target.title}); browserForLink.livemarkLinks = livemarkLinks; if (browserForLink == gBrowser || browserForLink == gBrowser.mCurrentBrowser) gLivemarksButton.setAttribute("livemarks", "true"); }}
if (panelBrowser.getAttribute("cachedsrc")) panelBrowser.setAttribute("src", panelBrowser.getAttribute("cachedsrc"));
if (gLoadCachedSrc && panelBrowser.getAttribute("cachedurl")) { panelBrowser.setAttribute("src", panelBrowser.getAttribute("cachedurl")); }
function load(){ var panelBrowser = document.getElementById('web-panels-browser'); panelBrowser.webProgress.addProgressListener(panelProgressListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL); if (panelBrowser.getAttribute("cachedsrc")) panelBrowser.setAttribute("src", panelBrowser.getAttribute("cachedsrc"));}
var active_charsets_treeroot = document.getElementById('active_charsets_root');
function LoadActiveCharSets(){ var active_charsets = document.getElementById('active_charsets'); var active_charsets_treeroot = document.getElementById('active_charsets_root'); var arrayOfPrefs = []; var str; var tit; arrayOfPrefs = pref_string_content.split(', '); if (arrayOfPrefs.length > 0) { for (var i = 0; i < arrayOfPrefs.length; i++) { str = arrayOfPrefs[i]; tit = GetCharSetTitle(str); if (str && tit) AddTreeItem(document, active_charsets_treeroot, str, tit); } }}
AddTreeItem(document, active_charsets_treeroot, str, tit);
AddListItem(document, active_charsets, str, tit);
function LoadActiveCharSets(){ var active_charsets = document.getElementById('active_charsets'); var active_charsets_treeroot = document.getElementById('active_charsets_root'); var arrayOfPrefs = []; var str; var tit; arrayOfPrefs = pref_string_content.split(', '); if (arrayOfPrefs.length > 0) { for (var i = 0; i < arrayOfPrefs.length; i++) { str = arrayOfPrefs[i]; tit = GetCharSetTitle(str); if (str && tit) AddTreeItem(document, active_charsets_treeroot, str, tit); } }}
var arrayOfPrefs = pref_string.split(', ');
var arrayOfPrefs = pref_string.split(separatorRe);
function LoadActiveLanguages(){ if (pref_string) { var arrayOfPrefs = pref_string.split(', '); for (var i = 0; i < arrayOfPrefs.length; i++) { var str = arrayOfPrefs[i]; var tit = GetLanguageTitle(str); if (str) { if (!tit) tit = '[' + str + ']'; AddTreeItem(document, active_languages_treeroot, str, tit); } //if } //for }}
AddTreeItem(document, active_languages_treeroot, str, tit);
AddListItem(document, active_languages, str, tit);
function LoadActiveLanguages(){ if (pref_string) { var arrayOfPrefs = pref_string.split(separatorRe); for (var i = 0; i < arrayOfPrefs.length; i++) { var str = arrayOfPrefs[i]; var tit = GetLanguageTitle(str); if (str) { if (!tit) tit = '[' + str + ']'; AddTreeItem(document, active_languages_treeroot, str, tit); } //if } //for }}
var available_charsets_treeroot = document.getElementById('available_charsets_root');
var available_charsets_listbox = document.getElementById('available_charsets');
function LoadAvailableCharSets(){ try { var available_charsets_treeroot = document.getElementById('available_charsets_root'); var rdf=Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var kNC_Root = rdf.GetResource("NC:DecodersRoot"); var kNC_name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); var rdfDataSource = rdf.GetDataSource("rdf:charset-menu"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); rdfContainer.Init(rdfDataSource, kNC_Root); var availableCharsets = rdfContainer.GetElements(); var charset; for (var i = 0; i < rdfContainer.GetCount(); i++) { charset = availableCharsets.getNext().QueryInterface(Components.interfaces.nsIRDFResource); availCharsetDict[i] = new Array(2); availCharsetDict[i][0] = readRDFString(rdfDataSource, charset, kNC_name); availCharsetDict[i][1] = charset.Value; AddTreeItem(document, available_charsets_treeroot, availCharsetDict[i][1], availCharsetDict[i][0]); } } catch (e) {}}
AddTreeItem(document, available_charsets_treeroot,
AddListItem(document, available_charsets_listbox,
function LoadAvailableCharSets(){ try { var available_charsets_treeroot = document.getElementById('available_charsets_root'); var rdf=Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var kNC_Root = rdf.GetResource("NC:DecodersRoot"); var kNC_name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); var rdfDataSource = rdf.GetDataSource("rdf:charset-menu"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); rdfContainer.Init(rdfDataSource, kNC_Root); var availableCharsets = rdfContainer.GetElements(); var charset; for (var i = 0; i < rdfContainer.GetCount(); i++) { charset = availableCharsets.getNext().QueryInterface(Components.interfaces.nsIRDFResource); availCharsetDict[i] = new Array(2); availCharsetDict[i][0] = readRDFString(rdfDataSource, charset, kNC_name); availCharsetDict[i][1] = charset.Value; AddTreeItem(document, available_charsets_treeroot, availCharsetDict[i][1], availCharsetDict[i][0]); } } catch (e) {}}
try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1'];
try { var rdf=Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var kNC_Root = rdf.GetResource("NC:DecodersRoot"); var kNC_name = rdf.GetResource("http: var rdfDataSource = rdf.GetDataSource("rdf:charset-menu"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer);
function LoadAvailableCharSets(){ try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible; for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; //don't ignore charset detectors without a title } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; //dump('Getting invisible for:' + str + ' failed!\n'); } } //atom } //for ClearTreelist(dialog.charsetTree); charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try { //let's beef up our error handling for charsets without label / title//dump("add " + charsetDict[i][0] + charsetDict[i][1] + "\n"); var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item;//dump("hit default " + charset + "\n"); } } } //try catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); } //catch } //for } // if if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); } } } // if}
if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible;
rdfContainer.Init(rdfDataSource, kNC_Root);
function LoadAvailableCharSets(){ try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible; for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; //don't ignore charset detectors without a title } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; //dump('Getting invisible for:' + str + ' failed!\n'); } } //atom } //for ClearTreelist(dialog.charsetTree); charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try { //let's beef up our error handling for charsets without label / title//dump("add " + charsetDict[i][0] + charsetDict[i][1] + "\n"); var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item;//dump("hit default " + charset + "\n"); } } } //try catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); } //catch } //for } // if if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); } } } // if}
for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; } } }
var availableCharsets = rdfContainer.GetElements(); var charsetNode; var selectedItem; var item;
function LoadAvailableCharSets(){ try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible; for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; //don't ignore charset detectors without a title } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; //dump('Getting invisible for:' + str + ' failed!\n'); } } //atom } //for ClearTreelist(dialog.charsetTree); charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try { //let's beef up our error handling for charsets without label / title//dump("add " + charsetDict[i][0] + charsetDict[i][1] + "\n"); var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item;//dump("hit default " + charset + "\n"); } } } //try catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); } //catch } //for } // if if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); } } } // if}
charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try {
function LoadAvailableCharSets(){ try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible; for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; //don't ignore charset detectors without a title } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; //dump('Getting invisible for:' + str + ' failed!\n'); } } //atom } //for ClearTreelist(dialog.charsetTree); charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try { //let's beef up our error handling for charsets without label / title//dump("add " + charsetDict[i][0] + charsetDict[i][1] + "\n"); var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item;//dump("hit default " + charset + "\n"); } } } //try catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); } //catch } //for } // if if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); } } } // if}
var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item; } } } catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); }
for (var i = 0; i < rdfContainer.GetCount(); i++) { charsetNode = availableCharsets.getNext().QueryInterface(Components.interfaces.nsIRDFResource); item = AppendStringToTreelist(dialog.charsetTree, readRDFString(rdfDataSource, charsetNode, kNC_name)); item.firstChild.firstChild.setAttribute("value", charsetNode.Value); if(charset == charsetNode.Value) selectedItem = item; }
function LoadAvailableCharSets(){ try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible; for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; //don't ignore charset detectors without a title } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; //dump('Getting invisible for:' + str + ' failed!\n'); } } //atom } //for ClearTreelist(dialog.charsetTree); charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try { //let's beef up our error handling for charsets without label / title//dump("add " + charsetDict[i][0] + charsetDict[i][1] + "\n"); var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item;//dump("hit default " + charset + "\n"); } } } //try catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); } //catch } //for } // if if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); } } } // if}
} } if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); }
if(selectedItem) { dialog.charsetTree.selectItem(selectedItem); dialog.charsetTree.ensureElementIsVisible(selectedItem);
function LoadAvailableCharSets(){ try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible; for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; //don't ignore charset detectors without a title } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; //dump('Getting invisible for:' + str + ' failed!\n'); } } //atom } //for ClearTreelist(dialog.charsetTree); charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try { //let's beef up our error handling for charsets without label / title//dump("add " + charsetDict[i][0] + charsetDict[i][1] + "\n"); var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item;//dump("hit default " + charset + "\n"); } } } //try catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); } //catch } //for } // if if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); } } } // if}
}
} catch(e) {}
function LoadAvailableCharSets(){ try { var ccm = Components.classes['@mozilla.org/charset-converter-manager;1']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); var charsetList = ccm.GetDecoderList(); charsetList = charsetList.QueryInterface(Components.interfaces.nsISupportsArray); } } catch(ex) { dump("failed to get charset mgr\n"); } if (charsetList) { var j=0; var atom; var str; var tit; var visible; for (var i = 0; i < charsetList.Count(); i++) { atom = charsetList.GetElementAt(i); atom = atom.QueryInterface(Components.interfaces.nsIAtom); if (atom) { str = atom.GetUnicode(); try { tit = ccm.GetCharsetTitle(atom); } catch (ex) { tit = str; //don't ignore charset detectors without a title } try { visible = ccm.GetCharsetData(atom,'.notForBrowser'); visible = false; } catch (ex) { visible = true; charsetDict[j] = new Array(2); charsetDict[j][0] = tit; charsetDict[j][1] = str; j++; //dump('Getting invisible for:' + str + ' failed!\n'); } } //atom } //for ClearTreelist(dialog.charsetTree); charsetDict.sort(); var selItem; if (charsetDict) { for (i = 0; i < charsetDict.length; i++) { try { //let's beef up our error handling for charsets without label / title//dump("add " + charsetDict[i][0] + charsetDict[i][1] + "\n"); var item = AppendStringToTreelist(dialog.charsetTree, charsetDict[i][0]); if(item) { var row= item.firstChild; if(row) { var cell= row.firstChild; if(cell) { cell.setAttribute("value", charsetDict[i][1]); } } if(charset == charsetDict[i][1] ) { selItem = item;//dump("hit default " + charset + "\n"); } } } //try catch (ex) { dump("*** Failed to add charset: " + tit + ex + "\n"); } //catch } //for } // if if(selItem) { try { dialog.charsetTree.selectItem(selItem); dialog.charsetTree.ensureElementIsVisible(selItem); } catch (ex) { dump("*** Failed to select and ensure : " + ex + "\n"); } } } // if}
function LoadAvailableCharSets()
function LoadAvailableCharSets(converterRoot)
function LoadAvailableCharSets(){ try { var available_charsets_listbox = document.getElementById('available_charsets'); var rdf=Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var kNC_Root = rdf.GetResource("NC:DecodersRoot"); var kNC_name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); var rdfDataSource = rdf.GetDataSource("rdf:charset-menu"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); rdfContainer.Init(rdfDataSource, kNC_Root); var availableCharsets = rdfContainer.GetElements(); var charset; for (var i = 0; i < rdfContainer.GetCount(); i++) { charset = availableCharsets.getNext().QueryInterface(Components.interfaces.nsIRDFResource); availCharsetDict[i] = new Array(2); availCharsetDict[i][0] = readRDFString(rdfDataSource, charset, kNC_name); availCharsetDict[i][1] = charset.Value; AddListItem(document, available_charsets_listbox, availCharsetDict[i][1], availCharsetDict[i][0]); } } catch (e) {}}
var kNC_Root = rdf.GetResource("NC:DecodersRoot");
var kNC_Root = rdf.GetResource(converterRoot);
function LoadAvailableCharSets(){ try { var available_charsets_listbox = document.getElementById('available_charsets'); var rdf=Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var kNC_Root = rdf.GetResource("NC:DecodersRoot"); var kNC_name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); var rdfDataSource = rdf.GetDataSource("rdf:charset-menu"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); rdfContainer.Init(rdfDataSource, kNC_Root); var availableCharsets = rdfContainer.GetElements(); var charset; for (var i = 0; i < rdfContainer.GetCount(); i++) { charset = availableCharsets.getNext().QueryInterface(Components.interfaces.nsIRDFResource); availCharsetDict[i] = new Array(2); availCharsetDict[i][0] = readRDFString(rdfDataSource, charset, kNC_name); availCharsetDict[i][1] = charset.Value; AddListItem(document, available_charsets_listbox, availCharsetDict[i][1], availCharsetDict[i][0]); } } catch (e) {}}
AddTreeItem(document, available_languages_treeroot, availLanguageDict[i][1], availLanguageDict[i][0]);
AddListItem(document, available_languages, availLanguageDict[i][1], availLanguageDict[i][0]);
function LoadAvailableLanguages(){ if (availLanguageDict) for (var i = 0; i < availLanguageDict.length; i++) { if (availLanguageDict[i][2] == 'true') { AddTreeItem(document, available_languages_treeroot, availLanguageDict[i][1], availLanguageDict[i][0]); } //if } //for}
}
},
loadBookmark: function (aEvent, aDS) { if (this.isBTBookmark(aEvent.target.id)) BookmarksUtils.loadBookmarkBrowser(aEvent, aDS); }
var browserTarget = BookmarksUtils.getBrowserTargetFromEvent(aEvent);
var browserTarget = whereToOpenLink(aEvent);
loadBookmark: function (aEvent, aTarget, aDS) { if (aTarget.getAttribute("class") == "openintabs-menuitem") aTarget = aTarget.parentNode.parentNode; // Check for invalid bookmarks (most likely a static menu item like "Manage Bookmarks") if (!this.isBTBookmark(aTarget.id)) return; var rSource = RDF.GetResource(aTarget.id); var selection = BookmarksUtils.getSelectionFromResource(rSource); var browserTarget = BookmarksUtils.getBrowserTargetFromEvent(aEvent); BookmarksCommand.openBookmark(selection, browserTarget, aDS); aEvent.preventBubble(); },
gBookmarksDoc = aDOMParser.parseFromString(storeStr,"text/xml"); if(gBookmarksDoc&&gBookmarksDoc.firstChild&&gBookmarksDoc.firstChild.nodeName=="bm") {
if(storeStr) { gBookmarksDoc = aDOMParser.parseFromString(storeStr,"text/xml"); } if(storeStr&&gBookmarksDoc&&gBookmarksDoc.firstChild&&gBookmarksDoc.firstChild.nodeName=="bm") {
function loadBookmarks(storeStr) { var aDOMParser = new DOMParser(); gBookmarksDoc = aDOMParser.parseFromString(storeStr,"text/xml"); if(gBookmarksDoc&&gBookmarksDoc.firstChild&&gBookmarksDoc.firstChild.nodeName=="bm") { refreshBookmarks(); } else { var bookmarkEmpty="<bm></bm>"; gPref.setCharPref("browser.bookmark.store",bookmarkEmpty); gBookmarksDoc = aDOMParser.parseFromString(bookmarkEmpty,"text/xml"); refreshBookmarks(); }}
var hasRead = BMSVC.readBookmarks();
BMSVC.readBookmarks();
function LoadBookmarksCallback(){ // loads the services initServices(); initBMService(); var hasRead = BMSVC.readBookmarks(); var bt = document.getElementById("bookmarks-ptf"); if (bt) { if (hasRead) bt.builder.rebuild(); bt.database.AddObserver(BookmarksToolbarRDFObserver); } window.addEventListener("resize", BookmarksToolbar.resizeFunc, false); controllers.appendController(BookmarksMenuController);}
if (hasRead) bt.builder.rebuild();
function LoadBookmarksCallback(){ // loads the services initServices(); initBMService(); var hasRead = BMSVC.readBookmarks(); var bt = document.getElementById("bookmarks-ptf"); if (bt) { if (hasRead) bt.builder.rebuild(); bt.database.AddObserver(BookmarksToolbarRDFObserver); } window.addEventListener("resize", BookmarksToolbar.resizeFunc, false); controllers.appendController(BookmarksMenuController);}
if (bt && hasRead) bt.builder.rebuild();
if (bt) { if (hasRead) bt.builder.rebuild(); bt.database.AddObserver(BookmarksToolbarRDFObserver); } window.addEventListener("resize", BookmarksToolbar.resizeFunc, false);
function LoadBookmarksCallback(){ // loads the services initServices(); initBMService(); var hasRead = BMSVC.readBookmarks(); var bt = document.getElementById("bookmarks-ptf"); if (bt && hasRead) bt.builder.rebuild(); controllers.appendController(BookmarksMenuController);}
document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password;
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath; document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password; } else { //get default values from the prefs document.getElementById( "publish-remotePath-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" ); } document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", publishButtonLabel ); checkURLField( ); var firstFocus = document.getElementById( "publish-remotePath-textbox" ); firstFocus.focus();}
document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" );
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath; document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password; } else { //get default values from the prefs document.getElementById( "publish-remotePath-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" ); } document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", publishButtonLabel ); checkURLField( ); var firstFocus = document.getElementById( "publish-remotePath-textbox" ); firstFocus.focus();}
document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", "Publish" );
document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", publishButtonLabel );
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath; document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password; } else { //get default values from the prefs document.getElementById( "publish-remotePath-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" ); } document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", "Publish" ); checkURLField( ); var firstFocus = document.getElementById( "publish-remotePath-textbox" ); firstFocus.focus();}
document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath;
gPublishObject = args.publishObject; if ( args.publishObject.remotePath ) document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath;
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath; } else { //get default values from the prefs document.getElementById( "publish-remotePath-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); } document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", publishButtonLabel ); checkURLField( ); var firstFocus = document.getElementById( "publish-remotePath-textbox" ); firstFocus.focus();}
gPublishObject = new Object();
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath; } else { //get default values from the prefs document.getElementById( "publish-remotePath-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); } document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", publishButtonLabel ); checkURLField( ); var firstFocus = document.getElementById( "publish-remotePath-textbox" ); firstFocus.focus();}
document.getElementById( "publish-url-textbox" ).value = args.publishObject.url; document.getElementById( "publish-remotefilename-textbox" ).value = args.publishObject.filename;
document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath;
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-url-textbox" ).value = args.publishObject.url; document.getElementById( "publish-remotefilename-textbox" ).value = args.publishObject.filename; document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password; } else { //get default values from the prefs document.getElementById( "publish-url-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-remotefilename-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.filename", "" ); document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" ); } var firstFocus = document.getElementById( "publish-url-textbox" ); firstFocus.focus();}
document.getElementById( "publish-url-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-remotefilename-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.filename", "" );
document.getElementById( "publish-remotePath-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" );
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-url-textbox" ).value = args.publishObject.url; document.getElementById( "publish-remotefilename-textbox" ).value = args.publishObject.filename; document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password; } else { //get default values from the prefs document.getElementById( "publish-url-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-remotefilename-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.filename", "" ); document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" ); } var firstFocus = document.getElementById( "publish-url-textbox" ); firstFocus.focus();}
var firstFocus = document.getElementById( "publish-url-textbox" );
document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", "Publish" ); var firstFocus = document.getElementById( "publish-remotePath-textbox" );
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-url-textbox" ).value = args.publishObject.url; document.getElementById( "publish-remotefilename-textbox" ).value = args.publishObject.filename; document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password; } else { //get default values from the prefs document.getElementById( "publish-url-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-remotefilename-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.filename", "" ); document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" ); } var firstFocus = document.getElementById( "publish-url-textbox" ); firstFocus.focus();}
checkURLField( );
function loadCalendarPublishDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gOnOkFunction = args.onOk; if( args.publishObject ) { document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath; document.getElementById( "publish-username-textbox" ).value = args.publishObject.username; document.getElementById( "publish-password-textbox" ).value = args.publishObject.password; } else { //get default values from the prefs document.getElementById( "publish-remotePath-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" ); document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" ); document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" ); } document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", "Publish" ); var firstFocus = document.getElementById( "publish-remotePath-textbox" ); firstFocus.focus();}
document.getElementById( "server-username-textbox" ).value = gCalendarObject.username; document.getElementById( "server-password-textbox" ).value = gCalendarObject.password;
function loadCalendarServerDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gMode = args.mode; gOnOkFunction = args.onOk; gCalendarObject = args.CalendarObject; // mode is "new or "edit" - show proper header var titleDataItem = null; if( "new" == args.mode ) { titleDataItem = document.getElementById( "data-event-title-new" ); } else { titleDataItem = document.getElementById( "data-event-title-edit" ); document.getElementById( "server-path-textbox" ).setAttribute( "readonly", "true" ); } document.getElementById( "calendar-serverwindow" ).setAttribute( "title", titleDataItem.getAttribute( "value" ) ); document.getElementById( "server-name-textbox" ).value = gCalendarObject.name; document.getElementById( "server-username-textbox" ).value = gCalendarObject.username; document.getElementById( "server-password-textbox" ).value = gCalendarObject.password; document.getElementById( "server-publish-checkbox" ).checked = gCalendarObject.publishAutomatically; document.getElementById( "server-path-textbox" ).value = gCalendarObject.remotePath; document.getElementById( "server-local-path-textbox" ).value = gCalendarObject.path; document.getElementById( "calendar-color" ).color = gCalendarObject.color; //added by Dallas // start focus on title var firstFocus = document.getElementById( "server-name-textbox" ); firstFocus.focus(); sizeToContent();}
document.getElementById( "server-username-textbox" ).value = gCalendarObject.username; document.getElementById( "server-password-textbox" ).value = gCalendarObject.password;
function loadCalendarServerDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gMode = args.mode; gOnOkFunction = args.onOk; gCalendarObject = args.CalendarObject; // mode is "new or "edit" - show proper header var titleDataItem = null; if( "new" == args.mode ) { titleDataItem = document.getElementById( "data-event-title-new" ); } else { titleDataItem = document.getElementById( "data-event-title-edit" ); document.getElementById( "server-path-textbox" ).setAttribute( "readonly", "true" ); } // CofC - calendar coloring change document.getElementById("calendar-color").color = gCalendarObject.color; document.getElementById( "calendar-local-serverwindow" ).setAttribute( "title", titleDataItem.getAttribute( "value" ) ); document.getElementById( "server-name-textbox" ).value = gCalendarObject.name; document.getElementById( "server-path-textbox" ).value = gCalendarObject.path; document.getElementById( "server-remotepath-textbox" ).value = gCalendarObject.remotePath; document.getElementById( "server-username-textbox" ).value = gCalendarObject.username; document.getElementById( "server-password-textbox" ).value = gCalendarObject.password; document.getElementById( "server-publish-checkbox" ).setAttribute( "checked", gCalendarObject.publishAutomatically ); // start focus on title var firstFocus = document.getElementById( "server-name-textbox" ); firstFocus.focus(); sizeToContent();}
document.getElementById( "calendar-serverwindow" ).setAttribute( "title", titleDataItem.getAttribute( "value" ) );
function loadCalendarServerDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gMode = args.mode; gOnOkFunction = args.onOk; gCalendarObject = args.CalendarObject; // mode is "new or "edit" - show proper header var titleDataItem = null; if( "new" == args.mode ) { titleDataItem = document.getElementById( "data-event-title-new" ); } else { titleDataItem = document.getElementById( "data-event-title-edit" ); document.getElementById( "server-path-textbox" ).setAttribute( "readonly", "true" ); } document.getElementById( "server-name-textbox" ).value = gCalendarObject.name; if( gCalendarObject.remote == true ) document.getElementById( "server-path-textbox" ).value = gCalendarObject.remotePath; else document.getElementById( "server-path-textbox" ).value = gCalendarObject.path; // start focus on title var firstFocus = document.getElementById( "server-name-textbox" ); firstFocus.focus();}
document.getElementById( "server-remotepath-textbox" ).value = gCalendarObject.remotePath; document.getElementById( "server-username-textbox" ).value = gCalendarObject.username; document.getElementById( "server-password-textbox" ).value = gCalendarObject.password; document.getElementById( "server-publish-checkbox" ).checked = gCalendarObject.publishAutomatically;
function loadCalendarServerDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gMode = args.mode; gOnOkFunction = args.onOk; gCalendarObject = args.CalendarObject; // mode is "new or "edit" - show proper header var titleDataItem = null; if( "new" == args.mode ) { titleDataItem = document.getElementById( "data-event-title-new" ); } else { titleDataItem = document.getElementById( "data-event-title-edit" ); document.getElementById( "server-path-textbox" ).setAttribute( "readonly", "true" ); } document.getElementById( "calendar-serverwindow" ).setAttribute( "title", titleDataItem.getAttribute( "value" ) ); document.getElementById( "server-name-textbox" ).value = gCalendarObject.name; document.getElementById( "server-path-textbox" ).value = gCalendarObject.path; // start focus on title var firstFocus = document.getElementById( "server-name-textbox" ); firstFocus.focus(); sizeToContent();}
document.getElementById( "categories-field" ).appendItem(categoriesList[i], "Categories-"+categoriesList[i]);
document.getElementById( "categories-field" ).appendItem(categoriesList[i], categoriesList[i]);
function loadCalendarToDoDialog(){ // Get arguments, see description at top of file var args = window.arguments[0]; gMode = args.mode; gOnOkFunction = args.onOk; gToDo = args.calendarToDo; // mode is "new or "edit" - show proper header var titleDataItem = null; if( "new" == args.mode ) { titleDataItem = document.getElementById( "data-todo-title-new" ); } else { titleDataItem = document.getElementById( "data-todo-title-edit" ); } var titleString = titleDataItem.getAttribute( "value" ); document.getElementById("calendar-new-eventwindow").setAttribute("title", titleString); // fill in fields from the event var dueDate = new Date( gToDo.due.getTime() ); setDateFieldValue( "due-date-text", dueDate ); var startDate = new Date( gToDo.start.getTime() ); setDateFieldValue( "start-date-text", startDate ); setFieldValue( "priority-levels", gToDo.priority ); setFieldValue( "percent-complete-menulist", gToDo.percent ); if( gToDo.completed.getTime() > 0 ) { var completedDate = new Date( gToDo.completed.getTime() ); setDateFieldValue( "completed-date-text", completedDate ); setFieldValue( "completed-checkbox", "true", "checked" ); } else { var Today = new Date(); setDateFieldValue( "completed-date-text", Today ); } setFieldValue( "title-field", gToDo.title ); setFieldValue( "description-field", gToDo.description ); setFieldValue( "private-checkbox", gToDo.privateEvent, "checked" ); if( gToDo.alarm === false && gToDo.alarmLength == 0 ) { gToDo.alarmLength = gDefaultAlarmLength; } setFieldValue( "alarm-checkbox", gToDo.alarm, "checked" ); setFieldValue( "alarm-length-field", gToDo.alarmLength ); setFieldValue( "alarm-length-units", gToDo.alarmUnits ); // Load default categories this.categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties"); var categoriesString = this.categoriesStringBundle.GetStringFromName("categories" ); var categoriesList = categoriesString.split( "," ); var oldMenulist = document.getElementById( "categories-menulist-menupopup" ); while( oldMenulist.hasChildNodes() ) oldMenulist.removeChild( oldMenulist.lastChild ); for (var i = 0; i < categoriesList.length ; i++) { document.getElementById( "categories-field" ).appendItem(categoriesList[i], "Categories-"+categoriesList[i]); } document.getElementById( "categories-field" ).selectedIndex = -1; setFieldValue( "categories-field", gToDo.categories ); // update enabling and disabling updateAlarmItemEnabled(); updateCompletedItemEnabled(); // set up OK, Cancel doSetOKCancel( onOKCommand, 0 ); // start focus on title var firstFocus = document.getElementById( "title-field" ); firstFocus.focus();}
/*
function LoadCerts(){ certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB); caOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); caOutlinerView.loadCerts(nsIX509Cert.CA_CERT); document.getElementById('ca-outliner') .outlinerBoxObject.view = caOutlinerView; serverOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); serverOutlinerView.loadCerts(nsIX509Cert.SERVER_CERT); document.getElementById('server-outliner') .outlinerBoxObject.view = serverOutlinerView;/* emailOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); emailOutlinerView.loadCerts(nsIX509Cert.EMAIL_CERT); document.getElementById('email-outliner') .outlinerBoxObject.view = emailOutlinerView; */ userOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); userOutlinerView.loadCerts(nsIX509Cert.USER_CERT); document.getElementById('user-outliner') .outlinerBoxObject.view = userOutlinerView; var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties"); var verifiedColText; if (certdb.ocspOn) { verifiedColText = bundle.GetStringFromName("certmgr.verifiedNoOCSP"); } else { verifiedColText = bundle.GetStringFromName("certmgr.verified"); } var verifiedCol = document.getElementById('verifiedcol'); verifiedCol.setAttribute('label', verifiedColText);}
*/
function LoadCerts(){ certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB); caOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); caOutlinerView.loadCerts(nsIX509Cert.CA_CERT); document.getElementById('ca-outliner') .outlinerBoxObject.view = caOutlinerView; serverOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); serverOutlinerView.loadCerts(nsIX509Cert.SERVER_CERT); document.getElementById('server-outliner') .outlinerBoxObject.view = serverOutlinerView;/* emailOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); emailOutlinerView.loadCerts(nsIX509Cert.EMAIL_CERT); document.getElementById('email-outliner') .outlinerBoxObject.view = emailOutlinerView; */ userOutlinerView = Components.classes[nsCertOutliner] .createInstance(nsICertOutliner); userOutlinerView.loadCerts(nsIX509Cert.USER_CERT); document.getElementById('user-outliner') .outlinerBoxObject.view = userOutlinerView; var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties"); var verifiedColText; if (certdb.ocspOn) { verifiedColText = bundle.GetStringFromName("certmgr.verifiedNoOCSP"); } else { verifiedColText = bundle.GetStringFromName("certmgr.verified"); } var verifiedCol = document.getElementById('verifiedcol'); verifiedCol.setAttribute('label', verifiedColText);}
for (var i=0; i < ds.length; i++) {
for (var i=0; i < ds.length; ++i) {
function loadCompositeDS(datasources) { // We can't search on each individual datasource's - only the aggregate (for each sidebar tab) // has the appropriate structure. var compositeDS = Components.classes["@mozilla.org/rdf/datasource;1?name=composite-datasource"] .createInstance(Components.interfaces.nsIRDFCompositeDataSource); var ds = datasources.split(/\s+/); for (var i=0; i < ds.length; i++) { if (ds[i] == "rdf:null" || ds[i] == "") continue; try { // we need blocking here to ensure the database is loaded. var sourceDS = RDF.GetDataSourceBlocking(ds[i]); compositeDS.AddDataSource(sourceDS); } catch (e) { log("Datasource: " + ds[i] + " was not found."); } } return compositeDS;}
} else { document.getElementById("removeAllCookies").removeAttribute("disabled");
function loadCookies() { // load cookies into a table var enumerator = cookiemanager.enumerator; var count = 0; var showPolicyField = false; while (enumerator.hasMoreElements()) { var nextCookie = enumerator.getNext(); nextCookie = nextCookie.QueryInterface(Components.interfaces.nsICookie); var host = nextCookie.host; if (nextCookie.policy != nsICookie.POLICY_UNKNOWN) { showPolicyField = true; } cookies[count] = new Cookie(count++, nextCookie.name, nextCookie.value, nextCookie.isDomain, host, (host.charAt(0)==".") ? host.substring(1,host.length) : host, nextCookie.path, nextCookie.isSecure, nextCookie.expires, nextCookie.status, nextCookie.policy); } cookiesTreeView.rowCount = cookies.length; // sort and display the table cookiesTree.treeBoxObject.view = cookiesTreeView; if (window.arguments[0] == "cookieManagerFromIcon") { // came here by clicking on cookie icon // turn off the icon var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.notifyObservers(null, "cookieIcon", "off"); // unhide the status column and sort by reverse order on that column // Note that the sort routine normally does an ascending sort. The only // exception is if you sort on the same column more than once in a row. // In that case, the subsequent sorts will be the reverse of the previous ones. // So we are now going to force an initial reverse sort by fooling the sort routine // into thinking that it previously sorted on the status column and in ascending // order. document.getElementById("statusCol").removeAttribute("hidden"); lastCookieSortAscending = true; // force order to have blanks last instead of vice versa lastCookieSortColumn = 'status'; CookieColumnSort('status'); } else { // sort by host column CookieColumnSort('rawHost'); } // disable "remove all cookies" button if there are no cookies if (cookies.length == 0) { document.getElementById("removeAllCookies").setAttribute("disabled","true"); } // show policy field if at least one cookie has a policy if (showPolicyField) { document.getElementById("policyField").removeAttribute("hidden"); }}
if (!nextCookie) break;
function loadCookies() { // load cookies into a table var enumerator = cookiemanager.enumerator; var count = 0; var showPolicyField = false; while (enumerator.hasMoreElements()) { var nextCookie = enumerator.getNext(); nextCookie = nextCookie.QueryInterface(Components.interfaces.nsICookie); var host = nextCookie.host; if (nextCookie.policy != nsICookie.POLICY_UNKNOWN) { showPolicyField = true; } cookies[count] = new Cookie(count++, nextCookie.name, nextCookie.value, nextCookie.isDomain, host, (host.charAt(0)==".") ? host.substring(1,host.length) : host, nextCookie.path, nextCookie.isSecure, nextCookie.expires, nextCookie.status, nextCookie.policy); } cookiesTreeView.rowCount = cookies.length; // sort and display the table cookiesTree.treeBoxObject.view = cookiesTreeView; if (window.arguments[0] == "cookieManagerFromIcon") { // came here by clicking on cookie icon // turn off the icon var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.notifyObservers(null, "cookieIcon", "off"); // unhide the status column and sort by reverse order on that column // Note that the sort routine normally does an ascending sort. The only // exception is if you sort on the same column more than once in a row. // In that case, the subsequent sorts will be the reverse of the previous ones. // So we are now going to force an initial reverse sort by fooling the sort routine // into thinking that it previously sorted on the status column and in ascending // order. document.getElementById("statusCol").removeAttribute("hidden"); lastCookieSortAscending = true; // force order to have blanks last instead of vice versa lastCookieSortColumn = 'status'; CookieColumnSort('status'); } else { // sort by host column CookieColumnSort('rawHost'); } // disable "remove all cookies" button if there are no cookies if (cookies.length == 0) { document.getElementById("removeAllCookies").setAttribute("disabled","true"); } else { document.getElementById("removeAllCookies").removeAttribute("disabled"); } // show policy field if at least one cookie has a policy if (showPolicyField) { document.getElementById("policyField").removeAttribute("hidden"); }}
onSearch(searchTermsArrayForQS);
createSearchTermsWithList(searchTermsArrayForQS);
function LoadCustomMailView(index){ prepareForViewChange(); var searchTermsArray = gMailViewList.getMailViewAt(index).searchTerms; // create a temporary isupports array to store our search terms // since we will be modifying the terms so they work with quick search // and we don't want to write out the modified terms when we save the custom view // (see bug #189890) var searchTermsArrayForQS = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); var numEntries = searchTermsArray.Count(); for (var i = 0; i < numEntries; i++) { var searchTerm = searchTermsArray.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgSearchTerm); // clone the term, since we might be modifying it var searchTermForQS = gSearchSession.createTerm(); searchTermForQS.value = searchTerm.value; searchTermForQS.attrib = searchTerm.attrib; searchTermForQS.op = searchTerm.op; // mark the first node as a group if (i == 0) searchTermForQS.beginsGrouping = true; else if (i == numEntries - 1) searchTermForQS.endsGrouping = true; // turn the first term to true to work with quick search... searchTermForQS.booleanAnd = i ? searchTerm.booleanAnd : true; searchTermsArrayForQS.AppendElement(searchTermForQS); } onSearch(searchTermsArrayForQS); gDefaultSearchViewTerms = searchTermsArrayForQS;}
setCheckBox(asFormName, "OneStepMode", parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"OneStepMode"));
function loadData(){ var acctSetupFile = parent.parent.globals.getAcctSetupFilename(parent.parent.globals); var forceExisting = ""; var forceNew = ""; var showPhones = ""; var asFormName = "asglobals"; modeSectionName = "Mode Selection"; newSectionName = "New Acct Mode"; existingSectionName = "Existing Acct Mode"; //set the online/offline flags forceExisting = parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"ForceExisting"); forceNew = parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"ForceNew"); if ((forceNew != null) && (forceNew != "") && (forceNew == "yes")) { setRadio(asFormName, "asmode", 0); } else if ((forceExisting != null) && (forceExisting != "") && (forceExisting == "yes")) { setRadio(asFormName, "asmode", 1); } else { setRadio(asFormName, "asmode", 2); } //set the intlMode flag setCheckBox(asFormName, "intmode", parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"IntlMode")); //set the two other options flags setCheckBox(asFormName, "Show_Intro_Screens", parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"Show_Intro_Screens")); var Dialer_Idle_Time = parseInt(parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"Dialer_Disconnect_After")); if (Dialer_Idle_Time == null || isNaN(Dialer_Idle_Time) || Dialer_Idle_Time == "null" || Dialer_Idle_Time == "" || Dialer_Idle_Time < 5) Dialer_Idle_Time = 15; //default idle time setText(asFormName, "Dialer_Disconnect_After", Dialer_Idle_Time); if (parent.controls.generateControls) parent.controls.generateControls(); }//function loadData()
for (var i=0; i < ds.length; i++) {
for (var i=0; i < ds.length; ++i) {
function loadDatabases(compositeDatabase, datasources) { var ds = datasources.split(/\s+/); for (var i=0; i < ds.length; i++) { if (ds[i] == "rdf:null" || ds[i] == "") continue; try { // we need blocking here to ensure the database is loaded so getLink(topic) works. var datasource = RDF.GetDataSourceBlocking(ds[i]); if (datasource) compositeDatabase.AddDataSource(datasource); } catch (e) { log("Datasource: " + ds[i] + " was not found."); } }}
load (LIB_PATH + "utils.js"); load (LIB_PATH + "events.js"); load (LIB_PATH + "connection.js"); load (LIB_PATH + "http.js"); load (LIB_PATH + "dcc.js"); load (LIB_PATH + "irc.js"); load (LIB_PATH + "irc-debug.js"); load (LIB_PATH + "message-manager.js");
function loadDeps(){ load (LIB_PATH + "utils.js"); load (LIB_PATH + "events.js"); load (LIB_PATH + "connection.js"); load (LIB_PATH + "http.js"); load (LIB_PATH + "dcc.js"); load (LIB_PATH + "irc.js"); load (LIB_PATH + "irc-debug.js"); load (LIB_PATH + "message-manager.js"); bot.messageManager = new MessageManager(); if (!connection_init(LIB_PATH)) return false; return true; }
} if (isToDo(item)) { setElementValue("percent-complete-menulist", item.getProperty("PERCENT-COMPLETE"));
function loadDetails() { gDetailsShown = true; var item = window.calendarItem; /* attendence */ var attendeeString = ""; var attendeeListBox = document.getElementById("attendees-listbox"); var child; while ((child = attendeeListBox.lastChild) && (child.tagName == "listitem")) { attendeeListBox.removeChild(child); } for each (var attendee in item.getAttendees({})) { var listItem = document.createElement("listitem"); var nameCell = document.createElement("listcell"); nameCell.setAttribute("label", attendee.id.split("MAILTO:")[1]); listItem.appendChild(nameCell); listItem.attendee = attendee; attendeeListBox.appendChild(listItem); } /* Status */ setElementValue("item-url", item.getProperty("URL")); setElementValue("item-description", item.getProperty("DESCRIPTION")); if (isEvent(item)) { setElementValue("event-status", item.getProperty("STATUS")); } else { setElementValue("todo-status", item.getProperty("STATUS")); } /* Task completed date */ if (item.completedDate) { updateToDoStatus(item.status, item.completedDate.jsDate); } else { updateToDoStatus(item.status); } /* Priority */ var priorityInteger = parseInt(item.priority); if (priorityInteger >= 1 && priorityInteger <= 4) { document.getElementById("priority-levels").selectedIndex = 3; // high priority } else if (priorityInteger == 5) { document.getElementById("priority-levels").selectedIndex = 2; // medium priority } else if (priorityInteger >= 6 && priorityInteger <= 9) { document.getElementById("priority-levels").selectedIndex = 1; // low priority } else { document.getElementById("priority-levels").selectedIndex = 0; // not defined } /* Privacy */ switch (item.privacy) { case "PUBLIC": case "PRIVATE": case "CONFIDENTIAL": setElementValue("privacy-menulist", item.privacy); break; case "": setElementValue("private-menulist", "PUBLIC"); break; default: // bogus value dump("ERROR! Event has invalid privacy string: " + item.privacy + "\n"); break; } /* alarms */ if (item.alarmOffset) { var alarmRelatedStart = (item.alarmRelated == item.ALARM_RELATED_START); if (alarmRelatedStart) { setElementValue("alarm-trigger-relation", "START"); } else { setElementValue("alarm-trigger-relation", "END"); } var offset = item.alarmOffset; if (offset.minutes) { var minutes = offset.minutes + offset.hours*60 + offset.days*24*60 + offset.weeks*60*24*7; // Special cases for the common alarms if ((minutes == 15) && alarmRelatedStart) { document.getElementById("item-alarm").selectedIndex = 2; } else if ((minutes == 30) && alarmRelatedStart) { document.getElementById("item-alarm").selectedIndex = 3; } else { setElementValue("alarm-length-field", minutes); setElementValue("alarm-length-units", "minutes"); setElementValue("item-alarm", "custom"); } } else if (offset.hours) { var hours = offset.hours + offset.days*24 + offset.weeks*24*7; setElementValue("alarm-length-field", hours); setElementValue("alarm-length-units", "hours"); setElementValue("item-alarm", "custom"); } else { // days var days = offset.days + offset.weeks*7; setElementValue("alarm-length-field", days); setElementValue("alarm-length-units", "days"); setElementValue("item-alarm", "custom"); } } // update alarm checkbox/label/settings button updateAlarm(); updateTaskAlarmWarnings();}
dump("run LoadDetectorsMenu");
dump("run LoadDetectorsMenu()\n");
function LoadDetectorsMenu() { dump("run LoadDetectorsMenu"); var Registry = Components.classes['component://netscape/registry-viewer'].createInstance(); Registry = Registry.QueryInterface(Components.interfaces.nsIRegistryDataSource); Registry.openWellKnownRegistry(Registry.ApplicationComponentRegistry); Registry = Registry.QueryInterface(Components.interfaces.nsIRDFDataSource); var menu = document.getElementById('CharsetDetectorsMenu'); menu.database.AddDataSource(Registry); menu.setAttribute('ref', 'urn:mozilla-registry:key:/software/netscape/intl/charsetdetector'); }