rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
PlaySoundCheck(); | function Startup(){ var startupFunc; try { startupFunc = document.getElementById("mailnewsEnableMapi").getAttribute('startupFunc'); } catch (ex) { startupFunc = null; } if (startupFunc) eval(startupFunc); StartPageCheck();} |
|
element = document.getElementById("signonTab"); element.setAttribute("style","display: inline;" ); element = document.getElementById("signonSitesTab"); element.setAttribute("style","display: inline;" ); | function Startup(){ signonviewer = Components.classes["@mozilla.org/signonviewer/signonviewer-world;1"].createInstance(); signonviewer = signonviewer.QueryInterface(Components.interfaces.nsISignonViewer); doSetOKCancel(onOK, null); // init ok event handler // remove wallet functions (unless overruled by the "wallet.enabled" pref) try { pref = Components.classes['@mozilla.org/preferences;1']; pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); try { if (!pref.GetBoolPref("wallet.enabled")) { var element; element = document.getElementById("nopreview"); element.setAttribute("style","display: none;" ); element = document.getElementById("nocapture"); element.setAttribute("style","display: none;" ); } } catch(e) { dump("wallet.enabled pref is missing from all.js"); } } catch (ex) { dump("failed to get prefs service!\n"); pref = null; } var tab = window.arguments[0]; if (tab == "S") { element = document.getElementById("signonTab"); element.setAttribute("selected","true" ); element = document.getElementById("signonTab"); element.setAttribute("style","display: inline;" ); element = document.getElementById("signonSitesTab"); element.setAttribute("style","display: inline;" ); element = document.getElementById("panel"); element.setAttribute("index","0" ); } else if (tab == "W") { element = document.getElementById("signonviewer"); element.setAttribute("title", element.getAttribute("alttitle")); element = document.getElementById("nopreview"); element.setAttribute("selected","true" ); element = document.getElementById("nopreview"); element.setAttribute("style","display: inline;" ); element = document.getElementById("nocapture"); element.setAttribute("style","display: inline;" ); element = document.getElementById("panel"); element.setAttribute("index","2" ); } else { /* invalid value for argument */ } if (!LoadSignons()) { return; /* user failed to unlock the database */ } LoadReject(); LoadNopreview(); LoadNocapture();} |
|
element.setAttribute("style","display: inline;" ); | element.setAttribute("style","display: block;" ); | function Startup(){ signonviewer = Components.classes["@mozilla.org/signonviewer/signonviewer-world;1"].createInstance(); signonviewer = signonviewer.QueryInterface(Components.interfaces.nsISignonViewer); doSetOKCancel(onOK, null); // init ok event handler // remove wallet functions (unless overruled by the "wallet.enabled" pref) try { pref = Components.classes['@mozilla.org/preferences;1']; pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); try { if (!pref.GetBoolPref("wallet.enabled")) { var element; element = document.getElementById("nopreview"); element.setAttribute("style","display: none;" ); element = document.getElementById("nocapture"); element.setAttribute("style","display: none;" ); } } catch(e) { dump("wallet.enabled pref is missing from all.js"); } } catch (ex) { dump("failed to get prefs service!\n"); pref = null; } var tab = window.arguments[0]; if (tab == "S") { element = document.getElementById("signonTab"); element.setAttribute("selected","true" ); element = document.getElementById("signonTab"); element.setAttribute("style","display: inline;" ); element = document.getElementById("signonSitesTab"); element.setAttribute("style","display: inline;" ); element = document.getElementById("panel"); element.setAttribute("index","0" ); } else if (tab == "W") { element = document.getElementById("signonviewer"); element.setAttribute("title", element.getAttribute("alttitle")); element = document.getElementById("nopreview"); element.setAttribute("selected","true" ); element = document.getElementById("nopreview"); element.setAttribute("style","display: inline;" ); element = document.getElementById("nocapture"); element.setAttribute("style","display: inline;" ); element = document.getElementById("panel"); element.setAttribute("index","2" ); } else { /* invalid value for argument */ } if (!LoadSignons()) { return; /* user failed to unlock the database */ } LoadReject(); LoadNopreview(); LoadNocapture();} |
profilesElement.selectedItem = listitem; | setTimeout(function f(a) { profilesElement.selectedItem = a; }, 0, listitem); | function startup(){ try { gDialogParams = window.arguments[0]. QueryInterface(I.nsIDialogParamBlock); gProfileService = C[ToolkitProfileService].getService(I.nsIToolkitProfileService); gProfileManagerBundle = document.getElementById("bundle_profileManager"); gBrandBundle = document.getElementById("bundle_brand"); gPromptService = C[PromptService].getService(I.nsIPromptService); document.documentElement.centerWindowOnScreen(); var profilesElement = document.getElementById("profiles"); var profileList = gProfileService.profiles; while (profileList.hasMoreElements()) { var profile = profileList.getNext().QueryInterface(I.nsIToolkitProfile); var listitem = profilesElement.appendItem(profile.name, ""); var tooltiptext = gProfileManagerBundle.getFormattedString("profileTooltip", [profile.name, profile.rootDir.path]); listitem.setAttribute("tooltiptext", tooltiptext); listitem.setAttribute("class", "listitem-iconic"); listitem.profile = profile; try { if (profile === gProfileService.selectedProfile) { profilesElement.selectedItem = listitem; } } catch(e) { } } var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); autoSelectLastProfile.checked = gProfileService.startWithLastProfile; profilesElement.focus(); } catch(e) { window.close(); throw (e); }} |
var regFolder = dirServ.get("AppRegD", Components.interfaces.nsIFile); dump("New location for profile registry and user profile directories is -> " + regFolder.path + "\n"); | function StartUp(){ gDialogParams = window.arguments[0]. QueryInterface(Components.interfaces.nsIDialogParamBlock); gStartupMode = (gDialogParams.GetString(0) == "startup"); gProfileManagerBundle = document.getElementById("bundle_profileManager"); gBrandBundle = document.getElementById("bundle_brand"); SetUpOKCancelButtons(); centerWindowOnScreen(); if(window.location && window.location.search && window.location.search == "?manage=true" ) SwitchProfileManagerMode(); // Set up the intro text, depending on our context var introTextItem = document.getElementById("intro"); var introText, insertText; if (gStartupMode) { insertText = gProfileManagerBundle.getFormattedString("startButton", [gBrandBundle.getString("brandShortName")]); introText = gProfileManagerBundle.getFormattedString("intro_start", [insertText]); } else { insertText = gProfileManagerBundle.getString("selectButton"); introText = gProfileManagerBundle.getFormattedString("intro_switch", [insertText]); } introTextItem.childNodes[0].nodeValue = introText; var dirServ = Components.classes['@mozilla.org/file/directory_service;1'].createInstance(); dirServ = dirServ.QueryInterface(Components.interfaces.nsIProperties); // "AggRegF" stands for Application Registry File. // Forgive the weird name directory service has adapted for // application registry file.... var regFile = dirServ.get("AppRegF", Components.interfaces.nsIFile); Registry = Components.classes['@mozilla.org/registry;1'].createInstance(); Registry = Registry.QueryInterface(Components.interfaces.nsIRegistry); Registry.open(regFile); // get new profile registry & users location and dump it to console // to let users know about it. var regFolder = dirServ.get("AppRegD", Components.interfaces.nsIFile); dump("New location for profile registry and user profile directories is -> " + regFolder.path + "\n"); loadElements(); highlightCurrentProfile(); var offlineState = document.getElementById("offlineState"); if (gStartupMode) { // set the checkbox to reflect the current state. var ioService = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); offlineState.checked = ioService.offline; } else { // hide the checkbox in this context offlineState.hidden = true; } var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); autoSelectLastProfile.checked = profile.startWithLastUsedProfile; var profileList = document.getElementById("profiles"); profileList.focus(); DoEnabling();} |
|
var dir = prefWindow.getPref("localfile", kCacheParentDirPref); | dir = prefWindow.getPref("localfile", kCacheParentDirPref); | function Startup(){ var prefWindow = parent.hPrefWindow; gFolderField = document.getElementById("browserCacheDiskCacheFolder"); var dir = prefWindow.getPref("localfile", kCacheParentDirPref); if (dir == "!/!ERROR_UNDEFINED_PREF!/!") { try { // no disk cache folder found; default to profile directory var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"] .getService(nsIProperties); dir = dirSvc.get("ProfD", nsILocalFile); // now remember the new assumption prefWindow.setPref("localfile", kCacheParentDirPref, dir); } catch (ex) { dir = null; } } // if both pref and dir svc fail leave this field blank else show directory if (dir) gFolderField.value = (/Mac/.test(navigator.platform)) ? dir.leafName : dir.path; document.getElementById("chooseDiskCacheFolder").disabled = prefWindow.getPrefIsLocked(kCacheParentDirPref);} |
dir = dirSvc.get("ProfD", nsILocalFile); prefWindow.setPref("localfile", kCacheParentDirPref, dir); | if (dirSvc.has("ProfLD")) dir = dirSvc.get("ProfLD", nsILocalFile); else dir = dirSvc.get("ProfD", nsILocalFile); | function Startup(){ var prefWindow = parent.hPrefWindow; gFolderField = document.getElementById("browserCacheDiskCacheFolder"); var dir = prefWindow.getPref("localfile", kCacheParentDirPref); if (dir == "!/!ERROR_UNDEFINED_PREF!/!") { try { // no disk cache folder found; default to profile directory var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"] .getService(nsIProperties); dir = dirSvc.get("ProfD", nsILocalFile); // now remember the new assumption prefWindow.setPref("localfile", kCacheParentDirPref, dir); } catch (ex) { dir = null; } } // if both pref and dir svc fail leave this field blank else show directory if (dir) gFolderField.value = (/Mac/.test(navigator.platform)) ? dir.leafName : dir.path; document.getElementById("chooseDiskCacheFolder").disabled = prefWindow.getPrefIsLocked(kCacheParentDirPref);} |
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.notifyObservers(null, "charsetmenu-selected", "other"); | function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); gDialog.TitleInput = document.getElementById("TitleInput"); gDialog.charsetTree = document.getElementById('CharsetTree'); gDialog.exportToText = document.getElementById('ExportToText'); contenttypeElement = GetHTTPEquivMetaElement("content-type"); if(!contenttypeElement && (editorShell.contentsMIMEType != 'text/plain')) { contenttypeElement = CreateHTTPEquivMetaElement("content-type"); if( ! contenttypeElement ) { window.close(); return; } insertNewContentType = true; } InitDialog(); // Use the same text as the messagebox for getting title by regular "Save" document.getElementById("EnterTitleLabel").setAttribute("value",GetString("NeedDocTitle")); // This is an <HTML> element so it wraps -- append a child textnode var helpTextParent = document.getElementById("TitleHelp"); var helpText = document.createTextNode(GetString("DocTitleHelp")); if (helpTextParent) helpTextParent.appendChild(helpText); // SET FOCUS TO FIRST CONTROL SetTextboxFocus(gDialog.TitleInput); LoadAvailableCharSets(); initDone = true; SetWindowLocation();} |
|
SetTextfieldFocus(nameInput); | SetTextboxFocus(nameInput); | function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); nameInput = document.getElementById("nameInput"); // Get a single selected element of the desired type anchorElement = editorShell.GetSelectedElement(tagName); if (anchorElement) { // We found an element and don't need to insert one insertNew = false; // Make a copy to use for AdvancedEdit globalElement = anchorElement.cloneNode(false); originalName = anchorElement.name; } else { insertNew = true; // We don't have an element selected, // so create one with default attributes anchorElement = editorShell.CreateElementWithDefaults(tagName); if (anchorElement) { // Use the current selection as suggested name var name = GetSelectionAsText(); // Get 40 characters of the selected text and don't add "...", // replace whitespace with "_" and strip non-word characters name = ConvertToCDATAString(TruncateStringAtWordEnd(name, 40, false)); //Be sure the name is unique to the document if (AnchorNameExists(name)) name += "_" // Make a copy to use for AdvancedEdit globalElement = anchorElement.cloneNode(false); globalElement.setAttribute("name",name); } } if(!anchorElement) { dump("Failed to get selected element or create a new one!\n"); window.close(); } InitDialog(); SetTextfieldFocus(nameInput); SetWindowLocation();} |
{ if (top.opener) { var browser = top.opener.document.getElementById("content"); | { var useButton = document.getElementById("browserUseCurrent"); try { var browser = top.opener.document.getElementById("content"); | function Startup(){ if (top.opener) { var browser = top.opener.document.getElementById("content"); var l = browser.mPanelContainer.childNodes.length; if (l > 1) { var useButton = document.getElementById("browserUseCurrent"); useButton.label = useButton.getAttribute("label2"); } } parent.hPrefWindow.registerOKCallbackFunc(onOK);} |
if (l > 1) { var useButton = document.getElementById("browserUseCurrent"); | if (l > 1) | function Startup(){ if (top.opener) { var browser = top.opener.document.getElementById("content"); var l = browser.mPanelContainer.childNodes.length; if (l > 1) { var useButton = document.getElementById("browserUseCurrent"); useButton.label = useButton.getAttribute("label2"); } } parent.hPrefWindow.registerOKCallbackFunc(onOK);} |
} | } catch (e) { useButton.disabled = true; | function Startup(){ if (top.opener) { var browser = top.opener.document.getElementById("content"); var l = browser.mPanelContainer.childNodes.length; if (l > 1) { var useButton = document.getElementById("browserUseCurrent"); useButton.label = useButton.getAttribute("label2"); } } parent.hPrefWindow.registerOKCallbackFunc(onOK);} |
SetTextfieldFocus(dialog.TitleInput); | SetTextboxFocus(dialog.TitleInput); | function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); // Create dialog object to store controls for easy access dialog = new Object; dialog.TitleInput = document.getElementById("TitleInput"); dialog.charsetTree = document.getElementById('CharsetTree'); //dialog.charsetRoot = document.getElementById('CharsetRoot'); contenttypeElement = GetHTTPEquivMetaElement("content-type"); if(! contenttypeElement ) { contenttypeElement = CreateHTTPEquivMetaElement("content-type"); if( ! contenttypeElement ) window.close(); insertNewContentType = true; } InitDialog(); // Use the same text as the messagebox for getting title by regular "Save" document.getElementById("EnterTitleLabel").setAttribute("value",GetString("NeedDocTitle")); // This is an <HTML> element so it wraps -- append a child textnode var helpTextParent = document.getElementById("TitleHelp"); var helpText = document.createTextNode(GetString("DocTitleHelp")); if (helpTextParent) helpTextParent.appendChild(helpText); // SET FOCUS TO FIRST CONTROL SetTextfieldFocus(dialog.TitleInput); LoadAvailableCharSets(); initDone = true; SetWindowLocation();} |
if (!gDateService) { gDateService = Components.classes[nsScriptableDateFormat_CONTRACTID] .getService(nsIScriptableDateFormat); } | function Startup(){ // xpconnect to cookiemanager interface cookiemanager = Components.classes["@mozilla.org/cookiemanager;1"].getService(); cookiemanager = cookiemanager.QueryInterface(Components.interfaces.nsICookieManager); // xpconnect to permissionmanager interface permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"].getService(); permissionmanager = permissionmanager.QueryInterface(Components.interfaces.nsIPermissionManager); // intialise string bundle bundle = srGetStrBundle(JS_STRINGS_FILE); // install imageblocker tab if instructed to do so by the "imageblocker.enabled" pref try { var pref; pref = Components.classes['@mozilla.org/preferences;1']; pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); try { if (pref.GetBoolPref("imageblocker.enabled")) { var element; element = document.getElementById("imagesTab"); element.setAttribute("hidden","false" ); element = document.getElementById("images"); element.setAttribute("hidden","false" ); } } catch(e) { } try { var tab = window.arguments[0]; var element2 = document.getElementById("tabbox"); if (tab == "0") { element = document.getElementById("cookiesTab"); element2.selectedTab = element; element = document.getElementById("panel"); element.setAttribute("index","0" ); element = document.getElementById("imagesTab"); element.setAttribute("hidden","true" ); } else { element = document.getElementById("cookieviewer"); element.setAttribute("title", bundle.GetStringFromName("imageTitle")); element = document.getElementById("imagesTab"); element2.selectedTab = element; element = document.getElementById("panel"); element.setAttribute("index","2" ); element = document.getElementById("serversTab"); element.setAttribute("hidden","true" ); element = document.getElementById("cookiesTab"); element.setAttribute("hidden","true" ); } } catch(e) { } } catch (ex) { dump("failed to get prefs service!\n"); pref = null; } loadCookies(); loadPermissions(); doSetOKCancel(onOK, null); window.sizeToContent();} |
|
var dirServ = Components.classes['component: | var dirServ = Components.classes['@mozilla.org/file/directory_service;1'].createInstance(); | function StartUp(){ SetUpOKCancelButtons(); centerWindowOnScreen(); if(window.location && window.location.search && window.location.search == "?manage=true" ) SwitchProfileManagerMode(); var dirServ = Components.classes['component://netscape/file/directory_service'].createInstance(); dirServ = dirServ.QueryInterface(Components.interfaces.nsIProperties); // "AggRegF" stands for Application Registry File. // Forgive the weird name directory service has adapted for // application registry file.... var regFile = dirServ.get("AppRegF", Components.interfaces.nsIFile); Registry = Components.classes['component://netscape/registry'].createInstance(); Registry = Registry.QueryInterface(Components.interfaces.nsIRegistry); Registry.open(regFile.path); // get new profile registry & users location and dump it to console // to let users know about it. var regFolder = dirServ.get("AppRegD", Components.interfaces.nsIFile); dump("New location for profile registry and user profile directories is -> " + regFolder.path + "\n"); loadElements(); highlightCurrentProfile(); // set the checkbox to reflect the current state. var offlineState = document.getElementById("offlineState"); try { var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}", "nsIIOService"); offlineState.checked = ioService.offline; } catch(e) { } var profileTree = document.getElementById("profiles"); profileTree.focus(); DoEnabling();} |
Registry = Components.classes['component: | Registry = Components.classes['@mozilla.org/registry;1'].createInstance(); | function StartUp(){ SetUpOKCancelButtons(); centerWindowOnScreen(); if(window.location && window.location.search && window.location.search == "?manage=true" ) SwitchProfileManagerMode(); var dirServ = Components.classes['component://netscape/file/directory_service'].createInstance(); dirServ = dirServ.QueryInterface(Components.interfaces.nsIProperties); // "AggRegF" stands for Application Registry File. // Forgive the weird name directory service has adapted for // application registry file.... var regFile = dirServ.get("AppRegF", Components.interfaces.nsIFile); Registry = Components.classes['component://netscape/registry'].createInstance(); Registry = Registry.QueryInterface(Components.interfaces.nsIRegistry); Registry.open(regFile.path); // get new profile registry & users location and dump it to console // to let users know about it. var regFolder = dirServ.get("AppRegD", Components.interfaces.nsIFile); dump("New location for profile registry and user profile directories is -> " + regFolder.path + "\n"); loadElements(); highlightCurrentProfile(); // set the checkbox to reflect the current state. var offlineState = document.getElementById("offlineState"); try { var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}", "nsIIOService"); offlineState.checked = ioService.offline; } catch(e) { } var profileTree = document.getElementById("profiles"); profileTree.focus(); DoEnabling();} |
if ("arguments" in window && window.arguments[2] == true) | if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true) | function Startup(){ gNavigatorBundle = document.getElementById("bundle_navigator"); gBrandBundle = document.getElementById("bundle_brand"); gNavigatorRegionBundle = document.getElementById("bundle_navigator_region"); gBrandRegionBundle = document.getElementById("bundle_brand_region"); window.XULBrowserWindow = new nsXULBrowserWindow(); window.buttonPrefListener = new nsButtonPrefListener(); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw Components.results.NS_ERROR_FAILURE; webNavigation = getWebNavigation(); if (!webNavigation) throw Components.results.NS_ERROR_FAILURE; } catch (e) { alert("Error creating browser instance"); window.close(); // Give up. return; } _content.appCore = appCore; // Initialize browser instance.. appCore.setWebShellWindow(window); gURLBar = document.getElementById("urlbar"); // set the offline/online mode setOfflineStatus(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); // set default character set if provided if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window BrowserSetDefaultCharacterSet(arrayArgComponents[1]); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch (ex) { } // set home button tooltip text var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); //initConsoleListener(); // load appropriate initial page from commandline var isPageCycling = false; // page cycling for tinderbox tests if (!appCore.cmdLineURLUsed) isPageCycling = appCore.startPageCycler(); // only load url passed in when we're not page cycling if (!isPageCycling) { var startPage; if (!appCore.cmdLineURLUsed) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); startPage = cmdLineService.URLToLoad; if (!startPage) { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); startPage = cmdLineHandler.defaultArgs; } appCore.cmdLineURLUsed = true; } if (!startPage) { // Check for window.arguments[0]. If present, use that for startPage. if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) startPage = window.arguments[0]; } if (startPage) loadURI(startPage); // Focus the content area if the caller instructed us to. if ("arguments" in window && window.arguments[2] == true) _content.focus(); else gURLBar.focus(); // Perform default browser checking. checkForDefaultBrowser(); }} |
SetTextfieldFocus(WordInput); | SetTextboxFocus(WordInput); | function Startup(){ if (!InitEditorShell()) return; dump("EditoreditorShell found for dialog\n"); // Get the spellChecker shell spellChecker = editorShell.QueryInterface(Components.interfaces.nsIEditorSpellCheck); if (!spellChecker) { dump("SpellChecker not found!!!\n"); window.close(); } // The word to add word is passed as the 2nd extra parameter in window.openDialog() WordToAdd = window.arguments[1]; WordInput = document.getElementById("WordInput"); DictionaryList = document.getElementById("DictionaryList"); WordInput.value = WordToAdd; FillDictionaryList(); // Select the supplied word if it is already in the list SelectWordToAddInList(); SetTextfieldFocus(WordInput); SetWindowLocation();} |
setTimeout("_content.focus();", 0); | setTimeout(WindowFocusTimerCallback, 0, _content); | function Startup(){ // init globals gNavigatorBundle = document.getElementById("bundle_navigator"); gBrandBundle = document.getElementById("bundle_brand"); gNavigatorRegionBundle = document.getElementById("bundle_navigator_region"); gBrandRegionBundle = document.getElementById("bundle_brand_region"); gBrowser = document.getElementById("content"); gURLBar = document.getElementById("urlbar"); SetPageProxyState("invalid"); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw "couldn't create a browser instance"; webNavigation = getWebNavigation(); if (!webNavigation) throw "no XBL binding for browser"; } catch (e) { alert("Error launching browser window:" + e); window.close(); // Give up. return; } // Do all UI building here: // set home button tooltip text var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); // initialize observers and listeners window.XULBrowserWindow = new nsBrowserStatusHandler(); window.buttonPrefListener = new nsButtonPrefListener(); window.browserContentListener = new nsBrowserContentListener(window, getBrowser()); // XXXjag hack for directory.xul/js _content.appCore = appCore; // Initialize browser instance.. appCore.setWebShellWindow(window); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); var turboMode = false; // set default character set if provided if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window appCore.setDefaultCharacterSet(arrayArgComponents[1]); //XXXjag see bug 67442 } } else if (window.arguments[1].indexOf("turbo=yes") != -1) { turboMode = true; } } //initConsoleListener(); // wire up session history before any possible progress notifications for back/forward button updating webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); // hook up UI through progress listener getBrowser().addProgressListener(window.XULBrowserWindow); // XXXjag see bug 68662 (needed to hook up web progress listener) getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", window.XULBrowserWindow); // load appropriate initial page from commandline var isPageCycling = false; // page cycling for tinderbox tests if (!appCore.cmdLineURLUsed) isPageCycling = appCore.startPageCycler(); // only load url passed in when we're not page cycling if (!isPageCycling) { var uriToLoad; // Check for window.arguments[0]. If present, use that for uriToLoad. if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) uriToLoad = window.arguments[0]; if (uriToLoad && uriToLoad != "about:blank") { gURLBar.value = uriToLoad; loadURI(uriToLoad); } // Close the window now, if it's for turbo mode startup. if ( turboMode ) { // Set "command line used" flag. If we don't do this, then when a cmd line url // for a "real* invocation comes in, we will override it with the "cmd line url" // from the turbo-mode process (i.e., the home page). appCore.cmdLineURLUsed = true; // For some reason, window.close() directly doesn't work, so do it in the future. window.setTimeout( "window.close()", 100 ); return; } // Focus the content area if the caller instructed us to. if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true || !window.locationbar.visible) setTimeout("_content.focus();", 0); // XXXjag bug 91884 else setTimeout("gURLBar.focus();", 0); // XXXjag bug 91884 // Perform default browser checking. checkForDefaultBrowser(); // hook up remote support if (XREMOTESERVICE_CONTRACTID in Components.classes) { var remoteService; remoteService = Components.classes[XREMOTESERVICE_CONTRACTID] .getService(Components.interfaces.nsIXRemoteService); remoteService.addBrowserInstance(window); } }} |
setTimeout("gURLBar.focus();", 0); | setTimeout(WindowFocusTimerCallback, 0, gURLBar); | function Startup(){ // init globals gNavigatorBundle = document.getElementById("bundle_navigator"); gBrandBundle = document.getElementById("bundle_brand"); gNavigatorRegionBundle = document.getElementById("bundle_navigator_region"); gBrandRegionBundle = document.getElementById("bundle_brand_region"); gBrowser = document.getElementById("content"); gURLBar = document.getElementById("urlbar"); SetPageProxyState("invalid"); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw "couldn't create a browser instance"; webNavigation = getWebNavigation(); if (!webNavigation) throw "no XBL binding for browser"; } catch (e) { alert("Error launching browser window:" + e); window.close(); // Give up. return; } // Do all UI building here: // set home button tooltip text var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); // initialize observers and listeners window.XULBrowserWindow = new nsBrowserStatusHandler(); window.buttonPrefListener = new nsButtonPrefListener(); window.browserContentListener = new nsBrowserContentListener(window, getBrowser()); // XXXjag hack for directory.xul/js _content.appCore = appCore; // Initialize browser instance.. appCore.setWebShellWindow(window); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); var turboMode = false; // set default character set if provided if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window appCore.setDefaultCharacterSet(arrayArgComponents[1]); //XXXjag see bug 67442 } } else if (window.arguments[1].indexOf("turbo=yes") != -1) { turboMode = true; } } //initConsoleListener(); // wire up session history before any possible progress notifications for back/forward button updating webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); // hook up UI through progress listener getBrowser().addProgressListener(window.XULBrowserWindow); // XXXjag see bug 68662 (needed to hook up web progress listener) getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", window.XULBrowserWindow); // load appropriate initial page from commandline var isPageCycling = false; // page cycling for tinderbox tests if (!appCore.cmdLineURLUsed) isPageCycling = appCore.startPageCycler(); // only load url passed in when we're not page cycling if (!isPageCycling) { var uriToLoad; // Check for window.arguments[0]. If present, use that for uriToLoad. if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) uriToLoad = window.arguments[0]; if (uriToLoad && uriToLoad != "about:blank") { gURLBar.value = uriToLoad; loadURI(uriToLoad); } // Close the window now, if it's for turbo mode startup. if ( turboMode ) { // Set "command line used" flag. If we don't do this, then when a cmd line url // for a "real* invocation comes in, we will override it with the "cmd line url" // from the turbo-mode process (i.e., the home page). appCore.cmdLineURLUsed = true; // For some reason, window.close() directly doesn't work, so do it in the future. window.setTimeout( "window.close()", 100 ); return; } // Focus the content area if the caller instructed us to. if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true || !window.locationbar.visible) setTimeout("_content.focus();", 0); // XXXjag bug 91884 else setTimeout("gURLBar.focus();", 0); // XXXjag bug 91884 // Perform default browser checking. checkForDefaultBrowser(); // hook up remote support if (XREMOTESERVICE_CONTRACTID in Components.classes) { var remoteService; remoteService = Components.classes[XREMOTESERVICE_CONTRACTID] .getService(Components.interfaces.nsIXRemoteService); remoteService.addBrowserInstance(window); } }} |
for( var index in settings ) { var setting = settings[ index ]; var checkbox = document.getElementById( setting ); if ( checkbox && prefs[ setting ] ) { checkbox.setAttribute( "checked", "true" ); } } | parent.winHooks.winhooks = winhooks; parent.winHooks.prefs = prefs; parent.hPrefWindow.registerOKCallbackFunc( onOK ); | function Startup() { if ( !winhooks ) { // Get component service. try { winhooks = Components.classes[ "@mozilla.org/winhooks;1" ].getService( Components.interfaces.nsIWindowsHooks ); if ( winhooks ) { // Try to get preferences. prefs = winhooks.settings; // Now transfer those to the dialog checkboxes. for( var index in settings ) { var setting = settings[ index ]; var checkbox = document.getElementById( setting ); if ( checkbox && prefs[ setting ] ) { checkbox.setAttribute( "checked", "true" ); } } } } catch(e) { dump( e + "\n" ); alert( "Rats!" ); } } // If all is well, hook into "Ok". if ( winhooks && prefs && parent && parent.hPrefWindow ) { parent.hPrefWindow.registerOKCallbackFunc( onOK ); }} |
alert( "Rats!" ); | function Startup() { if ( !winhooks ) { // Get component service. try { winhooks = Components.classes[ "@mozilla.org/winhooks;1" ].getService( Components.interfaces.nsIWindowsHooks ); if ( winhooks ) { // Try to get preferences. prefs = winhooks.settings; // Now transfer those to the dialog checkboxes. for( var index in settings ) { var setting = settings[ index ]; var checkbox = document.getElementById( setting ); if ( checkbox && prefs[ setting ] ) { checkbox.setAttribute( "checked", "true" ); } } } } catch(e) { dump( e + "\n" ); alert( "Rats!" ); } } // If all is well, hook into "Ok". if ( winhooks && prefs && parent && parent.hPrefWindow ) { parent.hPrefWindow.registerOKCallbackFunc( onOK ); }} |
|
if ( winhooks && prefs && parent && parent.hPrefWindow ) { parent.hPrefWindow.registerOKCallbackFunc( onOK ); | for( var index in settings ) { var setting = settings[ index ]; var checkbox = document.getElementById( setting ); if ( checkbox && prefs[ setting ] ) { checkbox.setAttribute( "checked", "true" ); } | function Startup() { if ( !winhooks ) { // Get component service. try { winhooks = Components.classes[ "@mozilla.org/winhooks;1" ].getService( Components.interfaces.nsIWindowsHooks ); if ( winhooks ) { // Try to get preferences. prefs = winhooks.settings; // Now transfer those to the dialog checkboxes. for( var index in settings ) { var setting = settings[ index ]; var checkbox = document.getElementById( setting ); if ( checkbox && prefs[ setting ] ) { checkbox.setAttribute( "checked", "true" ); } } } } catch(e) { dump( e + "\n" ); alert( "Rats!" ); } } // If all is well, hook into "Ok". if ( winhooks && prefs && parent && parent.hPrefWindow ) { parent.hPrefWindow.registerOKCallbackFunc( onOK ); }} |
const kPrefSvcContractID = "@mozilla.org/preferences;1"; const kPrefSvcIID = Components.interfaces.nsIPref; | const kPrefSvcContractID = "@mozilla.org/preferences-service;1"; const kPrefSvcIID = Components.interfaces.nsIPrefService; | function Startup(){ gData = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-themes.xul"]; var list = document.getElementById( "skinsList" ); if ("loaded" in gData && "themeIndex" in gData) { list.selectedIndex = gData.themeIndex; return; } gData.loaded = true; parent.hPrefWindow.registerOKCallbackFunc( applySkin ); const kPrefSvcContractID = "@mozilla.org/preferences;1"; const kPrefSvcIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID); var theme = null; try { theme = kPrefSvc.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data; } catch (e) { } var matches; for (var i = 0; i < list.childNodes.length; ++i) { var child = list.childNodes[i]; var name = child.getAttribute("name"); if (name) { if (!theme) matches = chromeRegistry.isSkinSelected(name, true) == Components.interfaces.nsIChromeRegistry.FULL; else matches = name == theme; if (matches) { list.selectItem(child); break; } } } var navbundle = document.getElementById("bundle_navigator"); var showSkinsDescription = navbundle.getString("showskinsdescription"); if( showSkinsDescription == "false" ) { gShowDescription = false; var description = document.getElementById("description"); while (description.hasChildNodes()) description.removeChild(description.firstChild); }} |
list = walletpreview.GetPrefillValue(); BREAK = list[0]; | var list = walletpreview.GetPrefillValue(); var BREAK = list[0]; | function Startup() { /* fetch the input */ list = walletpreview.GetPrefillValue(); BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); var heading = document.getElementById("heading"); heading.setAttribute("value", bundle.GetStringFromName("heading")); var fieldHeading = document.getElementById("fieldHeading"); fieldHeading.setAttribute("value", bundle.GetStringFromName("fieldHeading")); var valueHeading = document.getElementById("valueHeading"); valueHeading.setAttribute("value", bundle.GetStringFromName("valueHeading")); var menuPopup; var count; /* create the fill-in entries */ for (i=1; i<prefillList.length-2; i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; menuPopup = document.createElement("menupopup");// menuList.setAttribute("size", Number(count)+1); } count--; var menuItem = document.createElement("menuitem"); if (count == (prefillList[i]-1)) { menuItem.setAttribute("selected", "true"); } menuItem.setAttribute("data", prefillList[i+1]); menuItem.setAttribute("value", prefillList[i+2]); menuPopup.appendChild(menuItem); if(count == 0) { var lastMenuItem = document.createElement("menuitem"); lastMenuItem.setAttribute("data", prefillList[i+1]); lastMenuItem.setAttribute("value", "<"+doNotPrefill+">"); menuPopup.appendChild(lastMenuItem); var menuList = document.createElement("menulist"); menuList.setAttribute("id", "x"+(++fieldCount)); menuList.setAttribute("allowevents", "true"); menuList.appendChild(menuPopup); var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);} |
var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); | var title = document.getElementById("walletpreview"); title.setAttribute("title", bundle.GetStringFromName("title")); | function Startup() { /* fetch the input */ list = walletpreview.GetPrefillValue(); BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); var heading = document.getElementById("heading"); heading.setAttribute("value", bundle.GetStringFromName("heading")); var fieldHeading = document.getElementById("fieldHeading"); fieldHeading.setAttribute("value", bundle.GetStringFromName("fieldHeading")); var valueHeading = document.getElementById("valueHeading"); valueHeading.setAttribute("value", bundle.GetStringFromName("valueHeading")); var menuPopup; var count; /* create the fill-in entries */ for (i=1; i<prefillList.length-2; i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; menuPopup = document.createElement("menupopup");// menuList.setAttribute("size", Number(count)+1); } count--; var menuItem = document.createElement("menuitem"); if (count == (prefillList[i]-1)) { menuItem.setAttribute("selected", "true"); } menuItem.setAttribute("data", prefillList[i+1]); menuItem.setAttribute("value", prefillList[i+2]); menuPopup.appendChild(menuItem); if(count == 0) { var lastMenuItem = document.createElement("menuitem"); lastMenuItem.setAttribute("data", prefillList[i+1]); lastMenuItem.setAttribute("value", "<"+doNotPrefill+">"); menuPopup.appendChild(lastMenuItem); var menuList = document.createElement("menulist"); menuList.setAttribute("id", "x"+(++fieldCount)); menuList.setAttribute("allowevents", "true"); menuList.appendChild(menuPopup); var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);} |
for (i=1; i<prefillList.length-2; i+=3) { | for (var i=1; i<prefillList.length-2; i+=3) { | function Startup() { /* fetch the input */ list = walletpreview.GetPrefillValue(); BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); var heading = document.getElementById("heading"); heading.setAttribute("value", bundle.GetStringFromName("heading")); var fieldHeading = document.getElementById("fieldHeading"); fieldHeading.setAttribute("value", bundle.GetStringFromName("fieldHeading")); var valueHeading = document.getElementById("valueHeading"); valueHeading.setAttribute("value", bundle.GetStringFromName("valueHeading")); var menuPopup; var count; /* create the fill-in entries */ for (i=1; i<prefillList.length-2; i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; menuPopup = document.createElement("menupopup");// menuList.setAttribute("size", Number(count)+1); } count--; var menuItem = document.createElement("menuitem"); if (count == (prefillList[i]-1)) { menuItem.setAttribute("selected", "true"); } menuItem.setAttribute("data", prefillList[i+1]); menuItem.setAttribute("value", prefillList[i+2]); menuPopup.appendChild(menuItem); if(count == 0) { var lastMenuItem = document.createElement("menuitem"); lastMenuItem.setAttribute("data", prefillList[i+1]); lastMenuItem.setAttribute("value", "<"+doNotPrefill+">"); menuPopup.appendChild(lastMenuItem); var menuList = document.createElement("menulist"); menuList.setAttribute("id", "x"+(++fieldCount)); menuList.setAttribute("allowevents", "true"); menuList.appendChild(menuPopup); var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);} |
var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) | var textField = document.createElement("textfield"); textField.setAttribute("value", prefillList[i+1]); textField.setAttribute("readonly", "true"); | function Startup() { /* fetch the input */ list = walletpreview.GetPrefillValue(); BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); var heading = document.getElementById("heading"); heading.setAttribute("value", bundle.GetStringFromName("heading")); var fieldHeading = document.getElementById("fieldHeading"); fieldHeading.setAttribute("value", bundle.GetStringFromName("fieldHeading")); var valueHeading = document.getElementById("valueHeading"); valueHeading.setAttribute("value", bundle.GetStringFromName("valueHeading")); var menuPopup; var count; /* create the fill-in entries */ for (i=1; i<prefillList.length-2; i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; menuPopup = document.createElement("menupopup");// menuList.setAttribute("size", Number(count)+1); } count--; var menuItem = document.createElement("menuitem"); if (count == (prefillList[i]-1)) { menuItem.setAttribute("selected", "true"); } menuItem.setAttribute("data", prefillList[i+1]); menuItem.setAttribute("value", prefillList[i+2]); menuPopup.appendChild(menuItem); if(count == 0) { var lastMenuItem = document.createElement("menuitem"); lastMenuItem.setAttribute("data", prefillList[i+1]); lastMenuItem.setAttribute("value", "<"+doNotPrefill+">"); menuPopup.appendChild(lastMenuItem); var menuList = document.createElement("menulist"); menuList.setAttribute("id", "x"+(++fieldCount)); menuList.setAttribute("allowevents", "true"); menuList.appendChild(menuPopup); var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);} |
var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); | var row = document.createElement("row"); row.appendChild(textField); row.appendChild(menuList); | function Startup() { /* fetch the input */ list = walletpreview.GetPrefillValue(); BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); var heading = document.getElementById("heading"); heading.setAttribute("value", bundle.GetStringFromName("heading")); var fieldHeading = document.getElementById("fieldHeading"); fieldHeading.setAttribute("value", bundle.GetStringFromName("fieldHeading")); var valueHeading = document.getElementById("valueHeading"); valueHeading.setAttribute("value", bundle.GetStringFromName("valueHeading")); var menuPopup; var count; /* create the fill-in entries */ for (i=1; i<prefillList.length-2; i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; menuPopup = document.createElement("menupopup");// menuList.setAttribute("size", Number(count)+1); } count--; var menuItem = document.createElement("menuitem"); if (count == (prefillList[i]-1)) { menuItem.setAttribute("selected", "true"); } menuItem.setAttribute("data", prefillList[i+1]); menuItem.setAttribute("value", prefillList[i+2]); menuPopup.appendChild(menuItem); if(count == 0) { var lastMenuItem = document.createElement("menuitem"); lastMenuItem.setAttribute("data", prefillList[i+1]); lastMenuItem.setAttribute("value", "<"+doNotPrefill+">"); menuPopup.appendChild(lastMenuItem); var menuList = document.createElement("menulist"); menuList.setAttribute("id", "x"+(++fieldCount)); menuList.setAttribute("allowevents", "true"); menuList.appendChild(menuPopup); var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);} |
var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); | var rows = document.getElementById("rows"); rows.appendChild(row); | function Startup() { /* fetch the input */ list = walletpreview.GetPrefillValue(); BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); var heading = document.getElementById("heading"); heading.setAttribute("value", bundle.GetStringFromName("heading")); var fieldHeading = document.getElementById("fieldHeading"); fieldHeading.setAttribute("value", bundle.GetStringFromName("fieldHeading")); var valueHeading = document.getElementById("valueHeading"); valueHeading.setAttribute("value", bundle.GetStringFromName("valueHeading")); var menuPopup; var count; /* create the fill-in entries */ for (i=1; i<prefillList.length-2; i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; menuPopup = document.createElement("menupopup");// menuList.setAttribute("size", Number(count)+1); } count--; var menuItem = document.createElement("menuitem"); if (count == (prefillList[i]-1)) { menuItem.setAttribute("selected", "true"); } menuItem.setAttribute("data", prefillList[i+1]); menuItem.setAttribute("value", prefillList[i+2]); menuPopup.appendChild(menuItem); if(count == 0) { var lastMenuItem = document.createElement("menuitem"); lastMenuItem.setAttribute("data", prefillList[i+1]); lastMenuItem.setAttribute("value", "<"+doNotPrefill+">"); menuPopup.appendChild(lastMenuItem); var menuList = document.createElement("menulist"); menuList.setAttribute("id", "x"+(++fieldCount)); menuList.setAttribute("allowevents", "true"); menuList.appendChild(menuPopup); var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);} |
var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); | function Startup() { /* fetch the input */ list = walletpreview.GetPrefillValue(); BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var heading = document.getElementById("walletpreview"); heading.setAttribute("title", bundle.GetStringFromName("title")); var heading = document.getElementById("heading"); heading.setAttribute("value", bundle.GetStringFromName("heading")); var fieldHeading = document.getElementById("fieldHeading"); fieldHeading.setAttribute("value", bundle.GetStringFromName("fieldHeading")); var valueHeading = document.getElementById("valueHeading"); valueHeading.setAttribute("value", bundle.GetStringFromName("valueHeading")); var menuPopup; var count; /* create the fill-in entries */ for (i=1; i<prefillList.length-2; i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; menuPopup = document.createElement("menupopup");// menuList.setAttribute("size", Number(count)+1); } count--; var menuItem = document.createElement("menuitem"); if (count == (prefillList[i]-1)) { menuItem.setAttribute("selected", "true"); } menuItem.setAttribute("data", prefillList[i+1]); menuItem.setAttribute("value", prefillList[i+2]); menuPopup.appendChild(menuItem); if(count == 0) { var lastMenuItem = document.createElement("menuitem"); lastMenuItem.setAttribute("data", prefillList[i+1]); lastMenuItem.setAttribute("value", "<"+doNotPrefill+">"); menuPopup.appendChild(lastMenuItem); var menuList = document.createElement("menulist"); menuList.setAttribute("id", "x"+(++fieldCount)); menuList.setAttribute("allowevents", "true"); menuList.appendChild(menuPopup); var treeCell0 = document.createElement("treecell"); treeCell0.setAttribute("value", prefillList[i+1]) var treeCell = document.createElement("treecell"); treeCell.appendChild(menuList); var treeRow = document.createElement("treerow"); treeRow.appendChild(treeCell0); treeRow.appendChild(treeCell); var treeItem = document.createElement("treeitem"); treeItem.appendChild(treeRow); var treeChildren = document.getElementById("combolists"); treeChildren.appendChild(treeItem); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);} |
|
dialogElement.setAttribute("title", dialogElement.getAttribute("selectFolderTitle")); | document.title = dialogElement.getAttribute("selectFolderTitle"); | function Startup(){ gFld_Name = document.getElementById("name"); gFld_URL = document.getElementById("url"); gFld_ShortcutURL = document.getElementById("shortcutUrl"); gCB_AddGroup = document.getElementById("addgroup"); var bookmarkView = document.getElementById("bookmarks-view"); var shouldSetOKButton = true; var dialogElement = document.documentElement; if ("arguments" in window) { var ind; var folderItem = null; var arg; if (window.arguments.length < 5) arg = null; else arg = window.arguments[4]; switch (arg) { case "selectFolder": // If we're being opened as a folder selection window document.getElementById("bookmarknamegrid").hidden = true; document.getElementById("showaddgroup").hidden = true; document.getElementById("destinationSeparator").hidden = true; document.getElementById("nameseparator").hidden = true; dialogElement.setAttribute("title", dialogElement.getAttribute("selectFolderTitle")); shouldSetOKButton = false; if (window.arguments[2]) folderItem = bookmarkView.rdf.GetResource(window.arguments[2]); if (folderItem) { ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem); bookmarkView.view.selection.select(ind); } break; case "newBookmark": document.getElementById("showaddgroup").hidden = true; document.getElementById("destinationSeparator").hidden = true; document.getElementById("folderbox").hidden = true; setupFields(); if (window.arguments[2]) gCreateInFolder = window.arguments[2]; break; case "addGroup": setupFields(); break; case "addGroup,group": gCB_AddGroup.checked = true; setupFields(); toggleGroup(); break; default: // Regular Add Bookmark document.getElementById("showaddgroup").hidden = true; setupFields(); if (window.arguments[2]) { gCreateInFolder = window.arguments[2]; folderItem = bookmarkView.rdf.GetResource(gCreateInFolder); if (folderItem) { ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem); bookmarkView.view.selection.select(ind); } } } } if ((arg != "newBookmark") && (bookmarkView.currentIndex == -1)) bookmarkView.view.selection.select(0); if (shouldSetOKButton) onFieldInput(); if (document.getElementById("bookmarknamegrid").hidden) { bookmarkView.tree.focus(); } else { gFld_Name.select(); gFld_Name.focus(); } // XXX fix old profiles dialogElement.removeAttribute("height"); dialogElement.removeAttribute("width"); sizeToContent();} |
return; | function Startup(){ //XXX Very weird! When calling this with an existing image, // we get called twice. That causes dialog layout // to explode to fullscreen! if (StartupCalled) { dump("*** CALLING IMAGE DIALOG Startup() AGAIN! ***\n"); return; } StartupCalled = true; if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); // Create dialog object to store controls for easy access dialog = new Object; dialog.srcInput = document.getElementById( "srcInput" ); dialog.altTextInput = document.getElementById( "altTextInput" ); dialog.MoreFewerButton = document.getElementById( "MoreFewerButton" ); dialog.AdvancedEditButton = document.getElementById( "AdvancedEditButton" ); dialog.AdvancedEditButton2 = document.getElementById( "AdvancedEditButton2" ); dialog.MoreSection = document.getElementById( "MoreSection" ); dialog.customSizeRadio = document.getElementById( "customSizeRadio" ); dialog.actualSizeRadio = document.getElementById( "actualSizeRadio" ); dialog.constrainCheckbox = document.getElementById( "constrainCheckbox" ); dialog.widthInput = document.getElementById( "widthInput" ); dialog.heightInput = document.getElementById( "heightInput" ); dialog.widthUnitsMenulist = document.getElementById( "widthUnitsMenulist" ); dialog.heightUnitsMenulist = document.getElementById( "heightUnitsMenulist" ); dialog.imagelrInput = document.getElementById( "imageleftrightInput" ); dialog.imagetbInput = document.getElementById( "imagetopbottomInput" ); dialog.border = document.getElementById( "border" ); dialog.alignTypeSelect = document.getElementById( "alignTypeSelect" ); dialog.alignImage = document.getElementById( "alignImage" ); dialog.alignText = document.getElementById( "alignText" ); dialog.editImageMap = document.getElementById( "editImageMap" ); dialog.removeImageMap = document.getElementById( "removeImageMap" ); dialog.ImageHolder = document.getElementById( "preview-image-holder" ); dialog.PreviewBox = document.getElementById( "preview-image-box" ); dialog.PreviewWidth = document.getElementById( "PreviewWidth" ); dialog.PreviewHeight = document.getElementById( "PreviewHeight" ); dialog.PreviewSize = document.getElementById( "PreviewSize" ); // Get a single selected image element var tagName = "img" imageElement = editorShell.GetSelectedElement(tagName); if (imageElement) { // We found an element and don't need to insert one insertNew = false; actualWidth = imageElement.naturalWidth; actualHeight = imageElement.naturalHeight; } else { insertNew = true; // We don't have an element selected, // so create one with default attributes imageElement = editorShell.CreateElementWithDefaults(tagName); if( !imageElement ) { dump("Failed to get selected element or create a new one!\n"); window.close(); } } // Make a copy to use for AdvancedEdit globalElement = imageElement.cloneNode(false); // Get image map for image var usemap = globalElement.getAttribute("usemap"); if (usemap) { var mapname = usemap.substring(1, usemap.length); var mapCollection = editorShell.editorDocument.getElementsByName(mapname); if (mapCollection[0] != null) { imageMap = mapCollection[0]; globalMap = imageMap; canRemoveImageMap = true; insertNewIMap = false; dump(imageMap.childNodes.length+"\n"); } else { insertNewIMap = true; globalMap = null; } } else { insertNewIMap = true; globalMap = null; } InitDialog(); // By default turn constrain on, but both width and height must be in pixels dialog.constrainCheckbox.checked = dialog.widthUnitsMenulist.selectedIndex == 0 && dialog.heightUnitsMenulist.selectedIndex == 0; // Set SeeMore bool to the OPPOSITE of the current state, // which is automatically saved by using the 'persist="more"' // attribute on the MoreFewerButton button // onMoreFewer will toggle the state and redraw the dialog SeeMore = (dialog.MoreFewerButton.getAttribute("more") != "1"); // Initialize widgets with image attributes in the case where the entire dialog isn't visible onMoreFewer(); // this call will initialize all widgets if entire dialog is visible SetTextboxFocus(dialog.srcInput); SetWindowLocation();} |
|
.classes["component: | .classes["@mozilla.org/embedding/browser/nsCommandHandler;1"] | function Startup(){ window.XULBrowserWindow = new nsXULBrowserWindow(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // create the embedding command handler netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var commandHandlerInit = Components .classes["component://netscape/embedding/browser/nsCommandHandler"] .createInstance(Components.interfaces.nsICommandHandlerInit); // Attach it to the window commandHandlerInit.window = window; commandHandler = commandHandlerInit.QueryInterface(Components.interfaces.nsICommandHandler); gURLBar = document.getElementById("urlbar");} |
const kRDF = gBookmarksShell.RDF; const krNavCenter = kRDF.GetResource("NC:NavCenter"); const kRDFCUtilsContractID = "@mozilla.org/rdf/container-utils;1"; const kRDFCUtilsIID = Components.interfaces.nsIRDFContainerUtils; const kRDFCUtils = Components.classes[kRDFCUtilsContractID].getService(kRDFCUtilsIID); const kNC_NavCenter = kRDFCUtils.MakeSeq(gBookmarksShell.db, krNavCenter); const krBookmarksRoot = kRDF.GetResource("NC:BookmarksRoot"); const krName = kRDF.GetResource(NC_NS + "Name"); | function Startup(){ // Create the Bookmarks Shell var bookmarksTree = document.getElementById("bookmarksTree"); gBookmarksShell = new BookmarksWindowTree (bookmarksTree.database); // Set up the tree controller bookmarksTree.controllers.appendController(gBookmarksShell.controller); const windowNode = document.getElementById("bookmark-window"); // If we've been opened with a parameter, root the tree on it. if ("arguments" in window && window.arguments[0]) { bookmarksTree.setAttribute("ref", window.arguments[0]); const krNameArc = gBookmarksShell.RDF.GetResource(NC_NS + "Name"); const krRoot = gBookmarksShell.RDF.GetResource(window.arguments[0]); var rName = gBookmarksShell.db.GetTarget(krRoot, krNameArc, true); rName = rName.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; const titleString = gBookmarksShell.getLocaleString("window_title"); windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, rName)); } else { // There's a better way of doing this, but for the initial revision just // using the root folder in the bookmarks window will do. // For the next milestone I'd like to move this either into the bookmarks // service or some other higher level datasource so that it can be accessed // from everywhere. const kRDF = gBookmarksShell.RDF; const krNavCenter = kRDF.GetResource("NC:NavCenter"); const kRDFCUtilsContractID = "@mozilla.org/rdf/container-utils;1"; const kRDFCUtilsIID = Components.interfaces.nsIRDFContainerUtils; const kRDFCUtils = Components.classes[kRDFCUtilsContractID].getService(kRDFCUtilsIID); const kNC_NavCenter = kRDFCUtils.MakeSeq(gBookmarksShell.db, krNavCenter); const krBookmarksRoot = kRDF.GetResource("NC:BookmarksRoot"); const krName = kRDF.GetResource(NC_NS + "Name"); var rootfoldername = gBookmarksShell.getLocaleString("bookmarks_root"); const kProfileContractID = "@mozilla.org/profile/manager;1"; const kProfileIID = Components.interfaces.nsIProfile; const kProfile = Components.classes[kProfileContractID].getService(kProfileIID); rootfoldername = rootfoldername.replace(/%user_name%/, kProfile.currentProfile); const klBookmarksRootName = kRDF.GetLiteral(rootfoldername); const kBMDS = kRDF.GetDataSource("rdf:bookmarks"); kBMDS.Assert(krBookmarksRoot, krName, klBookmarksRootName, true); kNC_NavCenter.AppendElement(krBookmarksRoot); windowNode.setAttribute("title", rootfoldername); /* Blue Sky const krHistoryRoot = kRDF.GetResource("NC:HistoryRoot"); const klHistoryRootName = kRDF.GetLiteral("Browsing History"); const kHistory = kRDF.GetDataSource("rdf:history"); kHistory.Assert(krHistoryRoot, krName, klHistoryRootName, true); kNC_NavCenter.AppendElement(krHistoryRoot); */ const krType = kRDF.GetResource(RDF_NS + "type"); const krFolderType = kRDF.GetResource(NC_NS + "Folder"); gBookmarksShell.db.Assert(krNavCenter, krType, krFolderType, true); } // Update to the last sort. RefreshSort(); // Initialize the tree widget. var children = document.getElementById("treechildren-bookmarks"); if (children.firstChild) { bookmarksTree.selectItem(children.firstChild); children.firstChild.setAttribute("open", "true"); } // XXX templates suck ASS var node = document.getElementById("NC:BookmarksRoot"); if (node.localName == "menubutton") node.removeAttribute("open"); bookmarksTree.focus();} |
|
const klBookmarksRootName = kRDF.GetLiteral(rootfoldername); const kBMDS = kRDF.GetDataSource("rdf:bookmarks"); kBMDS.Assert(krBookmarksRoot, krName, klBookmarksRootName, true); kNC_NavCenter.AppendElement(krBookmarksRoot); | function Startup(){ // Create the Bookmarks Shell var bookmarksTree = document.getElementById("bookmarksTree"); gBookmarksShell = new BookmarksWindowTree (bookmarksTree.database); // Set up the tree controller bookmarksTree.controllers.appendController(gBookmarksShell.controller); const windowNode = document.getElementById("bookmark-window"); // If we've been opened with a parameter, root the tree on it. if ("arguments" in window && window.arguments[0]) { bookmarksTree.setAttribute("ref", window.arguments[0]); const krNameArc = gBookmarksShell.RDF.GetResource(NC_NS + "Name"); const krRoot = gBookmarksShell.RDF.GetResource(window.arguments[0]); var rName = gBookmarksShell.db.GetTarget(krRoot, krNameArc, true); rName = rName.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; const titleString = gBookmarksShell.getLocaleString("window_title"); windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, rName)); } else { // There's a better way of doing this, but for the initial revision just // using the root folder in the bookmarks window will do. // For the next milestone I'd like to move this either into the bookmarks // service or some other higher level datasource so that it can be accessed // from everywhere. const kRDF = gBookmarksShell.RDF; const krNavCenter = kRDF.GetResource("NC:NavCenter"); const kRDFCUtilsContractID = "@mozilla.org/rdf/container-utils;1"; const kRDFCUtilsIID = Components.interfaces.nsIRDFContainerUtils; const kRDFCUtils = Components.classes[kRDFCUtilsContractID].getService(kRDFCUtilsIID); const kNC_NavCenter = kRDFCUtils.MakeSeq(gBookmarksShell.db, krNavCenter); const krBookmarksRoot = kRDF.GetResource("NC:BookmarksRoot"); const krName = kRDF.GetResource(NC_NS + "Name"); var rootfoldername = gBookmarksShell.getLocaleString("bookmarks_root"); const kProfileContractID = "@mozilla.org/profile/manager;1"; const kProfileIID = Components.interfaces.nsIProfile; const kProfile = Components.classes[kProfileContractID].getService(kProfileIID); rootfoldername = rootfoldername.replace(/%user_name%/, kProfile.currentProfile); const klBookmarksRootName = kRDF.GetLiteral(rootfoldername); const kBMDS = kRDF.GetDataSource("rdf:bookmarks"); kBMDS.Assert(krBookmarksRoot, krName, klBookmarksRootName, true); kNC_NavCenter.AppendElement(krBookmarksRoot); windowNode.setAttribute("title", rootfoldername); /* Blue Sky const krHistoryRoot = kRDF.GetResource("NC:HistoryRoot"); const klHistoryRootName = kRDF.GetLiteral("Browsing History"); const kHistory = kRDF.GetDataSource("rdf:history"); kHistory.Assert(krHistoryRoot, krName, klHistoryRootName, true); kNC_NavCenter.AppendElement(krHistoryRoot); */ const krType = kRDF.GetResource(RDF_NS + "type"); const krFolderType = kRDF.GetResource(NC_NS + "Folder"); gBookmarksShell.db.Assert(krNavCenter, krType, krFolderType, true); } // Update to the last sort. RefreshSort(); // Initialize the tree widget. var children = document.getElementById("treechildren-bookmarks"); if (children.firstChild) { bookmarksTree.selectItem(children.firstChild); children.firstChild.setAttribute("open", "true"); } // XXX templates suck ASS var node = document.getElementById("NC:BookmarksRoot"); if (node.localName == "menubutton") node.removeAttribute("open"); bookmarksTree.focus();} |
|
const krType = kRDF.GetResource(RDF_NS + "type"); const krFolderType = kRDF.GetResource(NC_NS + "Folder"); gBookmarksShell.db.Assert(krNavCenter, krType, krFolderType, true); | function Startup(){ // Create the Bookmarks Shell var bookmarksTree = document.getElementById("bookmarksTree"); gBookmarksShell = new BookmarksWindowTree (bookmarksTree.database); // Set up the tree controller bookmarksTree.controllers.appendController(gBookmarksShell.controller); const windowNode = document.getElementById("bookmark-window"); // If we've been opened with a parameter, root the tree on it. if ("arguments" in window && window.arguments[0]) { bookmarksTree.setAttribute("ref", window.arguments[0]); const krNameArc = gBookmarksShell.RDF.GetResource(NC_NS + "Name"); const krRoot = gBookmarksShell.RDF.GetResource(window.arguments[0]); var rName = gBookmarksShell.db.GetTarget(krRoot, krNameArc, true); rName = rName.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; const titleString = gBookmarksShell.getLocaleString("window_title"); windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, rName)); } else { // There's a better way of doing this, but for the initial revision just // using the root folder in the bookmarks window will do. // For the next milestone I'd like to move this either into the bookmarks // service or some other higher level datasource so that it can be accessed // from everywhere. const kRDF = gBookmarksShell.RDF; const krNavCenter = kRDF.GetResource("NC:NavCenter"); const kRDFCUtilsContractID = "@mozilla.org/rdf/container-utils;1"; const kRDFCUtilsIID = Components.interfaces.nsIRDFContainerUtils; const kRDFCUtils = Components.classes[kRDFCUtilsContractID].getService(kRDFCUtilsIID); const kNC_NavCenter = kRDFCUtils.MakeSeq(gBookmarksShell.db, krNavCenter); const krBookmarksRoot = kRDF.GetResource("NC:BookmarksRoot"); const krName = kRDF.GetResource(NC_NS + "Name"); var rootfoldername = gBookmarksShell.getLocaleString("bookmarks_root"); const kProfileContractID = "@mozilla.org/profile/manager;1"; const kProfileIID = Components.interfaces.nsIProfile; const kProfile = Components.classes[kProfileContractID].getService(kProfileIID); rootfoldername = rootfoldername.replace(/%user_name%/, kProfile.currentProfile); const klBookmarksRootName = kRDF.GetLiteral(rootfoldername); const kBMDS = kRDF.GetDataSource("rdf:bookmarks"); kBMDS.Assert(krBookmarksRoot, krName, klBookmarksRootName, true); kNC_NavCenter.AppendElement(krBookmarksRoot); windowNode.setAttribute("title", rootfoldername); /* Blue Sky const krHistoryRoot = kRDF.GetResource("NC:HistoryRoot"); const klHistoryRootName = kRDF.GetLiteral("Browsing History"); const kHistory = kRDF.GetDataSource("rdf:history"); kHistory.Assert(krHistoryRoot, krName, klHistoryRootName, true); kNC_NavCenter.AppendElement(krHistoryRoot); */ const krType = kRDF.GetResource(RDF_NS + "type"); const krFolderType = kRDF.GetResource(NC_NS + "Folder"); gBookmarksShell.db.Assert(krNavCenter, krType, krFolderType, true); } // Update to the last sort. RefreshSort(); // Initialize the tree widget. var children = document.getElementById("treechildren-bookmarks"); if (children.firstChild) { bookmarksTree.selectItem(children.firstChild); children.firstChild.setAttribute("open", "true"); } // XXX templates suck ASS var node = document.getElementById("NC:BookmarksRoot"); if (node.localName == "menubutton") node.removeAttribute("open"); bookmarksTree.focus();} |
|
var children = document.getElementById("treechildren-bookmarks"); if (children.firstChild) { bookmarksTree.selectItem(children.firstChild); children.firstChild.setAttribute("open", "true"); } var node = document.getElementById("NC:BookmarksRoot"); if (node.localName == "menubutton") node.removeAttribute("open"); | function Startup(){ // Create the Bookmarks Shell var bookmarksTree = document.getElementById("bookmarksTree"); gBookmarksShell = new BookmarksWindowTree (bookmarksTree.database); // Set up the tree controller bookmarksTree.controllers.appendController(gBookmarksShell.controller); const windowNode = document.getElementById("bookmark-window"); // If we've been opened with a parameter, root the tree on it. if ("arguments" in window && window.arguments[0]) { bookmarksTree.setAttribute("ref", window.arguments[0]); const krNameArc = gBookmarksShell.RDF.GetResource(NC_NS + "Name"); const krRoot = gBookmarksShell.RDF.GetResource(window.arguments[0]); var rName = gBookmarksShell.db.GetTarget(krRoot, krNameArc, true); rName = rName.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; const titleString = gBookmarksShell.getLocaleString("window_title"); windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, rName)); } else { // There's a better way of doing this, but for the initial revision just // using the root folder in the bookmarks window will do. // For the next milestone I'd like to move this either into the bookmarks // service or some other higher level datasource so that it can be accessed // from everywhere. const kRDF = gBookmarksShell.RDF; const krNavCenter = kRDF.GetResource("NC:NavCenter"); const kRDFCUtilsContractID = "@mozilla.org/rdf/container-utils;1"; const kRDFCUtilsIID = Components.interfaces.nsIRDFContainerUtils; const kRDFCUtils = Components.classes[kRDFCUtilsContractID].getService(kRDFCUtilsIID); const kNC_NavCenter = kRDFCUtils.MakeSeq(gBookmarksShell.db, krNavCenter); const krBookmarksRoot = kRDF.GetResource("NC:BookmarksRoot"); const krName = kRDF.GetResource(NC_NS + "Name"); var rootfoldername = gBookmarksShell.getLocaleString("bookmarks_root"); const kProfileContractID = "@mozilla.org/profile/manager;1"; const kProfileIID = Components.interfaces.nsIProfile; const kProfile = Components.classes[kProfileContractID].getService(kProfileIID); rootfoldername = rootfoldername.replace(/%user_name%/, kProfile.currentProfile); const klBookmarksRootName = kRDF.GetLiteral(rootfoldername); const kBMDS = kRDF.GetDataSource("rdf:bookmarks"); kBMDS.Assert(krBookmarksRoot, krName, klBookmarksRootName, true); kNC_NavCenter.AppendElement(krBookmarksRoot); windowNode.setAttribute("title", rootfoldername); /* Blue Sky const krHistoryRoot = kRDF.GetResource("NC:HistoryRoot"); const klHistoryRootName = kRDF.GetLiteral("Browsing History"); const kHistory = kRDF.GetDataSource("rdf:history"); kHistory.Assert(krHistoryRoot, krName, klHistoryRootName, true); kNC_NavCenter.AppendElement(krHistoryRoot); */ const krType = kRDF.GetResource(RDF_NS + "type"); const krFolderType = kRDF.GetResource(NC_NS + "Folder"); gBookmarksShell.db.Assert(krNavCenter, krType, krFolderType, true); } // Update to the last sort. RefreshSort(); // Initialize the tree widget. var children = document.getElementById("treechildren-bookmarks"); if (children.firstChild) { bookmarksTree.selectItem(children.firstChild); children.firstChild.setAttribute("open", "true"); } // XXX templates suck ASS var node = document.getElementById("NC:BookmarksRoot"); if (node.localName == "menubutton") node.removeAttribute("open"); bookmarksTree.focus();} |
|
winhooks = Components.classes[ "component: | winhooks = Components.classes[ "@mozilla.org/winhooks;1" ].getService( Components.interfaces.nsIWindowsHooks ); | function Startup() { if ( !winhooks ) { // Get component service. try { winhooks = Components.classes[ "component://mozilla/winhooks" ].getService( Components.interfaces.nsIWindowsHooks ); if ( winhooks ) { // Try to get preferences. prefs = winhooks.settings; // Now transfer those to the dialog checkboxes. for( var index in settings ) { var setting = settings[ index ]; var checkbox = document.getElementById( setting ); if ( checkbox && prefs[ setting ] ) { checkbox.setAttribute( "checked", "true" ); } } } } catch(e) { dump( e + "\n" ); alert( "Rats!" ); } } // If all is well, hook into "Ok". if ( winhooks && prefs && parent && parent.hPrefWindow ) { parent.hPrefWindow.registerOKCallbackFunc( onOK ); }} |
sizeToContent(); | function Startup(){ sizeToContent(); //XXXpch buggy imo, we shouldn't need it initServices(); initBMService(); gName = document.getElementById("name"); gRequiredFields.push(gName); gKeywordRow = document.getElementById("keywordRow"); gKeyword = document.getElementById("keyword"); gGroup = document.getElementById("addgroup"); gExpander = document.getElementById("expander"); gMenulist = document.getElementById("select-menu"); gBookmarksTree = document.getElementById("folder-tree"); gName.value = window.arguments[0]; gName.select(); gName.focus(); gKeyword.value = window.arguments[7]; gKeywordRequired = window.arguments[8]; if (!window.arguments[7] && !gKeywordRequired) gKeywordRow.hidden = true; if (gKeywordRequired) gRequiredFields.push(gKeyword); onFieldInput(); gSelectedFolder = RDF.GetResource(gMenulist.selectedItem.id); gExpander.setAttribute("tooltiptext", gExpander.getAttribute("tooltiptextdown")); gPostData = window.arguments[9];# read the persisted attribute. If it is not present, set a default height. WSucks = parseInt(gBookmarksTree.getAttribute("height")); if (!WSucks) WSucks = 150; // fix no more persisted class attribute in old profiles var localStore = RDF.GetDataSource("rdf:local-store"); var rAttribute = RDF.GetResource("class"); var rElement = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul#expander"); var rDialog = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul"); var rPersist = RDF.GetResource(NC_NS+"persist"); var rOldValue = localStore.GetTarget(rElement, rAttribute, true); if (rOldValue) { localStore.Unassert(rElement, rAttribute, rOldValue, true); localStore.Unassert(rDialog, rPersist, rElement, true); gExpander.setAttribute("class", "down"); }} |
|
gKeyword.value = window.arguments[7]; | gSuggestedKeyword = window.arguments[7]; | function Startup(){ sizeToContent(); //XXXpch buggy imo, we shouldn't need it initServices(); initBMService(); gName = document.getElementById("name"); gRequiredFields.push(gName); gKeywordRow = document.getElementById("keywordRow"); gKeyword = document.getElementById("keyword"); gGroup = document.getElementById("addgroup"); gExpander = document.getElementById("expander"); gMenulist = document.getElementById("select-menu"); gBookmarksTree = document.getElementById("folder-tree"); gName.value = window.arguments[0]; gName.select(); gName.focus(); gKeyword.value = window.arguments[7]; gKeywordRequired = window.arguments[8]; if (!window.arguments[7] && !gKeywordRequired) gKeywordRow.hidden = true; if (gKeywordRequired) gRequiredFields.push(gKeyword); onFieldInput(); gSelectedFolder = RDF.GetResource(gMenulist.selectedItem.id); gExpander.setAttribute("tooltiptext", gExpander.getAttribute("tooltiptextdown")); gPostData = window.arguments[9];# read the persisted attribute. If it is not present, set a default height. WSucks = parseInt(gBookmarksTree.getAttribute("height")); if (!WSucks) WSucks = 150; // fix no more persisted class attribute in old profiles var localStore = RDF.GetDataSource("rdf:local-store"); var rAttribute = RDF.GetResource("class"); var rElement = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul#expander"); var rDialog = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul"); var rPersist = RDF.GetResource(NC_NS+"persist"); var rOldValue = localStore.GetTarget(rElement, rAttribute, true); if (rOldValue) { localStore.Unassert(rElement, rAttribute, rOldValue, true); localStore.Unassert(rDialog, rPersist, rElement, true); gExpander.setAttribute("class", "down"); }} |
if (!window.arguments[7] && !gKeywordRequired) | if (!gSuggestedKeyword && !gKeywordRequired) { | function Startup(){ sizeToContent(); //XXXpch buggy imo, we shouldn't need it initServices(); initBMService(); gName = document.getElementById("name"); gRequiredFields.push(gName); gKeywordRow = document.getElementById("keywordRow"); gKeyword = document.getElementById("keyword"); gGroup = document.getElementById("addgroup"); gExpander = document.getElementById("expander"); gMenulist = document.getElementById("select-menu"); gBookmarksTree = document.getElementById("folder-tree"); gName.value = window.arguments[0]; gName.select(); gName.focus(); gKeyword.value = window.arguments[7]; gKeywordRequired = window.arguments[8]; if (!window.arguments[7] && !gKeywordRequired) gKeywordRow.hidden = true; if (gKeywordRequired) gRequiredFields.push(gKeyword); onFieldInput(); gSelectedFolder = RDF.GetResource(gMenulist.selectedItem.id); gExpander.setAttribute("tooltiptext", gExpander.getAttribute("tooltiptextdown")); gPostData = window.arguments[9];# read the persisted attribute. If it is not present, set a default height. WSucks = parseInt(gBookmarksTree.getAttribute("height")); if (!WSucks) WSucks = 150; // fix no more persisted class attribute in old profiles var localStore = RDF.GetDataSource("rdf:local-store"); var rAttribute = RDF.GetResource("class"); var rElement = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul#expander"); var rDialog = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul"); var rPersist = RDF.GetResource(NC_NS+"persist"); var rOldValue = localStore.GetTarget(rElement, rAttribute, true); if (rOldValue) { localStore.Unassert(rElement, rAttribute, rOldValue, true); localStore.Unassert(rDialog, rPersist, rElement, true); gExpander.setAttribute("class", "down"); }} |
if (gKeywordRequired) gRequiredFields.push(gKeyword); | } else { if (gSuggestedKeyword) gKeyword.value = gSuggestedKeyword; if (gKeywordRequired) gRequiredFields.push(gKeyword); } sizeToContent(); | function Startup(){ sizeToContent(); //XXXpch buggy imo, we shouldn't need it initServices(); initBMService(); gName = document.getElementById("name"); gRequiredFields.push(gName); gKeywordRow = document.getElementById("keywordRow"); gKeyword = document.getElementById("keyword"); gGroup = document.getElementById("addgroup"); gExpander = document.getElementById("expander"); gMenulist = document.getElementById("select-menu"); gBookmarksTree = document.getElementById("folder-tree"); gName.value = window.arguments[0]; gName.select(); gName.focus(); gKeyword.value = window.arguments[7]; gKeywordRequired = window.arguments[8]; if (!window.arguments[7] && !gKeywordRequired) gKeywordRow.hidden = true; if (gKeywordRequired) gRequiredFields.push(gKeyword); onFieldInput(); gSelectedFolder = RDF.GetResource(gMenulist.selectedItem.id); gExpander.setAttribute("tooltiptext", gExpander.getAttribute("tooltiptextdown")); gPostData = window.arguments[9];# read the persisted attribute. If it is not present, set a default height. WSucks = parseInt(gBookmarksTree.getAttribute("height")); if (!WSucks) WSucks = 150; // fix no more persisted class attribute in old profiles var localStore = RDF.GetDataSource("rdf:local-store"); var rAttribute = RDF.GetResource("class"); var rElement = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul#expander"); var rDialog = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul"); var rPersist = RDF.GetResource(NC_NS+"persist"); var rOldValue = localStore.GetTarget(rElement, rAttribute, true); if (rOldValue) { localStore.Unassert(rElement, rAttribute, rOldValue, true); localStore.Unassert(rDialog, rPersist, rElement, true); gExpander.setAttribute("class", "down"); }} |
return; | function Startup(){ if (!InitEditorShell()) return; // Get the spellChecker shell spellChecker = editorShell.QueryInterface(Components.interfaces.nsIEditorSpellCheck); if (!spellChecker) { dump("SpellChecker not found!!!\n"); window.close(); } // Start the spell checker module. try { spellChecker.InitSpellChecker(); // XXX: We need to read in a pref here so we can set the // default language for the spellchecker! // spellChecker.SetCurrentDictionary(); } catch(ex) { dump("*** Exception error: InitSpellChecker\n"); window.close(); } // Create dialog object to store controls for easy access dialog = new Object; if (!dialog) { dump("Failed to create dialog object!!!\n"); Close(); } dialog.MisspelledWordLabel = document.getElementById("MisspelledWordLabel"); dialog.MisspelledWord = document.getElementById("MisspelledWord"); dialog.ReplaceButton = document.getElementById("Replace"); dialog.IgnoreButton = document.getElementById("Ignore"); dialog.CloseButton = document.getElementById("Close"); dialog.ReplaceWordInput = document.getElementById("ReplaceWordInput"); dialog.SuggestedList = document.getElementById("SuggestedList"); dialog.LanguageMenulist = document.getElementById("LanguageMenulist"); if (!dialog.MisspelledWord || !dialog.ReplaceWordInput || !dialog.SuggestedList || !dialog.LanguageMenulist ) { return; } if (dialog.LanguageMenulist) { // Fill in the language menulist and sync it up // with the spellchecker's current language. var curLang; try { curLang = spellChecker.GetCurrentDictionary(); } catch(ex) { curLang = ""; } InitLanguageMenu(curLang); } SetWindowLocation(); // Get the first misspelled word and setup all UI NextWord(); // Clear flag that determines message when // no misspelled word is found // (different message when used for the first time) firstTime = false;} |
|
xulBrowserWin = new nsXULBrowserWindow(); window.addXPConnectObject("XULBrowserWindow", xulBrowserWin); | window.XULBrowserWindow = new nsXULBrowserWindow(); | function Startup() { xulBrowserWin = new nsXULBrowserWindow(); window.addXPConnectObject("XULBrowserWindow", xulBrowserWin); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", UpdateHistory, true); contentArea.addEventListener("load", UpdateBookmarksLastVisitedDate, true); contentArea.addEventListener("load", UpdateInternetSearchResults, true); } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } } |
if (!startPage && "arguments" in window && window.arguments.length > 0) startPage = window.arguments[0]; | if (!startPage) { if ("arguments" in window && window.arguments.length > 0) { startPage = window.arguments[0]; } else { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); startPage = cmdLineHandler.defaultArgs; } } | function Startup(){ window.XULBrowserWindow = new nsXULBrowserWindow(); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw Components.results.NS_ERROR_FAILURE; webNavigation = getWebNavigation(); if (!webNavigation) throw Components.results.NS_ERROR_FAILURE; } catch (e) { alert("Error creating browser instance"); window.close(); // Give up. return; } _content.appCore = appCore; // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly gURLBar = document.getElementById("urlbar"); gURLBar.focus(); // set the offline/online mode setOfflineStatus(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); // set default character set if provided if ("arguments" in window && window.arguments.length > 1) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch (ex) { } // set home button tooltip text var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); //initConsoleListener(); // load appropriate initial page from commandline var isPageCycling = false; // page cycling for tinderbox tests if (!appCore.cmdLineURLUsed) isPageCycling = appCore.startPageCycler(); // only load url passed in when we're not page cycling if (!isPageCycling) { var startPage; if (!appCore.cmdLineURLUsed) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); startPage = cmdLineService.URLToLoad; appCore.cmdLineURLUsed = true; } // Check for window.arguments[0]. If present, use that for startPage. if (!startPage && "arguments" in window && window.arguments.length > 0) startPage = window.arguments[0]; if (startPage) loadURI(startPage); // Perform default browser checking. checkForDefaultBrowser(); }} |
SetTextfieldFocus(dialog.srcInput); | SetTextboxFocus(dialog.srcInput); | function Startup(){ //XXX Very weird! When calling this with an existing image, // we get called twice. That causes dialog layout // to explode to fullscreen! if (StartupCalled) { dump("*** CALLING IMAGE DIALOG Startup() AGAIN! ***\n"); return; } StartupCalled = true; if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); // Create dialog object to store controls for easy access dialog = new Object; dialog.srcInput = document.getElementById( "srcInput" ); dialog.altTextInput = document.getElementById( "altTextInput" ); dialog.MoreFewerButton = document.getElementById( "MoreFewerButton" ); dialog.AdvancedEditButton = document.getElementById( "AdvancedEditButton" ); dialog.AdvancedEditButton2 = document.getElementById( "AdvancedEditButton2" ); dialog.MoreSection = document.getElementById( "MoreSection" ); dialog.customSizeRadio = document.getElementById( "customSizeRadio" ); dialog.actualSizeRadio = document.getElementById( "actualSizeRadio" ); dialog.constrainCheckbox = document.getElementById( "constrainCheckbox" ); dialog.widthInput = document.getElementById( "widthInput" ); dialog.heightInput = document.getElementById( "heightInput" ); dialog.widthUnitsMenulist = document.getElementById( "widthUnitsMenulist" ); dialog.heightUnitsMenulist = document.getElementById( "heightUnitsMenulist" ); dialog.imagelrInput = document.getElementById( "imageleftrightInput" ); dialog.imagetbInput = document.getElementById( "imagetopbottomInput" ); dialog.border = document.getElementById( "border" ); dialog.alignTypeSelect = document.getElementById( "alignTypeSelect" ); dialog.alignImage = document.getElementById( "alignImage" ); dialog.alignText = document.getElementById( "alignText" ); dialog.editImageMap = document.getElementById( "editImageMap" ); dialog.removeImageMap = document.getElementById( "removeImageMap" ); dialog.ImageHolder = document.getElementById( "preview-image-holder" ); dialog.PreviewBox = document.getElementById( "preview-image-box" ); dialog.PreviewWidth = document.getElementById( "PreviewWidth" ); dialog.PreviewHeight = document.getElementById( "PreviewHeight" ); dialog.PreviewSize = document.getElementById( "PreviewSize" ); // Get a single selected image element var tagName = "img" imageElement = editorShell.GetSelectedElement(tagName); if (imageElement) { // We found an element and don't need to insert one insertNew = false; actualWidth = imageElement.naturalWidth; actualHeight = imageElement.naturalHeight; } else { insertNew = true; // We don't have an element selected, // so create one with default attributes imageElement = editorShell.CreateElementWithDefaults(tagName); if( !imageElement ) { dump("Failed to get selected element or create a new one!\n"); window.close(); } } // Make a copy to use for AdvancedEdit globalElement = imageElement.cloneNode(false); // Get image map for image var usemap = globalElement.getAttribute("usemap"); if (usemap) { var mapname = usemap.substring(1, usemap.length); var mapCollection = editorShell.editorDocument.getElementsByName(mapname); if (mapCollection[0] != null) { imageMap = mapCollection[0]; globalMap = imageMap; canRemoveImageMap = true; insertNewIMap = false; dump(imageMap.childNodes.length+"\n"); } else { insertNewIMap = true; globalMap = null; } } else { insertNewIMap = true; globalMap = null; } InitDialog(); // By default turn constrain on, but both width and height must be in pixels dialog.constrainCheckbox.checked = dialog.widthUnitsMenulist.selectedIndex == 0 && dialog.heightUnitsMenulist.selectedIndex == 0; // Set SeeMore bool to the OPPOSITE of the current state, // which is automatically saved by using the 'persist="more"' // attribute on the MoreFewerButton button // onMoreFewerImage will toggle the state and redraw the dialog SeeMore = (dialog.MoreFewerButton.getAttribute("more") != "1"); // Initialize widgets with image attributes in the case where the entire dialog isn't visible onMoreFewerImage(); // this call will initialize all widgets if entire dialog is visible SetTextfieldFocus(dialog.srcInput); SetWindowLocation();} |
{ window.XULBrowserWindow = new nsXULBrowserWindow(); | { window.XULBrowserWindow = new nsXULBrowserWindow(); var webNavigation; try { | function Startup() { window.XULBrowserWindow = new nsXULBrowserWindow(); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); // set the offline/online mode setOfflineStatus(); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); // set home button tooltip text var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); // Perform default browser checking. checkForDefaultBrowser(); } |
createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { window.close(); | appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw Components.results.NS_ERROR_FAILURE; webNavigation = getWebNavigation(); if (!webNavigation) throw Components.results.NS_ERROR_FAILURE; } catch (e) { alert("Error creating browser instance"); window.close(); } _content.appCore= appCore; appCore.setWebShellWindow(window); gURLBar = document.getElementById("urlbar"); gURLBar.focus(); setOfflineStatus(); debug("Setting content window\n"); appCore.setContentWindow(_content); var startpage; try { var handler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); startpage = handler.defaultArgs; } catch (ex) { debug("failed, reason: " + ex + "\n"); startpage = "about:blank"; } document.getElementById("args").setAttribute("value", startpage); appCore.loadInitialPage(); var contentArea = document.getElementById("appcontent"); contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); debug("*** Pulling out the charset\n"); if ("arguments" in window && window.arguments.length > 1) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { appCore.SetDocumentCharset(arrayArgComponents[1]); debug("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } | function Startup() { window.XULBrowserWindow = new nsXULBrowserWindow(); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); // set the offline/online mode setOfflineStatus(); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); // set home button tooltip text var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); // Perform default browser checking. checkForDefaultBrowser(); } |
appCore.setWebShellWindow(window); var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); | } | function Startup() { window.XULBrowserWindow = new nsXULBrowserWindow(); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); // set the offline/online mode setOfflineStatus(); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); // set home button tooltip text var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); // Perform default browser checking. checkForDefaultBrowser(); } |
setOfflineStatus(); tryToSetContentWindow(); var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); | try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch (ex) { } var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); if ("arguments" in window && window.arguments.length > 0) { if (document.getElementById("navigator-throbber").getAttribute("busy") == "true") { debug("Stopping load of default initial page\n"); getWebNavigation().stop(); | function Startup() { window.XULBrowserWindow = new nsXULBrowserWindow(); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); // set the offline/online mode setOfflineStatus(); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); // set home button tooltip text var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); // Perform default browser checking. checkForDefaultBrowser(); } |
dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } | debug("Loading page specified via openDialog\n"); loadURI(window.arguments[0]); } | function Startup() { window.XULBrowserWindow = new nsXULBrowserWindow(); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); // set the offline/online mode setOfflineStatus(); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); // set home button tooltip text var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); // Perform default browser checking. checkForDefaultBrowser(); } |
try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } | initConsoleListener(); | function Startup() { window.XULBrowserWindow = new nsXULBrowserWindow(); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); // set the offline/online mode setOfflineStatus(); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); // set home button tooltip text var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); // Perform default browser checking. checkForDefaultBrowser(); } |
if ( window.arguments && window.arguments[0] ) { onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); checkForDefaultBrowser(); } | checkForDefaultBrowser(); } | function Startup() { window.XULBrowserWindow = new nsXULBrowserWindow(); // TileWindow(); // Make sure window fits on screen initially //FitToScreen(); // Create the browser instance component. createBrowserInstance(); window._content.appCore= appCore; if (appCore == null) { // Give up. window.close(); } // Initialize browser instance.. appCore.setWebShellWindow(window); // give urlbar focus so it'll be an active editor and d&d will work properly var url_bar = document.getElementById("urlbar"); if ( url_bar ) url_bar.focus(); // set the offline/online mode setOfflineStatus(); tryToSetContentWindow(); // Add a capturing event listener to the content area // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) // so we'll be notified when onloads complete. var contentArea = document.getElementById("appcontent"); if (contentArea) { contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments.length > 1 ) { if (window.arguments[1].indexOf('charset=') != -1) { var arrayArgComponents = window.arguments[1].split('='); if (arrayArgComponents) { if (appCore != null) { //we should "inherit" the charset menu setting in a new window appCore.SetDocumentCharset(arrayArgComponents[1]); } dump("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n"); } } } try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch(ex) { } // Check for window.arguments[0]. If present, go to that url. if ( window.arguments && window.arguments[0] ) { // Load it using yet another psuedo-onload handler. onLoadViaOpenDialog(); } gURLBar = document.getElementById("urlbar"); // set home button tooltip text var homepage; try { homepage = pref.getLocalizedUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("home-button", homepage); initConsoleListener(); // Perform default browser checking. checkForDefaultBrowser(); } |
if(! contenttypeElement ) | if(!contenttypeElement && (editorShell.contentsMIMEType != 'text/plain')) | function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); // Create dialog object to store controls for easy access dialog = new Object; dialog.TitleInput = document.getElementById("TitleInput"); dialog.charsetTree = document.getElementById('CharsetTree'); dialog.exportToText = document.getElementById('ExportToText'); //dialog.charsetRoot = document.getElementById('CharsetRoot'); contenttypeElement = GetHTTPEquivMetaElement("content-type"); if(! contenttypeElement ) { contenttypeElement = CreateHTTPEquivMetaElement("content-type"); if( ! contenttypeElement ) { window.close(); return; } insertNewContentType = true; } InitDialog(); // Use the same text as the messagebox for getting title by regular "Save" document.getElementById("EnterTitleLabel").setAttribute("value",GetString("NeedDocTitle")); // This is an <HTML> element so it wraps -- append a child textnode var helpTextParent = document.getElementById("TitleHelp"); var helpText = document.createTextNode(GetString("DocTitleHelp")); if (helpTextParent) helpTextParent.appendChild(helpText); // SET FOCUS TO FIRST CONTROL SetTextboxFocus(dialog.TitleInput); LoadAvailableCharSets(); initDone = true; SetWindowLocation();} |
SetTextfieldFocus(dialog.widthInput); | SetTextboxFocus(dialog.widthInput); | function Startup(){ dump("HLine Properties startup...\n"); if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); // Get the selected horizontal line hLineElement = editorShell.GetSelectedElement(tagName); if (!hLineElement) { // We should never be here if not editing an existing HLine dump("HLine is not selected! Shouldn't be here!\n"); window.close(); return; } // Create dialog object to store controls for easy access dialog = new Object; dialog.heightInput = document.getElementById("height"); dialog.widthInput = document.getElementById("width"); dialog.leftAlign = document.getElementById("leftAlign"); dialog.centerAlign = document.getElementById("centerAlign"); dialog.rightAlign = document.getElementById("rightAlign"); dialog.shading = document.getElementById("3dShading"); dialog.pixelOrPercentMenulist = document.getElementById("pixelOrPercentMenulist"); // Make a copy to use for AdvancedEdit and onSaveDefault globalElement = hLineElement.cloneNode(false); // Initialize control values based on existing attributes InitDialog() // SET FOCUS TO FIRST CONTROL SetTextfieldFocus(dialog.widthInput); // Resize window window.sizeToContent(); SetWindowLocation();} |
document.getElementById("togglePasswords").label = kSignonBundle.getString(showingPasswords ? "hidePasswords" : "showPasswords"); | function Startup() { // xpconnect to password manager interfaces signonviewer = Components.classes["@mozilla.org/signonviewer/signonviewer-world;1"].createInstance(); signonviewer = signonviewer.QueryInterface(Components.interfaces.nsISignonViewer); passwordmanager = Components.classes["@mozilla.org/passwordmanager;1"].getService(); passwordmanager = passwordmanager.QueryInterface(Components.interfaces.nsIPasswordManager); // determine if database is encrypted try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { encrypted = pref.getBoolPref("wallet.crypto"); } catch(e) { dump("wallet.crypto pref is missing from all.js"); } } catch (ex) { dump("failed to get prefs service!\n"); pref = null; } // determine whether to run in password-manager mode or form-manager mode var tabBox = document.getElementById("tabbox"); kSignonBundle = document.getElementById("signonBundle"); var element; if (isPasswordManager) { // be prepared to reload the display if anything changes kObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); kObserverService.addObserver(signonReloadDisplay, "signonChanged", false); // be prepared to disable the buttons when selectuser dialog is in use kObserverService.addObserver(signonReloadDisplay, "signonSelectUser", false); signonsTree = document.getElementById("signonsTree"); rejectsTree = document.getElementById("rejectsTree"); // set initial password-manager tab element = document.getElementById("signonsTab"); tabBox.selectedTab = element; // hide form-manager tabs element = document.getElementById("nopreviewsTab"); element.hidden = "true"; element = document.getElementById("nocapturesTab"); element.hidden = "true" // load password manager items if (!LoadSignons()) { return; /* user failed to unlock the database */ } LoadRejects(); } else { nopreviewsTree = document.getElementById("nopreviewsTree"); nocapturesTree = document.getElementById("nocapturesTree"); // change title on window var wind = document.getElementById("signonviewer"); wind.setAttribute("title", wind.getAttribute("alttitle")); // set initial form-manager tab element = document.getElementById("nopreviewsTab"); tabBox.selectedTab = element; // hide password-manager tabs element = document.getElementById("signonsTab"); element.hidden = "true"; element = document.getElementById("signonsitesTab"); element.hidden = "true"; // load form manager items LoadNopreview(); LoadNocapture(); } // label the close button document.documentElement.getButton("accept").label = kSignonBundle.getString("close");} |
|
gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; var app = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, app.ID); | function Startup() { gWindowState = window.location.search.substr("?type=".length, window.location.search.length); var isExtensions = gWindowState == "extensions"; gItemType = isExtensions ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME; var typeCondition = document.getElementById("typeCondition"); typeCondition.setAttribute("object", gItemType); document.documentElement.setAttribute("windowtype", document.documentElement.getAttribute("windowtype") + "-" + gWindowState); gExtensionsView = document.getElementById("extensionsView"); gExtensionsView.setAttribute("state", gWindowState); gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"] .getService(Components.interfaces.nsIExtensionManager); gApp = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo) .QueryInterface(Components.interfaces.nsIXULRuntime); // Extension Command Updating is handled by a command controller. gExtensionsView.controllers.appendController(gExtensionsViewController); gExtensionsView.addEventListener("extension-updatenow", onExtensionUpdateNow, false); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var defaultPref = pref.QueryInterface(Components.interfaces.nsIPrefService) .getDefaultBranch(null); if (!isExtensions) { gExtensionsView.addEventListener("select", onThemeSelect, false); try { gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); gDefaultTheme = defaultPref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); } catch (e) { } var useThemeButton = document.getElementById("useThemeButton"); useThemeButton.hidden = false; var optionsButton = document.getElementById("optionsButton"); optionsButton.hidden = true; } // Finally, update the UI. gExtensionsView.database.AddDataSource(gExtensionManager.datasource); gExtensionsView.setAttribute("ref", RDFURI_ITEM_ROOT); gExtensionsView.focus(); var extensionsStrings = document.getElementById("extensionsStrings"); document.title = extensionsStrings.getString(gWindowState + "Title"); gExtensionsViewController.onCommandUpdate(); gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; var app = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, app.ID); // Update various pieces of state-dependant UI var getMore = document.getElementById("getMore"); getMore.setAttribute("value", getMore.getAttribute(isExtensions ? "valueextensions" : "valuethemes")); getMore.setAttribute("tooltiptext", getMore.getAttribute(isExtensions ? "tooltiptextextensions" : "tooltiptextthemes")); getMore.setAttribute('href', gGetMoreURL); if (!isExtensions) { var themePreviewArea = document.getElementById("themePreviewArea"); themePreviewArea.hidden = false; gExtensionsView.removeAttribute("flex"); gExtensionsView.style.width = extensionsStrings.getString("themesManagerLeftColumn"); } // Set Initial Size var win = document.documentElement; if (!win.hasAttribute("width") || !win.hasAttribute("height")) { win.setAttribute("width", isExtensions ? (extensionsStrings.getString("extensionsManagerWidth")) : (extensionsStrings.getString("themesManagerWidth"))); win.setAttribute("height", isExtensions ? (extensionsStrings.getString("extensionsManagerHeight")) : (extensionsStrings.getString("themesManagerHeight"))); } // Now look and see if we're being opened by XPInstall gDownloadManager = new XPInstallDownloadManager(); var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.addObserver(gDownloadManager, "xpinstall-download-started", false); gObserverIndex = gExtensionManager.addUpdateListener(gDownloadManager); if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { if (window.arguments[0] == "updatecheck") performUpdate(); } } // Set the tooltips if (!isExtensions) {#ifndef MOZ_PHOENIX document.getElementById("installButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdInstallTooltipTheme"));#endif document.getElementById("uninstallButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUninstallTooltipTheme")); document.getElementById("updateButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUpdateTooltipTheme")); }} |
|
getMore.setAttribute("value", getMore.getAttribute(isExtensions ? "valueextensions" : "valuethemes")); getMore.setAttribute("tooltiptext", getMore.getAttribute(isExtensions ? "tooltiptextextensions" : "tooltiptextthemes")); getMore.setAttribute('href', gGetMoreURL); | try { var getMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; var app = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); getMoreURL = getMoreURL.replace(/%APPID%/g, app.ID); getMore.setAttribute("value", getMore.getAttribute(isExtensions ? "valueextensions" : "valuethemes")); getMore.setAttribute("tooltiptext", getMore.getAttribute(isExtensions ? "tooltiptextextensions" : "tooltiptextthemes")); getMore.setAttribute('href', getMoreURL); } catch (e) { getMore.hidden = true; } | function Startup() { gWindowState = window.location.search.substr("?type=".length, window.location.search.length); var isExtensions = gWindowState == "extensions"; gItemType = isExtensions ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME; var typeCondition = document.getElementById("typeCondition"); typeCondition.setAttribute("object", gItemType); document.documentElement.setAttribute("windowtype", document.documentElement.getAttribute("windowtype") + "-" + gWindowState); gExtensionsView = document.getElementById("extensionsView"); gExtensionsView.setAttribute("state", gWindowState); gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"] .getService(Components.interfaces.nsIExtensionManager); gApp = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo) .QueryInterface(Components.interfaces.nsIXULRuntime); // Extension Command Updating is handled by a command controller. gExtensionsView.controllers.appendController(gExtensionsViewController); gExtensionsView.addEventListener("extension-updatenow", onExtensionUpdateNow, false); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var defaultPref = pref.QueryInterface(Components.interfaces.nsIPrefService) .getDefaultBranch(null); if (!isExtensions) { gExtensionsView.addEventListener("select", onThemeSelect, false); try { gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); gDefaultTheme = defaultPref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); } catch (e) { } var useThemeButton = document.getElementById("useThemeButton"); useThemeButton.hidden = false; var optionsButton = document.getElementById("optionsButton"); optionsButton.hidden = true; } // Finally, update the UI. gExtensionsView.database.AddDataSource(gExtensionManager.datasource); gExtensionsView.setAttribute("ref", RDFURI_ITEM_ROOT); gExtensionsView.focus(); var extensionsStrings = document.getElementById("extensionsStrings"); document.title = extensionsStrings.getString(gWindowState + "Title"); gExtensionsViewController.onCommandUpdate(); gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; var app = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, app.ID); // Update various pieces of state-dependant UI var getMore = document.getElementById("getMore"); getMore.setAttribute("value", getMore.getAttribute(isExtensions ? "valueextensions" : "valuethemes")); getMore.setAttribute("tooltiptext", getMore.getAttribute(isExtensions ? "tooltiptextextensions" : "tooltiptextthemes")); getMore.setAttribute('href', gGetMoreURL); if (!isExtensions) { var themePreviewArea = document.getElementById("themePreviewArea"); themePreviewArea.hidden = false; gExtensionsView.removeAttribute("flex"); gExtensionsView.style.width = extensionsStrings.getString("themesManagerLeftColumn"); } // Set Initial Size var win = document.documentElement; if (!win.hasAttribute("width") || !win.hasAttribute("height")) { win.setAttribute("width", isExtensions ? (extensionsStrings.getString("extensionsManagerWidth")) : (extensionsStrings.getString("themesManagerWidth"))); win.setAttribute("height", isExtensions ? (extensionsStrings.getString("extensionsManagerHeight")) : (extensionsStrings.getString("themesManagerHeight"))); } // Now look and see if we're being opened by XPInstall gDownloadManager = new XPInstallDownloadManager(); var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.addObserver(gDownloadManager, "xpinstall-download-started", false); gObserverIndex = gExtensionManager.addUpdateListener(gDownloadManager); if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { if (window.arguments[0] == "updatecheck") performUpdate(); } } // Set the tooltips if (!isExtensions) {#ifndef MOZ_PHOENIX document.getElementById("installButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdInstallTooltipTheme"));#endif document.getElementById("uninstallButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUninstallTooltipTheme")); document.getElementById("updateButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUpdateTooltipTheme")); }} |
cookieviewer = Components.classes["component: | cookieviewer = Components.classes["@mozilla.org/cookieviewer/cookieviewer-world;1"].createInstance(); | function Startup(){ // xpconnect to cookieviewer interface cookieviewer = Components.classes["component://netscape/cookieviewer/cookieviewer-world"].createInstance(); cookieviewer = cookieviewer.QueryInterface(Components.interfaces.nsICookieViewer); // intialise string bundle for bundle = srGetStrBundle(JS_STRINGS_FILE); // install imageblocker tab if instructed to do so by the "imageblocker.enabled" pref try { pref = Components.classes['component://netscape/preferences']; pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); try { if (pref.GetBoolPref("imageblocker.enabled")) { var element; element = document.getElementById("imagesTab"); element.setAttribute("style","display: inline;" ); element = document.getElementById("images"); element.setAttribute("style","display: inline;" ); } } catch(e) { } try { var tab = window.arguments[0]; if (tab == "0") { element = document.getElementById("cookiesTab"); element.setAttribute("selected","true" ); element = document.getElementById("panel"); element.setAttribute("index","0" ); } else { element = document.getElementById("cookieviewer"); element.setAttribute("title", bundle.GetStringFromName("imageTitle")); element = document.getElementById("imagesTab"); element.setAttribute("selected","true" ); element = document.getElementById("panel"); element.setAttribute("index","2" ); } } catch(e) { } } catch (ex) { dump("failed to get prefs service!\n"); pref = null; } loadCookies(); loadPermissions(); loadImages(); doSetOKCancel(onOK, null); window.sizeToContent();} |
pref = Components.classes['component: | pref = Components.classes['@mozilla.org/preferences;1']; | function Startup(){ // xpconnect to cookieviewer interface cookieviewer = Components.classes["component://netscape/cookieviewer/cookieviewer-world"].createInstance(); cookieviewer = cookieviewer.QueryInterface(Components.interfaces.nsICookieViewer); // intialise string bundle for bundle = srGetStrBundle(JS_STRINGS_FILE); // install imageblocker tab if instructed to do so by the "imageblocker.enabled" pref try { pref = Components.classes['component://netscape/preferences']; pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); try { if (pref.GetBoolPref("imageblocker.enabled")) { var element; element = document.getElementById("imagesTab"); element.setAttribute("style","display: inline;" ); element = document.getElementById("images"); element.setAttribute("style","display: inline;" ); } } catch(e) { } try { var tab = window.arguments[0]; if (tab == "0") { element = document.getElementById("cookiesTab"); element.setAttribute("selected","true" ); element = document.getElementById("panel"); element.setAttribute("index","0" ); } else { element = document.getElementById("cookieviewer"); element.setAttribute("title", bundle.GetStringFromName("imageTitle")); element = document.getElementById("imagesTab"); element.setAttribute("selected","true" ); element = document.getElementById("panel"); element.setAttribute("index","2" ); } } catch(e) { } } catch (ex) { dump("failed to get prefs service!\n"); pref = null; } loadCookies(); loadPermissions(); loadImages(); doSetOKCancel(onOK, null); window.sizeToContent();} |
javascriptEnabledChange() | function Startup(){ policyButton = document.getElementById("popupPolicy"); manageTree = document.getElementById("permissionsTree"); togglePermissionEnabling(); loadPermissions(); var imagesEnabled = document.getElementById("enableImages").checked; var imageBroadcaster = document.getElementById("imageBroadcaster"); imageBroadcaster.setAttribute("disabled", !imagesEnabled);} |
|
sizeToContent(); moveToAlertPosition(); | function Startup(){ doSetOKCancel(onOK); gDescriptionField = document.getElementById("description"); gExtensionField = document.getElementById("extensions"); gMIMEField = document.getElementById("mimeType"); gAppPath = document.getElementById("appPath"); gPrefApplicationsBundle = document.getElementById("bundle_prefApplications"); // If an arg was passed, then it's an nsIHelperAppLauncherDialog if ( "arguments" in window && window.arguments[0] ) { // Get mime info. var info = window.arguments[0].mLauncher.MIMEInfo; // Fill the fields we can from this. gDescriptionField.value = info.Description; gExtensionField.value = info.FirstExtension(); gMIMEField.value = info.MIMEType; var app = info.preferredApplicationHandler; if ( app ) { gAppPath.value = app.unicodePath; } // Don't let user change mime type. gMIMEField.setAttribute( "readonly", "true" ); // Start user in app field. gAppPath.focus(); } else { gDescriptionField.focus(); }} |
|
defaultActiveColor = defaultLinkColor; | defaultActiveColor = browserColors.ActiveLinkColor; | function Startup(){ var editor = GetCurrentEditor(); if (!editor) { window.close(); return; } gDialog.ColorPreview = document.getElementById("ColorPreview"); gDialog.NormalText = document.getElementById("NormalText"); gDialog.LinkText = document.getElementById("LinkText"); gDialog.ActiveLinkText = document.getElementById("ActiveLinkText"); gDialog.VisitedLinkText = document.getElementById("VisitedLinkText"); gDialog.PageColorGroup = document.getElementById("PageColorGroup"); gDialog.DefaultColorsRadio = document.getElementById("DefaultColorsRadio"); gDialog.CustomColorsRadio = document.getElementById("CustomColorsRadio"); gDialog.BackgroundImageInput = document.getElementById("BackgroundImageInput"); try { gBodyElement = editor.rootElement; } catch (e) {} if (!gBodyElement) { dump("Failed to get BODY element!\n"); window.close(); } // Set element we will edit globalElement = gBodyElement.cloneNode(false); // Initialize default colors from browser prefs var browserColors = GetDefaultBrowserColors(); if (browserColors) { // Use author's browser pref colors passed into dialog defaultTextColor = browserColors.TextColor; defaultLinkColor = browserColors.LinkColor; // Note: Browser doesn't store a value for ActiveLinkColor defaultActiveColor = defaultLinkColor; defaultVisitedColor = browserColors.VisitedLinkColor; defaultBackgroundColor= browserColors.BackgroundColor; } // We only need to test for this once per dialog load gHaveDocumentUrl = GetDocumentBaseUrl(); InitDialog(); gDialog.PageColorGroup.focus(); SetWindowLocation();} |
doSetOKCancel(find); | function Startup(){ doSetOKCancel(find); var bundle = document.getElementById("historyBundle"); gOKButton = document.getElementById("ok"); gOKButton.label = bundle.getString("search_button_label"); gOKButton.disabled = true; gSearchField = document.getElementById("searchField"); gSearchField.focus();} |
|
gIOService = Components.classes["@mozilla.org/network/io-service;1"] .getService(nsIIOService); gPrompt = document.getElementById("autoDownload"); gLocation = document.getElementById("downloadLocation"); gChooseButton = document.getElementById("chooseDownloadFolder"); gFolderField = document.getElementById("downloadFolder"); gFinishedSound = document.getElementById("finishedSoundUrl"); var prefWindow = parent.hPrefWindow; gChooseButtonLocked = prefWindow.getPrefIsLocked(kDownloadDirPref); gPromptLocked = prefWindow.getPrefIsLocked("browser.download.autoDownload"); gFinishedSoundLocked = prefWindow.getPrefIsLocked("browser.download.finished_sound_url"); var dir = prefWindow.getPref("localfile", kDownloadDirPref); if (dir == "!/!ERROR_UNDEFINED_PREF!/!") dir = null; if (!dir) { try { var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"] .getService(nsIProperties); dir = dirSvc.get("ProfD", nsILocalFile); prefWindow.setPref("localfile", kDownloadDirPref, dir); } catch (ex) { } } if (dir) gFolderField.value = (/Mac/.test(navigator.platform)) ? dir.leafName : dir.path; setPrefDLElements(); try { var URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"] .getService(nsIURIFixup); gFinishedSound.value = URIFixup.createFixupURI(gFinishedSound.value, nsIURIFixup.FIXUP_FLAG_NONE).spec; } catch (ex) { } | function Startup(){ PlaySoundCheck(); // if we don't have the alert service, hide the pref UI for using alerts to notify on download completion // see bug #158711 var downloadDoneNotificationAlertUI = document.getElementById("finishedNotificationAlert"); downloadDoneNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);} |
|
SetTextfieldFocus(dialog.ColorInput); | SetTextboxFocus(dialog.ColorInput); | function Startup(){ if (!window.arguments[1]) { dump("EdColorPicker: Missing color object param\n"); return; } window.arguments[1].Cancel = false; // Create dialog object to store controls for easy access dialog = new Object; dialog.ColorPicker = document.getElementById("ColorPicker"); dialog.ColorInput = document.getElementById("ColorInput"); dialog.LastPickedButton = document.getElementById("LastPickedButton"); dialog.LastPickedColor = document.getElementById("LastPickedColor"); dialog.TableRadio = document.getElementById("TableRadio"); dialog.CellRadio = document.getElementById("CellRadio"); dialog.Ok = document.getElementById("ok"); dialog.ColorSwatch = document.getElementById("ColorPickerSwatch"); // The type of color we are setting: // text: Text, Link, ActiveLink, VisitedLink, // or background: Page, Table, or Cell if (window.arguments[1].Type) { ColorType = window.arguments[1].Type; // Get string for dialog title from passed-in type // (note constraint on editor.properties string name) window.title = GetString(ColorType+"Color"); } if (!window.title) window.title = GetString("Color"); dialog.ColorInput.value = ""; var tmpColor; // window.arguments[1] is object to set initial and return color switch (ColorType) { case "Page": tmpColor = window.arguments[1].PageColor; if (tmpColor && tmpColor.toLowerCase() != "window") color = tmpColor; break; case "Table": if (window.arguments[1].TableColor) color = window.arguments[1].TableColor; break; case "Cell": if (window.arguments[1].CellColor) color = window.arguments[1].CellColor; break; case "TableOrCell": TableOrCell = true; document.getElementById("TableOrCellGroup").setAttribute("collapsed", "false"); if (window.arguments[1].TableColor) { color = window.arguments[1].TableColor; dialog.TableRadio.checked = true; } else { color = window.arguments[1].CellColor; dialog.CellRadio.checked = true; } break; default: // Any other type will change some kind of text, TextType = true; tmpColor = window.arguments[1].TextColor; if (tmpColor && tmpColor.toLowerCase() != "windowtext") color = window.arguments[1].TextColor; break; } SetCurrentColor(color) if (TextType) LastPickedColor = dialog.LastPickedColor.getAttribute("LastTextColor"); else LastPickedColor = dialog.LastPickedColor.getAttribute("LastBackgroundColor"); dialog.LastPickedColor.setAttribute("style","background-color: "+LastPickedColor); doSetOKCancel(onOK, onCancelColor); // Set method to detect clicking on OK button // so we don't get fooled by changing "default" behavior dialog.Ok.setAttribute("onclick", "onOKClick()"); // Make the "Last-picked" the default button // until the user selects a color dialog.Ok.removeAttribute("default"); dialog.LastPickedButton.setAttribute("default","true"); // Caller can prevent user from submitting an empty, i.e., default color NoDefault = window.arguments[1].NoDefault; if (NoDefault) { // Hide the "Default button -- user must pick a color document.getElementById("DefaultColorButton").setAttribute("collapsed","true"); } SetTextfieldFocus(dialog.ColorInput); SetWindowLocation();} |
gApp = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo) .QueryInterface(Components.interfaces.nsIXULRuntime); | function Startup() { gWindowState = window.location.search.substr("?type=".length, window.location.search.length); var isExtensions = gWindowState == "extensions"; gItemType = isExtensions ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME; var typeCondition = document.getElementById("typeCondition"); typeCondition.setAttribute("object", gItemType); document.documentElement.setAttribute("windowtype", document.documentElement.getAttribute("windowtype") + "-" + gWindowState); gExtensionsView = document.getElementById("extensionsView"); gExtensionsView.setAttribute("state", gWindowState); gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"] .getService(Components.interfaces.nsIExtensionManager); // Extension Command Updating is handled by a command controller. gExtensionsView.controllers.appendController(gExtensionsViewController); // This persists the last-selected extension gExtensionsView.addEventListener("richview-select", onExtensionSelect, false); // Finally, update the UI. gExtensionsView.database.AddDataSource(gExtensionManager.datasource); gExtensionsView.setAttribute("ref", RDFURI_ITEM_ROOT); gExtensionsView.focus(); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!isExtensions) { gExtensionsView.addEventListener("richview-select", onThemeSelect, false); if (pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) gCurrentTheme = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); else if (pref.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); if (!gCurrentTheme) gCurrentTheme = KEY_DEFAULT_THEME; var useThemeButton = document.getElementById("useThemeButton"); useThemeButton.hidden = false; var optionsButton = document.getElementById("optionsButton"); optionsButton.hidden = true; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!pref.getBoolPref(PREF_EXTENSIONS_DSS_ENABLED) && pref.getBoolPref(PREF_EXTENSIONS_DSS_SWITCHPENDING) && pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) { var lastSelectedSkin = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); for (var i = 0; i < gExtensionsView.childNodes.length; ++i) { var item = gExtensionsView.childNodes[i]; if (item.getAttribute("internalName") == lastSelectedSkin) break; } setRestartMessage(item); } } // Restore the last-selected extension var lastSelected = gExtensionsView.getAttribute("last-selected"); if (lastSelected != "") lastSelected = document.getElementById(lastSelected); if (!lastSelected) gExtensionsView.selectionForward(); else gExtensionsView.selected = lastSelected; var extensionsStrings = document.getElementById("extensionsStrings"); document.title = extensionsStrings.getString(gWindowState + "Title"); gExtensionsViewController.onCommandUpdate(); gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; var app = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, app.ID); // Update various pieces of state-dependant UI var getMore = document.getElementById("getMore"); getMore.setAttribute("value", getMore.getAttribute(isExtensions ? "valueextensions" : "valuethemes")); getMore.setAttribute("tooltiptext", getMore.getAttribute(isExtensions ? "tooltiptextextensions" : "tooltiptextthemes")); if (!isExtensions) { var themePreviewArea = document.getElementById("themePreviewArea"); themePreviewArea.hidden = false; gExtensionsView.removeAttribute("flex"); } // Set Initial Size var win = document.documentElement; if (!win.hasAttribute("width") || !win.hasAttribute("height")) { win.setAttribute("width", isExtensions ? 460 : 560); win.setAttribute("height", isExtensions ? 300 : 380); } // Now look and see if we're being opened by XPInstall gDownloadManager = new XPInstallDownloadManager(); var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.addObserver(gDownloadManager, "xpinstall-download-started", false); gObserverIndex = gExtensionManager.addDownloadListener(gDownloadManager); if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { } } // Set the tooltips if (!isExtensions) { var extensionsStrings = document.getElementById("extensionsStrings");#ifndef MOZ_PHOENIX document.getElementById("installButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdInstallTooltipTheme"));#endif document.getElementById("uninstallButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUninstallTooltipTheme")); document.getElementById("updateButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUpdateTooltipTheme")); }} |
|
if (pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) gCurrentTheme = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); else if (pref.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); if (!gCurrentTheme) gCurrentTheme = KEY_DEFAULT_THEME; | try { gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); gDefaultTheme = defaultPref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); } catch (e) { } | function Startup() { gWindowState = window.location.search.substr("?type=".length, window.location.search.length); var isExtensions = gWindowState == "extensions"; gItemType = isExtensions ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME; var typeCondition = document.getElementById("typeCondition"); typeCondition.setAttribute("object", gItemType); document.documentElement.setAttribute("windowtype", document.documentElement.getAttribute("windowtype") + "-" + gWindowState); gExtensionsView = document.getElementById("extensionsView"); gExtensionsView.setAttribute("state", gWindowState); gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"] .getService(Components.interfaces.nsIExtensionManager); // Extension Command Updating is handled by a command controller. gExtensionsView.controllers.appendController(gExtensionsViewController); // This persists the last-selected extension gExtensionsView.addEventListener("richview-select", onExtensionSelect, false); // Finally, update the UI. gExtensionsView.database.AddDataSource(gExtensionManager.datasource); gExtensionsView.setAttribute("ref", RDFURI_ITEM_ROOT); gExtensionsView.focus(); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!isExtensions) { gExtensionsView.addEventListener("richview-select", onThemeSelect, false); if (pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) gCurrentTheme = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); else if (pref.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); if (!gCurrentTheme) gCurrentTheme = KEY_DEFAULT_THEME; var useThemeButton = document.getElementById("useThemeButton"); useThemeButton.hidden = false; var optionsButton = document.getElementById("optionsButton"); optionsButton.hidden = true; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!pref.getBoolPref(PREF_EXTENSIONS_DSS_ENABLED) && pref.getBoolPref(PREF_EXTENSIONS_DSS_SWITCHPENDING) && pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) { var lastSelectedSkin = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); for (var i = 0; i < gExtensionsView.childNodes.length; ++i) { var item = gExtensionsView.childNodes[i]; if (item.getAttribute("internalName") == lastSelectedSkin) break; } setRestartMessage(item); } } // Restore the last-selected extension var lastSelected = gExtensionsView.getAttribute("last-selected"); if (lastSelected != "") lastSelected = document.getElementById(lastSelected); if (!lastSelected) gExtensionsView.selectionForward(); else gExtensionsView.selected = lastSelected; var extensionsStrings = document.getElementById("extensionsStrings"); document.title = extensionsStrings.getString(gWindowState + "Title"); gExtensionsViewController.onCommandUpdate(); gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; var app = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, app.ID); // Update various pieces of state-dependant UI var getMore = document.getElementById("getMore"); getMore.setAttribute("value", getMore.getAttribute(isExtensions ? "valueextensions" : "valuethemes")); getMore.setAttribute("tooltiptext", getMore.getAttribute(isExtensions ? "tooltiptextextensions" : "tooltiptextthemes")); if (!isExtensions) { var themePreviewArea = document.getElementById("themePreviewArea"); themePreviewArea.hidden = false; gExtensionsView.removeAttribute("flex"); } // Set Initial Size var win = document.documentElement; if (!win.hasAttribute("width") || !win.hasAttribute("height")) { win.setAttribute("width", isExtensions ? 460 : 560); win.setAttribute("height", isExtensions ? 300 : 380); } // Now look and see if we're being opened by XPInstall gDownloadManager = new XPInstallDownloadManager(); var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.addObserver(gDownloadManager, "xpinstall-download-started", false); gObserverIndex = gExtensionManager.addDownloadListener(gDownloadManager); if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { } } // Set the tooltips if (!isExtensions) { var extensionsStrings = document.getElementById("extensionsStrings");#ifndef MOZ_PHOENIX document.getElementById("installButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdInstallTooltipTheme"));#endif document.getElementById("uninstallButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUninstallTooltipTheme")); document.getElementById("updateButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUpdateTooltipTheme")); }} |
var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!pref.getBoolPref(PREF_EXTENSIONS_DSS_ENABLED) && pref.getBoolPref(PREF_EXTENSIONS_DSS_SWITCHPENDING) && pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) { var lastSelectedSkin = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); for (var i = 0; i < gExtensionsView.childNodes.length; ++i) { var item = gExtensionsView.childNodes[i]; if (item.getAttribute("internalName") == lastSelectedSkin) break; } setRestartMessage(item); } | function Startup() { gWindowState = window.location.search.substr("?type=".length, window.location.search.length); var isExtensions = gWindowState == "extensions"; gItemType = isExtensions ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME; var typeCondition = document.getElementById("typeCondition"); typeCondition.setAttribute("object", gItemType); document.documentElement.setAttribute("windowtype", document.documentElement.getAttribute("windowtype") + "-" + gWindowState); gExtensionsView = document.getElementById("extensionsView"); gExtensionsView.setAttribute("state", gWindowState); gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"] .getService(Components.interfaces.nsIExtensionManager); // Extension Command Updating is handled by a command controller. gExtensionsView.controllers.appendController(gExtensionsViewController); // This persists the last-selected extension gExtensionsView.addEventListener("richview-select", onExtensionSelect, false); // Finally, update the UI. gExtensionsView.database.AddDataSource(gExtensionManager.datasource); gExtensionsView.setAttribute("ref", RDFURI_ITEM_ROOT); gExtensionsView.focus(); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!isExtensions) { gExtensionsView.addEventListener("richview-select", onThemeSelect, false); if (pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) gCurrentTheme = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); else if (pref.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); if (!gCurrentTheme) gCurrentTheme = KEY_DEFAULT_THEME; var useThemeButton = document.getElementById("useThemeButton"); useThemeButton.hidden = false; var optionsButton = document.getElementById("optionsButton"); optionsButton.hidden = true; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!pref.getBoolPref(PREF_EXTENSIONS_DSS_ENABLED) && pref.getBoolPref(PREF_EXTENSIONS_DSS_SWITCHPENDING) && pref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) { var lastSelectedSkin = pref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); for (var i = 0; i < gExtensionsView.childNodes.length; ++i) { var item = gExtensionsView.childNodes[i]; if (item.getAttribute("internalName") == lastSelectedSkin) break; } setRestartMessage(item); } } // Restore the last-selected extension var lastSelected = gExtensionsView.getAttribute("last-selected"); if (lastSelected != "") lastSelected = document.getElementById(lastSelected); if (!lastSelected) gExtensionsView.selectionForward(); else gExtensionsView.selected = lastSelected; var extensionsStrings = document.getElementById("extensionsStrings"); document.title = extensionsStrings.getString(gWindowState + "Title"); gExtensionsViewController.onCommandUpdate(); gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; var app = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, app.ID); // Update various pieces of state-dependant UI var getMore = document.getElementById("getMore"); getMore.setAttribute("value", getMore.getAttribute(isExtensions ? "valueextensions" : "valuethemes")); getMore.setAttribute("tooltiptext", getMore.getAttribute(isExtensions ? "tooltiptextextensions" : "tooltiptextthemes")); if (!isExtensions) { var themePreviewArea = document.getElementById("themePreviewArea"); themePreviewArea.hidden = false; gExtensionsView.removeAttribute("flex"); } // Set Initial Size var win = document.documentElement; if (!win.hasAttribute("width") || !win.hasAttribute("height")) { win.setAttribute("width", isExtensions ? 460 : 560); win.setAttribute("height", isExtensions ? 300 : 380); } // Now look and see if we're being opened by XPInstall gDownloadManager = new XPInstallDownloadManager(); var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.addObserver(gDownloadManager, "xpinstall-download-started", false); gObserverIndex = gExtensionManager.addDownloadListener(gDownloadManager); if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { } } // Set the tooltips if (!isExtensions) { var extensionsStrings = document.getElementById("extensionsStrings");#ifndef MOZ_PHOENIX document.getElementById("installButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdInstallTooltipTheme"));#endif document.getElementById("uninstallButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUninstallTooltipTheme")); document.getElementById("updateButton").setAttribute("tooltiptext", extensionsStrings.getString("cmdUpdateTooltipTheme")); }} |
|
walleteditor = Components.classes["component: | walleteditor = Components.classes["@mozilla.org/walleteditor/walleteditor-world;1"].createInstance(); | function Startup(){ walleteditor = Components.classes["component://netscape/walleteditor/walleteditor-world"].createInstance(); walleteditor = walleteditor.QueryInterface(Components.interfaces.nsIWalletEditor); walletservice = Components.classes['component://netscape/wallet/wallet-service']; walletservice = walletservice.getService(); walletservice = walletservice.QueryInterface(Components.interfaces.nsIWalletService); bundle = srGetStrBundle(JS_STRINGS_FILE); /* initialize string bundle */ EncryptionTest(); /* abort if user failed to unlock the database */ if (!FetchInput()) { return; /* user failed to unlock the database */ } ViewSchema(); /* create the display of schemas */ doSetOKCancel(onOK, null); /* register the onOK method */ window.sizeToContent();} |
walletservice = Components.classes['component: | walletservice = Components.classes['@mozilla.org/wallet/wallet-service;1']; | function Startup(){ walleteditor = Components.classes["component://netscape/walleteditor/walleteditor-world"].createInstance(); walleteditor = walleteditor.QueryInterface(Components.interfaces.nsIWalletEditor); walletservice = Components.classes['component://netscape/wallet/wallet-service']; walletservice = walletservice.getService(); walletservice = walletservice.QueryInterface(Components.interfaces.nsIWalletService); bundle = srGetStrBundle(JS_STRINGS_FILE); /* initialize string bundle */ EncryptionTest(); /* abort if user failed to unlock the database */ if (!FetchInput()) { return; /* user failed to unlock the database */ } ViewSchema(); /* create the display of schemas */ doSetOKCancel(onOK, null); /* register the onOK method */ window.sizeToContent();} |
window.sizeToContent(); | function Startup() { permissionManager = Components.classes["@mozilla.org/permissionmanager;1"] .getService(Components.interfaces.nsIPermissionManager); permissionsTree = document.getElementById("permissionsTree"); popupStringBundle = document.getElementById("popupStringBundle"); // window.args[0]: host to prefill // window.args[1]: true = opened from pref panel, false = opened from tools menu or statusbar icon sortAscending = (permissionsTree.getAttribute("sortAscending") == "true"); loadPermissions(permissions); loadTree(); if (window.arguments[0] != "") { // fill textbox to unblock/add to whitelist var prefill = window.arguments[0]; if (prefill.indexOf("www.") == 0) prefill = prefill.slice(4); document.getElementById("addSiteBox").value = prefill; } document.documentElement.addEventListener("keypress", onReturnHit, true); window.sizeToContent();} |
|
try{ document.getElementById('allowWindowOpen').checked = !pref.GetBoolPref("dom.disable_open_during_load"); } catch (e){ document.getElementById('allowWindowOpen').checked = true; | data = parent.hPrefWindow.wsm.dataManager.pageData["chrome: if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowWindowMoveResizeChanged", "allowWindowStatusChangeChanged", "allowWindowFlipChanged", "allowDocumentCookieSetChanged", "allowDocumentCookieGetChanged", "allowImageSrcChangeChanged"]; data.scriptData = []; for(var run = 0; run < changedList.length; run++ ){ data.scriptData[ changedList[run] ] = []; data.scriptData[ changedList[run] ].value = false; } try{ document.getElementById("allowWindowOpen").checked = !pref.GetBoolPref("dom.disable_open_during_load"); } catch (e){ document.getElementById("allowWindowOpen").checked = true; } document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("capability.policy.default.Window.resizeTo") && getPrefValueForCheckbox("capability.policy.default.Window.innerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.innerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.sizeToContent") && getPrefValueForCheckbox("capability.policy.default.Window.resizeBy") && getPrefValueForCheckbox("capability.policy.default.Window.screenX.set") && getPrefValueForCheckbox("capability.policy.default.Window.screenY.set") && getPrefValueForCheckbox("capability.policy.default.Window.moveTo") && getPrefValueForCheckbox("capability.policy.default.Window.moveBy"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("capability.policy.default.Window.focus"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("capability.policy.default.Window.status"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("capability.policy.default.HTMLImageElement.src"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.set"); } else { document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowWindowMoveResize").checked = data["allowWindowMoveResize"].checked; document.getElementById("allowWindowFlip").checked = data["allowWindowFlip"].checked; document.getElementById("allowWindowStatusChange").checked = data["allowWindowStatusChange"].checked; document.getElementById("allowImageSrcChange").checked = data["allowImageSrcChange"].checked; document.getElementById("allowDocumentCookieSet").checked = data["allowDocumentCookieSet"].checked; document.getElementById("allowDocumentCookieGet").checked = data["allowDocumentCookieGet"].checked; document.getElementById("javascriptEnabled").checked = data["javascriptEnabled"].checked; | function Startup(){ try{ document.getElementById('allowWindowOpen').checked = !pref.GetBoolPref("dom.disable_open_during_load"); } catch (e){ //if we get an error, the pref is not existent, we default to true document.getElementById('allowWindowOpen').checked = true; } //if one of the security capability prefs is set, checkbox becomes unchecked document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("capability.policy.default.Window.resizeTo") && getPrefValueForCheckbox("capability.policy.default.Window.innerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.innerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.sizeToContent") && getPrefValueForCheckbox("capability.policy.default.Window.resizeBy") && getPrefValueForCheckbox("capability.policy.default.Window.screenX.set") && getPrefValueForCheckbox("capability.policy.default.Window.screenY.set") && getPrefValueForCheckbox("capability.policy.default.Window.moveTo") && getPrefValueForCheckbox("capability.policy.default.Window.moveBy"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("capability.policy.default.Window.focus"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("capability.policy.default.Window.status"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("capability.policy.default.HTMLImageElement.src"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.set"); //if javascript is disabled, disable the checkboxes if (!document.getElementById('javascriptEnabled').checked) changeDisabledState(true); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);} |
document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("capability.policy.default.Window.resizeTo") && getPrefValueForCheckbox("capability.policy.default.Window.innerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.innerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.sizeToContent") && getPrefValueForCheckbox("capability.policy.default.Window.resizeBy") && getPrefValueForCheckbox("capability.policy.default.Window.screenX.set") && getPrefValueForCheckbox("capability.policy.default.Window.screenY.set") && getPrefValueForCheckbox("capability.policy.default.Window.moveTo") && getPrefValueForCheckbox("capability.policy.default.Window.moveBy"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("capability.policy.default.Window.focus"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("capability.policy.default.Window.status"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("capability.policy.default.HTMLImageElement.src"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.set"); if (!document.getElementById('javascriptEnabled').checked) changeDisabledState(true); | if (!document.getElementById("javascriptEnabled").checked) changeDisabledState(true); | function Startup(){ try{ document.getElementById('allowWindowOpen').checked = !pref.GetBoolPref("dom.disable_open_during_load"); } catch (e){ //if we get an error, the pref is not existent, we default to true document.getElementById('allowWindowOpen').checked = true; } //if one of the security capability prefs is set, checkbox becomes unchecked document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("capability.policy.default.Window.resizeTo") && getPrefValueForCheckbox("capability.policy.default.Window.innerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.innerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerWidth.set") && getPrefValueForCheckbox("capability.policy.default.Window.outerHeight.set") && getPrefValueForCheckbox("capability.policy.default.Window.sizeToContent") && getPrefValueForCheckbox("capability.policy.default.Window.resizeBy") && getPrefValueForCheckbox("capability.policy.default.Window.screenX.set") && getPrefValueForCheckbox("capability.policy.default.Window.screenY.set") && getPrefValueForCheckbox("capability.policy.default.Window.moveTo") && getPrefValueForCheckbox("capability.policy.default.Window.moveBy"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("capability.policy.default.Window.focus"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("capability.policy.default.Window.status"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("capability.policy.default.HTMLImageElement.src"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("capability.policy.default.HTMLDocument.cookie.set"); //if javascript is disabled, disable the checkboxes if (!document.getElementById('javascriptEnabled').checked) changeDisabledState(true); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);} |
var file_url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIFileURL); if (file_url) file_url.file = file; gDS = gRDF.GetDataSource(file_url.spec); | gDS = gRDF.GetDataSource(file.URL); | function Startup(){ // set up the string bundle gPrefApplicationsBundle = document.getElementById("bundle_prefApplications"); // set up the elements gTree = document.getElementById("appTree"); gExtensionField = document.getElementById("extension"); gMIMETypeField = document.getElementById("mimeType"); gHandlerField = document.getElementById("handler"); gNewTypeButton = document.getElementById("newTypeButton"); gEditButton = document.getElementById("editButton"); gRemoveButton = document.getElementById("removeButton"); // Disable the Edit & Remove buttons until we click on something updateLockedButtonState(false); const mimeTypes = "UMimTyp"; var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"].getService(); if (fileLocator) fileLocator = fileLocator.QueryInterface(Components.interfaces.nsIProperties); var file = fileLocator.get(mimeTypes, Components.interfaces.nsIFile); var file_url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIFileURL); if (file_url) file_url.file = file; gDS = gRDF.GetDataSource(file_url.spec); if (gDS) gDS = gDS.QueryInterface(Components.interfaces.nsIRDFDataSource); // intialise the tree gTree.database.AddDataSource(gDS); gTree.setAttribute("ref", "urn:mimetypes");} |
document.getElementById("TableOrCellGroup").setAttribute("collapsed", "false"); | document.getElementById("TableOrCellGroup").collapsed = false; | function Startup(){ if (!window.arguments[1]) { dump("EdColorPicker: Missing color object param\n"); return; } // window.arguments[1] is object to get initial values and return color data gColorObj = window.arguments[1]; gColorObj.Cancel = false; gDialog.ColorPicker = document.getElementById("ColorPicker"); gDialog.ColorInput = document.getElementById("ColorInput"); gDialog.LastPickedButton = document.getElementById("LastPickedButton"); gDialog.LastPickedColor = document.getElementById("LastPickedColor"); gDialog.CellOrTableGroup = document.getElementById("CellOrTableGroup"); gDialog.TableRadio = document.getElementById("TableRadio"); gDialog.CellRadio = document.getElementById("CellRadio"); gDialog.ColorSwatch = document.getElementById("ColorPickerSwatch"); gDialog.Ok = document.documentElement.getButton("accept"); // The type of color we are setting: // text: Text, Link, ActiveLink, VisitedLink, // or background: Page, Table, or Cell if (gColorObj.Type) { ColorType = gColorObj.Type; // Get string for dialog title from passed-in type // (note constraint on editor.properties string name) var prefs = GetPrefs(); var IsCSSPrefChecked = prefs.getBoolPref("editor.use_css"); if (GetCurrentEditor()) { window.title = GetString(ColorType+"Color"); if (ColorType == "Page" && IsCSSPrefChecked && IsHTMLEditor()) window.title = GetString("BlockColor"); } } if (!window.title) window.title = GetString("Color"); gDialog.ColorInput.value = ""; var tmpColor; var haveTableRadio = false; switch (ColorType) { case "Page": tmpColor = gColorObj.PageColor; if (tmpColor && tmpColor.toLowerCase() != "window") gColor = tmpColor; break; case "Table": if (gColorObj.TableColor) gColor = gColorObj.TableColor; break; case "Cell": if (gColorObj.CellColor) gColor = gColorObj.CellColor; break; case "TableOrCell": TableOrCell = true; document.getElementById("TableOrCellGroup").setAttribute("collapsed", "false"); haveTableRadio = true; if (gColorObj.SelectedType == "Cell") { gColor = gColorObj.CellColor; gDialog.CellOrTableGroup.selectedItem = gDialog.CellRadio; gDialog.CellRadio.focus(); } else { gColor = gColorObj.TableColor; gDialog.CellOrTableGroup.selectedItem = gDialog.TableRadio; gDialog.TableRadio.focus(); } break; case "Highlight": HighlightType = true; if (gColorObj.HighlightColor) gColor = gColorObj.HighlightColor; break; default: // Any other type will change some kind of text, TextType = true; tmpColor = gColorObj.TextColor; if (tmpColor && tmpColor.toLowerCase() != "windowtext") gColor = gColorObj.TextColor; break; } // Set initial color in input field and in the colorpicker SetCurrentColor(gColor); gDialog.ColorPicker.initColor(gColor); // Use last-picked colors passed in, or those persistent on dialog if (TextType) { if ( !("LastTextColor" in gColorObj) || !gColorObj.LastTextColor) gColorObj.LastTextColor = gDialog.LastPickedColor.getAttribute("LastTextColor"); LastPickedColor = gColorObj.LastTextColor; } else if (HighlightType) { if ( !("LastHighlightColor" in gColorObj) || !gColorObj.LastHighlightColor) gColorObj.LastHighlightColor = gDialog.LastPickedColor.getAttribute("LastHighlightColor"); LastPickedColor = gColorObj.LastHighlightColor; } else { if ( !("LastBackgroundColor" in gColorObj) || !gColorObj.LastBackgroundColor) gColorObj.LastBackgroundColor = gDialog.LastPickedColor.getAttribute("LastBackgroundColor"); LastPickedColor = gColorObj.LastBackgroundColor; } gDialog.LastPickedColor.setAttribute("style","background-color: "+LastPickedColor); // Set method to detect clicking on OK button // so we don't get fooled by changing "default" behavior gDialog.Ok.setAttribute("onclick", "SetDefaultToOk()"); // Make the "Last-picked" the default button // until the user selects a color gDialog.Ok.removeAttribute("default"); gDialog.LastPickedButton.setAttribute("default","true"); // Caller can prevent user from submitting an empty, i.e., default color NoDefault = gColorObj.NoDefault; if (NoDefault) { // Hide the "Default button -- user must pick a color document.getElementById("DefaultColorButton").setAttribute("collapsed","true"); } // Set focus to colorpicker if not set to table radio buttons above if (!haveTableRadio) gDialog.ColorPicker.focus(); SetWindowLocation();} |
document.getElementById("DefaultColorButton").setAttribute("collapsed","true"); | document.getElementById("DefaultColorButton").collapsed = true; | function Startup(){ if (!window.arguments[1]) { dump("EdColorPicker: Missing color object param\n"); return; } // window.arguments[1] is object to get initial values and return color data gColorObj = window.arguments[1]; gColorObj.Cancel = false; gDialog.ColorPicker = document.getElementById("ColorPicker"); gDialog.ColorInput = document.getElementById("ColorInput"); gDialog.LastPickedButton = document.getElementById("LastPickedButton"); gDialog.LastPickedColor = document.getElementById("LastPickedColor"); gDialog.CellOrTableGroup = document.getElementById("CellOrTableGroup"); gDialog.TableRadio = document.getElementById("TableRadio"); gDialog.CellRadio = document.getElementById("CellRadio"); gDialog.ColorSwatch = document.getElementById("ColorPickerSwatch"); gDialog.Ok = document.documentElement.getButton("accept"); // The type of color we are setting: // text: Text, Link, ActiveLink, VisitedLink, // or background: Page, Table, or Cell if (gColorObj.Type) { ColorType = gColorObj.Type; // Get string for dialog title from passed-in type // (note constraint on editor.properties string name) var prefs = GetPrefs(); var IsCSSPrefChecked = prefs.getBoolPref("editor.use_css"); if (GetCurrentEditor()) { window.title = GetString(ColorType+"Color"); if (ColorType == "Page" && IsCSSPrefChecked && IsHTMLEditor()) window.title = GetString("BlockColor"); } } if (!window.title) window.title = GetString("Color"); gDialog.ColorInput.value = ""; var tmpColor; var haveTableRadio = false; switch (ColorType) { case "Page": tmpColor = gColorObj.PageColor; if (tmpColor && tmpColor.toLowerCase() != "window") gColor = tmpColor; break; case "Table": if (gColorObj.TableColor) gColor = gColorObj.TableColor; break; case "Cell": if (gColorObj.CellColor) gColor = gColorObj.CellColor; break; case "TableOrCell": TableOrCell = true; document.getElementById("TableOrCellGroup").setAttribute("collapsed", "false"); haveTableRadio = true; if (gColorObj.SelectedType == "Cell") { gColor = gColorObj.CellColor; gDialog.CellOrTableGroup.selectedItem = gDialog.CellRadio; gDialog.CellRadio.focus(); } else { gColor = gColorObj.TableColor; gDialog.CellOrTableGroup.selectedItem = gDialog.TableRadio; gDialog.TableRadio.focus(); } break; case "Highlight": HighlightType = true; if (gColorObj.HighlightColor) gColor = gColorObj.HighlightColor; break; default: // Any other type will change some kind of text, TextType = true; tmpColor = gColorObj.TextColor; if (tmpColor && tmpColor.toLowerCase() != "windowtext") gColor = gColorObj.TextColor; break; } // Set initial color in input field and in the colorpicker SetCurrentColor(gColor); gDialog.ColorPicker.initColor(gColor); // Use last-picked colors passed in, or those persistent on dialog if (TextType) { if ( !("LastTextColor" in gColorObj) || !gColorObj.LastTextColor) gColorObj.LastTextColor = gDialog.LastPickedColor.getAttribute("LastTextColor"); LastPickedColor = gColorObj.LastTextColor; } else if (HighlightType) { if ( !("LastHighlightColor" in gColorObj) || !gColorObj.LastHighlightColor) gColorObj.LastHighlightColor = gDialog.LastPickedColor.getAttribute("LastHighlightColor"); LastPickedColor = gColorObj.LastHighlightColor; } else { if ( !("LastBackgroundColor" in gColorObj) || !gColorObj.LastBackgroundColor) gColorObj.LastBackgroundColor = gDialog.LastPickedColor.getAttribute("LastBackgroundColor"); LastPickedColor = gColorObj.LastBackgroundColor; } gDialog.LastPickedColor.setAttribute("style","background-color: "+LastPickedColor); // Set method to detect clicking on OK button // so we don't get fooled by changing "default" behavior gDialog.Ok.setAttribute("onclick", "SetDefaultToOk()"); // Make the "Last-picked" the default button // until the user selects a color gDialog.Ok.removeAttribute("default"); gDialog.LastPickedButton.setAttribute("default","true"); // Caller can prevent user from submitting an empty, i.e., default color NoDefault = gColorObj.NoDefault; if (NoDefault) { // Hide the "Default button -- user must pick a color document.getElementById("DefaultColorButton").setAttribute("collapsed","true"); } // Set focus to colorpicker if not set to table radio buttons above if (!haveTableRadio) gDialog.ColorPicker.focus(); SetWindowLocation();} |
prefvalue = parent.hPrefWindow.getPref( "int", "browser.display.screen_resolution" ); | var prefvalue = parent.hPrefWindow.getPref( "int", "browser.display.screen_resolution" ); | function Startup() { variableSize = document.getElementById( "sizeVar" ); fixedSize = document.getElementById( "sizeMono" ); minSize = document.getElementById( "minSize" ); languageList = document.getElementById( "selectLangs" ); gPrefutilitiesBundle = document.getElementById("bundle_prefutilities"); // register our ok callback function parent.hPrefWindow.registerOKCallbackFunc( saveFontPrefs ); // eventually we should detect the default language and select it by default selectLanguage(); // Allow user to ask the OS for a DPI if we are under X if (navigator.appVersion.indexOf("X11") != -1) { document.getElementById( "systemResolution" ).removeAttribute( "hidden" ); } // Set up the labels for the standard issue resolutions var resolution; resolution = document.getElementById( "screenResolution" ); // Set an attribute on the selected resolution item so we can fall back on // it if an invalid selection is made (select "Other...", hit Cancel) resolution.selectedItem.setAttribute("current", "true"); var dpi = resolution.getAttribute( "dpi" ); resolution = document.getElementById( "otherResolution" ); resolution.setAttribute( "value", "72" ); resolution.setAttribute( "label", dpi.replace(/\$val/, "72" ) ); resolution = document.getElementById( "defaultResolution" ); resolution.setAttribute( "value", "96" ); resolution.setAttribute( "label", dpi.replace(/\$val/, "96" ) ); // Get the pref and set up the dialog appropriately. Startup is called // after SetFields so we can't rely on that call to do the business. prefvalue = parent.hPrefWindow.getPref( "int", "browser.display.screen_resolution" ); if( prefvalue != "!/!ERROR_UNDEFINED_PREF!/!" ) resolution = prefvalue; else resolution = 96; // If it all goes horribly wrong, fall back on 96. setResolution( resolution ); // This prefstring is a contrived pref whose sole purpose is to lock some // elements in this panel. The value of the pref is not used and does not matter. if ( parent.hPrefWindow.getPrefIsLocked( "browser.display.languageList" ) ) { disableAllFontElements(); } } |
window.sizeToContent(); | function Startup() { // arguments passed to this routine: // cookieManager // cookieManagerFromIcon // imageManager // xpconnect to cookiemanager/permissionmanager/popupmanager interfaces cookiemanager = Components.classes["@mozilla.org/cookiemanager;1"].getService(); cookiemanager = cookiemanager.QueryInterface(Components.interfaces.nsICookieManager); permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"].getService(); permissionmanager = permissionmanager.QueryInterface(Components.interfaces.nsIPermissionManager); popupmanager = Components.classes["@mozilla.org/PopupWindowManager;1"].getService(); popupmanager = popupmanager.QueryInterface(Components.interfaces.nsIPopupWindowManager); // intialize gDateService if (!gDateService) { const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1"; const nsIScriptableDateFormat = Components.interfaces.nsIScriptableDateFormat; gDateService = Components.classes[nsScriptableDateFormat_CONTRACTID] .getService(nsIScriptableDateFormat); } // intialize string bundle cookieBundle = document.getElementById("cookieBundle"); // label the close button document.documentElement.getButton("accept").label = cookieBundle.getString("close"); // determine if labelling is for cookies or images try { var tabBox = document.getElementById("tabbox"); var element; if (dialogType == cookieType) { element = document.getElementById("cookiesTab"); tabBox.selectedTab = element; } else if (dialogType == imageType) { element = document.getElementById("cookieviewer"); element.setAttribute("title", cookieBundle.getString("imageTitle")); element = document.getElementById("permissionsTab"); element.label = cookieBundle.getString("tabBannedImages"); tabBox.selectedTab = element; element = document.getElementById("permissionsText"); element.value = cookieBundle.getString("textBannedImages"); element = document.getElementById("cookiesTab"); element.hidden = "true"; } else { element = document.getElementById("cookieviewer"); element.setAttribute("title", cookieBundle.getString("popupTitle")); element = document.getElementById("permissionsTab"); element.label = cookieBundle.getString("tabBannedPopups"); tabBox.selectedTab = element; element = document.getElementById("permissionsText"); element.value = cookieBundle.getString("textBannedPopups"); element = document.getElementById("cookiesTab"); element.hidden = "true"; } } catch(e) { } // load in the cookies and permissions cookiesTree = document.getElementById("cookiesTree"); permissionsTree = document.getElementById("permissionsTree"); if (dialogType == cookieType) { loadCookies(); } loadPermissions(); // be prepared to reload the display if anything changes kObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); kObserverService.addObserver(cookieReloadDisplay, "cookieChanged", false); window.sizeToContent();} |
|
return; } | function Startup(){ if (!InitEditorShell()) return; dialog = new Object; if (!dialog) { dump("Failed to create dialog object!!!\n"); window.close(); } dialog.PageLocation = document.getElementById("PageLocation"); dialog.TitleInput = document.getElementById("TitleInput"); dialog.AuthorInput = document.getElementById("AuthorInput"); dialog.DescriptionInput = document.getElementById("DescriptionInput"); doSetOKCancel(onOK, onCancel); // Default string for new page is set from DTD string in XUL, // so set only if not new doc URL var location = editorShell.editorDocument.location; var lastmodString = GetString("Unknown");dump("location="+location); if (location != "about:blank") { dialog.PageLocation.setAttribute("value", editorShell.editorDocument.location); // Get last-modified file date+time // TODO: Convert this to local time? var lastmod = editorShell.editorDocument.lastModified; // get string of last modified date var lastmoddate = Date.parse(lastmod); // convert modified string to date if(lastmoddate != 0) // unknown date (or January 1, 1970 GMT) lastmodString = lastmoddate; }dump(", lastmod date="+lastmoddate+"\n"); document.getElementById("PageModDate").setAttribute("value", lastmodString); authorElement = GetMetaElement("author"); if (!authorElement) { authorElement = CreateMetaElement("author"); if (!authorElement) window.close(); insertNewAuthor = true; } descriptionElement = GetMetaElement("description"); if (!descriptionElement) { descriptionElement = CreateMetaElement("description"); if (!descriptionElement) window.close(); insertNewDescription = true; } InitDialog(); SetTextboxFocus(dialog.TitleInput); SetWindowLocation();} |
|
gData.navigatorData["startupPage"].value = radiogroup.value; | function Startup(){ var radiogroup = document.getElementById("startupPage"); radiogroup.addEventListener("RadioStateChange", onRadioCheck, false); var textbox = document.getElementById("browserStartupHomepage"); textbox.addEventListener("input", updateHomePageButtons, false); updateHomePageButtons(); gData = parent.hPrefWindow.wsm.dataManager .pageData["chrome://communicator/content/pref/pref-navigator.xul"]; if (!("navigatorData" in gData)) { gData.navigatorData = []; gData.navigatorData["startupPage"] = []; gData.navigatorData["startupPage"].changed = false; gData.navigatorData["startupPage"].originalValue = radiogroup.value; } gDefaultPage = getDefaultPage(); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);} |
|
getColorFromWellAndSetValue("activelinkmenu"); | function Startup() { getColorFromWellAndSetValue("foregroundtextmenu"); getColorFromWellAndSetValue("backgroundmenu"); getColorFromWellAndSetValue("unvisitedlinkmenu"); getColorFromWellAndSetValue("visitedlinkmenu"); return true; } |
|
defaultActiveColor = defaultLinkColor; | defaultActiveColor = browserColors.ActiveLinkColor; | function Startup(){ gDialog.ColorPreview = document.getElementById("ColorPreview"); gDialog.NormalText = document.getElementById("NormalText"); gDialog.LinkText = document.getElementById("LinkText"); gDialog.ActiveLinkText = document.getElementById("ActiveLinkText"); gDialog.VisitedLinkText = document.getElementById("VisitedLinkText"); gDialog.DefaultColorsRadio = document.getElementById("DefaultColorsRadio"); gDialog.CustomColorsRadio = document.getElementById("CustomColorsRadio"); gDialog.BackgroundImageInput = document.getElementById("BackgroundImageInput"); // The data elements that hold the pref values gDialog.NormalData = document.getElementById("textData"); gDialog.LinkData = document.getElementById("linkData"); gDialog.ActiveLinkData = document.getElementById("aLinkData"); gDialog.VisitedLinkData = document.getElementById("fLinkData"); gDialog.BackgroundColorData = document.getElementById("backgroundColorData"); gDialog.BackgroundImageData = document.getElementById("backgroundImageData"); browserColors = GetDefaultBrowserColors(); // Use author's browser pref colors passed into dialog defaultTextColor = browserColors.TextColor; defaultLinkColor = browserColors.LinkColor; // Note: Browser doesn't store a value for ActiveLinkColor defaultActiveColor = defaultLinkColor; defaultVisitedColor = browserColors.VisitedLinkColor; defaultBackgroundColor= browserColors.BackgroundColor; // Get the colors and image set by prefs init code customTextColor = gDialog.NormalData.getAttribute("value"); customLinkColor = gDialog.LinkData.getAttribute("value"); customActiveColor = gDialog.ActiveLinkData.getAttribute("value"); customVisitedColor = gDialog.VisitedLinkData.getAttribute("value"); customBackgroundColor = gDialog.BackgroundColorData.getAttribute("value"); backgroundImage = gDialog.BackgroundImageData.getAttribute("value"); if (backgroundImage) gDialog.BackgroundImageInput.value = backgroundImage; // "value" attribute value is a string conversion of boolean! if( document.getElementById( "useCustomColors" ).value == "true" ) UseCustomColors(); else UseDefaultColors(); return true;} |
var prefInterface; | function Startup(){ var prefInterface; var defaultLanguage; var languageList = document.getElementById("langList"); var selectedLanguage = window.arguments.length ? window.arguments[0] : null; var defaultRegion; var regionList = document.getElementById("regionList"); var selectedRegion = window.arguments.length ? window.arguments[1] : null; //get pref defaults try { prefInterface = Components.classes["@mozilla.org/preferences;1"]. getService(Components.interfaces.nsIPref); defaultLanguage = prefInterface. getLocalizedUnicharPref("general.useragent.locale"); defaultRegion = prefInterface. getLocalizedUnicharPref("general.useragent.contentlocale"); } catch(e) {} //persist previous user selection, highlight a default otherwise if (!SelectListItem(languageList, selectedLanguage)) if (!SelectListItem(languageList, defaultLanguage)) languageList.selectedIndex = 0; //persist previous user selection, highlight a default otherwise if (!SelectListItem(regionList, selectedRegion)) if (!SelectListItem(regionList, defaultRegion)) regionList.selectedIndex = 1;} |
|
prefInterface = Components.classes["@mozilla.org/preferences;1"]. getService(Components.interfaces.nsIPref); defaultLanguage = prefInterface. getLocalizedUnicharPref("general.useragent.locale"); defaultRegion = prefInterface. getLocalizedUnicharPref("general.useragent.contentlocale"); | const nsIPrefLocalizedString = Components.interfaces.nsIPrefLocalizedString; var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService) .getBranch("general.useragent."); defaultLanguage = prefBranch.getComplexValue("locale", nsIPrefLocalizedString).data; defaultRegion = prefBranch.getComplexValue("contentlocale", nsIPrefLocalizedString).data; | function Startup(){ var prefInterface; var defaultLanguage; var languageList = document.getElementById("langList"); var selectedLanguage = window.arguments.length ? window.arguments[0] : null; var defaultRegion; var regionList = document.getElementById("regionList"); var selectedRegion = window.arguments.length ? window.arguments[1] : null; //get pref defaults try { prefInterface = Components.classes["@mozilla.org/preferences;1"]. getService(Components.interfaces.nsIPref); defaultLanguage = prefInterface. getLocalizedUnicharPref("general.useragent.locale"); defaultRegion = prefInterface. getLocalizedUnicharPref("general.useragent.contentlocale"); } catch(e) {} //persist previous user selection, highlight a default otherwise if (!SelectListItem(languageList, selectedLanguage)) if (!SelectListItem(languageList, defaultLanguage)) languageList.selectedIndex = 0; //persist previous user selection, highlight a default otherwise if (!SelectListItem(regionList, selectedRegion)) if (!SelectListItem(regionList, defaultRegion)) regionList.selectedIndex = 1;} |
PlaySoundCheck(); | function Startup(){ var startupFunc; try { startupFunc = document.getElementById("mailnewsEnableMapi").getAttribute('startupFunc'); } catch (ex) { startupFunc = null; } if (startupFunc) eval(startupFunc); StartPageCheck(); PlaySoundCheck();} |
|
dialog.wordInput = document.getElementById("Word"); | dialog.misspelledWord = document.getElementById("MisspelledWord"); dialog.replaceWordInput = document.getElementById("ReplaceWord"); | function Startup(){ if (!InitEditorShell()) return; dump("EditorShell found for Spell Checker dialog\n"); // Get the spellChecker shell spellChecker = editorShell.QueryInterface(Components.interfaces.nsIEditorSpellCheck); if (!spellChecker) { dump("SpellChecker not found!!!\n"); window.close(); } // Save as a property of the window so it can be used by child dialogs window.spellChecker = spellChecker; // Create dialog object to store controls for easy access dialog = new Object; if (!dialog) { dump("Failed to create dialog object!!!\n"); window.close(); } dialog.wordInput = document.getElementById("Word"); dialog.suggestedList = document.getElementById("SuggestedList"); dialog.languageList = document.getElementById(""); if (!dialog.wordInput || !dialog.suggestedList || !dialog.languageList ) { dump("Not all dialog controls were found!!!\n"); } // NOTE: We shouldn't have been created if there was no misspelled word // The first misspelled word is passed as the 2nd extra parameter in window.openDialog() misspelledWord = window.arguments[1]; if (misspelledWord != "") { dump("First misspelled word = "+misspelledWord+"\n"); // Put word in input field dialog.wordInput.value = misspelledWord; // Get the list of suggested replacements FillSuggestedList(); } else { dump("No misspelled word found\n"); } dialog.suggestedList.focus(); } |
dialog.languageList = document.getElementById(""); if (!dialog.wordInput || | dialog.languageList = document.getElementById("LanguageList"); if (!dialog.misspelledWord || !dialog.replaceWordInput || | function Startup(){ if (!InitEditorShell()) return; dump("EditorShell found for Spell Checker dialog\n"); // Get the spellChecker shell spellChecker = editorShell.QueryInterface(Components.interfaces.nsIEditorSpellCheck); if (!spellChecker) { dump("SpellChecker not found!!!\n"); window.close(); } // Save as a property of the window so it can be used by child dialogs window.spellChecker = spellChecker; // Create dialog object to store controls for easy access dialog = new Object; if (!dialog) { dump("Failed to create dialog object!!!\n"); window.close(); } dialog.wordInput = document.getElementById("Word"); dialog.suggestedList = document.getElementById("SuggestedList"); dialog.languageList = document.getElementById(""); if (!dialog.wordInput || !dialog.suggestedList || !dialog.languageList ) { dump("Not all dialog controls were found!!!\n"); } // NOTE: We shouldn't have been created if there was no misspelled word // The first misspelled word is passed as the 2nd extra parameter in window.openDialog() misspelledWord = window.arguments[1]; if (misspelledWord != "") { dump("First misspelled word = "+misspelledWord+"\n"); // Put word in input field dialog.wordInput.value = misspelledWord; // Get the list of suggested replacements FillSuggestedList(); } else { dump("No misspelled word found\n"); } dialog.suggestedList.focus(); } |
dialog.wordInput.value = misspelledWord; | dialog.misspelledWord.setAttribute("value", misspelledWord); | function Startup(){ if (!InitEditorShell()) return; dump("EditorShell found for Spell Checker dialog\n"); // Get the spellChecker shell spellChecker = editorShell.QueryInterface(Components.interfaces.nsIEditorSpellCheck); if (!spellChecker) { dump("SpellChecker not found!!!\n"); window.close(); } // Save as a property of the window so it can be used by child dialogs window.spellChecker = spellChecker; // Create dialog object to store controls for easy access dialog = new Object; if (!dialog) { dump("Failed to create dialog object!!!\n"); window.close(); } dialog.wordInput = document.getElementById("Word"); dialog.suggestedList = document.getElementById("SuggestedList"); dialog.languageList = document.getElementById(""); if (!dialog.wordInput || !dialog.suggestedList || !dialog.languageList ) { dump("Not all dialog controls were found!!!\n"); } // NOTE: We shouldn't have been created if there was no misspelled word // The first misspelled word is passed as the 2nd extra parameter in window.openDialog() misspelledWord = window.arguments[1]; if (misspelledWord != "") { dump("First misspelled word = "+misspelledWord+"\n"); // Put word in input field dialog.wordInput.value = misspelledWord; // Get the list of suggested replacements FillSuggestedList(); } else { dump("No misspelled word found\n"); } dialog.suggestedList.focus(); } |
dialog.replaceWordInput.value = misspelledWord; dialog.languageList.selectedIndex = 0; dump("Language Listed Index = "+dialog.languageList.selectedIndex+"\n"); | function Startup(){ if (!InitEditorShell()) return; dump("EditorShell found for Spell Checker dialog\n"); // Get the spellChecker shell spellChecker = editorShell.QueryInterface(Components.interfaces.nsIEditorSpellCheck); if (!spellChecker) { dump("SpellChecker not found!!!\n"); window.close(); } // Save as a property of the window so it can be used by child dialogs window.spellChecker = spellChecker; // Create dialog object to store controls for easy access dialog = new Object; if (!dialog) { dump("Failed to create dialog object!!!\n"); window.close(); } dialog.wordInput = document.getElementById("Word"); dialog.suggestedList = document.getElementById("SuggestedList"); dialog.languageList = document.getElementById(""); if (!dialog.wordInput || !dialog.suggestedList || !dialog.languageList ) { dump("Not all dialog controls were found!!!\n"); } // NOTE: We shouldn't have been created if there was no misspelled word // The first misspelled word is passed as the 2nd extra parameter in window.openDialog() misspelledWord = window.arguments[1]; if (misspelledWord != "") { dump("First misspelled word = "+misspelledWord+"\n"); // Put word in input field dialog.wordInput.value = misspelledWord; // Get the list of suggested replacements FillSuggestedList(); } else { dump("No misspelled word found\n"); } dialog.suggestedList.focus(); } |
|
if (!dialog) | if (!dialog) { | function Startup(){ if (!InitEditorShell()) return; dialog = new Object; if (!dialog) window.close(); doSetOKCancel(onOK, onCancel); dialog.ListTypeList = document.getElementById("ListType"); dialog.BulletStyleList = document.getElementById("BulletStyle"); dialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); dialog.StartingNumberInput = document.getElementById("StartingNumber"); dialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); dialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); dialog.RadioGroup = document.getElementById("RadioGroup"); dialog.ChangeAllRadio = document.getElementById("ChangeAll"); dialog.ChangeSelectedRadio = document.getElementById("ChangeSelected"); // Try to get an existing list(s) var mixedObj = new Object; ListType = editorShell.GetListState(mixedObj); // We may have mixed list and non-list, or > 1 list type in selection MixedListSelection = mixedObj.value; // Get the list element at the anchor node ListElement = editorShell.GetElementOrParentByTagName("list", null); // The copy to use in AdvancedEdit if (ListElement) globalElement = ListElement.cloneNode(false); // Show extra options for changing entire list if we have one already. dialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); if (ListElement) { // Radio button index is persistant if (dialog.RadioGroup.getAttribute("index") == "1") dialog.ChangeSelectedRadio.checked = true; else dialog.ChangeAllRadio.checked = true; } InitDialog(); originalListType = ListType; dialog.ListTypeList.focus(); SetWindowLocation();} |
return; } | function Startup(){ if (!InitEditorShell()) return; dialog = new Object; if (!dialog) window.close(); doSetOKCancel(onOK, onCancel); dialog.ListTypeList = document.getElementById("ListType"); dialog.BulletStyleList = document.getElementById("BulletStyle"); dialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); dialog.StartingNumberInput = document.getElementById("StartingNumber"); dialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); dialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); dialog.RadioGroup = document.getElementById("RadioGroup"); dialog.ChangeAllRadio = document.getElementById("ChangeAll"); dialog.ChangeSelectedRadio = document.getElementById("ChangeSelected"); // Try to get an existing list(s) var mixedObj = new Object; ListType = editorShell.GetListState(mixedObj); // We may have mixed list and non-list, or > 1 list type in selection MixedListSelection = mixedObj.value; // Get the list element at the anchor node ListElement = editorShell.GetElementOrParentByTagName("list", null); // The copy to use in AdvancedEdit if (ListElement) globalElement = ListElement.cloneNode(false); // Show extra options for changing entire list if we have one already. dialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); if (ListElement) { // Radio button index is persistant if (dialog.RadioGroup.getAttribute("index") == "1") dialog.ChangeSelectedRadio.checked = true; else dialog.ChangeAllRadio.checked = true; } InitDialog(); originalListType = ListType; dialog.ListTypeList.focus(); SetWindowLocation();} |
|
name = PrepareStringForURL(TruncateStringAtWordEnd(name, 40, false)); | name = ConvertToCDATAString(TruncateStringAtWordEnd(name, 40, false)); | function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); nameInput = document.getElementById("nameInput"); // Get a single selected element of the desired type anchorElement = editorShell.GetSelectedElement(tagName); if (anchorElement) { // We found an element and don't need to insert one insertNew = false; // Make a copy to use for AdvancedEdit globalElement = anchorElement.cloneNode(false); originalName = anchorElement.name; } else { insertNew = true; // We don't have an element selected, // so create one with default attributes anchorElement = editorShell.CreateElementWithDefaults(tagName); if (anchorElement) { // Use the current selection as suggested name var name = GetSelectionAsText(); // Get 40 characters of the selected text and don't add "...", // replace whitespace with "_" and strip non-word characters name = PrepareStringForURL(TruncateStringAtWordEnd(name, 40, false)); //Be sure the name is unique to the document if (AnchorNameExists(name)) name += "_" // Make a copy to use for AdvancedEdit globalElement = anchorElement.cloneNode(false); globalElement.setAttribute("name",name); } } if(!anchorElement) { dump("Failed to get selected element or create a new one!\n"); window.close(); } InitDialog(); SetTextfieldFocus(nameInput); SetWindowLocation();} |
setTimeout("postStart()", 0); | setTimeout(postStart, 0); | function Startup() { var folderList = document.getElementById("downloadFolderList"); const nsILocalFile = Components.interfaces.nsILocalFile; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { var downloadDir = pref.getComplexValue(downloadDirPref, nsILocalFile); var desktop = getDownloadsFolder("Desktop"); var downloads = getDownloadsFolder("Documents"); // Check to see if the user-entered download dir is actually one of our // enumerated values (Desktop, My Downloads) and if so select that // item instead of the user selected one. // XXX - It's lame that I should have to compare the path directly. The // win32 implementation of nsIFile should know that Windows is not case // sensitive. var downloadPath = downloadDir.path.toUpperCase(); if (downloadPath == desktop.path.toUpperCase()) { pref.clearUserPref(downloadDirPref); pref.setIntPref(downloadModePref, 0); folderList.selectedIndex = 0; } else if (downloadPath == downloads.path.toUpperCase()) { pref.clearUserPref(downloadDirPref); pref.setIntPref(downloadModePref, 1); folderList.selectedIndex = 1; } } catch (e) { } try { selectCustomFolder(false); } catch (e) { } gLastSelectedIndex = folderList.selectedIndex; // Initialize the File Type list gHelperApps = new HelperApps(); gHandlersList = document.getElementById("fileHandlersList"); gHandlersList.database.AddDataSource(gHelperApps); gHandlersList.setAttribute("ref", "urn:mimetypes"); (gEditFileHandler = document.getElementById("editFileHandler")).disabled = true; (gRemoveFileHandler = document.getElementById("removeFileHandler")).disabled = true; parent.hPrefWindow.registerOKCallbackFunc(updateSaveToFolder); // XXXben such a hack. Should really update the OKCallbackFunction thing a bit to // let it support holding arbitrary data. parent.hPrefWindow.getSpecialFolderKey = getSpecialFolderKey; // XXXben menulist hack #43. When initializing the display to the custom // download path field, the field is blank. var downloadFolderList = document.getElementById("downloadFolderList"); downloadFolderList.parentNode.removeChild(downloadFolderList); var showFolder = document.getElementById("showFolder"); showFolder.parentNode.insertBefore(downloadFolderList, showFolder); downloadFolderList.hidden = false;#ifdef MOZ_PHOENIX toggleDMPrefUI(document.getElementById("showWhenStarting"));#endif setTimeout("postStart()", 0);} |
dump(uri); | function Startup(){ var bookmarksView = document.getElementById("bookmarks-view"); // Set up the outliner controller // gBookmarksShell = new nsBookmarksShell("bookmarks-outliner", "bookmarks-outlinerbody"); // var rdflinerObserver = new nsBookmarksRDFLinerObserver(); // var builder = bookmarksBody.builder.QueryInterface(Components.interfaces.nsIXULOutlinerBuilder); // builder.addObserver(rdflinerObserver); const windowNode = document.getElementById("bookmark-window"); // If we've been opened with a parameter, root the outliner on it. if ("arguments" in window && window.arguments[0]) { var uri = window.arguments[0]; dump(uri); bookmarksView.outliner.setAttribute("ref", uri); var title = ""; if (uri.substring(0,5) == "find:") { title = bookmarksView._bundle.GetStringFromName("search_results_title"); // Update the windowtype so that future searches are directed // there and the window is not re-used for bookmarks. windowNode.setAttribute("windowtype", "bookmarks:searchresults"); } else { const krNameArc = bookmarksView.rdf.GetResource(NC_NS + "Name"); const krRoot = bookmarksView.rdf.GetResource(window.arguments[0]); var rName = bookmarksView.db.GetTarget(krRoot, krNameArc, true); title = rName.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; } const titleString = bookmarksView._bundle.GetStringFromName("window_title"); windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, title)); } else { var rootfoldername = bookmarksView._bundle.GetStringFromName("bookmarks_root"); const kProfileContractID = "@mozilla.org/profile/manager;1"; const kProfileIID = Components.interfaces.nsIProfile; const kProfile = Components.classes[kProfileContractID].getService(kProfileIID); rootfoldername = rootfoldername.replace(/%user_name%/, kProfile.currentProfile); windowNode.setAttribute("title", rootfoldername); } bookmarksView.outlinerBoxObject.selection.select(0); bookmarksView.outliner.focus();} |
|
if (!theme) matches = chromeRegistry.isSkinSelected(name, true) == Components.interfaces.nsIChromeRegistry.FULL; else matches = name == theme; if (matches) { list.selectItem(child); break; | if (name) { if (!theme) matches = chromeRegistry.isSkinSelected(name, true) == Components.interfaces.nsIChromeRegistry.FULL; else matches = name == theme; if (matches) { list.selectItem(child); break; } | function Startup(){ gData = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-themes.xul"]; var list = document.getElementById( "skinsList" ); if ("loaded" in gData && "themeIndex" in gData) { list.selectedIndex = gData.themeIndex; return; } gData.loaded = true; parent.hPrefWindow.registerOKCallbackFunc( applySkin ); const kPrefSvcContractID = "@mozilla.org/preferences;1"; const kPrefSvcIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID); var theme = null; try { theme = kPrefSvc.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data; } catch (e) { } var matches; for (var i = 0; i < list.childNodes.length; ++i) { var child = list.childNodes[i]; var name = child.getAttribute("name"); if (!theme) matches = chromeRegistry.isSkinSelected(name, true) == Components.interfaces.nsIChromeRegistry.FULL; else matches = name == theme; if (matches) { list.selectItem(child); break; } } var navbundle = document.getElementById("bundle_navigator"); var showSkinsDescription = navbundle.getString("showskinsdescription"); if( showSkinsDescription == "false" ) { gShowDescription = false; var description = document.getElementById("description"); while (description.hasChildNodes()) description.removeChild(description.firstChild); }} |
SetTextboxFocus(dialog.rowsInput); | SetTextboxFocusById("rowsInput"); | function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); tableElement = editorShell.CreateElementWithDefaults(tagName); if(!tableElement) { dump("Failed to create a new table!\n"); window.close(); } // Create dialog object to store controls for easy access dialog = new Object; dialog.rowsInput = document.getElementById("rowsInput"); dialog.columnsInput = document.getElementById("columnsInput"); dialog.widthInput = document.getElementById("widthInput"); dialog.borderInput = document.getElementById("borderInput"); dialog.widthPixelOrPercentMenulist = document.getElementById("widthPixelOrPercentMenulist"); // Make a copy to use for AdvancedEdit globalElement = tableElement.cloneNode(false); // Initialize all widgets with image attributes InitDialog(); // Set initial number to 2 rows, 2 columns: // Note, these are not attributes on the table, // so don't put them in InitDialog(), // else the user's values will be trashed when they use // the Advanced Edit dialog dialog.rowsInput.value = 2; dialog.columnsInput.value = 2; // If no default value on the width, set to 100% if (dialog.widthInput.value.length == 0) { dialog.widthInput.value = "100"; dialog.widthPixelOrPercentMenulist.selectedIndex = 1; } // Resize window window.sizeToContent(); SetTextboxFocus(dialog.rowsInput); SetWindowLocation();} |
if (!GetCurrentEditor()) { | if (InitEditorShell) { if (!InitEditorShell()) return; } else if (GetCurrentEditor && !GetCurrentEditor()) { | function Startup(){ if (!GetCurrentEditor()) { window.close(); return; } // gDialog is declared in EdDialogCommon.js // Set commonly-used widgets like this: gDialog.selectedTab = TEXT_TAB; gDialog.sheetsTreechildren = document.getElementById("stylesheetsTree"); gDialog.sheetsTree = document.getElementById("sheetsTree"); gDialog.sheetInfoTab = document.getElementById("sheetInfoTab"); gDialog.atimportButton = document.getElementById("atimportButton"); gDialog.atmediaButton = document.getElementById("atmediaButton"); gDialog.linkButton = document.getElementById("linkButton"); gDialog.styleButton = document.getElementById("styleButton"); gDialog.ruleButton = document.getElementById("ruleButton"); gDialog.removeButton = document.getElementById("removeButton"); gDialog.upButton = document.getElementById("upButton"); gDialog.downButton = document.getElementById("downButton"); gDialog.selectedTab = GENERAL_TAB; gDialog.sheetInfoTabPanelTitle = document.getElementById("sheetInfoTabPanelTitle"); gDialog.textTab = document.getElementById("textTab"); gDialog.brownFoxLabel = document.getElementById("brownFoxLabel"); gDialog.backgroundImageInput = document.getElementById("backgroundImageInput"); gDialog.backgroundPreview = document.getElementById("backgroundPreview"); gDialog.sheetTabbox = document.getElementById("sheetTabbox"); gDialog.backgroundColorInput = document.getElementById("backgroundColorInput"); gDialog.textColorInput = document.getElementById("textColorInput"); gDialog.backgroundRepeatMenulist = document.getElementById("backgroundRepeatMenulist"); gDialog.backgroundAttachmentCheckbox = document.getElementById("backgroundAttachmentCheckbox"); gDialog.xBackgroundPositionRadiogroup = document.getElementById("xBackgroundPositionRadiogroup"); gDialog.yBackgroundPositionRadiogroup = document.getElementById("yBackgroundPositionRadiogroup"); gDialog.fontFamilyRadiogroup = document.getElementById("fontFamilyRadiogroup"); gDialog.customFontFamilyInput = document.getElementById("customFontFamilyInput"); gDialog.predefFontFamilyMenulist = document.getElementById("predefFontFamilyMenulist"); gDialog.fontSizeInput = document.getElementById("fontSizeInput"); gDialog.lineHeightInput = document.getElementById("lineHeightInput"); gDialog.textUnderlineCheckbox = document.getElementById("underlineTextDecorationCheckbox"); gDialog.textOverlineCheckbox = document.getElementById("overlineTextDecorationCheckbox"); gDialog.textLinethroughCheckbox = document.getElementById("linethroughTextDecorationCheckbox"); gDialog.textBlinkCheckbox = document.getElementById("blinkTextDecorationCheckbox"); gDialog.noDecorationCheckbox = document.getElementById("noneTextDecorationCheckbox"); gDialog.topBorderStyleMenulist = document.getElementById("topBorderStyleMenulist"); gDialog.topBorderWidthInput = document.getElementById("topBorderWidthInput"); gDialog.topBorderColorInput = document.getElementById("topBorderColorInput"); gDialog.leftBorderStyleMenulist = document.getElementById("leftBorderStyleMenulist"); gDialog.leftBorderWidthInput = document.getElementById("leftBorderWidthInput"); gDialog.leftBorderColorInput = document.getElementById("leftBorderColorInput"); gDialog.rightBorderStyleMenulist = document.getElementById("rightBorderStyleMenulist"); gDialog.rightBorderWidthInput = document.getElementById("rightBorderWidthInput"); gDialog.rightBorderColorInput = document.getElementById("rightBorderColorInput"); gDialog.bottomBorderStyleMenulist = document.getElementById("bottomBorderStyleMenulist"); gDialog.bottomBorderWidthInput = document.getElementById("bottomBorderWidthInput"); gDialog.bottomBorderColorInput = document.getElementById("bottomBorderColorInput"); gDialog.allFourBordersSame = document.getElementById("allFourBordersSame"); gDialog.borderPreview = document.getElementById("borderPreview"); gDialog.volumeScrollbar = document.getElementById("volumeScrollbar"); gDialog.volumeMenulist = document.getElementById("volumeMenulist"); gDialog.muteVolumeCheckbox = document.getElementById("muteVolumeCheckbox"); gDialog.opacityScrollbar = document.getElementById("opacityScrollbar"); gDialog.sheetInfoTabGridRows = document.getElementById("sheetInfoTabGridRows"); gDialog.sheetInfoTabGrid = document.getElementById("sheetInfoTabGrid"); gDialog.expertMode = true; gDialog.modified = false; gDialog.selectedIndex = -1; gHaveDocumentUrl = GetDocumentBaseUrl(); // Initialize all dialog widgets here, // e.g., get attributes from an element for property dialog InitSheetsTree(gDialog.sheetsTreechildren); // Set window location relative to parent window (based on persisted attributes) SetWindowLocation();} |
coreName = "ViewSource." + ( new Date() ).getTime().toString(); | appCoreName = "ViewSource." + ( new Date() ).getTime().toString(); | function StartupViewSource() { // Generate unique name. coreName = "ViewSource." + ( new Date() ).getTime().toString(); // Create and initialize the browser app core. appCore = new BrowserAppCore(); appCore.Init( coreName ); appCore.setContentWindow(window.frames[0]); appCore.setWebShellWindow(window); appCore.setToolbarWindow(window); // Get url whose source to view. var url = document.getElementById("args").getAttribute("value"); // Load the source (the app core will magically know what to do). XPAppCoresManager.Find( coreName ).loadUrl(url); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.