rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
setTimeout(LoadBookmarksCallback, 100);
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"; // Get the preferences service var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); pref = prefService.getBranch(null); 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(WindowFocusTimerCallback, 0, _content); else setTimeout(WindowFocusTimerCallback, 0, gURLBar); // 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); } }}
var fileLocator = Components.classes["component:
var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"].getService();
function Startup(){ // set up the string bundle gBundle = srGetStrBundle("chrome://communicator/locale/pref/pref-applications.properties"); // set up the elements gTree = document.getElementById("appTree"); gExtensionField = document.getElementById("extension"); gMIMETypeField = document.getElementById("mimeType"); gHandlerField = document.getElementById("handler"); gEditButton = document.getElementById("editButton"); gRemoveButton = document.getElementById("removeButton"); const mimeTypes = "UMimTyp"; var fileLocator = Components.classes["component://netscape/file/directory_service"].getService(); if (fileLocator) fileLocator = fileLocator.QueryInterface(Components.interfaces.nsIProperties); var file = fileLocator.get(mimeTypes, Components.interfaces.nsIFile); var file_url = Components.classes["component://netscape/network/standard-url"].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");}
var file_url = Components.classes["component:
var file_url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIFileURL);
function Startup(){ // set up the string bundle gBundle = srGetStrBundle("chrome://communicator/locale/pref/pref-applications.properties"); // set up the elements gTree = document.getElementById("appTree"); gExtensionField = document.getElementById("extension"); gMIMETypeField = document.getElementById("mimeType"); gHandlerField = document.getElementById("handler"); gEditButton = document.getElementById("editButton"); gRemoveButton = document.getElementById("removeButton"); const mimeTypes = "UMimTyp"; var fileLocator = Components.classes["component://netscape/file/directory_service"].getService(); if (fileLocator) fileLocator = fileLocator.QueryInterface(Components.interfaces.nsIProperties); var file = fileLocator.get(mimeTypes, Components.interfaces.nsIFile); var file_url = Components.classes["component://netscape/network/standard-url"].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");}
dialog.heightInput = document.getElementById("heightInput");
function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, null); dump(tagName+" = InsertTable tagName\n"); 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"); dialog.heightPixelOrPercentMenulist = document.getElementById("heightPixelOrPercentMenulist"); // Make a copy to use for AdvancedEdit globalElement = tableElement.cloneNode(false); // Initialize all widgets with image attributes InitDialog(); // Set initial number to 1 row, 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 = 1; dialog.columnsInput.value = 2; dialog.rowsInput.focus(); // Resize window window.sizeToContent();}
if (!appCore.cmdLineURLUsed) {
if (!appCore.cmdLineURLUsed && !turboMode) {
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 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; } // Do all UI building here: // set home button tooltip text var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch (ex) { } // 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); // 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 } } } //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 var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.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; if (!appCore.cmdLineURLUsed) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); uriToLoad = cmdLineService.URLToLoad; if (!uriToLoad) { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); uriToLoad = cmdLineHandler.defaultArgs; } appCore.cmdLineURLUsed = true; } if (!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); } // Focus the content area if the caller instructed us to. if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true) _content.focus(); else gURLBar.focus(); // Perform default browser checking. checkForDefaultBrowser(); }}
if ( turboMode ) { appCore.cmdLineURLUsed = true; window.setTimeout( "window.close()", 100 ); return; }
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 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; } // Do all UI building here: // set home button tooltip text var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch (ex) { } // 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); // 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 } } } //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 var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.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; if (!appCore.cmdLineURLUsed) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); uriToLoad = cmdLineService.URLToLoad; if (!uriToLoad) { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); uriToLoad = cmdLineHandler.defaultArgs; } appCore.cmdLineURLUsed = true; } if (!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); } // Focus the content area if the caller instructed us to. if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true) _content.focus(); else gURLBar.focus(); // Perform default browser checking. checkForDefaultBrowser(); }}
window.addEventListener("load", UpdateInternetSearchResults, true);
function Startup() { // Position window. var win = document.getElementById( "main-window" ); if (win) { var x = win.getAttribute( "x" ); var y = win.getAttribute( "y" ); // dump(" move to "+x+" "+y+"\n"); window.moveTo( x, y ); } // 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 window so we'll // be notified when onloads complete. window.addEventListener("load", UpdateHistory, true); window.addEventListener("load", UpdateBookmarksLastVisitedDate, 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 (!prefService) throw "couldn't create a preferences service";
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"; // Get the preferences service var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); if (!prefService) throw "couldn't create a preferences service"; pref = prefService.getBranch(null); 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(WindowFocusTimerCallback, 0, _content); else setTimeout(WindowFocusTimerCallback, 0, gURLBar); // 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); } }}
const kPrefSvcContractID = "@mozilla.org/preferences;1"; const kPrefSvcIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);
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); }}
theme = kPrefSvc.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data;
theme = parent.hPrefWindow.pref.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data;
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); }}
SetTextfieldFocus(dialog.rowsInput);
SetTextboxFocus(dialog.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(); SetTextfieldFocus(dialog.rowsInput); SetWindowLocation();}
signonviewer = Components.classes["component:
signonviewer = Components.classes["@mozilla.org/signonviewer/signonviewer-world;1"].createInstance();
function Startup(){ signonviewer = Components.classes["component://netscape/signonviewer/signonviewer-world"].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['component://netscape/preferences']; 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();}
pref = Components.classes['component:
pref = Components.classes['@mozilla.org/preferences;1'];
function Startup(){ signonviewer = Components.classes["component://netscape/signonviewer/signonviewer-world"].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['component://netscape/preferences']; 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();}
onMoreFewerImage();
onMoreFewer();
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 SetTextboxFocus(dialog.srcInput); SetWindowLocation();}
var bookmarksView = document.getElementById("bookmarks-view");
const windowNode = document.getElementById("bookmark-window"); const bookmarksView = document.getElementById("bookmarks-view"); var titleString;
function Startup(){ var bookmarksView = document.getElementById("bookmarks-view"); 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]) { var uri = window.arguments[0]; bookmarksView.tree.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.treeBoxObject.selection.select(0); bookmarksView.tree.focus();}
const windowNode = document.getElementById("bookmark-window");
function Startup(){ var bookmarksView = document.getElementById("bookmarks-view"); 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]) { var uri = window.arguments[0]; bookmarksView.tree.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.treeBoxObject.selection.select(0); bookmarksView.tree.focus();}
var title = "";
function Startup(){ var bookmarksView = document.getElementById("bookmarks-view"); 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]) { var uri = window.arguments[0]; bookmarksView.tree.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.treeBoxObject.selection.select(0); bookmarksView.tree.focus();}
const titleString = bookmarksView._bundle.GetStringFromName("window_title"); windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, title));
titleString = bookmarksView._bundle.GetStringFromName("window_title"); titleString = titleString.replace(/%folder_name%/gi, title); windowNode.setAttribute("title", titleString);
function Startup(){ var bookmarksView = document.getElementById("bookmarks-view"); 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]) { var uri = window.arguments[0]; bookmarksView.tree.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.treeBoxObject.selection.select(0); bookmarksView.tree.focus();}
var rootfoldername = bookmarksView._bundle.GetStringFromName("bookmarks_root");
function Startup(){ var bookmarksView = document.getElementById("bookmarks-view"); 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]) { var uri = window.arguments[0]; bookmarksView.tree.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.treeBoxObject.selection.select(0); bookmarksView.tree.focus();}
rootfoldername = rootfoldername.replace(/%user_name%/, kProfile.currentProfile); windowNode.setAttribute("title", rootfoldername);
var length = {value:0}; var profileList = kProfile.getProfileList(length); if (length.value > 1 || kProfile.currentProfile.toLowerCase() != "default") { titleString = bookmarksView._bundle.GetStringFromName("bookmarks_root"); titleString = titleString.replace(/%user_name%/, kProfile.currentProfile); windowNode.setAttribute("title", titleString); }
function Startup(){ var bookmarksView = document.getElementById("bookmarks-view"); 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]) { var uri = window.arguments[0]; bookmarksView.tree.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.treeBoxObject.selection.select(0); bookmarksView.tree.focus();}
return; }
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 SetTextboxFocus(dialog.TitleInput); LoadAvailableCharSets(); initDone = true; SetWindowLocation();}
BrowserSetDefaultCharacterSet(arrayArgComponents[1]);
appCore.setDefaultCharacterSet(arrayArgComponents[1]);
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(); var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(appCore); webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); // XXXjag see bug 68662 getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", appCore); // 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.length >= 3 && window.arguments[2] == true) _content.focus(); else gURLBar.focus(); // Perform default browser checking. checkForDefaultBrowser(); }}
if (startPage)
if (startPage && startPage != "about:blank")
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(); var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(appCore); webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); // XXXjag see bug 68662 getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", appCore); // 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.length >= 3 && window.arguments[2] == true) _content.focus(); else gURLBar.focus(); // Perform default browser checking. checkForDefaultBrowser(); }}
element.setAttribute("selected","true" );
element2.selectedTab = element;
function Startup(){ // xpconnect to cookieviewer interface cookieviewer = Components.classes["@mozilla.org/cookieviewer/cookieviewer-world;1"].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['@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("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();}
return; }
function Startup(){ if (!InitEditorShell()) return; selection = editorShell.editorSelection; if (!selection) return; dialog = new Object; if (!dialog) window.close(); // Get dialog widgets - Table Panel dialog.TableRowsInput = document.getElementById("TableRowsInput"); dialog.TableColumnsInput = document.getElementById("TableColumnsInput"); dialog.TableWidthInput = document.getElementById("TableWidthInput"); dialog.TableWidthUnits = document.getElementById("TableWidthUnits"); dialog.BorderWidthInput = document.getElementById("BorderWidthInput"); dialog.SpacingInput = document.getElementById("SpacingInput"); dialog.PaddingInput = document.getElementById("PaddingInput"); dialog.TableAlignList = document.getElementById("TableAlignList"); dialog.TableCaptionList = document.getElementById("TableCaptionList"); dialog.TableInheritColor = document.getElementById("TableInheritColor"); // Cell Panel dialog.SelectionList = document.getElementById("SelectionList"); dialog.PreviousButton = document.getElementById("PreviousButton"); dialog.NextButton = document.getElementById("NextButton"); // Currently, we always apply changes and load new attributes when changing selection // (Let's keep this for possible future use) //dialog.ApplyBeforeMove = document.getElementById("ApplyBeforeMove"); //dialog.KeepCurrentData = document.getElementById("KeepCurrentData"); dialog.CellHeightInput = document.getElementById("CellHeightInput"); dialog.CellHeightUnits = document.getElementById("CellHeightUnits"); dialog.CellWidthInput = document.getElementById("CellWidthInput"); dialog.CellWidthUnits = document.getElementById("CellWidthUnits"); dialog.RowSpanInput = document.getElementById("RowSpanInput"); dialog.ColSpanInput = document.getElementById("ColSpanInput"); dialog.CellHAlignList = document.getElementById("CellHAlignList"); dialog.CellVAlignList = document.getElementById("CellVAlignList"); dialog.CellInheritColor = document.getElementById("CellInheritColor"); dialog.CellStyleList = document.getElementById("CellStyleList"); dialog.TextWrapList = document.getElementById("TextWrapList"); // In cell panel, user must tell us which attributes to apply via checkboxes, // else we would apply values from one cell to ALL in selection // and that's probably not what they expect! dialog.CellHeightCheckbox = document.getElementById("CellHeightCheckbox"); dialog.CellWidthCheckbox = document.getElementById("CellWidthCheckbox"); dialog.RowSpanCheckbox = document.getElementById("RowSpanCheckbox"); dialog.ColSpanCheckbox = document.getElementById("ColSpanCheckbox"); dialog.CellHAlignCheckbox = document.getElementById("CellHAlignCheckbox"); dialog.CellVAlignCheckbox = document.getElementById("CellVAlignCheckbox"); dialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox"); dialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox"); dialog.CellColorCheckbox = document.getElementById("CellColorCheckbox"); TabPanels = document.getElementById("TabPanels"); var TableTab = document.getElementById("TableTab"); var CellTab = document.getElementById("CellTab"); TableElement = editorShell.GetElementOrParentByTagName("table", null); if(!TableElement) { dump("Failed to get table element!\n"); window.close(); } globalTableElement = TableElement.cloneNode(false); var tagNameObj = new Object; var countObj = new Object; var tableOrCellElement = editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj); gSelectedCellCount = countObj.value; if (tagNameObj.value == "td") { // We are in a cell CellElement = tableOrCellElement; globalCellElement = CellElement.cloneNode(false); // Tells us whether cell, row, or column is selected SelectedCellsType = editorShell.GetSelectedCellsType(TableElement); SetSpanEnable(); // Ignore types except Cell, Row, and Column if (SelectedCellsType < SELECT_CELL || SelectedCellsType > SELECT_COLUMN) SelectedCellsType = SELECT_CELL; // Be sure at least 1 cell is selected. // (If the count is 0, then we were inside the cell.) if (gSelectedCellCount == 0) DoCellSelection(); // Get location in the cell map curRowIndex = editorShell.GetRowIndex(CellElement); curColIndex = editorShell.GetColumnIndex(CellElement); // We save the current colspan to quickly // move selection from from cell to cell if (GetCellData(curRowIndex, curColIndex)) curColSpan = cellData.colSpan; // Starting TabPanel name is passed in if (window.arguments[1] == "CellPanel") { currentPanel = CellPanel; //Set index for starting panel on the <tabpanels> element TabPanels.setAttribute("index", CellPanel); // Trigger setting of style for the tab widgets CellTab.setAttribute("selected", "true"); TableTab.removeAttribute("selected"); // Use cell element for Advanced Edit dialog globalElement = globalCellElement; } } if (currentPanel == TablePanel) { // Use table element for Advanced Edit dialog globalElement = globalTableElement; // We may call this with table selected, but no cell, // so disable the Cell Properties tab if(!CellElement) CellTab.setAttribute("disabled", "true"); } doSetOKCancel(onOK, onCancel); // Note: we must use TableElement, not globalTableElement for these, // thus we should not put this in InitDialog. // Instead, monitor desired counts with separate globals rowCount = editorShell.GetTableRowCount(TableElement); lastRowIndex = rowCount-1; colCount = editorShell.GetTableColumnCount(TableElement); lastColIndex = colCount-1; // Set appropriate icons and enable state for the Previous/Next buttons SetSelectionButtons(); // If only one cell in table, disable change-selection widgets if (rowCount == 1 && colCount == 1) dialog.SelectionList.setAttribute("disabled", "true"); // User can change these via textboxes newRowCount = rowCount; newColCount = colCount; // This flag is used to control whether set check state // on "set attribute" checkboxes // (Advanced Edit dialog use calls InitDialog when done) AdvancedEditUsed = false; InitDialog(); AdvancedEditUsed = true; // If first initializing, we really aren't changing anything CellDataChanged = false; if (currentPanel == CellPanel) dialog.SelectionList.focus(); else SetTextboxFocus(dialog.TableRowsInput); SetWindowLocation();}
dialog.RowSpanInput = document.getElementById("RowSpanInput"); dialog.ColSpanInput = document.getElementById("ColSpanInput");
function Startup(){ if (!InitEditorShell()) return; selection = editorShell.editorSelection; if (!selection) return; dialog = new Object; if (!dialog) window.close(); // Get dialog widgets - Table Panel dialog.TableRowsInput = document.getElementById("TableRowsInput"); dialog.TableColumnsInput = document.getElementById("TableColumnsInput"); dialog.TableWidthInput = document.getElementById("TableWidthInput"); dialog.TableWidthUnits = document.getElementById("TableWidthUnits"); dialog.BorderWidthInput = document.getElementById("BorderWidthInput"); dialog.SpacingInput = document.getElementById("SpacingInput"); dialog.PaddingInput = document.getElementById("PaddingInput"); dialog.TableAlignList = document.getElementById("TableAlignList"); dialog.TableCaptionList = document.getElementById("TableCaptionList"); dialog.TableInheritColor = document.getElementById("TableInheritColor"); // Cell Panel dialog.SelectionList = document.getElementById("SelectionList"); dialog.PreviousButton = document.getElementById("PreviousButton"); dialog.NextButton = document.getElementById("NextButton"); // Currently, we always apply changes and load new attributes when changing selection // (Let's keep this for possible future use) //dialog.ApplyBeforeMove = document.getElementById("ApplyBeforeMove"); //dialog.KeepCurrentData = document.getElementById("KeepCurrentData"); dialog.CellHeightInput = document.getElementById("CellHeightInput"); dialog.CellHeightUnits = document.getElementById("CellHeightUnits"); dialog.CellWidthInput = document.getElementById("CellWidthInput"); dialog.CellWidthUnits = document.getElementById("CellWidthUnits"); dialog.RowSpanInput = document.getElementById("RowSpanInput"); dialog.ColSpanInput = document.getElementById("ColSpanInput"); dialog.CellHAlignList = document.getElementById("CellHAlignList"); dialog.CellVAlignList = document.getElementById("CellVAlignList"); dialog.CellInheritColor = document.getElementById("CellInheritColor"); dialog.CellStyleList = document.getElementById("CellStyleList"); dialog.TextWrapList = document.getElementById("TextWrapList"); // In cell panel, user must tell us which attributes to apply via checkboxes, // else we would apply values from one cell to ALL in selection // and that's probably not what they expect! dialog.CellHeightCheckbox = document.getElementById("CellHeightCheckbox"); dialog.CellWidthCheckbox = document.getElementById("CellWidthCheckbox"); dialog.RowSpanCheckbox = document.getElementById("RowSpanCheckbox"); dialog.ColSpanCheckbox = document.getElementById("ColSpanCheckbox"); dialog.CellHAlignCheckbox = document.getElementById("CellHAlignCheckbox"); dialog.CellVAlignCheckbox = document.getElementById("CellVAlignCheckbox"); dialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox"); dialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox"); dialog.CellColorCheckbox = document.getElementById("CellColorCheckbox"); TabPanels = document.getElementById("TabPanels"); var TableTab = document.getElementById("TableTab"); var CellTab = document.getElementById("CellTab"); TableElement = editorShell.GetElementOrParentByTagName("table", null); if(!TableElement) { dump("Failed to get table element!\n"); window.close(); } globalTableElement = TableElement.cloneNode(false); var tagNameObj = new Object; var countObj = new Object; var tableOrCellElement = editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj); gSelectedCellCount = countObj.value; if (tagNameObj.value == "td") { // We are in a cell CellElement = tableOrCellElement; globalCellElement = CellElement.cloneNode(false); // Tells us whether cell, row, or column is selected SelectedCellsType = editorShell.GetSelectedCellsType(TableElement); SetSpanEnable(); // Ignore types except Cell, Row, and Column if (SelectedCellsType < SELECT_CELL || SelectedCellsType > SELECT_COLUMN) SelectedCellsType = SELECT_CELL; // Be sure at least 1 cell is selected. // (If the count is 0, then we were inside the cell.) if (gSelectedCellCount == 0) DoCellSelection(); // Get location in the cell map curRowIndex = editorShell.GetRowIndex(CellElement); curColIndex = editorShell.GetColumnIndex(CellElement); // We save the current colspan to quickly // move selection from from cell to cell if (GetCellData(curRowIndex, curColIndex)) curColSpan = cellData.colSpan; // Starting TabPanel name is passed in if (window.arguments[1] == "CellPanel") { currentPanel = CellPanel; //Set index for starting panel on the <tabpanels> element TabPanels.setAttribute("index", CellPanel); // Trigger setting of style for the tab widgets CellTab.setAttribute("selected", "true"); TableTab.removeAttribute("selected"); // Use cell element for Advanced Edit dialog globalElement = globalCellElement; } } if (currentPanel == TablePanel) { // Use table element for Advanced Edit dialog globalElement = globalTableElement; // We may call this with table selected, but no cell, // so disable the Cell Properties tab if(!CellElement) CellTab.setAttribute("disabled", "true"); } doSetOKCancel(onOK, onCancel); // Note: we must use TableElement, not globalTableElement for these, // thus we should not put this in InitDialog. // Instead, monitor desired counts with separate globals rowCount = editorShell.GetTableRowCount(TableElement); lastRowIndex = rowCount-1; colCount = editorShell.GetTableColumnCount(TableElement); lastColIndex = colCount-1; // Set appropriate icons and enable state for the Previous/Next buttons SetSelectionButtons(); // If only one cell in table, disable change-selection widgets if (rowCount == 1 && colCount == 1) dialog.SelectionList.setAttribute("disabled", "true"); // User can change these via textboxes newRowCount = rowCount; newColCount = colCount; // This flag is used to control whether set check state // on "set attribute" checkboxes // (Advanced Edit dialog use calls InitDialog when done) AdvancedEditUsed = false; InitDialog(); AdvancedEditUsed = true; // If first initializing, we really aren't changing anything CellDataChanged = false; if (currentPanel == CellPanel) dialog.SelectionList.focus(); else SetTextboxFocus(dialog.TableRowsInput); SetWindowLocation();}
dialog.RowSpanCheckbox = document.getElementById("RowSpanCheckbox"); dialog.ColSpanCheckbox = document.getElementById("ColSpanCheckbox");
function Startup(){ if (!InitEditorShell()) return; selection = editorShell.editorSelection; if (!selection) return; dialog = new Object; if (!dialog) window.close(); // Get dialog widgets - Table Panel dialog.TableRowsInput = document.getElementById("TableRowsInput"); dialog.TableColumnsInput = document.getElementById("TableColumnsInput"); dialog.TableWidthInput = document.getElementById("TableWidthInput"); dialog.TableWidthUnits = document.getElementById("TableWidthUnits"); dialog.BorderWidthInput = document.getElementById("BorderWidthInput"); dialog.SpacingInput = document.getElementById("SpacingInput"); dialog.PaddingInput = document.getElementById("PaddingInput"); dialog.TableAlignList = document.getElementById("TableAlignList"); dialog.TableCaptionList = document.getElementById("TableCaptionList"); dialog.TableInheritColor = document.getElementById("TableInheritColor"); // Cell Panel dialog.SelectionList = document.getElementById("SelectionList"); dialog.PreviousButton = document.getElementById("PreviousButton"); dialog.NextButton = document.getElementById("NextButton"); // Currently, we always apply changes and load new attributes when changing selection // (Let's keep this for possible future use) //dialog.ApplyBeforeMove = document.getElementById("ApplyBeforeMove"); //dialog.KeepCurrentData = document.getElementById("KeepCurrentData"); dialog.CellHeightInput = document.getElementById("CellHeightInput"); dialog.CellHeightUnits = document.getElementById("CellHeightUnits"); dialog.CellWidthInput = document.getElementById("CellWidthInput"); dialog.CellWidthUnits = document.getElementById("CellWidthUnits"); dialog.RowSpanInput = document.getElementById("RowSpanInput"); dialog.ColSpanInput = document.getElementById("ColSpanInput"); dialog.CellHAlignList = document.getElementById("CellHAlignList"); dialog.CellVAlignList = document.getElementById("CellVAlignList"); dialog.CellInheritColor = document.getElementById("CellInheritColor"); dialog.CellStyleList = document.getElementById("CellStyleList"); dialog.TextWrapList = document.getElementById("TextWrapList"); // In cell panel, user must tell us which attributes to apply via checkboxes, // else we would apply values from one cell to ALL in selection // and that's probably not what they expect! dialog.CellHeightCheckbox = document.getElementById("CellHeightCheckbox"); dialog.CellWidthCheckbox = document.getElementById("CellWidthCheckbox"); dialog.RowSpanCheckbox = document.getElementById("RowSpanCheckbox"); dialog.ColSpanCheckbox = document.getElementById("ColSpanCheckbox"); dialog.CellHAlignCheckbox = document.getElementById("CellHAlignCheckbox"); dialog.CellVAlignCheckbox = document.getElementById("CellVAlignCheckbox"); dialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox"); dialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox"); dialog.CellColorCheckbox = document.getElementById("CellColorCheckbox"); TabPanels = document.getElementById("TabPanels"); var TableTab = document.getElementById("TableTab"); var CellTab = document.getElementById("CellTab"); TableElement = editorShell.GetElementOrParentByTagName("table", null); if(!TableElement) { dump("Failed to get table element!\n"); window.close(); } globalTableElement = TableElement.cloneNode(false); var tagNameObj = new Object; var countObj = new Object; var tableOrCellElement = editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj); gSelectedCellCount = countObj.value; if (tagNameObj.value == "td") { // We are in a cell CellElement = tableOrCellElement; globalCellElement = CellElement.cloneNode(false); // Tells us whether cell, row, or column is selected SelectedCellsType = editorShell.GetSelectedCellsType(TableElement); SetSpanEnable(); // Ignore types except Cell, Row, and Column if (SelectedCellsType < SELECT_CELL || SelectedCellsType > SELECT_COLUMN) SelectedCellsType = SELECT_CELL; // Be sure at least 1 cell is selected. // (If the count is 0, then we were inside the cell.) if (gSelectedCellCount == 0) DoCellSelection(); // Get location in the cell map curRowIndex = editorShell.GetRowIndex(CellElement); curColIndex = editorShell.GetColumnIndex(CellElement); // We save the current colspan to quickly // move selection from from cell to cell if (GetCellData(curRowIndex, curColIndex)) curColSpan = cellData.colSpan; // Starting TabPanel name is passed in if (window.arguments[1] == "CellPanel") { currentPanel = CellPanel; //Set index for starting panel on the <tabpanels> element TabPanels.setAttribute("index", CellPanel); // Trigger setting of style for the tab widgets CellTab.setAttribute("selected", "true"); TableTab.removeAttribute("selected"); // Use cell element for Advanced Edit dialog globalElement = globalCellElement; } } if (currentPanel == TablePanel) { // Use table element for Advanced Edit dialog globalElement = globalTableElement; // We may call this with table selected, but no cell, // so disable the Cell Properties tab if(!CellElement) CellTab.setAttribute("disabled", "true"); } doSetOKCancel(onOK, onCancel); // Note: we must use TableElement, not globalTableElement for these, // thus we should not put this in InitDialog. // Instead, monitor desired counts with separate globals rowCount = editorShell.GetTableRowCount(TableElement); lastRowIndex = rowCount-1; colCount = editorShell.GetTableColumnCount(TableElement); lastColIndex = colCount-1; // Set appropriate icons and enable state for the Previous/Next buttons SetSelectionButtons(); // If only one cell in table, disable change-selection widgets if (rowCount == 1 && colCount == 1) dialog.SelectionList.setAttribute("disabled", "true"); // User can change these via textboxes newRowCount = rowCount; newColCount = colCount; // This flag is used to control whether set check state // on "set attribute" checkboxes // (Advanced Edit dialog use calls InitDialog when done) AdvancedEditUsed = false; InitDialog(); AdvancedEditUsed = true; // If first initializing, we really aren't changing anything CellDataChanged = false; if (currentPanel == CellPanel) dialog.SelectionList.focus(); else SetTextboxFocus(dialog.TableRowsInput); SetWindowLocation();}
SetSpanEnable();
function Startup(){ if (!InitEditorShell()) return; selection = editorShell.editorSelection; if (!selection) return; dialog = new Object; if (!dialog) window.close(); // Get dialog widgets - Table Panel dialog.TableRowsInput = document.getElementById("TableRowsInput"); dialog.TableColumnsInput = document.getElementById("TableColumnsInput"); dialog.TableWidthInput = document.getElementById("TableWidthInput"); dialog.TableWidthUnits = document.getElementById("TableWidthUnits"); dialog.BorderWidthInput = document.getElementById("BorderWidthInput"); dialog.SpacingInput = document.getElementById("SpacingInput"); dialog.PaddingInput = document.getElementById("PaddingInput"); dialog.TableAlignList = document.getElementById("TableAlignList"); dialog.TableCaptionList = document.getElementById("TableCaptionList"); dialog.TableInheritColor = document.getElementById("TableInheritColor"); // Cell Panel dialog.SelectionList = document.getElementById("SelectionList"); dialog.PreviousButton = document.getElementById("PreviousButton"); dialog.NextButton = document.getElementById("NextButton"); // Currently, we always apply changes and load new attributes when changing selection // (Let's keep this for possible future use) //dialog.ApplyBeforeMove = document.getElementById("ApplyBeforeMove"); //dialog.KeepCurrentData = document.getElementById("KeepCurrentData"); dialog.CellHeightInput = document.getElementById("CellHeightInput"); dialog.CellHeightUnits = document.getElementById("CellHeightUnits"); dialog.CellWidthInput = document.getElementById("CellWidthInput"); dialog.CellWidthUnits = document.getElementById("CellWidthUnits"); dialog.RowSpanInput = document.getElementById("RowSpanInput"); dialog.ColSpanInput = document.getElementById("ColSpanInput"); dialog.CellHAlignList = document.getElementById("CellHAlignList"); dialog.CellVAlignList = document.getElementById("CellVAlignList"); dialog.CellInheritColor = document.getElementById("CellInheritColor"); dialog.CellStyleList = document.getElementById("CellStyleList"); dialog.TextWrapList = document.getElementById("TextWrapList"); // In cell panel, user must tell us which attributes to apply via checkboxes, // else we would apply values from one cell to ALL in selection // and that's probably not what they expect! dialog.CellHeightCheckbox = document.getElementById("CellHeightCheckbox"); dialog.CellWidthCheckbox = document.getElementById("CellWidthCheckbox"); dialog.RowSpanCheckbox = document.getElementById("RowSpanCheckbox"); dialog.ColSpanCheckbox = document.getElementById("ColSpanCheckbox"); dialog.CellHAlignCheckbox = document.getElementById("CellHAlignCheckbox"); dialog.CellVAlignCheckbox = document.getElementById("CellVAlignCheckbox"); dialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox"); dialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox"); dialog.CellColorCheckbox = document.getElementById("CellColorCheckbox"); TabPanels = document.getElementById("TabPanels"); var TableTab = document.getElementById("TableTab"); var CellTab = document.getElementById("CellTab"); TableElement = editorShell.GetElementOrParentByTagName("table", null); if(!TableElement) { dump("Failed to get table element!\n"); window.close(); } globalTableElement = TableElement.cloneNode(false); var tagNameObj = new Object; var countObj = new Object; var tableOrCellElement = editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj); gSelectedCellCount = countObj.value; if (tagNameObj.value == "td") { // We are in a cell CellElement = tableOrCellElement; globalCellElement = CellElement.cloneNode(false); // Tells us whether cell, row, or column is selected SelectedCellsType = editorShell.GetSelectedCellsType(TableElement); SetSpanEnable(); // Ignore types except Cell, Row, and Column if (SelectedCellsType < SELECT_CELL || SelectedCellsType > SELECT_COLUMN) SelectedCellsType = SELECT_CELL; // Be sure at least 1 cell is selected. // (If the count is 0, then we were inside the cell.) if (gSelectedCellCount == 0) DoCellSelection(); // Get location in the cell map curRowIndex = editorShell.GetRowIndex(CellElement); curColIndex = editorShell.GetColumnIndex(CellElement); // We save the current colspan to quickly // move selection from from cell to cell if (GetCellData(curRowIndex, curColIndex)) curColSpan = cellData.colSpan; // Starting TabPanel name is passed in if (window.arguments[1] == "CellPanel") { currentPanel = CellPanel; //Set index for starting panel on the <tabpanels> element TabPanels.setAttribute("index", CellPanel); // Trigger setting of style for the tab widgets CellTab.setAttribute("selected", "true"); TableTab.removeAttribute("selected"); // Use cell element for Advanced Edit dialog globalElement = globalCellElement; } } if (currentPanel == TablePanel) { // Use table element for Advanced Edit dialog globalElement = globalTableElement; // We may call this with table selected, but no cell, // so disable the Cell Properties tab if(!CellElement) CellTab.setAttribute("disabled", "true"); } doSetOKCancel(onOK, onCancel); // Note: we must use TableElement, not globalTableElement for these, // thus we should not put this in InitDialog. // Instead, monitor desired counts with separate globals rowCount = editorShell.GetTableRowCount(TableElement); lastRowIndex = rowCount-1; colCount = editorShell.GetTableColumnCount(TableElement); lastColIndex = colCount-1; // Set appropriate icons and enable state for the Previous/Next buttons SetSelectionButtons(); // If only one cell in table, disable change-selection widgets if (rowCount == 1 && colCount == 1) dialog.SelectionList.setAttribute("disabled", "true"); // User can change these via textboxes newRowCount = rowCount; newColCount = colCount; // This flag is used to control whether set check state // on "set attribute" checkboxes // (Advanced Edit dialog use calls InitDialog when done) AdvancedEditUsed = false; InitDialog(); AdvancedEditUsed = true; // If first initializing, we really aren't changing anything CellDataChanged = false; if (currentPanel == CellPanel) dialog.SelectionList.focus(); else SetTextboxFocus(dialog.TableRowsInput); SetWindowLocation();}
StartPageCheck();
function Startup(){ var startupFunc; try { startupFunc = document.getElementById("mailnewsEnableMapi").getAttribute('startupFunc'); } catch (ex) { startupFunc = null; } if (startupFunc) eval(startupFunc);}
try { gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); } catch (e) { gCurrentTheme = "classic/1.0"; }
var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry); gCurrentTheme = cr.getSelectedSkin("global");
function Startup() { gWindowState = window.location.search.substr("?type=".length, window.location.search.length); var isExtensions = gWindowState == "extensions"; gURIPrefix = isExtensions ? "urn:mozilla:extension:" : "urn:mozilla:theme:"; gDSRoot = isExtensions ? "urn:mozilla:extension:root" : "urn:mozilla:theme:root"; 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", gDSRoot); gExtensionsView.focus(); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!isExtensions) { gExtensionsView.addEventListener("richview-select", onThemeSelect, false); try { gCurrentTheme = pref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN); } catch (e) { gCurrentTheme = "classic/1.0"; } var useThemeButton = document.getElementById("useThemeButton"); useThemeButton.hidden = false; } // 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.documentElement.setAttribute("title", extensionsStrings.getString(gWindowState + "Title")); gExtensionsViewController.onCommandUpdate(); gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, pref.getCharPref(PREF_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 ? 400 : 500); win.setAttribute("height", isExtensions ? 300 : 380); } // Now look and see if we're being opened by XPInstall var 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.addDownloadObserver(gDownloadManager); if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { } }}
SeeMore = (dialog.MoreFewerButton.getAttribute("more") != "1"); onMoreFewer();
function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, null); // 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.MoreSection = document.getElementById( "MoreSection" ); dialog.customsizeRadio = document.getElementById( "customsizeRadio" ); dialog.originalsizeRadio = document.getElementById( "originalsizeRadio" ); dialog.constrainCheckbox = document.getElementById( "constrainCheckbox" ); dialog.widthInput = document.getElementById( "widthInput" ); dialog.heightInput = document.getElementById( "heightInput" ); dialog.widthUnitsSelect = document.getElementById( "widthUnitsSelect" ); dialog.heightUnitsSelect = document.getElementById( "heightUnitsSelect" ); dialog.imagelrInput = document.getElementById( "imageleftrightInput" ); dialog.imagetbInput = document.getElementById( "imagetopbottomInput" ); dialog.border = document.getElementById( "border" ); dialog.alignTypeSelect = document.getElementById( "alignTypeSelect" ); dialog.editImageMap = document.getElementById( "editImageMap" ); dialog.removeImageMap = document.getElementById( "removeImageMap" ); // Another version of button just for this dialog -- on same line as "More Properties" dialog.AdvancedEditButton2 = document.getElementById( "AdvancedEditButton2" ); // 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"); onMoreFewer(); // 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; } 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); // Initialize all widgets with image attributes InitDialog(); dialog.srcInput.focus();}
InitDialog();
SeeMore = (dialog.MoreFewerButton.getAttribute("more") != "1"); if ( SeeMore ) InitDialog();
function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, null); // 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.MoreSection = document.getElementById( "MoreSection" ); dialog.customsizeRadio = document.getElementById( "customsizeRadio" ); dialog.originalsizeRadio = document.getElementById( "originalsizeRadio" ); dialog.constrainCheckbox = document.getElementById( "constrainCheckbox" ); dialog.widthInput = document.getElementById( "widthInput" ); dialog.heightInput = document.getElementById( "heightInput" ); dialog.widthUnitsSelect = document.getElementById( "widthUnitsSelect" ); dialog.heightUnitsSelect = document.getElementById( "heightUnitsSelect" ); dialog.imagelrInput = document.getElementById( "imageleftrightInput" ); dialog.imagetbInput = document.getElementById( "imagetopbottomInput" ); dialog.border = document.getElementById( "border" ); dialog.alignTypeSelect = document.getElementById( "alignTypeSelect" ); dialog.editImageMap = document.getElementById( "editImageMap" ); dialog.removeImageMap = document.getElementById( "removeImageMap" ); // Another version of button just for this dialog -- on same line as "More Properties" dialog.AdvancedEditButton2 = document.getElementById( "AdvancedEditButton2" ); // 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"); onMoreFewer(); // 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; } 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); // Initialize all widgets with image attributes InitDialog(); dialog.srcInput.focus();}
onMoreFewer();
function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, null); // 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.MoreSection = document.getElementById( "MoreSection" ); dialog.customsizeRadio = document.getElementById( "customsizeRadio" ); dialog.originalsizeRadio = document.getElementById( "originalsizeRadio" ); dialog.constrainCheckbox = document.getElementById( "constrainCheckbox" ); dialog.widthInput = document.getElementById( "widthInput" ); dialog.heightInput = document.getElementById( "heightInput" ); dialog.widthUnitsSelect = document.getElementById( "widthUnitsSelect" ); dialog.heightUnitsSelect = document.getElementById( "heightUnitsSelect" ); dialog.imagelrInput = document.getElementById( "imageleftrightInput" ); dialog.imagetbInput = document.getElementById( "imagetopbottomInput" ); dialog.border = document.getElementById( "border" ); dialog.alignTypeSelect = document.getElementById( "alignTypeSelect" ); dialog.editImageMap = document.getElementById( "editImageMap" ); dialog.removeImageMap = document.getElementById( "removeImageMap" ); // Another version of button just for this dialog -- on same line as "More Properties" dialog.AdvancedEditButton2 = document.getElementById( "AdvancedEditButton2" ); // 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"); onMoreFewer(); // 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; } 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); // Initialize all widgets with image attributes InitDialog(); dialog.srcInput.focus();}
var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlert"); newMailNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);
var downloadDoneNotificationAlertUI = document.getElementById("finishedNotificationAlert"); downloadDoneNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);
function Startup(){ PlaySoundCheck(); // if we don't have the alert service, hide the pref UI for using alerts to notify on new mail // see bug #158711 var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlert"); newMailNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);}
windowNode.setAttribute("title", titleString);
document.title = titleString;
function Startup(){ const windowNode = document.getElementById("bookmark-window"); const bookmarksView = document.getElementById("bookmarks-view"); var titleString; // If we've been opened with a parameter, root the tree on it. if ("arguments" in window && window.arguments[0]) { var title; var uri = window.arguments[0]; bookmarksView.tree.setAttribute("ref", uri); document.getElementById("bookmarks-search").setAttribute("hidden","true") if (uri.substring(0,5) == "find:") { title = BookmarksUtils.getLocaleString("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 title = BookmarksUtils.getProperty(window.arguments[0], NC_NS+"Name"); titleString = BookmarksUtils.getLocaleString("window_title", title); } else { titleString = BookmarksUtils.getLocaleString("bookmarks_title", title); // always open the bookmark top root folder if (!bookmarksView.treeBoxObject.view.isContainerOpen(0)) bookmarksView.treeBoxObject.view.toggleOpenState(0); } bookmarksView.treeBoxObject.view.selection.select(0); windowNode.setAttribute("title", titleString); document.getElementById("CommandUpdate_Bookmarks").setAttribute("commandupdater","true"); bookmarksView.tree.focus();}
if(lastmoddate == 0) lastmod = GetString("Unknown");
if(lastmoddate != 0) lastmodString = lastmoddate;
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; 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) lastmod = GetString("Unknown"); document.getElementById("PageModDate").setAttribute("value",lastmod); } 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(); SetTextfieldFocus(dialog.TitleInput); SetWindowLocation();}
document.getElementById("PageModDate").setAttribute("value",lastmod);
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; 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) lastmod = GetString("Unknown"); document.getElementById("PageModDate").setAttribute("value",lastmod); } 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(); SetTextfieldFocus(dialog.TitleInput); SetWindowLocation();}
dump(", lastmod date="+lastmoddate+"\n"); document.getElementById("PageModDate").setAttribute("value", lastmodString);
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; 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) lastmod = GetString("Unknown"); document.getElementById("PageModDate").setAttribute("value",lastmod); } 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(); SetTextfieldFocus(dialog.TitleInput); SetWindowLocation();}
if (!turboMode) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); var cmdLineUrl = cmdLineService.URLToLoad; if (cmdLineUrl && !appCore.cmdLineURLUsed) { uriToLoad = cmdLineUrl; appCore.cmdLineURLUsed = true; } if (!uriToLoad) { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); uriToLoad = cmdLineHandler.defaultArgs; } }
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 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; } // 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 var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.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 (!turboMode) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); var cmdLineUrl = cmdLineService.URLToLoad; // try the command line first if (cmdLineUrl && !appCore.cmdLineURLUsed) { uriToLoad = cmdLineUrl; appCore.cmdLineURLUsed = true; } // ok, no command line, try the default args if (!uriToLoad) { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); uriToLoad = cmdLineHandler.defaultArgs; } } 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) _content.focus(); else gURLBar.focus(); // Perform default browser checking. checkForDefaultBrowser(); }}
try { encrypted = pref.GetBoolPref("wallet.crypto"); } catch(e) { dump("wallet.crypto pref is missing from all.js"); }
function Startup(){ 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); 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("hidden", "true"); element = document.getElementById("nocapture"); element.setAttribute("hidden", "true"); } } 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("panel"); element.setAttribute("index","0" ); // hide non-used tabs element = document.getElementById("nopreview"); element.setAttribute("hidden", "true"); element = document.getElementById("nocapture"); element.setAttribute("hidden", "true"); if (!LoadSignons()) { return; /* user failed to unlock the database */ } LoadReject(); } else if (tab == "W") { element = document.getElementById("signonviewer"); element.setAttribute("title", element.getAttribute("alttitle")); // hide non-used tabs element = document.getElementById("nopreview"); element.selected = true; element = document.getElementById("signonTab"); element.setAttribute("hidden", "true"); element = document.getElementById("signonSitesTab"); element.setAttribute("hidden", "true"); element = document.getElementById("panel"); element.setAttribute("index","2" ); LoadNopreview(); LoadNocapture(); } else { /* invalid value for argument */ }}
if ( parent.hPrefWindow.getPrefIsLocked( "browser.display.languageList" ) ) { disableAllFontElements(); }
function Startup() { variableSize = document.getElementById( "sizeVar" ); fixedSize = document.getElementById( "sizeMono" ); 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" ); 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" ) ); }
gReplicationBundle.getString("downloadButtonAccessKey");
gReplicationBundle.getString("downloadButton.accesskey");
function Startup(){ gPrefInt = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gReplicationBundle = document.getElementById("bundle_replication"); document.getElementById("download").label = gReplicationBundle.getString("downloadButton"); document.getElementById("download").accessKey = gReplicationBundle.getString("downloadButtonAccessKey"); if ( "arguments" in window && window.arguments[0] ) { gCurrentDirectory = window.arguments[0].selectedDirectory; gCurrentDirectoryString = window.arguments[0].selectedDirectoryString; try { fillSettings(); } catch (ex) { dump("pref-directory-add.js:Startup(): fillSettings() exception: " + ex + "\n"); } // Only set up the download button for online/offline status toggling // if the pref isn't locked to disable the button. if (!gPrefInt.prefIsLocked(gCurrentDirectoryString + ".disable_button_download")) { // Now connect to the offline/online observer var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); observerService.addObserver(ldapOfflineObserver, "network:offline-status-changed", false); // Now set the initial offline/online state. var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); // And update the state setDownloadOfflineOnlineState(ioService.offline); } } else { fillDefaultSettings(); // Don't add observer here as it doesn't make any sense. }}
getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", appCore);
getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", window.XULBrowserWindow);
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"); 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; } // Do all UI building here: setOfflineStatus(); // set home button tooltip text var homePage = getHomePage(); if (homePage) document.getElementById("home-button").setAttribute("tooltiptext", homePage); try { var searchMode = pref.GetIntPref("browser.search.mode"); setBrowserSearchMode(searchMode); } catch (ex) { } // initialize observers and listeners window.XULBrowserWindow = new nsBrowserStatusHandler(); window.buttonPrefListener = new nsButtonPrefListener(); // 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); // 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 } } } //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 var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow); // XXXjag see bug 68662 getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", appCore); // 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; if (!appCore.cmdLineURLUsed) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); uriToLoad = cmdLineService.URLToLoad; if (!uriToLoad) { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); uriToLoad = cmdLineHandler.defaultArgs; } appCore.cmdLineURLUsed = true; } if (!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); } // Focus the content area if the caller instructed us to. if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true) _content.focus(); else gURLBar.focus(); // Perform default browser checking. checkForDefaultBrowser(); }}
#endif
function Startup() { gWindowState = window.location.search.substr("?type=".length, window.location.search.length); var isExtensions = gWindowState == "extensions"; gURIPrefix = isExtensions ? "urn:mozilla:extension:" : "urn:mozilla:theme:"; gDSRoot = isExtensions ? "urn:mozilla:extension:root" : "urn:mozilla:theme:root"; 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", gDSRoot); gExtensionsView.focus(); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (!isExtensions) { gExtensionsView.addEventListener("richview-select", onThemeSelect, false); var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry); gCurrentTheme = cr.getSelectedSkin("global"); var useThemeButton = document.getElementById("useThemeButton"); useThemeButton.hidden = false; } // 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.documentElement.setAttribute("title", extensionsStrings.getString(gWindowState + "Title")); gExtensionsViewController.onCommandUpdate(); gGetMoreURL = pref.getComplexValue(isExtensions ? PREF_EXTENSIONS_GETMOREEXTENSIONSURL : PREF_EXTENSIONS_GETMORETHEMESURL, Components.interfaces.nsIPrefLocalizedString).data; gGetMoreURL = gGetMoreURL.replace(/%APPID%/g, pref.getCharPref(PREF_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 ? 400 : 500); win.setAttribute("height", isExtensions ? 300 : 380); } // Now look and see if we're being opened by XPInstall var 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.addDownloadObserver(gDownloadManager); if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { } }}
dump(tagName+" = InsertTable tagName\n");
function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, null); dump(tagName+" = InsertTable tagName\n"); 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.heightInput = document.getElementById("heightInput"); dialog.borderInput = document.getElementById("borderInput"); dialog.widthPixelOrPercentMenulist = document.getElementById("widthPixelOrPercentMenulist"); dialog.heightPixelOrPercentMenulist = document.getElementById("heightPixelOrPercentMenulist"); // Make a copy to use for AdvancedEdit globalElement = tableElement.cloneNode(false); // Initialize all widgets with image attributes InitDialog(); // Set initial number to 1 row, 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 = 1; dialog.columnsInput.value = 2; dialog.rowsInput.focus(); // Resize window window.sizeToContent();}
return;
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 = ConvertToCDATAString(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(); DoEnabling(); SetTextboxFocus(nameInput); SetWindowLocation();}
switch (window.arguments[4]) {
var folderItem; var arg; if (window.arguments.length < 5) arg = null; else arg = window.arguments[4]; switch (arg) {
function Startup(){ doSetOKCancel(onOK); gFld_Name = document.getElementById("name"); gFld_URL = document.getElementById("url"); gFolderTree = document.getElementById("folders"); var shouldSetOKButton = true; if ("arguments" in window) { switch (window.arguments[4]) { case "selectFolder": // If we're being opened as a folder selection window document.getElementById("bookmarknamegrid").setAttribute("hidden", "true"); document.getElementById("createinseparator").setAttribute("hidden", "true"); document.getElementById("nameseparator").setAttribute("hidden", "true"); sizeToContent(); var windowNode = document.getElementById("newBookmarkWindow"); windowNode.setAttribute("title", windowNode.getAttribute("title-selectFolder")); shouldSetOKButton = false; var folderItem = document.getElementById(window.arguments[2]); if (folderItem) gFolderTree.selectItem(folderItem); break; case "newBookmark": setupFields(); if (window.arguments[2]) gCreateInFolder = window.arguments[2]; document.getElementById("folderbox").setAttribute("hidden", "true"); windowNode = document.getElementById("newBookmarkWindow"); windowNode.removeAttribute("persist"); windowNode.removeAttribute("height"); windowNode.removeAttribute("width"); windowNode.setAttribute("style", windowNode.getAttribute("style")); sizeToContent(); break; default: // Regular Add Bookmark setupFields(); if (window.arguments[2]) { gCreateInFolder = window.arguments[2]; var folderItem = document.getElementById(gCreateInFolder); if (folderItem) gFolderTree.selectItem(folderItem); } } } if (shouldSetOKButton) onLocationInput(); gFld_Name.select(); gFld_Name.focus();}
var folderItem = document.getElementById(window.arguments[2]);
folderItem = document.getElementById(window.arguments[2]);
function Startup(){ doSetOKCancel(onOK); gFld_Name = document.getElementById("name"); gFld_URL = document.getElementById("url"); gFolderTree = document.getElementById("folders"); var shouldSetOKButton = true; if ("arguments" in window) { switch (window.arguments[4]) { case "selectFolder": // If we're being opened as a folder selection window document.getElementById("bookmarknamegrid").setAttribute("hidden", "true"); document.getElementById("createinseparator").setAttribute("hidden", "true"); document.getElementById("nameseparator").setAttribute("hidden", "true"); sizeToContent(); var windowNode = document.getElementById("newBookmarkWindow"); windowNode.setAttribute("title", windowNode.getAttribute("title-selectFolder")); shouldSetOKButton = false; var folderItem = document.getElementById(window.arguments[2]); if (folderItem) gFolderTree.selectItem(folderItem); break; case "newBookmark": setupFields(); if (window.arguments[2]) gCreateInFolder = window.arguments[2]; document.getElementById("folderbox").setAttribute("hidden", "true"); windowNode = document.getElementById("newBookmarkWindow"); windowNode.removeAttribute("persist"); windowNode.removeAttribute("height"); windowNode.removeAttribute("width"); windowNode.setAttribute("style", windowNode.getAttribute("style")); sizeToContent(); break; default: // Regular Add Bookmark setupFields(); if (window.arguments[2]) { gCreateInFolder = window.arguments[2]; var folderItem = document.getElementById(gCreateInFolder); if (folderItem) gFolderTree.selectItem(folderItem); } } } if (shouldSetOKButton) onLocationInput(); gFld_Name.select(); gFld_Name.focus();}
var folderItem = document.getElementById(gCreateInFolder);
folderItem = document.getElementById(gCreateInFolder);
function Startup(){ doSetOKCancel(onOK); gFld_Name = document.getElementById("name"); gFld_URL = document.getElementById("url"); gFolderTree = document.getElementById("folders"); var shouldSetOKButton = true; if ("arguments" in window) { switch (window.arguments[4]) { case "selectFolder": // If we're being opened as a folder selection window document.getElementById("bookmarknamegrid").setAttribute("hidden", "true"); document.getElementById("createinseparator").setAttribute("hidden", "true"); document.getElementById("nameseparator").setAttribute("hidden", "true"); sizeToContent(); var windowNode = document.getElementById("newBookmarkWindow"); windowNode.setAttribute("title", windowNode.getAttribute("title-selectFolder")); shouldSetOKButton = false; var folderItem = document.getElementById(window.arguments[2]); if (folderItem) gFolderTree.selectItem(folderItem); break; case "newBookmark": setupFields(); if (window.arguments[2]) gCreateInFolder = window.arguments[2]; document.getElementById("folderbox").setAttribute("hidden", "true"); windowNode = document.getElementById("newBookmarkWindow"); windowNode.removeAttribute("persist"); windowNode.removeAttribute("height"); windowNode.removeAttribute("width"); windowNode.setAttribute("style", windowNode.getAttribute("style")); sizeToContent(); break; default: // Regular Add Bookmark setupFields(); if (window.arguments[2]) { gCreateInFolder = window.arguments[2]; var folderItem = document.getElementById(gCreateInFolder); if (folderItem) gFolderTree.selectItem(folderItem); } } } if (shouldSetOKButton) onLocationInput(); gFld_Name.select(); gFld_Name.focus();}
wind.setAttribute("title", wind.getAttribute("alttitle"));
document.title = wind.getAttribute("alttitle");
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(); // label the show/hide password button document.getElementById("togglePasswords").label = kSignonBundle.getString(showingPasswords ? "hidePasswords" : "showPasswords"); } 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");}
sizeToContent(); document.title = document.documentElement.getAttribute("selectFolderTitle");
sizeToFit(); document.title = document.documentElement.getAttribute("title-selectFolder");
function Startup(){ initServices(); initBMService(); gFld_Name = document.getElementById("name"); gFld_URL = document.getElementById("url"); gCB_AddGroup = document.getElementById("addgroup"); var bookmarkView = document.getElementById("bookmarks-view"); var shouldSetOKButton = true; 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").setAttribute("hidden", "true"); document.getElementById("createinseparator").setAttribute("hidden", "true"); document.getElementById("nameseparator").setAttribute("hidden", "true"); sizeToContent(); document.title = document.documentElement.getAttribute("selectFolderTitle"); shouldSetOKButton = false; if (window.arguments[2]) folderItem = RDF.GetResource(window.arguments[2]); if (folderItem) { ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem); bookmarkView.treeBoxObject.view.selection.select(ind); } break; case "newBookmark": setupFields(); if (window.arguments[2]) gCreateInFolder = window.arguments[2]; document.getElementById("folderbox").setAttribute("hidden", "true"); sizeToFit(); break; case "addGroup": document.getElementById("showaddgroup").setAttribute("hidden", "false"); setupFields(); sizeToFit(); break; case "addGroup,group": document.getElementById("showaddgroup").setAttribute("hidden", "false"); gCB_AddGroup.setAttribute("checked", "true"); setupFields(); toggleGroup(); sizeToFit(); break; default: // Regular Add Bookmark setupFields(); if (window.arguments[2]) { gCreateInFolder = window.arguments[2]; folderItem = bookmarkView.rdf.GetResource(gCreateInFolder); if (folderItem) { ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem); bookmarkView.treeBoxObject.view.selection.select(ind); } } } } if (shouldSetOKButton) onFieldInput(); if (document.getElementById("bookmarknamegrid").hasAttribute("hidden")) { bookmarkView.tree.focus(); if (bookmarkView.currentIndex == -1) bookmarkView.treeBoxObject.view.selection.select(0); } else { gFld_Name.select(); gFld_Name.focus(); }}
var changedList = ["allowWindowOpenChanged", "allowWindowMoveResizeChanged",
var changedList = ["allowWindowMoveResizeChanged",
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowWindowMoveResizeChanged", "allowWindowStatusChangeChanged", "allowWindowFlipChanged", "allowDocumentCookieSetChanged", "allowDocumentCookieGetChanged", "allowImageSrcChangeChanged", "allowHideStatusBarChanged"]; data.scriptData = []; for(var run = 0; run < changedList.length; run++ ){ data.scriptData[ changedList[run] ] = []; data.scriptData[ changedList[run] ].value = false; } document.getElementById("allowWindowOpen").checked = getPrefValueForCheckbox("dom.disable_open_during_load"); document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("dom.disable_window_move_resize"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("dom.disable_window_flip"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("dom.disable_window_status_change"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("dom.disable_image_src_set"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("dom.disable_cookie_get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("dom.disable_cookie_set"); document.getElementById("allowHideStatusBar").checked = getPrefValueForCheckbox("dom.disable_window_open_feature.status"); } javascriptEnabledChange(!document.getElementById("enableJavascript").checked); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
document.getElementById("allowWindowOpen").checked = getPrefValueForCheckbox("dom.disable_open_during_load");
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowWindowMoveResizeChanged", "allowWindowStatusChangeChanged", "allowWindowFlipChanged", "allowDocumentCookieSetChanged", "allowDocumentCookieGetChanged", "allowImageSrcChangeChanged", "allowHideStatusBarChanged"]; data.scriptData = []; for(var run = 0; run < changedList.length; run++ ){ data.scriptData[ changedList[run] ] = []; data.scriptData[ changedList[run] ].value = false; } document.getElementById("allowWindowOpen").checked = getPrefValueForCheckbox("dom.disable_open_during_load"); document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("dom.disable_window_move_resize"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("dom.disable_window_flip"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("dom.disable_window_status_change"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("dom.disable_image_src_set"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("dom.disable_cookie_get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("dom.disable_cookie_set"); document.getElementById("allowHideStatusBar").checked = getPrefValueForCheckbox("dom.disable_window_open_feature.status"); } javascriptEnabledChange(!document.getElementById("enableJavascript").checked); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
if (uriToLoad == "about:blank" && !toolbar.hidden && gURLBar && !gURLBar.parentNode.parentNode.collapsed) { elt = gURLBar; } else { elt = _content;
if (uriToLoad == "about:blank") { var navBar = document.getElementById("nav-bar"); if (navBar && !navBar.hidden && gURLBar && !gURLBar.parentNode.parentNode.collapsed) elt = gURLBar; else elt = _content;
function Startup(){ // init globals gNavigatorBundle = document.getElementById("bundle_browser"); gBrowser = document.getElementById("content"); gURLBar = document.getElementById("urlbar"); gReportButton = document.getElementById("page-report-button"); gBrowser.addEventListener("DOMUpdatePageReport", UpdatePageReport, false); gProgressMeterPanel = document.getElementById("statusbar-progresspanel"); 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; } // initialize observers and listeners window.XULBrowserWindow = new nsBrowserStatusHandler(); window.browserContentListener = new nsBrowserContentListener(window, gBrowser); // Initialize browser instance.. appCore.setWebShellWindow(window); // 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 getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1]; } } } // XXXjag work-around for bug 113076 // there's another bug where we throw an exception when getting // sessionHistory if it is null, which I'm exploiting here to // detect the situation described in bug 113076. // The same problem caused bug 139522, also worked around below. try { gBrowser.sessionHistory; } catch (e) { // sessionHistory wasn't set from the browser's constructor // so we'll just have to set it here. // Wire up session and global history before any possible // progress notifications for back/forward button updating webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); // wire up global history. the same applies here. var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"] .getService(Components.interfaces.nsIGlobalHistory); gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).globalHistory = globalHistory; const selectedBrowser = gBrowser.selectedBrowser; if (selectedBrowser.securityUI) selectedBrowser.securityUI.init(selectedBrowser.contentWindow); } // hook up UI through progress listener gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);#ifdef ENABLE_PAGE_CYCLER appCore.startPageCycler();#else // only load url passed in when we're not page cycling var uriToLoad = null; // 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") { if (gURLBar) gURLBar.value = uriToLoad; if ("arguments" in window && window.arguments.length >= 3) { loadURI(uriToLoad, window.arguments[2]); } else { loadURI(uriToLoad); } }#ifdef MOZ_ENABLE_XREMOTE // hook up remote support var remoteService; remoteService = Components.classes["@mozilla.org/browser/xremoteservice;1"] .getService(Components.interfaces.nsIXRemoteService); remoteService.addBrowserInstance(window); RegisterTabOpenObserver();#endif#endif if (window.opener) { var openerSidebarBox = window.opener.document.getElementById("sidebar-box"); if (!openerSidebarBox.hidden) { gMustLoadSidebar = true; var sidebarBox = document.getElementById("sidebar-box"); sidebarBox.hidden = false; var sidebarSplitter = document.getElementById("sidebar-splitter"); sidebarSplitter.hidden = false; var sidebarTitle = document.getElementById("sidebar-title"); sidebarTitle.setAttribute("value", window.opener.document.getElementById("sidebar-title").getAttribute("value")); sidebarBox.setAttribute("width", openerSidebarBox.boxObject.width); var sidebarCmd = openerSidebarBox.getAttribute("sidebarcommand"); document.getElementById(sidebarCmd).setAttribute("checked", "true"); sidebarBox.setAttribute("sidebarcommand", sidebarCmd); } } // Focus the content area unless we're loading a blank page var elt; if (uriToLoad == "about:blank" && !toolbar.hidden && gURLBar && !gURLBar.parentNode.parentNode.collapsed) { elt = gURLBar; } else { elt = _content; } setTimeout(delayedStartup, 0, elt);}
appCore.SetDocumentCharset(arrayArgComponents[1]);
BrowserSetDefaultCharacterSet(arrayArgComponents[1]);
function Startup(){ 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); // 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; } if (!startPage) { // Check for window.arguments[0]. If present, use that for 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; } } if (startPage) loadURI(startPage); // Perform default browser checking. checkForDefaultBrowser(); }}
SetTextfieldFocus(dialog.TableRowsInput);
SetTextboxFocus(dialog.TableRowsInput);
function Startup(){ if (!InitEditorShell()) return; selection = editorShell.editorSelection; if (!selection) return; dialog = new Object; if (!dialog) window.close(); // Get dialog widgets - Table Panel dialog.TableRowsInput = document.getElementById("TableRowsInput"); dialog.TableColumnsInput = document.getElementById("TableColumnsInput"); dialog.TableWidthInput = document.getElementById("TableWidthInput"); dialog.TableWidthUnits = document.getElementById("TableWidthUnits"); dialog.BorderWidthInput = document.getElementById("BorderWidthInput"); dialog.SpacingInput = document.getElementById("SpacingInput"); dialog.PaddingInput = document.getElementById("PaddingInput"); dialog.TableAlignList = document.getElementById("TableAlignList"); dialog.TableCaptionList = document.getElementById("TableCaptionList"); dialog.TableInheritColor = document.getElementById("TableInheritColor"); // Cell Panel dialog.SelectionList = document.getElementById("SelectionList"); dialog.PreviousButton = document.getElementById("PreviousButton"); dialog.NextButton = document.getElementById("NextButton"); // Currently, we always apply changes and load new attributes when changing selection // (Let's keep this for possible future use) //dialog.ApplyBeforeMove = document.getElementById("ApplyBeforeMove"); //dialog.KeepCurrentData = document.getElementById("KeepCurrentData"); dialog.CellHeightInput = document.getElementById("CellHeightInput"); dialog.CellHeightUnits = document.getElementById("CellHeightUnits"); dialog.CellWidthInput = document.getElementById("CellWidthInput"); dialog.CellWidthUnits = document.getElementById("CellWidthUnits"); dialog.RowSpanInput = document.getElementById("RowSpanInput"); dialog.ColSpanInput = document.getElementById("ColSpanInput"); dialog.CellHAlignList = document.getElementById("CellHAlignList"); dialog.CellVAlignList = document.getElementById("CellVAlignList"); dialog.CellInheritColor = document.getElementById("CellInheritColor"); dialog.CellStyleList = document.getElementById("CellStyleList"); dialog.TextWrapList = document.getElementById("TextWrapList"); // In cell panel, user must tell us which attributes to apply via checkboxes, // else we would apply values from one cell to ALL in selection // and that's probably not what they expect! dialog.CellHeightCheckbox = document.getElementById("CellHeightCheckbox"); dialog.CellWidthCheckbox = document.getElementById("CellWidthCheckbox"); dialog.RowSpanCheckbox = document.getElementById("RowSpanCheckbox"); dialog.ColSpanCheckbox = document.getElementById("ColSpanCheckbox"); dialog.CellHAlignCheckbox = document.getElementById("CellHAlignCheckbox"); dialog.CellVAlignCheckbox = document.getElementById("CellVAlignCheckbox"); dialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox"); dialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox"); dialog.CellColorCheckbox = document.getElementById("CellColorCheckbox"); TabPanel = document.getElementById("TabPanel"); var TableTab = document.getElementById("TableTab"); var CellTab = document.getElementById("CellTab"); TableElement = editorShell.GetElementOrParentByTagName("table", null); if(!TableElement) { dump("Failed to get table element!\n"); window.close(); } globalTableElement = TableElement.cloneNode(false); var tagNameObj = new Object; var countObj = new Object; var tableOrCellElement = editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj); gSelectedCellCount = countObj.value; if (tagNameObj.value == "td") { // We are in a cell CellElement = tableOrCellElement; globalCellElement = CellElement.cloneNode(false); // Tells us whether cell, row, or column is selected SelectedCellsType = editorShell.GetSelectedCellsType(TableElement); SetSpanEnable(); // Ignore types except Cell, Row, and Column if (SelectedCellsType < SELECT_CELL || SelectedCellsType > SELECT_COLUMN) SelectedCellsType = SELECT_CELL; // Be sure at least 1 cell is selected. // (If the count is 0, then we were inside the cell.) if (gSelectedCellCount == 0) DoCellSelection(); // Get location in the cell map curRowIndex = editorShell.GetRowIndex(CellElement); curColIndex = editorShell.GetColumnIndex(CellElement); // We save the current colspan to quickly // move selection from from cell to cell if (GetCellData(curRowIndex, curColIndex)) curColSpan = cellData.colSpan; // Set appropriate icons in the Previous/Next buttons SetSelectionButtons(); // Starting TabPanel name is passed in if (window.arguments[1] == "CellPanel") { currentPanel = CellPanel; //Set index for starting panel on the <tabpanel> element TabPanel.setAttribute("index", CellPanel); // Trigger setting of style for the tab widgets CellTab.setAttribute("selected", "true"); TableTab.removeAttribute("selected"); // Use cell element for Advanced Edit dialog globalElement = globalCellElement; } } if (currentPanel == TablePanel) { // Use table element for Advanced Edit dialog globalElement = globalTableElement; // We may call this with table selected, but no cell, // so disable the Cell Properties tab if(!CellElement) CellTab.setAttribute("disabled", "true"); } doSetOKCancel(onOK, onCancel); // Note: we must use TableElement, not globalTableElement for these, // thus we should not put this in InitDialog. // Instead, monitor desired counts with separate globals rowCount = editorShell.GetTableRowCount(TableElement); lastRowIndex = rowCount-1; colCount = editorShell.GetTableColumnCount(TableElement); lastColIndex = colCount-1; // If only one cell in table, disable change-selection widgets if (rowCount == 1 && colCount == 1) { dialog.SelectionList.setAttribute("disabled", "true"); dialog.PreviousButton.setAttribute("disabled", "true"); dialog.NextButton.setAttribute("disabled", "true"); } // User can change these via textfields newRowCount = rowCount; newColCount = colCount; // This flag is used to control whether set check state // on "set attribute" checkboxes // (Advanced Edit dialog use calls InitDialog when done) AdvancedEditUsed = false; InitDialog(); AdvancedEditUsed = true; // If first initializing, we really aren't changing anything CellDataChanged = false; if (currentPanel == CellPanel) dialog.SelectionList.focus(); else SetTextfieldFocus(dialog.TableRowsInput); SetWindowLocation();}
window.content.appCore= appCore;
window._content.appCore= appCore;
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", UpdateBookmarksLastVisitedDate, true); contentArea.addEventListener("load", UpdateInternetSearchResults, true); contentArea.addEventListener("load", getContentAreaFrameCount, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments[1] ) { if (window.arguments[1].indexOf('charset=') != -1) { 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.CopyUnicharPref("browser.startup.homepage"); } catch(e) { homepage = null; } if (homepage) setTooltipText("homebutton", homepage); initConsoleListener(); }
document.getElementById("DocSubdir").setAttribute("hidden", "true");
document.getElementById("DocSubdir").hidden = true;
function Startup(){ gPublishData = window.arguments[0]; if (!gPublishData) { dump("No publish data!\n"); window.close(); return; } gDialog.FileList = document.getElementById("FileList"); gDialog.FinalStatusMessage = document.getElementById("FinalStatusMessage"); gDialog.StatusMessage = document.getElementById("StatusMessage"); gDialog.KeepOpen = document.getElementById("KeepOpen"); gDialog.Close = document.documentElement.getButton("cancel"); SetWindowLocation(); var title = GetDocumentTitle(); if (!title) title = "("+GetString("untitled")+")"; window.title = GetString("PublishProgressCaption").replace(/%title%/, title); document.getElementById("PublishToSite").value = GetString("PublishToSite").replace(/%title%/, TruncateStringAtWordEnd(gPublishData.siteName, 25)); // Show publishing destination URL document.getElementById("PublishUrl").value = gPublishData.publishUrl; // Show subdirectories only if not empty if (gPublishData.docDir || gPublishData.otherDir) { if (gPublishData.docDir) document.getElementById("docDir").value = gPublishData.docDir; else document.getElementById("DocSubdir").setAttribute("hidden", "true"); if (gPublishData.publishOtherFiles && gPublishData.otherDir) document.getElementById("otherDir").value = gPublishData.otherDir; else document.getElementById("OtherSubdir").setAttribute("hidden", "true"); } else document.getElementById("Subdirectories").setAttribute("hidden", "true"); // Add the document to the "publish to" list as quick as possible! SetProgressStatus(gPublishData.filename, "busy"); if (gPublishData.publishOtherFiles) { // When publishing images as well, expand list to show more items gDialog.FileList.setAttribute("rows", 5); window.sizeToContent(); } // Now that dialog is initialized, we can start publishing window.opener.StartPublishing();}
document.getElementById("OtherSubdir").setAttribute("hidden", "true");
document.getElementById("OtherSubdir").hidden = true;
function Startup(){ gPublishData = window.arguments[0]; if (!gPublishData) { dump("No publish data!\n"); window.close(); return; } gDialog.FileList = document.getElementById("FileList"); gDialog.FinalStatusMessage = document.getElementById("FinalStatusMessage"); gDialog.StatusMessage = document.getElementById("StatusMessage"); gDialog.KeepOpen = document.getElementById("KeepOpen"); gDialog.Close = document.documentElement.getButton("cancel"); SetWindowLocation(); var title = GetDocumentTitle(); if (!title) title = "("+GetString("untitled")+")"; window.title = GetString("PublishProgressCaption").replace(/%title%/, title); document.getElementById("PublishToSite").value = GetString("PublishToSite").replace(/%title%/, TruncateStringAtWordEnd(gPublishData.siteName, 25)); // Show publishing destination URL document.getElementById("PublishUrl").value = gPublishData.publishUrl; // Show subdirectories only if not empty if (gPublishData.docDir || gPublishData.otherDir) { if (gPublishData.docDir) document.getElementById("docDir").value = gPublishData.docDir; else document.getElementById("DocSubdir").setAttribute("hidden", "true"); if (gPublishData.publishOtherFiles && gPublishData.otherDir) document.getElementById("otherDir").value = gPublishData.otherDir; else document.getElementById("OtherSubdir").setAttribute("hidden", "true"); } else document.getElementById("Subdirectories").setAttribute("hidden", "true"); // Add the document to the "publish to" list as quick as possible! SetProgressStatus(gPublishData.filename, "busy"); if (gPublishData.publishOtherFiles) { // When publishing images as well, expand list to show more items gDialog.FileList.setAttribute("rows", 5); window.sizeToContent(); } // Now that dialog is initialized, we can start publishing window.opener.StartPublishing();}
document.getElementById("Subdirectories").setAttribute("hidden", "true");
document.getElementById("Subdirectories").hidden = true;
function Startup(){ gPublishData = window.arguments[0]; if (!gPublishData) { dump("No publish data!\n"); window.close(); return; } gDialog.FileList = document.getElementById("FileList"); gDialog.FinalStatusMessage = document.getElementById("FinalStatusMessage"); gDialog.StatusMessage = document.getElementById("StatusMessage"); gDialog.KeepOpen = document.getElementById("KeepOpen"); gDialog.Close = document.documentElement.getButton("cancel"); SetWindowLocation(); var title = GetDocumentTitle(); if (!title) title = "("+GetString("untitled")+")"; window.title = GetString("PublishProgressCaption").replace(/%title%/, title); document.getElementById("PublishToSite").value = GetString("PublishToSite").replace(/%title%/, TruncateStringAtWordEnd(gPublishData.siteName, 25)); // Show publishing destination URL document.getElementById("PublishUrl").value = gPublishData.publishUrl; // Show subdirectories only if not empty if (gPublishData.docDir || gPublishData.otherDir) { if (gPublishData.docDir) document.getElementById("docDir").value = gPublishData.docDir; else document.getElementById("DocSubdir").setAttribute("hidden", "true"); if (gPublishData.publishOtherFiles && gPublishData.otherDir) document.getElementById("otherDir").value = gPublishData.otherDir; else document.getElementById("OtherSubdir").setAttribute("hidden", "true"); } else document.getElementById("Subdirectories").setAttribute("hidden", "true"); // Add the document to the "publish to" list as quick as possible! SetProgressStatus(gPublishData.filename, "busy"); if (gPublishData.publishOtherFiles) { // When publishing images as well, expand list to show more items gDialog.FileList.setAttribute("rows", 5); window.sizeToContent(); } // Now that dialog is initialized, we can start publishing window.opener.StartPublishing();}
gDialog.RadioGroup.setAttribute("collapsed", gListElement ? "false" : "true");
gDialog.RadioGroup.collapsed = !gListElement;
function Startup(){ var editor = GetCurrentEditor(); if (!editor) { window.close(); return; } gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.ChangeSelectedRadio = document.getElementById("ChangeSelected"); // Try to get an existing list(s) var mixedObj = { value: null }; try { gListType = editor.getListState(mixedObj, {}, {}, {} ); // We may have mixed list and non-list, or > 1 list type in selection gMixedListSelection = mixedObj.value; // Get the list element at the anchor node gListElement = editor.getElementOrParentByTagName("list", null); } catch (e) {} // The copy to use in AdvancedEdit if (gListElement) globalElement = gListElement.cloneNode(false); // Show extra options for changing entire list if we have one already. gDialog.RadioGroup.setAttribute("collapsed", gListElement ? "false" : "true"); if (gListElement) { // Radio button index is persistant if (gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; } InitDialog(); gOriginalListType = gListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
pref_string = prefInt.CopyCharPref("mailnews.view_default_charset");
pref_string = prefInt.getLocalizedUnicharPref("mailnews.view_default_charset");
function startUp(){ try { prefInt = Components.classes["component://netscape/preferences"]; ccm = Components.classes['component://netscape/charset-converter-manager']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); availCharsetList = ccm.GetDecoderList(); availCharsetList = availCharsetList.QueryInterface(Components.interfaces.nsISupportsArray); if (prefInt) { prefInt = prefInt.getService(); prefInt = prefInt.QueryInterface(Components.interfaces.nsIPref); pref_string = prefInt.CopyCharPref("mailnews.view_default_charset"); } } } catch(ex) { dump("failed to get prefs or charset mgr. services!\n"); ccm = null; prefInt = null; } LoadAvailableCharSets();}
gExtensionsView.style.width = "20em";
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); // 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); var defaultPref = pref.QueryInterface(Components.interfaces.nsIPrefService) .getDefaultBranch(null); if (!isExtensions) { gExtensionsView.addEventListener("richview-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; } // Initialize the richlistbox. This will select the last selected extension // or default to the first listed one. gExtensionsView.init(); 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) {#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 changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "allowWindowMoveResizeChanged", "allowWindowStatusChangeChanged", "allowWindowFlipChanged", "allowDocumentCookieSetChanged", "allowDocumentCookieGetChanged", "allowImageSrcChangeChanged"];
var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "allowWindowMoveResizeChanged", "allowWindowStatusChangeChanged", "allowWindowFlipChanged", "allowDocumentCookieSetChanged", "allowDocumentCookieGetChanged", "allowImageSrcChangeChanged", "allowHideStatusBarChanged"];
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "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; } document.getElementById("allowWindowOpen").checked = getPrefValueForCheckbox("dom.disable_open_during_load"); document.getElementById("allowTargetNew").checked = getPrefValueForCheckbox("browser.block.target_new_window"); document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("dom.disable_window_move_resize"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("dom.disable_window_flip"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("dom.disable_window_status_change"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("dom.disable_image_src_set"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("dom.disable_cookie_get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("dom.disable_cookie_set"); //If we don't have a checkbox under groupbox pluginPreferences, we should hide it var pluginGroup = document.getElementById("pluginPreferences") var children = pluginGroup.childNodes; if (!children || children.length <= 1) // 1 for the caption pluginGroup.setAttribute("hidden", "true"); } else { //not first time it was loaded, get default values from data document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) { document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; } } javascriptEnabledChange(); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
} else { document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) { document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; }
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "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; } document.getElementById("allowWindowOpen").checked = getPrefValueForCheckbox("dom.disable_open_during_load"); document.getElementById("allowTargetNew").checked = getPrefValueForCheckbox("browser.block.target_new_window"); document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("dom.disable_window_move_resize"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("dom.disable_window_flip"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("dom.disable_window_status_change"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("dom.disable_image_src_set"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("dom.disable_cookie_get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("dom.disable_cookie_set"); //If we don't have a checkbox under groupbox pluginPreferences, we should hide it var pluginGroup = document.getElementById("pluginPreferences") var children = pluginGroup.childNodes; if (!children || children.length <= 1) // 1 for the caption pluginGroup.setAttribute("hidden", "true"); } else { //not first time it was loaded, get default values from data document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) { document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; } } javascriptEnabledChange(); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
gDialog.AdvancedEditCell = document.getElementById("AdvancedEditButton2"); gDialog.AdvancedEditCellToolTipText = gDialog.AdvancedEditCell.getAttribute("tooltiptext");
function Startup(){ if (!InitEditorShell()) return; selection = editorShell.editorSelection; if (!selection) return; // Get dialog widgets - Table Panel gDialog.TableRowsInput = document.getElementById("TableRowsInput"); gDialog.TableColumnsInput = document.getElementById("TableColumnsInput"); gDialog.TableWidthInput = document.getElementById("TableWidthInput"); gDialog.TableWidthUnits = document.getElementById("TableWidthUnits"); gDialog.TableHeightInput = document.getElementById("TableHeightInput"); gDialog.TableHeightUnits = document.getElementById("TableHeightUnits"); if (!gPrefs.getBoolPref("editor.use_css") || (editorShell.editorType != "html")) { gUseCSS = false; var tableHeightLabel = document.getElementById("TableHeightLabel"); tableHeightLabel.parentNode.removeChild(tableHeightLabel); gDialog.TableHeightInput.parentNode.removeChild(gDialog.TableHeightInput); gDialog.TableHeightUnits.parentNode.removeChild(gDialog.TableHeightUnits); } gDialog.BorderWidthInput = document.getElementById("BorderWidthInput"); gDialog.SpacingInput = document.getElementById("SpacingInput"); gDialog.PaddingInput = document.getElementById("PaddingInput"); gDialog.TableAlignList = document.getElementById("TableAlignList"); gDialog.TableCaptionList = document.getElementById("TableCaptionList"); gDialog.TableInheritColor = document.getElementById("TableInheritColor"); gDialog.TabBox = document.getElementById("TabBox"); // Cell Panel gDialog.SelectionList = document.getElementById("SelectionList"); gDialog.PreviousButton = document.getElementById("PreviousButton"); gDialog.NextButton = document.getElementById("NextButton"); // Currently, we always apply changes and load new attributes when changing selection // (Let's keep this for possible future use) //gDialog.ApplyBeforeMove = document.getElementById("ApplyBeforeMove"); //gDialog.KeepCurrentData = document.getElementById("KeepCurrentData"); gDialog.CellHeightInput = document.getElementById("CellHeightInput"); gDialog.CellHeightUnits = document.getElementById("CellHeightUnits"); gDialog.CellWidthInput = document.getElementById("CellWidthInput"); gDialog.CellWidthUnits = document.getElementById("CellWidthUnits"); gDialog.CellHAlignList = document.getElementById("CellHAlignList"); gDialog.CellVAlignList = document.getElementById("CellVAlignList"); gDialog.CellInheritColor = document.getElementById("CellInheritColor"); gDialog.CellStyleList = document.getElementById("CellStyleList"); gDialog.TextWrapList = document.getElementById("TextWrapList"); // In cell panel, user must tell us which attributes to apply via checkboxes, // else we would apply values from one cell to ALL in selection // and that's probably not what they expect! gDialog.CellHeightCheckbox = document.getElementById("CellHeightCheckbox"); gDialog.CellWidthCheckbox = document.getElementById("CellWidthCheckbox"); gDialog.CellHAlignCheckbox = document.getElementById("CellHAlignCheckbox"); gDialog.CellVAlignCheckbox = document.getElementById("CellVAlignCheckbox"); gDialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox"); gDialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox"); gDialog.CellColorCheckbox = document.getElementById("CellColorCheckbox"); gDialog.TableTab = document.getElementById("TableTab"); gDialog.CellTab = document.getElementById("CellTab"); TableElement = editorShell.GetElementOrParentByTagName("table", null); if(!TableElement) { dump("Failed to get table element!\n"); window.close(); return; } globalTableElement = TableElement.cloneNode(false); var tagNameObj = new Object; var countObj = new Object; var tableOrCellElement = editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj); gSelectedCellCount = countObj.value; if (tagNameObj.value == "td") { // We are in a cell CellElement = tableOrCellElement; globalCellElement = CellElement.cloneNode(false); // Tells us whether cell, row, or column is selected SelectedCellsType = editorShell.GetSelectedCellsType(TableElement); // Ignore types except Cell, Row, and Column if (SelectedCellsType < SELECT_CELL || SelectedCellsType > SELECT_COLUMN) SelectedCellsType = SELECT_CELL; // Be sure at least 1 cell is selected. // (If the count is 0, then we were inside the cell.) if (gSelectedCellCount == 0) DoCellSelection(); // Get location in the cell map curRowIndex = editorShell.GetRowIndex(CellElement); curColIndex = editorShell.GetColumnIndex(CellElement); // We save the current colspan to quickly // move selection from from cell to cell if (GetCellData(curRowIndex, curColIndex)) curColSpan = cellData.colSpan; // Starting TabPanel name is passed in if (window.arguments[1] == "CellPanel") gDialog.TabBox.selectedTab = gDialog.CellTab; } if (gDialog.TabBox.selectedTab == gDialog.TableTab) { // We may call this with table selected, but no cell, // so disable the Cell Properties tab if(!CellElement) { // XXX: Disabling of tabs is currently broken, so for // now we'll just remove the tab completely. //gDialog.CellTab.disabled = true; gDialog.CellTab.parentNode.removeChild(gDialog.CellTab); } } // Note: we must use TableElement, not globalTableElement for these, // thus we should not put this in InitDialog. // Instead, monitor desired counts with separate globals rowCount = editorShell.GetTableRowCount(TableElement); lastRowIndex = rowCount-1; colCount = editorShell.GetTableColumnCount(TableElement); lastColIndex = colCount-1; // Set appropriate icons and enable state for the Previous/Next buttons SetSelectionButtons(); // If only one cell in table, disable change-selection widgets if (rowCount == 1 && colCount == 1) gDialog.SelectionList.setAttribute("disabled", "true"); // User can change these via textboxes newRowCount = rowCount; newColCount = colCount; // This flag is used to control whether set check state // on "set attribute" checkboxes // (Advanced Edit dialog use calls InitDialog when done) AdvancedEditUsed = false; InitDialog(); AdvancedEditUsed = true; // If first initializing, we really aren't changing anything CellDataChanged = false; if (gDialog.TabBox.selectedTab == gDialog.CellTab) setTimeout("gDialog.SelectionList.focus()", 0); else SetTextboxFocus(gDialog.TableRowsInput); SetWindowLocation();}
if (labelElement.innerHTML.match(/</))
if (/</.test(labelElement.innerHTML))
function Startup(){ if (!InitEditorShell()) return; gDialog.editText = document.getElementById("EditText"); gDialog.labelText = document.getElementById("LabelText"); gDialog.labelFor = document.getElementById("LabelFor"); gDialog.labelAccessKey = document.getElementById("LabelAccessKey"); labelElement = window.arguments[0]; // Make a copy to use for AdvancedEdit globalElement = labelElement.cloneNode(false); InitDialog(); editorShell.SelectElement(labelElement); gDialog.labelText.value = GetSelectionAsText(); if (labelElement.innerHTML.match(/</)) { gDialog.editText.checked = false; gDialog.editText.disabled = false; gDialog.labelText.disabled = true; gDialog.editText.addEventListener("command", onEditText, false); SetTextboxFocus(gDialog.labelFor); } else SetTextboxFocus(gDialog.labelText); SetWindowLocation();}
var textField = document.createElement("textfield"); textField.setAttribute("value", prefillList[i+1]); textField.setAttribute("readonly", "true");
var textBox = document.createElement("textbox"); textBox.setAttribute("value", prefillList[i+1]); textBox.setAttribute("readonly", "true");
function Startup() { /* fetch the input */ var list = walletpreview.GetPrefillValue(); var BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var title = document.getElementById("walletpreview"); title.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 (var 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 textField = document.createElement("textfield"); textField.setAttribute("value", prefillList[i+1]); textField.setAttribute("readonly", "true"); var row = document.createElement("row"); row.appendChild(textField); row.appendChild(menuList); var rows = document.getElementById("rows"); rows.appendChild(row); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);}
row.appendChild(textField);
row.appendChild(textBox);
function Startup() { /* fetch the input */ var list = walletpreview.GetPrefillValue(); var BREAK = list[0]; prefillList = list.split(BREAK); /* create the heading */ var title = document.getElementById("walletpreview"); title.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 (var 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 textField = document.createElement("textfield"); textField.setAttribute("value", prefillList[i+1]); textField.setAttribute("readonly", "true"); var row = document.createElement("row"); row.appendChild(textField); row.appendChild(menuList); var rows = document.getElementById("rows"); rows.appendChild(row); } } /* create checkbox label */ var checkBox = document.getElementById("checkbox"); checkBox.setAttribute("value", bypass); /* initialization OK and Cancel buttons */ doSetOKCancel(Save, Cancel);}
if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio;
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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. gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); if (ListElement) { // Radio button index is persistant if (gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; } InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
if (ListElement) { if (gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; }
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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. gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); if (ListElement) { // Radio button index is persistant if (gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; } InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
ListType = editorShell.GetListState(mixedObj);
gListType = editorShell.GetListState(mixedObj);
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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); // Radio button index is persistent if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; // Show extra options for changing entire list only if we already have a list gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
MixedListSelection = mixedObj.value;
gMixedListSelection = mixedObj.value;
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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); // Radio button index is persistent if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; // Show extra options for changing entire list only if we already have a list gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
ListElement = editorShell.GetElementOrParentByTagName("list", null);
gListElement = editorShell.GetElementOrParentByTagName("list", null);
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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); // Radio button index is persistent if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; // Show extra options for changing entire list only if we already have a list gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
if (ListElement) globalElement = ListElement.cloneNode(false);
if (gListElement) globalElement = gListElement.cloneNode(false);
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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); // Radio button index is persistent if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; // Show extra options for changing entire list only if we already have a list gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true");
gDialog.RadioGroup.setAttribute("collapsed", gListElement ? "false" : "true"); if (gListElement) { if (gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; }
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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); // Radio button index is persistent if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; // Show extra options for changing entire list only if we already have a list gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
originalListType = ListType;
gOriginalListType = gListType;
function Startup(){ if (!InitEditorShell()) return; gDialog.ListTypeList = document.getElementById("ListType"); gDialog.BulletStyleList = document.getElementById("BulletStyle"); gDialog.BulletStyleLabel = document.getElementById("BulletStyleLabel"); gDialog.StartingNumberInput = document.getElementById("StartingNumber"); gDialog.StartingNumberLabel = document.getElementById("StartingNumberLabel"); gDialog.AdvancedEditButton = document.getElementById("AdvancedEditButton1"); gDialog.RadioGroup = document.getElementById("RadioGroup"); gDialog.ChangeAllRadio = document.getElementById("ChangeAll"); gDialog.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); // Radio button index is persistent if (ListElement && gDialog.RadioGroup.getAttribute("index") == "1") gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio; else gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio; // Show extra options for changing entire list only if we already have a list gDialog.RadioGroup.setAttribute("collapsed", ListElement ? "false" : "true"); InitDialog(); originalListType = ListType; gDialog.ListTypeList.focus(); SetWindowLocation();}
element = document.getElementById("cookieviewer"); element.setAttribute("title", cookieBundle.getString("imageTitle"));
document.title = cookieBundle.getString("imageTitle");
function Startup() { // arguments passed to this routine: // cookieManager // cookieManagerFromIcon // imageManager // xpconnect to cookiemanager/permissionmanager/promptservice/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); promptservice = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptservice = promptservice.QueryInterface(Components.interfaces.nsIPromptService); 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"); // Hide a dummy vbox inside the real box // If the actual box is hidden, the tabbox gets confused. // The first tab now controls the second panel. // Hiding the first tab doesn't help. document.getElementById("dummyContainer").hidden = "true"; document.getElementById("cookiesTab").hidden = "true"; element = document.getElementById("btnSession"); 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"); document.getElementById("dummyContainer").hidden = "true"; document.getElementById("cookiesTab").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); kObserverService.addObserver(cookieReloadDisplay, "perm-changed", false);}
element = document.getElementById("cookieviewer"); element.setAttribute("title", cookieBundle.getString("popupTitle"));
document.title = cookieBundle.getString("popupTitle");
function Startup() { // arguments passed to this routine: // cookieManager // cookieManagerFromIcon // imageManager // xpconnect to cookiemanager/permissionmanager/promptservice/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); promptservice = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptservice = promptservice.QueryInterface(Components.interfaces.nsIPromptService); 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"); // Hide a dummy vbox inside the real box // If the actual box is hidden, the tabbox gets confused. // The first tab now controls the second panel. // Hiding the first tab doesn't help. document.getElementById("dummyContainer").hidden = "true"; document.getElementById("cookiesTab").hidden = "true"; element = document.getElementById("btnSession"); 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"); document.getElementById("dummyContainer").hidden = "true"; document.getElementById("cookiesTab").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); kObserverService.addObserver(cookieReloadDisplay, "perm-changed", false);}
SetTextfieldFocus(dialog.TitleInput);
SetTextboxFocus(dialog.TitleInput);
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(); SetTextfieldFocus(dialog.TitleInput); SetWindowLocation();}
doSetOKCancel(find);
function Startup(){ doSetOKCancel(find); var bundle = document.getElementById("bookmarksBundle"); gOKButton = document.getElementById("ok"); gOKButton.label = bundle.getString("search_button_label"); gOKButton.disabled = true; gSearchField = document.getElementById("searchField"); gSearchField.focus();}
gSpellChecker.InitSpellChecker(GetCurrentEditor());
var filterContractId; gSendMailMessageMode = window.arguments[0]; if (gSendMailMessageMode) filterContractId = "@mozilla.org/editor/txtsrvfiltermail;1"; else filterContractId = "@mozilla.org/editor/txtsrvfilter;1"; gSpellChecker.setFilter(Components.classes[filterContractId].createInstance(Components.interfaces.nsITextServicesFilter)); gSpellChecker.InitSpellChecker(GetCurrentEditor());
function Startup(){ if (!GetCurrentEditor()) { window.close(); return; } // Get the spellChecker shell gSpellChecker = Components.classes['@mozilla.org/editor/editorspellchecker;1'].createInstance(Components.interfaces.nsIEditorSpellCheck); if (!gSpellChecker) { dump("SpellChecker not found!!!\n"); window.close(); return; } // Start the spell checker module. try { gSpellChecker.InitSpellChecker(GetCurrentEditor()); // XXX: We need to read in a pref here so we can set the // default language for the spellchecker! // gSpellChecker.SetCurrentDictionary(); } catch(ex) { dump("*** Exception error: InitSpellChecker\n"); window.close(); return; } gDialog.MisspelledWordLabel = document.getElementById("MisspelledWordLabel"); gDialog.MisspelledWord = document.getElementById("MisspelledWord"); gDialog.ReplaceButton = document.getElementById("Replace"); gDialog.IgnoreButton = document.getElementById("Ignore"); gDialog.StopButton = document.getElementById("Stop"); gDialog.CloseButton = document.getElementById("Close"); gDialog.ReplaceWordInput = document.getElementById("ReplaceWordInput"); gDialog.SuggestedList = document.getElementById("SuggestedList"); gDialog.LanguageMenulist = document.getElementById("LanguageMenulist"); // Fill in the language menulist and sync it up // with the spellchecker's current language. var curLang; try { curLang = gSpellChecker.GetCurrentDictionary(); } catch(ex) { curLang = ""; } InitLanguageMenu(curLang); // Get the first misspelled word and setup all UI NextWord(); // When startup param is true, setup different UI when spell checking // just before sending mail message gSendMailMessageMode = window.arguments[0]; if (gSendMailMessageMode) { // If no misspelled words found, simply close dialog and send message if (!gMisspelledWord) { onClose(); return; } // Hide "Close" button and use "Send" instead gDialog.CloseButton.hidden = true; gDialog.CloseButton = document.getElementById("Send"); gDialog.CloseButton.hidden = false; } else { // Normal spell checking - hide the "Stop" button // (Note that this button is the "Cancel" button for // Esc keybinding and related window close actions) gDialog.StopButton.hidden = true; } // Clear flag that determines message when // no misspelled word is found // (different message when used for the first time) gFirstTime = false;}
gSendMailMessageMode = window.arguments[0];
function Startup(){ if (!GetCurrentEditor()) { window.close(); return; } // Get the spellChecker shell gSpellChecker = Components.classes['@mozilla.org/editor/editorspellchecker;1'].createInstance(Components.interfaces.nsIEditorSpellCheck); if (!gSpellChecker) { dump("SpellChecker not found!!!\n"); window.close(); return; } // Start the spell checker module. try { gSpellChecker.InitSpellChecker(GetCurrentEditor()); // XXX: We need to read in a pref here so we can set the // default language for the spellchecker! // gSpellChecker.SetCurrentDictionary(); } catch(ex) { dump("*** Exception error: InitSpellChecker\n"); window.close(); return; } gDialog.MisspelledWordLabel = document.getElementById("MisspelledWordLabel"); gDialog.MisspelledWord = document.getElementById("MisspelledWord"); gDialog.ReplaceButton = document.getElementById("Replace"); gDialog.IgnoreButton = document.getElementById("Ignore"); gDialog.StopButton = document.getElementById("Stop"); gDialog.CloseButton = document.getElementById("Close"); gDialog.ReplaceWordInput = document.getElementById("ReplaceWordInput"); gDialog.SuggestedList = document.getElementById("SuggestedList"); gDialog.LanguageMenulist = document.getElementById("LanguageMenulist"); // Fill in the language menulist and sync it up // with the spellchecker's current language. var curLang; try { curLang = gSpellChecker.GetCurrentDictionary(); } catch(ex) { curLang = ""; } InitLanguageMenu(curLang); // Get the first misspelled word and setup all UI NextWord(); // When startup param is true, setup different UI when spell checking // just before sending mail message gSendMailMessageMode = window.arguments[0]; if (gSendMailMessageMode) { // If no misspelled words found, simply close dialog and send message if (!gMisspelledWord) { onClose(); return; } // Hide "Close" button and use "Send" instead gDialog.CloseButton.hidden = true; gDialog.CloseButton = document.getElementById("Send"); gDialog.CloseButton.hidden = false; } else { // Normal spell checking - hide the "Stop" button // (Note that this button is the "Cancel" button for // Esc keybinding and related window close actions) gDialog.StopButton.hidden = true; } // Clear flag that determines message when // no misspelled word is found // (different message when used for the first time) gFirstTime = false;}
} var docShell = { value : null }; var result = appCore.getContentDocShell(docShell); if (docShell.value) { webNavigation = docShell.value.QueryInterface(Components.interfaces.nsIWebNavigation);
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", UpdateBookmarksLastVisitedDate, true); contentArea.addEventListener("load", UpdateInternetSearchResults, true); contentArea.addEventListener("load", checkForDirectoryListing, true); contentArea.addEventListener("load", getContentAreaFrameCount, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); contentArea.addEventListener("load",postURLToNativeWidget, true); } dump("*** Pulling out the charset\n"); if ( window.arguments && window.arguments[1] ) { if (window.arguments[1].indexOf('charset=') != -1) { 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("homebutton", homepage); initConsoleListener(); }
} catch (e) { dump(" Exception ERROR in Link checker. e.result="+e.result+", gNumLinksToCheck="+gNumLinksToCheck+"\n"); }
} catch (e) { dump (" *** EXCEPTION\n");}
function Startup(){ if (!InitEditorShell()) return; // Set window location relative to parent window (based on persisted attributes) SetWindowLocation(); // Get all objects that refer to other locations var objects = editorShell.GetLinkedObjects(); // Loop over the nodes that have links: for (var i = 0; i < objects.Count(); i++) { var refobj = objects.GetElementAt(gNumLinksToCheck).QueryInterface(Components.interfaces.nsIURIRefObject); // Loop over the links in this node: if (refobj) { try { var uri; while ((uri = refobj.GetNextURI())) { // Use the real class in netlib: // Note that there may be more than one link per refobj gURIRefObjects[gNumLinksToCheck] = refobj; // Make a new nsIURIChecker gLinksBeingChecked[gNumLinksToCheck] = Components.classes["@mozilla.org/network/urichecker;1"] .createInstance() .QueryInterface(Components.interfaces.nsIURIChecker); // XXX Calling this is related to crash deleting gLinksBeingChecked when dialog is closed // (if this isn't called, no crash) gLinksBeingChecked[gNumLinksToCheck].asyncCheckURI(uri, gRequestObserver, null, Components.interfaces.nsIRequest.LOAD_NORMAL); gNumLinksToCheck++; }; } catch (e) {dump(" Exception ERROR in Link checker. e.result="+e.result+", gNumLinksToCheck="+gNumLinksToCheck+"\n"); } } } // Done with the loop, now we can be prepared for the finish: gStartedAllChecks = true; // Start timer to limit how long we wait for link checking gLinkCheckTimerID = setTimeout("LinkCheckTimeOut()", 5000);}
window.sizeToContent();
function Startup(){ if (!InitEditorShell()) return; // Set window location relative to parent window (based on persisted attributes) SetWindowLocation(); // Get all objects that refer to other locations var objects = editorShell.GetLinkedObjects(); // Loop over the nodes that have links: for (var i = 0; i < objects.Count(); i++) { var refobj = objects.GetElementAt(gNumLinksToCheck).QueryInterface(Components.interfaces.nsIURIRefObject); // Loop over the links in this node: if (refobj) { try { var uri; while ((uri = refobj.GetNextURI())) { // Use the real class in netlib: // Note that there may be more than one link per refobj gURIRefObjects[gNumLinksToCheck] = refobj; // Make a new nsIURIChecker gLinksBeingChecked[gNumLinksToCheck] = Components.classes["@mozilla.org/network/urichecker;1"] .createInstance() .QueryInterface(Components.interfaces.nsIURIChecker); // XXX Calling this is related to crash deleting gLinksBeingChecked when dialog is closed // (if this isn't called, no crash) gLinksBeingChecked[gNumLinksToCheck].asyncCheckURI(uri, gRequestObserver, null, Components.interfaces.nsIRequest.LOAD_NORMAL); gNumLinksToCheck++; }; } catch (e) {dump(" Exception ERROR in Link checker. e.result="+e.result+", gNumLinksToCheck="+gNumLinksToCheck+"\n"); } } } // Done with the loop, now we can be prepared for the finish: gStartedAllChecks = true; // Start timer to limit how long we wait for link checking gLinkCheckTimerID = setTimeout("LinkCheckTimeOut()", 5000);}
if (!LoadSignons()) { return; } LoadReject(); LoadNopreview(); LoadNocapture();
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("hidden", "true"); element = document.getElementById("nocapture"); element.setAttribute("hidden", "true"); } } 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("panel"); element.setAttribute("index","0" ); // hide non-used tabs element = document.getElementById("nopreview"); element.setAttribute("hidden", "true"); element = document.getElementById("nocapture"); element.setAttribute("hidden", "true"); } else if (tab == "W") { element = document.getElementById("signonviewer"); element.setAttribute("title", element.getAttribute("alttitle")); // hide non-used tabs element = document.getElementById("nopreview"); element.selected = true; element = document.getElementById("signonTab"); element.setAttribute("hidden", "true"); element = document.getElementById("signonSitesTab"); element.setAttribute("hidden", "true"); 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();}
try{ document.getElementById("allowWindowOpen").checked = !pref.GetBoolPref("dom.disable_open_during_load"); } catch (e){ document.getElementById("allowWindowOpen").checked = true; } try{ document.getElementById("allowTargetNew").checked = !pref.GetBoolPref("browser.block.target_new_window"); } catch (e){ document.getElementById("allowTargetNew").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") && getPrefValueForCheckbox("capability.policy.default.Window.defaultStatus"); 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");
document.getElementById("allowWindowOpen").checked = getPrefValueForCheckbox("dom.disable_open_during_load"); document.getElementById("allowTargetNew").checked = getPrefValueForCheckbox("browser.block.target_new_window"); document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("dom.disable_window_move_resize"); document.getElementById("allowWindowFlip").checked = getPrefValueForCheckbox("dom.disable_window_flip"); document.getElementById("allowWindowStatusChange").checked = getPrefValueForCheckbox("dom.disable_window_status_change"); document.getElementById("allowImageSrcChange").checked = getPrefValueForCheckbox("dom.disable_image_src_set"); document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("dom.disable_cookie_get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("dom.disable_cookie_set");
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "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){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowWindowOpen").checked = true; } try{ document.getElementById("allowTargetNew").checked = !pref.GetBoolPref("browser.block.target_new_window"); } catch (e){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowTargetNew").checked = true; } //If one of the security capability prefs is set, then the 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") && getPrefValueForCheckbox("capability.policy.default.Window.defaultStatus"); 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 { //not first time it was loaded, get default values from data document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; } javascriptEnabledChange(); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked;
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "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){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowWindowOpen").checked = true; } try{ document.getElementById("allowTargetNew").checked = !pref.GetBoolPref("browser.block.target_new_window"); } catch (e){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowTargetNew").checked = true; } //If one of the security capability prefs is set, then the 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") && getPrefValueForCheckbox("capability.policy.default.Window.defaultStatus"); 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 { //not first time it was loaded, get default values from data document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; } javascriptEnabledChange(); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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;
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "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){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowWindowOpen").checked = true; } try{ document.getElementById("allowTargetNew").checked = !pref.GetBoolPref("browser.block.target_new_window"); } catch (e){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowTargetNew").checked = true; } //If one of the security capability prefs is set, then the 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") && getPrefValueForCheckbox("capability.policy.default.Window.defaultStatus"); 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 { //not first time it was loaded, get default values from data document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; } javascriptEnabledChange(); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
if (document.getElementById("javascriptAllowMailnews"))
if (document.getElementById("javascriptAllowMailnews")) {
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "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){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowWindowOpen").checked = true; } try{ document.getElementById("allowTargetNew").checked = !pref.GetBoolPref("browser.block.target_new_window"); } catch (e){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowTargetNew").checked = true; } //If one of the security capability prefs is set, then the 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") && getPrefValueForCheckbox("capability.policy.default.Window.defaultStatus"); 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 { //not first time it was loaded, get default values from data document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; } javascriptEnabledChange(); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
}
function Startup(){ data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", "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){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowWindowOpen").checked = true; } try{ document.getElementById("allowTargetNew").checked = !pref.GetBoolPref("browser.block.target_new_window"); } catch (e){ //We will only get an error if the preference doesn't exist, when that happens we default to true document.getElementById("allowTargetNew").checked = true; } //If one of the security capability prefs is set, then the 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") && getPrefValueForCheckbox("capability.policy.default.Window.defaultStatus"); 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 { //not first time it was loaded, get default values from data document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; document.getElementById("allowTargetNew").checked = data["allowTargetNew"].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("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked; if (document.getElementById("javascriptAllowMailnews")) document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked; } javascriptEnabledChange(); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); parent.hPrefWindow.registerOKCallbackFunc(doOnOk);}
element = document.getElementById("cookiesTab"); element.hidden = "true";
document.getElementById("dummyContainer").hidden = "true"; document.getElementById("cookiesTab").hidden = "true";
function Startup() { // arguments passed to this routine: // cookieManager // cookieManagerFromIcon // imageManager // xpconnect to cookiemanager/permissionmanager/promptservice/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); promptservice = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptservice = promptservice.QueryInterface(Components.interfaces.nsIPromptService); 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"; element = document.getElementById("btnSession"); 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); kObserverService.addObserver(cookieReloadDisplay, "perm-changed", false);}
window.buttonPrefListener = new nsButtonPrefListener();
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; } if (!startPage) { // Check for window.arguments[0]. If present, use that for 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; } } if (startPage) loadURI(startPage); // Perform default browser checking. checkForDefaultBrowser(); }}
prefwindow = Components.classes['component:
prefwindow = Components.classes['@mozilla.org/prefwindow;1'].getService(Components.interfaces.nsIPrefWindow);
function StartUp(windowName){ dump("\nDoing " + windowName + " startup...\n"); dump("Looking up prefwindow object...\n"); if (prefwindow == null) { dump("Creating prefwindow object...\n"); prefwindow = Components.classes['component://netscape/prefwindow'].getService(Components.interfaces.nsIPrefWindow); } else { dump("prefwindow has already been created! Hurrah!\n"); } if (prefwindow != null && windowName != "Top" && windowName != "Bottom") { prefwindow.panelLoaded(window); }}
var kids = document.getElementById("treechildren"); tree.selectItem(kids);
tree.selectedIndex = 0; } var selectedRegion = window.arguments.length ? window.arguments[1] : null; var list = document.getElementById("regionList"); if (selectedRegion) { var elements = list.getElementsByAttribute("value", selectedRegion); if (elements.length) list.selectedItem = elements[0]; } else { list.selectedIndex = 1;
function Startup(){ doSetOKCancel(onOK); var selectedLanguage = window.arguments.length ? window.arguments[0] : null; var tree = document.getElementById("langList"); if (selectedLanguage) { var elements = tree.getElementsByAttribute("value", selectedLanguage); if (elements.length) tree.selectItem(elements[0].parentNode.parentNode); } else { var kids = document.getElementById("treechildren"); tree.selectItem(kids); }}
var pref;
function Startup(){ // xpconnect to cookieviewer interface cookieviewer = Components.classes["@mozilla.org/cookieviewer/cookieviewer-world;1"].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['@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("style","display: inline;" ); element = document.getElementById("images"); element.setAttribute("style","display: inline;" ); } } catch(e) { } try { var tab = window.arguments[0]; var element2 = document.getElementById("tabcontrol"); if (tab == "0") { element = document.getElementById("cookiesTab"); element2.selectedTab = element; element = document.getElementById("panel"); element.setAttribute("index","0" ); } 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" ); } } catch(e) { } } catch (ex) { dump("failed to get prefs service!\n"); pref = null; } loadCookies(); loadPermissions(); loadImages(); doSetOKCancel(onOK, null); window.sizeToContent();}
prefInt = Components.classes["component: ccm = Components.classes['component:
prefInt = Components.classes["@mozilla.org/preferences;1"]; ccm = Components.classes['@mozilla.org/charset-converter-manager;1'];
function startUp(){ try { prefInt = Components.classes["component://netscape/preferences"]; ccm = Components.classes['component://netscape/charset-converter-manager']; if (ccm) { ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); availCharsetList = ccm.GetDecoderList(); availCharsetList = availCharsetList.QueryInterface(Components.interfaces.nsISupportsArray); if (prefInt) { prefInt = prefInt.getService(); prefInt = prefInt.QueryInterface(Components.interfaces.nsIPref); pref_string = prefInt.getLocalizedUnicharPref("mailnews.view_default_charset"); } } } catch(ex) { dump("failed to get prefs or charset mgr. services!\n"); ccm = null; prefInt = null; } LoadAvailableCharSets();}
SetTextfieldFocus(dialog.urlInput);
SetTextboxFocus(dialog.urlInput);
function Startup(){ if (!InitEditorShell()) return; doSetOKCancel(onOK, onCancel); // Map OK/Cancel to relevant functions // Create dialog object to store controls for easy access dialog = new Object; dialog.urlInput = document.getElementById("urlInput"); dialog.targetInput = document.getElementById("targetInput"); dialog.altInput = document.getElementById("altInput"); dialog.commonInput = document.getElementById("commonInput"); dialog.hsHref = window.arguments[0].getAttribute("hsHref"); if (dialog.hsHref != '') dialog.urlInput.value = dialog.hsHref; dialog.hsAlt = window.arguments[0].getAttribute("hsAlt"); if (dialog.hsAlt != '') dialog.altInput.value = dialog.hsAlt; dialog.hsTarget = window.arguments[0].getAttribute("hsTarget"); if (dialog.hsTarget != ''){ dialog.targetInput.value = dialog.hsTarget; len = dialog.commonInput.length; for (i=0; i<len; i++){ if (dialog.hsTarget == dialog.commonInput.options[i].value) dialog.commonInput.options[i].selected = "true"; } } SetTextfieldFocus(dialog.urlInput); SetWindowLocation();}
gDialog.OkButton = document.documentElement.getButton("accept");
function Startup(){ if (!InitEditorShell()) return; tableElement = editorShell.CreateElementWithDefaults(tagName); if(!tableElement) { dump("Failed to create a new table!\n"); window.close(); return; } gDialog.rowsInput = document.getElementById("rowsInput"); gDialog.columnsInput = document.getElementById("columnsInput"); gDialog.widthInput = document.getElementById("widthInput"); gDialog.borderInput = document.getElementById("borderInput"); gDialog.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 gDialog.rowsInput.value = 2; gDialog.columnsInput.value = 2; // If no default value on the width, set to 100% if (gDialog.widthInput.value.length == 0) { gDialog.widthInput.value = "100"; gDialog.widthPixelOrPercentMenulist.selectedIndex = 1; } SetTextboxFocusById("rowsInput"); SetWindowLocation();}