rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
this.closeBranches( window.arguments[1], window.arguments[2] );
this.openBranch( window.arguments[1], window.arguments[2] );
init: function () { if( window.queuedTag ) { this.onpageload( window.queuedTag ); } if( window.arguments[1] ) this.closeBranches( window.arguments[1], window.arguments[2] ); },
init: function( aSource, aTarget, aDisplayName, aOpeningWith, aStartTime, aOperation ) {
init: function( aSource, aTarget, aDisplayName, aMIMEInfo, aStartTime, aOperation ) {
init: function( aSource, aTarget, aDisplayName, aOpeningWith, aStartTime, aOperation ) { this.source = aSource; this.target = aTarget; this.displayName = aDisplayName; this.openingWith = aOpeningWith; if ( aStartTime ) { this.startTime = aStartTime; } this.operation = aOperation; },
this.openingWith = aOpeningWith;
this.MIMEInfo = aMIMEInfo;
init: function( aSource, aTarget, aDisplayName, aOpeningWith, aStartTime, aOperation ) { this.source = aSource; this.target = aTarget; this.displayName = aDisplayName; this.openingWith = aOpeningWith; if ( aStartTime ) { this.startTime = aStartTime; } this.operation = aOperation; },
sidebar.db = window.arguments[0]; sidebar.resource = window.arguments[1]; debug("sidebar.db = " + sidebar.db + "\n"); debug("sidebar.resource = " + sidebar.resource + "\n");
sidebar.datasource_uri = window.arguments[0]; sidebar.resource = window.arguments[1]; debug("sidebar.datasource_uri = " + sidebar.datasource_uri); debug("sidebar.resource = " + sidebar.resource);
function Init(){ sidebar.db = window.arguments[0]; sidebar.resource = window.arguments[1]; debug("sidebar.db = " + sidebar.db + "\n"); debug("sidebar.resource = " + sidebar.resource + "\n"); // This will load the datasource, if it isn't already. sidebar.datasource = RDF.GetDataSource(sidebar.db); // Add the necessary datasources to the select list var select_list = document.getElementById('selected-panels'); select_list.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. select_list.setAttribute('ref', sidebar.resource); enableButtons();}
sidebar.datasource = RDF.GetDataSource(sidebar.db);
sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri);
function Init(){ sidebar.db = window.arguments[0]; sidebar.resource = window.arguments[1]; debug("sidebar.db = " + sidebar.db + "\n"); debug("sidebar.resource = " + sidebar.resource + "\n"); // This will load the datasource, if it isn't already. sidebar.datasource = RDF.GetDataSource(sidebar.db); // Add the necessary datasources to the select list var select_list = document.getElementById('selected-panels'); select_list.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. select_list.setAttribute('ref', sidebar.resource); enableButtons();}
saveInitialPanels();
function Init(){ sidebar.db = window.arguments[0]; sidebar.resource = window.arguments[1]; debug("sidebar.db = " + sidebar.db + "\n"); debug("sidebar.resource = " + sidebar.resource + "\n"); // This will load the datasource, if it isn't already. sidebar.datasource = RDF.GetDataSource(sidebar.db); // Add the necessary datasources to the select list var select_list = document.getElementById('selected-panels'); select_list.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. select_list.setAttribute('ref', sidebar.resource); enableButtons();}
#ifdef XP_MACOSX window.sizeToContent(); window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5); #endif
function init(aEvent) { if (aEvent.target != document) return; var userAgentField = document.getElementById("userAgent"); userAgentField.value = navigator.userAgent; var button = document.documentElement.getButton("extra2"); button.setAttribute("label", document.documentElement.getAttribute("creditslabel")); button.addEventListener("command", switchPage, false); document.documentElement.getButton("accept").focus();}
if (!window.arguments) {
if (!("arguments" in window)) {
function Init(){ doSetOKCancel(AddAvailableLanguage); try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!window.arguments) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch try { pref_string = parent.hPrefWindow.getPref( "string", "intl.accept_languages"); //fall-back (hard-coded for Beta2, need to move to XUL/DTD) if (!pref_string) pref_string = "en"; } //try catch(ex) { } //catch LoadActiveLanguages(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').value; } //try catch(ex) { } //catch LoadAvailableLanguages(); }}
var RDF = Components.classes[RDFSERVICE_PROGID].getService();
var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService();
function Init(){ debug("directory.js: Init()\n"); var tree = document.getElementById('tree'); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; if (baseURI && (baseURI.indexOf("ftp://") == 0)) { // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI.substr(baseURI.length - 1) != "/") { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } // Note: DON'T add the HTTPIndex datasource into the tree // for file URLs, only do it for FTP URLs; the "rdf:files" // datasources handles file URLs tree.database.AddDataSource(HTTPIndex.DataSource); } // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes[RDFSERVICE_PROGID].getService(); if (RDF) RDF = RDF.QueryInterface(nsIRDFService); if (RDF) { loadingArc = RDF.GetResource(NC_LOADING, true); var httpDS = HTTPIndex.DataSource; if (httpDS) httpDS = httpDS.QueryInterface(nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; // Use a default character set. if (window._content.defaultCharacterset) { httpDS.encoding = window._content.defaultCharacterset; } } } // set window title var theWindow = window._content.parentWindow; if (theWindow) { theWindow.title = baseURI; } tree.database.AddObserver(RDF_observer); debug("Directory: added observer\n"); // root the tree (do this last) tree.setAttribute("ref", baseURI);}
pref.SetDefaultBoolPref('sidebar.open', true);
pref.SetDefaultBoolPref('sidebar.open', false);
function Init() { var pref = Components.classes['component://netscape/preferences']; if (pref) { pref = pref.getService(); } if (pref) { pref = pref.QueryInterface(Components.interfaces.nsIPref); } if (pref) { pref.SetDefaultIntPref('sidebar.width', 170); // pref.SetIntPref(pref.GetIntPref('sidebar.width')); pref.SetDefaultBoolPref('sidebar.open', true); if (pref.GetBoolPref('sidebar.open')) { toggleOpenClose(); } }}
var tree = document.getElementById('tree');
function Init(){ debug("directory.js: Init()\n"); // Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: set encoding for FTP URLs BEFORE setting "ref" HTTPIndex.encoding = "ISO-8859-1"; // re-root the tree tree.setAttribute("ref", baseURI);}
HTTPIndex.encoding = "ISO-8859-1";
function Init(){ debug("directory.js: Init()\n"); // Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: set encoding for FTP URLs BEFORE setting "ref" HTTPIndex.encoding = "ISO-8859-1"; // re-root the tree tree.setAttribute("ref", baseURI);}
var tree = document.getElementById('tree'); var RDF = Components.classes["component: if (RDF) RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); if (RDF) { var httpDS = RDF.GetDataSource("rdf:httpindex"); if (httpDS) httpDS = httpDS.QueryInterface(Components.interfaces.nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; } }
function Init(){ debug("directory.js: Init()\n"); // Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: set encoding for FTP URLs BEFORE setting "ref" HTTPIndex.encoding = "ISO-8859-1"; // re-root the tree tree.setAttribute("ref", baseURI);}
debug("all panels datasources = " + all_panels_datasources); debug("all panels resource = " + all_panels_resource); debug("sidebar.datasource_uri = " + sidebar.datasource_uri); debug("sidebar.resource = " + sidebar.resource);
debug("Init: all panels datasources = " + all_panels_datasources); debug("Init: all panels resource = " + all_panels_resource); debug("Init: sidebar.datasource_uri = " + sidebar.datasource_uri); debug("Init: sidebar.resource = " + sidebar.resource);
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("all panels datasources = " + all_panels_datasources); debug("all panels resource = " + all_panels_resource); debug("sidebar.datasource_uri = " + sidebar.datasource_uri); debug("sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. all_panels.setAttribute('ref', all_panels_resource); current_panels.setAttribute('ref', sidebar.resource); saveInitialPanels(); enableButtonsForCurrentPanels();}
debug("Adding "+all_panels_datasources[ii]);
debug("Init: Adding "+all_panels_datasources[ii]);
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("all panels datasources = " + all_panels_datasources); debug("all panels resource = " + all_panels_resource); debug("sidebar.datasource_uri = " + sidebar.datasource_uri); debug("sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. all_panels.setAttribute('ref', all_panels_resource); current_panels.setAttribute('ref', sidebar.resource); saveInitialPanels(); enableButtonsForCurrentPanels();}
debug("Init: reset current panels ref, "+sidebar.resource);
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("all panels datasources = " + all_panels_datasources); debug("all panels resource = " + all_panels_resource); debug("sidebar.datasource_uri = " + sidebar.datasource_uri); debug("sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. all_panels.setAttribute('ref', all_panels_resource); current_panels.setAttribute('ref', sidebar.resource); saveInitialPanels(); enableButtonsForCurrentPanels();}
rdf_datasource = Components.classes['component:
rdf_datasource = Components.classes['@mozilla.org/rdf/datasource;1?name=xml-datasource'].createInstance();
function Init(){ // Initialize the Sidebar // Install all the datasources named in the Flash Registry into // the tree control. Datasources are listed as members of the // NC:FlashDataSources sequence, and are loaded in the order that // they appear in that sequence. try { // First try to construct a new one and load it // synchronously. nsIRDFService::GetDataSource() loads RDF/XML // asynchronously by default. rdf_datasource = Components.classes['component://netscape/rdf/datasource?name=xml-datasource'].createInstance(); rdf_datasource = rdf_datasource.QueryInterface(Components.interfaces.nsIRDFDataSource); rdf_remote_datasource = rdf_datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); rdf_remote_datasource.Init(RDFFileName); // this will throw if it's already been opened and registered. dump("Reading datasource synchronously.\n"); // read it in synchronously. rdf_remote_datasource.Refresh(true); } catch (ex) { // if we get here, then the RDF/XML has been opened and read // once. We just need to grab the datasource. dump("Datasource already read. Grabbing.\n"); rdf_datasource = RDFService.GetDataSource(RDFFileName); } // Create a 'container' wrapper around the appts_resourcename // resource so we can use some utility routines that make access a // bit easier. // NOT var, so it's global appts_container = Components.classes['component://netscape/rdf/container'].createInstance(); appts_container = appts_container.QueryInterface(Components.interfaces.nsIRDFContainer); appts_resource = RDFService.GetResource(appts_resourcename); appts_container.Init(rdf_datasource, appts_resource);}
appts_container = Components.classes['component:
appts_container = Components.classes['@mozilla.org/rdf/container;1'].createInstance();
function Init(){ // Initialize the Sidebar // Install all the datasources named in the Flash Registry into // the tree control. Datasources are listed as members of the // NC:FlashDataSources sequence, and are loaded in the order that // they appear in that sequence. try { // First try to construct a new one and load it // synchronously. nsIRDFService::GetDataSource() loads RDF/XML // asynchronously by default. rdf_datasource = Components.classes['component://netscape/rdf/datasource?name=xml-datasource'].createInstance(); rdf_datasource = rdf_datasource.QueryInterface(Components.interfaces.nsIRDFDataSource); rdf_remote_datasource = rdf_datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); rdf_remote_datasource.Init(RDFFileName); // this will throw if it's already been opened and registered. dump("Reading datasource synchronously.\n"); // read it in synchronously. rdf_remote_datasource.Refresh(true); } catch (ex) { // if we get here, then the RDF/XML has been opened and read // once. We just need to grab the datasource. dump("Datasource already read. Grabbing.\n"); rdf_datasource = RDFService.GetDataSource(RDFFileName); } // Create a 'container' wrapper around the appts_resourcename // resource so we can use some utility routines that make access a // bit easier. // NOT var, so it's global appts_container = Components.classes['component://netscape/rdf/container'].createInstance(); appts_container = appts_container.QueryInterface(Components.interfaces.nsIRDFContainer); appts_resource = RDFService.GetResource(appts_resourcename); appts_container.Init(rdf_datasource, appts_resource);}
setTimeout("centerOverParent()", 0);
setTimeout(centerOverParent, 0);
function init(){ gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); gPluginTypes = new PluginTypes(); // Initialize the File Type list gPluginTypesList = document.getElementById("pluginTypesList"); gPluginTypesList.treeBoxObject.view = gPluginTypes; var x = document.documentElement.getAttribute("screenX"); if (x == "") setTimeout("centerOverParent()", 0); }
function init(size) {
function init() {
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].alt; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_",""); boxes[i] = id; part = FetchElement("part_"+id); if(document.cookie && part.style.display != 'none') { hide = GetCookie(id); if(hide != '') { switchimg.src = box_img_plus; part.style.display = 'none'; } } HandCursor(switchimg); Switch(switchimg); } }}
else { switchimg.src = box_img_minus; }
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].alt; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_",""); boxes[i] = id; part = FetchElement("part_"+id); if(document.cookie && part.style.display != 'none') { hide = GetCookie(id); if(hide != '') { switchimg.src = box_img_plus; part.style.display = 'none'; } } HandCursor(switchimg); Switch(switchimg); } }}
DWREngine.setErrorHandler(catchFailure); DWREngine.setWarningHandler(DWREngine.defaultMessageHandler);
DWREngine.setErrorHandler(catchFailure); DWREngine.setWarningHandler(catchFailure);
function init(){ DWRUtil.setValue("useragent-real", navigator.userAgent); DWRUtil.setValue("useragent-reported", navigator.userAgent); failures = $("failures"); progress = $("progress"); failreport = $("failreport"); execreport = $("execreport"); DWREngine.setErrorHandler(catchFailure); DWREngine.setWarningHandler(DWREngine.defaultMessageHandler); var rownum = 0; DWRUtil.addRows("chart", tests, [ function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = DWRUtil.toDescriptiveString(row.data); if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function(row) { return "<input type='button' value='Test' onclick='runTest(" + rownum + ")'/>"; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);}
var rownum = 0; DWRUtil.addRows("chart", tests, [ function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = DWRUtil.toDescriptiveString(row.data); if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function(row) { return "<input type='button' value='Test' onclick='runTest(" + rownum + ")'/>"; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);
var rownum = 0; DWRUtil.addRows("chart", tests, [ function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = DWRUtil.toDescriptiveString(row.data); if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function(row) { return "<input type='button' value='Test' onclick='setSettings();runTest(" + rownum + ")'/>"; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);
function init(){ DWRUtil.setValue("useragent-real", navigator.userAgent); DWRUtil.setValue("useragent-reported", navigator.userAgent); failures = $("failures"); progress = $("progress"); failreport = $("failreport"); execreport = $("execreport"); DWREngine.setErrorHandler(catchFailure); DWREngine.setWarningHandler(DWREngine.defaultMessageHandler); var rownum = 0; DWRUtil.addRows("chart", tests, [ function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = DWRUtil.toDescriptiveString(row.data); if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function(row) { return "<input type='button' value='Test' onclick='runTest(" + rownum + ")'/>"; }, function(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);}
function init() {
function init() { helpWindow = document.getElementById("help"); helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-outliner"); helpIndexPanel = document.getElementById("help-index-outliner"); helpGlossaryPanel = document.getElementById("help-glossary-outliner"); helpBrowser = document.getElementById("help-content"); var URI = normalizeURI(decodeURIComponent(window.location.search)); helpFileURI = URI.helpFileURI; var helpTopic = URI.topic; helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1); loadHelpRDF(); displayTopic(helpTopic);
function init(){ // Initialize the Help window // move to right end of screen var width = document.documentElement.getAttribute("width"); var height = document.documentElement.getAttribute("height"); window.moveTo(screen.availWidth-width, (screen.availHeight-height)/2); gBrowser = document.getElementById("help-content"); var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); getWebNavigation().sessionHistory = sessionHistory; // if this is context-sensitive, // then window.location.search contains the "key" (from the top of this file) // that resolves to a particular html document or target if (key[window.location.search]) { dump("loading help content: " + key[window.location.search] + "\n"); loadURI(key[window.location.search]); } else { goHome(); } window.XULBrowserWindow = new nsHelpStatusHandler(); // hook up UI through progress listener var browser = document.getElementById("help-content"); var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow);}
gBrowser = document.getElementById("help-content");
function init(){ // Initialize the Help window // move to right end of screen var width = document.documentElement.getAttribute("width"); var height = document.documentElement.getAttribute("height"); window.moveTo(screen.availWidth-width, (screen.availHeight-height)/2); gBrowser = document.getElementById("help-content"); var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); getWebNavigation().sessionHistory = sessionHistory; // if this is context-sensitive, // then window.location.search contains the "key" (from the top of this file) // that resolves to a particular html document or target if (key[window.location.search]) { dump("loading help content: " + key[window.location.search] + "\n"); loadURI(key[window.location.search]); } else { goHome(); } window.XULBrowserWindow = new nsHelpStatusHandler(); // hook up UI through progress listener var browser = document.getElementById("help-content"); var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow);}
if (key[window.location.search]) { dump("loading help content: " + key[window.location.search] + "\n"); loadURI(key[window.location.search]); } else { goHome(); }
function init(){ // Initialize the Help window // move to right end of screen var width = document.documentElement.getAttribute("width"); var height = document.documentElement.getAttribute("height"); window.moveTo(screen.availWidth-width, (screen.availHeight-height)/2); gBrowser = document.getElementById("help-content"); var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); getWebNavigation().sessionHistory = sessionHistory; // if this is context-sensitive, // then window.location.search contains the "key" (from the top of this file) // that resolves to a particular html document or target if (key[window.location.search]) { dump("loading help content: " + key[window.location.search] + "\n"); loadURI(key[window.location.search]); } else { goHome(); } window.XULBrowserWindow = new nsHelpStatusHandler(); // hook up UI through progress listener var browser = document.getElementById("help-content"); var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow);}
var browser = document.getElementById("help-content"); var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
function init(){ // Initialize the Help window // move to right end of screen var width = document.documentElement.getAttribute("width"); var height = document.documentElement.getAttribute("height"); window.moveTo(screen.availWidth-width, (screen.availHeight-height)/2); gBrowser = document.getElementById("help-content"); var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); getWebNavigation().sessionHistory = sessionHistory; // if this is context-sensitive, // then window.location.search contains the "key" (from the top of this file) // that resolves to a particular html document or target if (key[window.location.search]) { dump("loading help content: " + key[window.location.search] + "\n"); loadURI(key[window.location.search]); } else { goHome(); } window.XULBrowserWindow = new nsHelpStatusHandler(); // hook up UI through progress listener var browser = document.getElementById("help-content"); var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow);}
setTimeout("centerOverParent()", 0);
setTimeout(centerOverParent, 0);
function init(){ gRDF = window.opener.gRDF; gItemRes = window.arguments[0]; gHelperApps = window.opener.gHelperApps; gHandlerPropArc = gHelperApps._handlerPropArc; gExternalAppArc = gHelperApps._externalAppArc; gFileHandlerArc = gHelperApps._fileHandlerArc; gNC_URI = window.opener.NC_URI; var typeField = document.getElementById("typeField"); var str = gHelperApps.getLiteralValue(gItemRes.Value, "FileType"); // XXXben localize! str += " (" + gHelperApps.getLiteralValue(gItemRes.Value, "FileExtensions") + ")"; typeField.value = str; var typeIcon = document.getElementById("typeIcon"); typeIcon.src = gHelperApps.getLiteralValue(gItemRes.Value, "FileIcon"); var handlerGroup = document.getElementById("handlerGroup"); gHandlerRes = gHelperApps.GetTarget(gItemRes, gHandlerPropArc, true); if (gHandlerRes) { gHandlerRes = gHandlerRes.QueryInterface(Components.interfaces.nsIRDFResource); // Custom App Handler Path - this must be set before we set the selected // radio button because the selection event handler for the radio group // requires the extapp handler field to be non-empty for the extapp radio // button to be selected. var gExtAppRes = gHelperApps.GetTarget(gHandlerRes, gExternalAppArc, true); if (gExtAppRes) { gExtAppRes = gExtAppRes.QueryInterface(Components.interfaces.nsIRDFResource); var customAppPath = document.getElementById("customAppPath"); customAppPath.value = gHelperApps.getLiteralValue(gExtAppRes.Value, "path"); } // Selected Action Radiogroup var handleInternal = gHelperApps.getLiteralValue(gHandlerRes.Value, "useSystemDefault"); var saveToDisk = gHelperApps.getLiteralValue(gHandlerRes.Value, "saveToDisk"); if (handleInternal == "true") handlerGroup.selectedItem = document.getElementById("openDefault"); else if (saveToDisk == "true") handlerGroup.selectedItem = document.getElementById("saveToDisk"); else handlerGroup.selectedItem = document.getElementById("openApplication"); gLastSelectedActionItem = handlerGroup.selectedItem; } else { // No Handler/ExtApp Resources for this type for some reason handlerGroup.selectedItem = document.getElementById("openDefault"); } var defaultAppName = document.getElementById("defaultAppName"); var mimeInfo = gHelperApps.getMIMEInfo(gItemRes); defaultAppName.value = mimeInfo.defaultDescription; handlerGroup.focus(); // We don't let users open .exe files or random binary data directly // from the browser at the moment because of security concerns. var mimeType = mimeInfo.MIMEType; if (mimeType == "application/object-stream" || mimeType == "application/x-msdownload") { document.getElementById("openApplication").disabled = true; document.getElementById("openDefault").disabled = true; handlerGroup.selectedItem = document.getElementById("saveToDisk"); } var x = document.documentElement.getAttribute("screenX"); if (x == "") setTimeout("centerOverParent()", 0);}
window.open().close();
gc();
function init(){ var inp = document.getElementsByTagName("input")[0]; countProps(inp); window.open().close(); // force gc? var blurfun = inp.blur; blurfun.__proto__ = null; countProps(blurfun); reportCompare(expect, actual, summary);}
gDelayTestDriverEnd = false; jsTestDriverEnd();
function init(){ var inp = document.getElementsByTagName("input")[0]; countProps(inp); window.open().close(); // force gc? var blurfun = inp.blur; blurfun.__proto__ = null; countProps(blurfun); reportCompare(expect, actual, summary);}
var oObserverService = Components.classes["component:
var oObserverService = Components.classes["@mozilla.org/observer-service;1"].getService();
function Init(){ // Initialize the Related Links panel // Install our navigation observer so we can track the main client window. oContentWindow = window._content; oFrame = document.getElementById('daFrame'); if (oContentWindow && oFrame) { window.setTimeout('window._content.resizeBy(0,1);window._content.resizeBy(0,-1);',0); var oObserverService = Components.classes["component://netscape/observer-service"].getService(); oObserverService = oObserverService.QueryInterface(Components.interfaces.nsIObserverService); oNavObserver = new NavObserver(oFrame,oContentWindow); oNavObserver.TrackContext(''+oContentWindow.location); if (oObserverService && oNavObserver) { oObserverService.AddObserver(oNavObserver, "StartDocumentLoad"); oObserverService.AddObserver(oNavObserver, "EndDocumentLoad"); oObserverService.AddObserver(oNavObserver, "FailDocumentLoad"); debug("added observer\n"); } else { oNavObserver = null; debug("FAILURE to get observer service\n"); } }}
prefInt = Components.classes["@mozilla.org/preferences;1"];
try { prefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); } catch (e) {}
function Init(){ var applicationArea = ""; if ("arguments" in window && window.arguments[0]) applicationArea = window.arguments[0]; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); if (applicationArea == "mailedit") { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); } if (applicationArea == "mailedit") { // mailedit LoadAvailableCharSets("NC:EncodersRoot"); } else { // browser, mailview, composer LoadAvailableCharSets("NC:DecodersRoot"); } LoadActiveCharSets();}
if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref);
if (prefBranch) {
function Init(){ var applicationArea = ""; if ("arguments" in window && window.arguments[0]) applicationArea = window.arguments[0]; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); if (applicationArea == "mailedit") { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); } if (applicationArea == "mailedit") { // mailedit LoadAvailableCharSets("NC:EncodersRoot"); } else { // browser, mailview, composer LoadAvailableCharSets("NC:DecodersRoot"); } LoadActiveCharSets();}
pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title);
pref_string_object = prefBranch.getComplexValue(pref_string_title, Components.interfaces.nsIPrefLocalizedString); pref_string_content = pref_string_object.data;
function Init(){ var applicationArea = ""; if ("arguments" in window && window.arguments[0]) applicationArea = window.arguments[0]; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); if (applicationArea == "mailedit") { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); } if (applicationArea == "mailedit") { // mailedit LoadAvailableCharSets("NC:EncodersRoot"); } else { // browser, mailview, composer LoadAvailableCharSets("NC:DecodersRoot"); } LoadActiveCharSets();}
sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3];
sidebarObj.datasource_uri = window.arguments[2]; sidebarObj.resource = window.arguments[3];
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("Init: all panels datasources = " + all_panels_datasources); debug("Init: all panels resource = " + all_panels_resource); debug("Init: sidebar.datasource_uri = " + sidebar.datasource_uri); debug("Init: sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Init: Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. debug("Init: Adding current panels, "+sidebar.datasource_uri); sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. debug("Init: reset all panels ref, "+all_panels_resource); all_panels.setAttribute('ref', all_panels_resource); debug("Init: reset current panels ref, "+sidebar.resource); current_panels.setAttribute('ref', sidebar.resource); save_initial_panels(); enable_buttons_for_current_panels();}
debug("Init: sidebar.datasource_uri = " + sidebar.datasource_uri); debug("Init: sidebar.resource = " + sidebar.resource);
debug("Init: sidebarObj.datasource_uri = " + sidebarObj.datasource_uri); debug("Init: sidebarObj.resource = " + sidebarObj.resource);
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("Init: all panels datasources = " + all_panels_datasources); debug("Init: all panels resource = " + all_panels_resource); debug("Init: sidebar.datasource_uri = " + sidebar.datasource_uri); debug("Init: sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Init: Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. debug("Init: Adding current panels, "+sidebar.datasource_uri); sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. debug("Init: reset all panels ref, "+all_panels_resource); all_panels.setAttribute('ref', all_panels_resource); debug("Init: reset current panels ref, "+sidebar.resource); current_panels.setAttribute('ref', sidebar.resource); save_initial_panels(); enable_buttons_for_current_panels();}
debug("Init: Adding current panels, "+sidebar.datasource_uri); sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource);
debug("Init: Adding current panels, "+sidebarObj.datasource_uri); sidebarObj.datasource = RDF.GetDataSource(sidebarObj.datasource_uri); current_panels.database.AddDataSource(sidebarObj.datasource);
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("Init: all panels datasources = " + all_panels_datasources); debug("Init: all panels resource = " + all_panels_resource); debug("Init: sidebar.datasource_uri = " + sidebar.datasource_uri); debug("Init: sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Init: Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. debug("Init: Adding current panels, "+sidebar.datasource_uri); sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. debug("Init: reset all panels ref, "+all_panels_resource); all_panels.setAttribute('ref', all_panels_resource); debug("Init: reset current panels ref, "+sidebar.resource); current_panels.setAttribute('ref', sidebar.resource); save_initial_panels(); enable_buttons_for_current_panels();}
debug("Init: reset current panels ref, "+sidebar.resource); current_panels.setAttribute('ref', sidebar.resource);
debug("Init: reset current panels ref, "+sidebarObj.resource); current_panels.setAttribute('ref', sidebarObj.resource);
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("Init: all panels datasources = " + all_panels_datasources); debug("Init: all panels resource = " + all_panels_resource); debug("Init: sidebar.datasource_uri = " + sidebar.datasource_uri); debug("Init: sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Init: Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. debug("Init: Adding current panels, "+sidebar.datasource_uri); sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. debug("Init: reset all panels ref, "+all_panels_resource); all_panels.setAttribute('ref', all_panels_resource); debug("Init: reset current panels ref, "+sidebar.resource); current_panels.setAttribute('ref', sidebar.resource); save_initial_panels(); enable_buttons_for_current_panels();}
httpDS.encoding = window._content.defaultCharacterset;
{ httpDS.encoding = window._content.defaultCharacterset; }
function Init(){ debug("directory.js: Init()\n"); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (RDF) RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); if (RDF) { var httpDS = RDF.GetDataSource("rdf:httpindex"); if (httpDS) httpDS = httpDS.QueryInterface(Components.interfaces.nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; // Use a default character set. if (window._content.defaultCharacterset) httpDS.encoding = window._content.defaultCharacterset; } } // root the tree (do this last) tree.setAttribute("ref", baseURI);}
} var theWindow = window._content.parentWindow; if (theWindow) { theWindow.title = baseURI;
function Init(){ debug("directory.js: Init()\n"); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (RDF) RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); if (RDF) { var httpDS = RDF.GetDataSource("rdf:httpindex"); if (httpDS) httpDS = httpDS.QueryInterface(Components.interfaces.nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; // Use a default character set. if (window._content.defaultCharacterset) httpDS.encoding = window._content.defaultCharacterset; } } // root the tree (do this last) tree.setAttribute("ref", baseURI);}
if (!pref_string) pref_string = "en";
function Init(){ doSetOKCancel(AddAvailableLanguage); try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch try { pref_string = parent.hPrefWindow.getPref( "string", "intl.accept_languages"); //fall-back (hard-coded for Beta2, need to move to XUL/DTD) if (!pref_string) pref_string = "en"; } //try catch(ex) { } //catch LoadActiveLanguages(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label; } //try catch(ex) { } //catch LoadAvailableLanguages(); } SelectLanguage();}
name = document.images[i].name;
name = document.images[i].alt;
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } }}
id = switchimg.id.replace("img_","")
id = switchimg.id.replace("img_","");
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } }}
part = FetchElement("part_"+id)
part = FetchElement("part_"+id);
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } }}
hide = GetCookie(id)
hide = GetCookie(id);
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } }}
switchimg.src = box_img_plus part.style.display = 'none'
switchimg.src = box_img_plus; part.style.display = 'none';
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } }}
HandCursor(switchimg) Switch(switchimg)
HandCursor(switchimg); Switch(switchimg);
function init(size) { for(var i=0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } }}
DWREngine.setTextHtmlHandler(contentFailure);
function init() { failures = $("failures"); failreport = $("failreport"); execreport = $("execreport"); DWREngine.setErrorHandler(catchFailure); DWREngine.setWarningHandler(catchFailure); DWRUtil.addRows("chart", tests, [ function(row, options) { return options.rowNum; }, function(row, options) { return "" + row.code; }, function(row, options) { var display = DWRUtil.toDescriptiveString(row.data); if (display.length > 30) display = display.substring(0, 27) + "..."; return display; }, function(row, options) { return "<input type='button' value='Test' onclick='setSettings();runTest(" + options.rowNum + ")'/>"; }, function(row, options) { return ""; } ], { cellCreator:function(options) { var td = document.createElement("td"); td.setAttribute("id", "t" + options.rowNum + cellNumIdSuffix[options.cellNum]); return td; } });}
prefInt = Components.classes["component:
prefInt = Components.classes["@mozilla.org/preferences;1"];
function Init(){ doSetOKCancel(Save); var applicationArea = new String(); dump("*** pref-charset.js, Init()\n"); try { if (window.arguments && window.arguments[0]) { applicationArea = window.arguments[0]; } else { dump("*** no window arguments!\n"); } //if } //try catch(ex) { dump("*** failed reading arguments\n"); } try { prefInt = Components.classes["component://netscape/preferences"]; if (prefInt) { prefInt = prefInt.getService(); prefInt = prefInt.QueryInterface(Components.interfaces.nsIPref); if (applicationArea.indexOf("mail") != -1) { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } dump("*** " + pref_string_title + " \n"); pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); dump("*** Charset PrefString: " + pref_string_content + "\n"); } } catch(ex) { dump("failed to get prefs services!\n"); prefInt = null; } try { 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); availCharsetList.sort; } } catch(ex) { dump("failed to get charset mgr. services!\n"); ccm = null; } LoadAvailableCharSets(); LoadActiveCharSets();}
ccm = Components.classes['component:
ccm = Components.classes['@mozilla.org/charset-converter-manager;1'];
function Init(){ doSetOKCancel(Save); var applicationArea = new String(); dump("*** pref-charset.js, Init()\n"); try { if (window.arguments && window.arguments[0]) { applicationArea = window.arguments[0]; } else { dump("*** no window arguments!\n"); } //if } //try catch(ex) { dump("*** failed reading arguments\n"); } try { prefInt = Components.classes["component://netscape/preferences"]; if (prefInt) { prefInt = prefInt.getService(); prefInt = prefInt.QueryInterface(Components.interfaces.nsIPref); if (applicationArea.indexOf("mail") != -1) { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } dump("*** " + pref_string_title + " \n"); pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); dump("*** Charset PrefString: " + pref_string_content + "\n"); } } catch(ex) { dump("failed to get prefs services!\n"); prefInt = null; } try { 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); availCharsetList.sort; } } catch(ex) { dump("failed to get charset mgr. services!\n"); ccm = null; } LoadAvailableCharSets(); LoadActiveCharSets();}
function createNumCell(row)
function(row)
function init(){ DWRUtil.setValue("useragent-real", navigator.userAgent); DWRUtil.setValue("useragent-reported", navigator.userAgent); DWREngine.setErrorHandler(DWREngine.defaultMessageHandler); DWREngine.setWarningHandler(DWREngine.defaultMessageHandler); var rownum = 0; DWRUtil.drawTable("chart", tests, [ function createNumCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function createCodeCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function createDataCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = "" + row.data; if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function createResultsCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);}
function createCodeCell(row)
function(row)
function init(){ DWRUtil.setValue("useragent-real", navigator.userAgent); DWRUtil.setValue("useragent-reported", navigator.userAgent); DWREngine.setErrorHandler(DWREngine.defaultMessageHandler); DWREngine.setWarningHandler(DWREngine.defaultMessageHandler); var rownum = 0; DWRUtil.drawTable("chart", tests, [ function createNumCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function createCodeCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function createDataCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = "" + row.data; if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function createResultsCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);}
function createDataCell(row)
function(row)
function init(){ DWRUtil.setValue("useragent-real", navigator.userAgent); DWRUtil.setValue("useragent-reported", navigator.userAgent); DWREngine.setErrorHandler(DWREngine.defaultMessageHandler); DWREngine.setWarningHandler(DWREngine.defaultMessageHandler); var rownum = 0; DWRUtil.drawTable("chart", tests, [ function createNumCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function createCodeCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function createDataCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = "" + row.data; if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function createResultsCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);}
function createResultsCell(row)
function(row)
function init(){ DWRUtil.setValue("useragent-real", navigator.userAgent); DWRUtil.setValue("useragent-reported", navigator.userAgent); DWREngine.setErrorHandler(DWREngine.defaultMessageHandler); DWREngine.setWarningHandler(DWREngine.defaultMessageHandler); var rownum = 0; DWRUtil.drawTable("chart", tests, [ function createNumCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-num"); td.innerHTML = "" + rownum; return td; }, function createCodeCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-code"); td.innerHTML = "" + row.code; return td; }, function createDataCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-data"); var display = "" + row.data; if (display.length > 30) { display = display.substring(0, 27) + "..."; } td.innerHTML = display; return td; }, function createResultsCell(row) { var td = document.createElement("td"); td.setAttribute("id", "t" + rownum + "-results"); td.innerHTML = ""; rownum++; return td; } ]);}
if (params.length >= 4)
if (arrayHasElementAt(params, 3))
function Init(){ gType = document.getElementById("czURLType"); gServer = document.getElementById("czServer"); gServerNeedPass = document.getElementById("czServerNeedPass"); gServerAlso = document.getElementById("czServerAlso"); gChannel = document.getElementById("czChannel"); gChannelIsNick = document.getElementById("czChannelIsNick"); gChannelNeedKey = document.getElementById("czChannelNeedKey"); if ("arguments" in window && window.arguments[0]) gData = window.arguments[0]; if (! gData) gData = new Object(); if (!("url" in gData) || !gData.url) gData.url = "irc:///"; if (gData.url == "irc:" || gData.url == "irc:/" || gData.url == "irc://") { gType.selectedIndex = 1; } else { gType.selectedIndex = 0; gChannelIsNick.selectedIndex = 0; // Split it up into server/channel parts... var params = gData.url.match(/^irc:\/\/(.*)\/([^,]*)(.*)?$/); gServer.value = params[1]; gChannel.value = params[2]; gServerAlso.checked = (gChannel.value != ''); if (params.length >= 4) { var modifiers = params[3].split(/,/); for (m in modifiers) { if (modifiers[m] == 'needpass') gServerNeedPass.checked = true; if (modifiers[m] == 'isnick') gChannelIsNick.selectedIndex = 1; if (modifiers[m] == 'needkey') gChannelNeedKey.checked = true; } } } updateType(); gData.ok = false;}
if (applicationArea.indexOf("mail") != -1) {
if (applicationArea == "mailedit") {
function Init(){ var applicationArea = ""; if ("arguments" in window && window.arguments[0]) applicationArea = window.arguments[0]; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); if (applicationArea.indexOf("mail") != -1) { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); } if (applicationArea.indexOf("mail") != -1) { // mailedit LoadAvailableCharSets("NC:EncodersRoot"); } else { // browser, mailview, composer LoadAvailableCharSets("NC:DecodersRoot"); } LoadActiveCharSets();}
var Tree = document.getElementById("Tree"); Tree.database.AddDataSource(Handler.QueryInterface(Components.interfaces.nsIRDFDataSource));
function Init(){ // Initialize the Related Links panel // Create a Related Links handler, and install it in the tree var Tree = document.getElementById("Tree"); Tree.database.AddDataSource(Handler.QueryInterface(Components.interfaces.nsIRDFDataSource)); // Install the observer so we'll be notified when new content is loaded. var ObserverService = Components.classes["component://netscape/observer-service"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { ObserverService.AddObserver(Observer, "StartDocumentLoad"); ObserverService.AddObserver(Observer, "EndDocumentLoad"); ObserverService.AddObserver(Observer, "FailDocumentLoad"); debug("added observer\n"); } else { debug("FAILURE to get observer service\n"); } if (ContentWindow) { refetchRelatedLinks(Handler, ContentWindow.location); }}
var ObserverService = Components.classes["component: ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { ObserverService.AddObserver(Observer, "StartDocumentLoad"); ObserverService.AddObserver(Observer, "EndDocumentLoad"); ObserverService.AddObserver(Observer, "FailDocumentLoad"); debug("added observer\n"); } else { debug("FAILURE to get observer service\n"); }
oContentWindow = window._content; oFrame = document.getElementById('daFrame');
function Init(){ // Initialize the Related Links panel // Create a Related Links handler, and install it in the tree var Tree = document.getElementById("Tree"); Tree.database.AddDataSource(Handler.QueryInterface(Components.interfaces.nsIRDFDataSource)); // Install the observer so we'll be notified when new content is loaded. var ObserverService = Components.classes["component://netscape/observer-service"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { ObserverService.AddObserver(Observer, "StartDocumentLoad"); ObserverService.AddObserver(Observer, "EndDocumentLoad"); ObserverService.AddObserver(Observer, "FailDocumentLoad"); debug("added observer\n"); } else { debug("FAILURE to get observer service\n"); } if (ContentWindow) { refetchRelatedLinks(Handler, ContentWindow.location); }}
if (ContentWindow) { refetchRelatedLinks(Handler, ContentWindow.location);
if (oContentWindow && oFrame) { window.setTimeout('window._content.resizeBy(0,1);window._content.resizeBy(0,-1);',0); var oObserverService = Components.classes["component: oObserverService = oObserverService.QueryInterface(Components.interfaces.nsIObserverService); oNavObserver = new NavObserver(oFrame,oContentWindow); oNavObserver.TrackContext(''+oContentWindow.location); if (oObserverService && oNavObserver) { oObserverService.AddObserver(oNavObserver, "StartDocumentLoad"); oObserverService.AddObserver(oNavObserver, "EndDocumentLoad"); oObserverService.AddObserver(oNavObserver, "FailDocumentLoad"); debug("added observer\n"); } else { oNavObserver = null; debug("FAILURE to get observer service\n"); }
function Init(){ // Initialize the Related Links panel // Create a Related Links handler, and install it in the tree var Tree = document.getElementById("Tree"); Tree.database.AddDataSource(Handler.QueryInterface(Components.interfaces.nsIRDFDataSource)); // Install the observer so we'll be notified when new content is loaded. var ObserverService = Components.classes["component://netscape/observer-service"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { ObserverService.AddObserver(Observer, "StartDocumentLoad"); ObserverService.AddObserver(Observer, "EndDocumentLoad"); ObserverService.AddObserver(Observer, "FailDocumentLoad"); debug("added observer\n"); } else { debug("FAILURE to get observer service\n"); } if (ContentWindow) { refetchRelatedLinks(Handler, ContentWindow.location); }}
cancelbutton.setAttribute("default", "true");
function init() { var updateBundle = document.getElementById("updateBundle"); var incompatibleItems = document.getElementById("incompatibleItems"); var items = window.arguments[0]; for (var i = 0; i < items.length; ++i) { var listitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "listitem"); var itemName = updateBundle.getFormattedString("updateName", [items[i].name, items[i].version]); listitem.setAttribute("label", itemName); incompatibleItems.appendChild(listitem); } var closebuttonlabel = document.documentElement.getAttribute("closebuttonlabel"); var cancelbutton = document.documentElement.getButton("cancel"); cancelbutton.label = closebuttonlabel; cancelbutton.focus();}
var sel = document.getElementsByTagName("select")[0]; sel.add(document.createElement('foo'), <bar/>);
try { var sel = document.getElementsByTagName("select")[0]; sel.add(document.createElement('foo'), <bar/>); } catch(ex) { printStatus(ex + ''); }
function init(){ var sel = document.getElementsByTagName("select")[0]; sel.add(document.createElement('foo'), <bar/>); TEST(1, expect, actual); END();}
gDelayTestDriverEnd = false; jsTestDriverEnd();
function init(){ var sel = document.getElementsByTagName("select")[0]; sel.add(document.createElement('foo'), <bar/>); TEST(1, expect, actual); END();}
extensionHomepage.setAttribute("onclick", "loadHomepage(\"" + homepage + "\");");
extensionHomepage.setAttribute("homepageURL", homepage);
function init(){ gExtensionID = window.arguments[0]; gExtensionDB = window.arguments[1]; var extensionsStrings = document.getElementById("extensionsStrings"); var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var extension = rdfs.GetResource(gExtensionID); // Name var nameArc = rdfs.GetResource(EM_NS("name")); var name = gExtensionDB.GetTarget(extension, nameArc, true); name = name.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Version var versionArc = rdfs.GetResource(EM_NS("version")); var version = gExtensionDB.GetTarget(extension, versionArc, true); version = version.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Description var descriptionArc = rdfs.GetResource(EM_NS("description")); var description = gExtensionDB.GetTarget(extension, descriptionArc, true); if (description) description = description.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Home Page URL var homepageArc = rdfs.GetResource(EM_NS("homepageURL")); var homepage = gExtensionDB.GetTarget(extension, homepageArc, true); if (homepage) { homepage = homepage.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // only allow http(s) homepages var scheme = ""; var uri = null; try { uri = makeURI(homepage); scheme = uri.scheme; } catch (ex) {} if (uri && (scheme == "http" || scheme == "https")) homepage = uri.spec; else homepage = null; } // Creator var creatorArc = rdfs.GetResource(EM_NS("creator")); var creator = gExtensionDB.GetTarget(extension, creatorArc, true); if (creator) creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; document.title = extensionsStrings.getFormattedString("aboutWindowTitle", [name]); var extensionName = document.getElementById("extensionName"); extensionName.setAttribute("value", name); var extensionVersion = document.getElementById("extensionVersion"); extensionVersion.setAttribute("value", extensionsStrings.getFormattedString("aboutWindowVersionString", [version])); var extensionDescription = document.getElementById("extensionDescription"); extensionDescription.appendChild(document.createTextNode(description)); var extensionCreator = document.getElementById("extensionCreator"); extensionCreator.setAttribute("value", creator); var extensionHomepage = document.getElementById("extensionHomepage"); if (homepage) { extensionHomepage.setAttribute("onclick", "loadHomepage(\"" + homepage + "\");"); extensionHomepage.setAttribute("tooltiptext", homepage); } else extensionHomepage.hidden = true; var sectionProps = [["developersBox", "developer", "extensionDevelopers"], ["translatorsBox", "translator", "extensionTranslators"], ["contributorsBox", "contributor", "extensionContributors"]]; for (var i = 0; i < sectionProps.length; ++i) { var node = document.getElementById(sectionProps[i][0]); var arc = rdfs.GetResource(EM_NS(sectionProps[i][1])); var targets = gExtensionDB.GetTargets(extension, arc, true); if (!(targets.hasMoreElements())) document.getElementById(sectionProps[i][2]).hidden = true; else { while (targets.hasMoreElements()) { var literalValue = targets.getNext().QueryInterface(Components.interfaces.nsIRDFLiteral).Value; var label = document.createElement("label"); label.setAttribute("value", literalValue); label.setAttribute("class", "contributor"); node.appendChild(label); } } } var acceptButton = document.documentElement.getButton("accept"); acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");}
doSetOKCancel(Save);
function Init(){ doSetOKCancel(Save); var applicationArea = ""; if ("arguments" in window && window.arguments[0]) applicationArea = window.arguments[0]; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); if (applicationArea.indexOf("mail") != -1) { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); } LoadAvailableCharSets(); LoadActiveCharSets();}
saveInitialPanels(); enableButtonsForCurrentPanels();
save_initial_panels(); enable_buttons_for_current_panels();
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebar.datasource_uri = window.arguments[2]; sidebar.resource = window.arguments[3]; debug("Init: all panels datasources = " + all_panels_datasources); debug("Init: all panels resource = " + all_panels_resource); debug("Init: sidebar.datasource_uri = " + sidebar.datasource_uri); debug("Init: sidebar.resource = " + sidebar.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Init: Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. debug("Init: Adding current panels, "+sidebar.datasource_uri); sidebar.datasource = RDF.GetDataSource(sidebar.datasource_uri); current_panels.database.AddDataSource(sidebar.datasource); // Root the customize dialog at the correct place. debug("Init: reset all panels ref, "+all_panels_resource); all_panels.setAttribute('ref', all_panels_resource); debug("Init: reset current panels ref, "+sidebar.resource); current_panels.setAttribute('ref', sidebar.resource); saveInitialPanels(); enableButtonsForCurrentPanels();}
var tree = document.getElementById("Tree"); if (tree) { var rdf = Components.classes["component: if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf) { rootNode = rdf.GetResource("NC:LastSearchRoot", true); textArc = rdf.GetResource("http: tree.database.AddObserver(RDF_observer); } }
function Init(){ // Initialize the Search panel}
prefs = Components.classes['component:
prefs = Components.classes['@mozilla.org/preferences;1'];
function init_sidebar(name, uri, width) { sidebar_name = name; sidebar_uri = uri; sidebar_width = width; sidebar_pref = 'sidebar.' + name; // Open/close sidebar based on saved pref. // This may be replaced by another system by hyatt. prefs = Components.classes['component://netscape/preferences']; if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { // The sidebar is closed by default, so open it only if the // preference is set to true. try { if (prefs.GetBoolPref(sidebar_pref + '.open')) { toggle_open_close(); } } catch (ex) { dump("failed to get sidebar_pref\n"); } }}
var ary = aliasDefs[i].split(/\s*=\s*/); var name = ary[0]; var list = ary[1];
var ary = aliasDefs[i].match(/^(.*?)\s*=\s*(.*)$/); var name = ary[1]; var list = ary[2];
function initAliases(){ var aliasDefs = client.prefs["aliases"]; for (var i = 0; i < aliasDefs.length; ++i) { var ary = aliasDefs[i].split(/\s*=\s*/); var name = ary[0]; var list = ary[1]; client.commandManager.defineCommand(name, list); }}
homeCalendar.name = "Home";
var name = srGetStrBundle("chrome: .GetStringFromName("homeCalendarName"); homeCalendar.name = name;
function initCalendarManager(){ var calMgr = getCalendarManager(); var composite = getDisplayComposite(); if (calMgr.getCalendars({}).length == 0) { var homeCalendar = calMgr.createCalendar("storage", makeURL("moz-profile-calendar://")); calMgr.registerCalendar(homeCalendar); // XXX Localize me homeCalendar.name = "Home"; composite.addCalendar(homeCalendar); } calMgr.addObserver(calCalendarManagerObserver); composite.addObserver(calCompositeCalendarObserver, 0); setCalendarManagerUI(); initColors();}
var composite = getDisplayComposite();
var composite = getCompositeCalendar();
function initCalendarManager(){ var calMgr = getCalendarManager(); var composite = getDisplayComposite(); if (calMgr.getCalendars({}).length == 0) { var homeCalendar = calMgr.createCalendar("storage", makeURL("moz-profile-calendar://")); calMgr.registerCalendar(homeCalendar); var name = srGetStrBundle("chrome://calendar/locale/calendar.properties") .GetStringFromName("homeCalendarName"); homeCalendar.name = name; composite.addCalendar(homeCalendar); } calMgr.addObserver(calCalendarManagerObserver); composite.addObserver(calCompositeCalendarObserver); setCalendarManagerUI(); initColors(); var calendarList = document.getElementById("list-calendars-listbox"); calendarList.addEventListener("select", onCalendarListSelect, true); // Set up a pref listener so the proper UI bits can be refreshed when prefs // are changed. var pb2 = prefService.getBranch("").QueryInterface( Components.interfaces.nsIPrefBranch2); pb2.addObserver("calendar.", calPrefObserver, false);}
previousValue = dialog.RowSpanInput.value; dialog.RowSpanInput.value = globalCellElement.getAttribute("rowspan"); dialog.RowSpanCheckbox.checked = AdvancedEditUsed && previousValue != dialog.RowSpanInput.value; previousValue = dialog.ColSpanInput.value; dialog.ColSpanInput.value = globalCellElement.getAttribute("colspan"); dialog.ColSpanCheckbox.checked = AdvancedEditUsed && previousValue != dialog.ColSpanInput.value;
function InitCellPanel(){ // Get cell attributes if (globalCellElement) { // This assumes order of items is Cell, Row, Column dialog.SelectionList.selectedIndex = SelectedCellsType-1; var previousValue = dialog.CellHeightInput.value; dialog.CellHeightInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "height", "CellHeightUnits", gPixel); dialog.CellHeightCheckbox.checked = AdvancedEditUsed && previousValue != dialog.CellHeightInput.value; previousValue= dialog.CellWidthInput.value; dialog.CellWidthInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "width", "CellWidthUnits", gPixel); dialog.CellWidthCheckbox.checked = AdvancedEditUsed && previousValue != dialog.CellWidthInput.value; previousValue = dialog.RowSpanInput.value; dialog.RowSpanInput.value = globalCellElement.getAttribute("rowspan"); dialog.RowSpanCheckbox.checked = AdvancedEditUsed && previousValue != dialog.RowSpanInput.value; previousValue = dialog.ColSpanInput.value; dialog.ColSpanInput.value = globalCellElement.getAttribute("colspan"); dialog.ColSpanCheckbox.checked = AdvancedEditUsed && previousValue != dialog.ColSpanInput.value; var previousIndex = dialog.CellVAlignList.selectedIndex; var valign = globalCellElement.vAlign.toLowerCase(); if (valign == topStr) dialog.CellVAlignList.selectedIndex = 0; else if (valign == bottomStr) dialog.CellVAlignList.selectedIndex = 2; else // Default = middle dialog.CellVAlignList.selectedIndex = 1; dialog.CellVAlignCheckbox.checked = AdvancedEditUsed && previousValue != dialog.CellVAlignList.selectedIndex; previousIndex = dialog.CellHAlignList.selectedIndex; alignWasChar = false; var halign = globalCellElement.align.toLowerCase(); switch (halign) { case centerStr: dialog.CellHAlignList.selectedIndex = 1; break; case rightStr: dialog.CellHAlignList.selectedIndex = 2; break; case justifyStr: dialog.CellHAlignList.selectedIndex = 3; break; case charStr: // We don't support UI for this because layout doesn't work: bug 2212. // Remember that's what they had so we don't change it // unless they change the alignment by using the menulist alignWasChar = true; // Fall through to use show default alignment in menu default: // Default depends on cell type (TH is "center", TD is "left") dialog.CellHAlignList.selectedIndex = (globalCellElement.nodeName.toLowerCase() == "th") ? 1 : 0; break; } dialog.CellHAlignCheckbox.checked = AdvancedEditUsed && previousIndex != dialog.CellHAlignList.selectedIndex; previousIndex = dialog.CellStyleList.selectedIndex; dialog.CellStyleList.selectedIndex = (globalCellElement.nodeName.toLowerCase() == "th") ? 1 : 0; dialog.CellStyleCheckbox.checked = AdvancedEditUsed && previousIndex != dialog.CellStyleList.selectedIndex; previousIndex = dialog.TextWrapList.selectedIndex; dialog.TextWrapList.selectedIndex = globalCellElement.noWrap ? 1 : 0; dialog.TextWrapCheckbox.checked = AdvancedEditUsed && previousIndex != dialog.TextWrapList.selectedIndex; previousValue = CellColor; SetColor("cellBackgroundCW", globalCellElement.bgColor); dialog.CellColorCheckbox.checked = AdvancedEditUsed && CellColor != globalCellElement.bgColor; CellColor = globalCellElement.bgColor; // We want to set this true in case changes came // from Advanced Edit dialog session (must assume something changed) CellDataChanged = true; }}
prefs = Components.classes['component:
prefs = Components.classes['@mozilla.org/preferences;1'];
function InitCharsetMenuCheckMark(){ // dump("msgCompose.compFields is " + msgCompose.compFields.GetCharacterSet() + "\n"); // return if the charset is already set explitily if (currentMailSendCharset != null) { dump("already set to " + currentMailSendCharset + "\n"); return; } var menuitem; // try to get preferences service var prefs = null; try { prefs = Components.classes['component://netscape/preferences']; prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } catch (ex) { dump("failed to get prefs service!\n"); prefs = null; } var send_default_charset = prefs.getLocalizedUnicharPref("mailnews.send_default_charset");// send_default_charset = send_default_charset.toUpperCase(); dump("send_default_charset is " + send_default_charset + "\n"); var compFieldsCharset = msgCompose.compFields.GetCharacterSet();// compFieldsCharset = compFieldsCharset.toUpperCase(); dump("msgCompose.compFields is " + compFieldsCharset + "\n"); if (compFieldsCharset == "us-ascii") compFieldsCharset = "ISO-8859-1"; menuitem = document.getElementById(compFieldsCharset); // charset may have been set implicitly in case of reply/forward if (send_default_charset != compFieldsCharset) { menuitem.setAttribute('checked', 'true'); return; } // use pref default menuitem = document.getElementById(send_default_charset); if (menuitem) menuitem.setAttribute('checked', 'true'); // Set a document charset to a default mail send charset. SetDocumentCharacterSet(send_default_charset);}
var send_default_charset = prefs.CopyCharPref("mailnews.send_default_charset");
var send_default_charset = prefs.getLocalizedUnicharPref("mailnews.send_default_charset");
function InitCharsetMenuCheckMark(){ // dump("msgCompose.compFields is " + msgCompose.compFields.GetCharacterSet() + "\n"); // return if the charset is already set explitily if (currentMailSendCharset != null) { dump("already set to " + currentMailSendCharset + "\n"); return; } var menuitem; // try to get preferences service var prefs = null; try { prefs = Components.classes['component://netscape/preferences']; prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } catch (ex) { dump("failed to get prefs service!\n"); prefs = null; } var send_default_charset = prefs.CopyCharPref("mailnews.send_default_charset");// send_default_charset = send_default_charset.toUpperCase(); dump("send_default_charset is " + send_default_charset + "\n"); var compFieldsCharset = msgCompose.compFields.GetCharacterSet();// compFieldsCharset = compFieldsCharset.toUpperCase(); dump("msgCompose.compFields is " + compFieldsCharset + "\n"); if (compFieldsCharset == "us-ascii") compFieldsCharset = "ISO-8859-1"; menuitem = document.getElementById(compFieldsCharset); // charset may have been set implicitly in case of reply/forward if (send_default_charset != compFieldsCharset) { menuitem.setAttribute('checked', 'true'); return; } // use pref default menuitem = document.getElementById(send_default_charset); if (menuitem) menuitem.setAttribute('checked', 'true'); // Set a document charset to a default mail send charset. SetDocumentCharacterSet(send_default_charset);}
this.showItem( "context-undo", this.isTextSelected || this.onTextInput ); this.showItem( "context-sep-undo", this.isTextSelected || this.onTextInput ); this.showItem( "context-cut", this.isTextSelected || this.onTextInput ); this.showItem( "context-copy", this.isTextSelected || this.onTextInput ); this.showItem( "context-paste", this.isTextSelected || this.onTextInput ); this.showItem( "context-delete", this.isTextSelected || this.onTextInput ); this.showItem( "context-sep-paste", this.isTextSelected || this.onTextInput ); this.showItem( "context-selectall", this.isTextSelected || this.onTextInput ); this.showItem( "context-sep-selectall", this.isTextSelected );
this.showItem( "context-undo", this.onTextInput ); this.showItem( "context-redo", this.onTextInput ); this.showItem( "context-sep-undo", this.onTextInput ); this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-copy", true ); this.showItem( "context-paste", this.onTextInput ); this.showItem( "context-delete", this.onTextInput ); this.showItem( "context-sep-paste", this.onTextInput ); this.showItem( "context-selectall", true ); this.showItem( "context-sep-selectall", this.isTextSelected && !this.onTextInput );
initClipboardItems : function () { // Copy depends on whether there is selected text. // Enabling this context menu item is now done through the global // command updating system // this.setItemAttr( "context-copy", "disabled", !this.isTextSelected() ); goUpdateGlobalEditMenuItems(); this.showItem( "context-undo", this.isTextSelected || this.onTextInput ); this.showItem( "context-sep-undo", this.isTextSelected || this.onTextInput ); this.showItem( "context-cut", this.isTextSelected || this.onTextInput ); this.showItem( "context-copy", this.isTextSelected || this.onTextInput ); this.showItem( "context-paste", this.isTextSelected || this.onTextInput ); this.showItem( "context-delete", this.isTextSelected || this.onTextInput ); this.showItem( "context-sep-paste", this.isTextSelected || this.onTextInput ); this.showItem( "context-selectall", this.isTextSelected || this.onTextInput ); this.showItem( "context-sep-selectall", this.isTextSelected ); // XXX dr // ------ // nsDocumentViewer.cpp has code to determine whether we're // on a link or an image. we really ought to be using that... // Copy email link depends on whether we're on an email link. this.showItem( "context-copyemail", this.onMailtoLink ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); this.showItem( "context-sep-copylink", this.onLink ); // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); this.showItem( "context-sep-copyimage", this.onImage ); },
this.showItem( "context-selectall", true ); this.showItem( "context-sep-selectall", this.isTextSelected && !this.onTextInput );
this.showItem( "context-selectall", this.isTextSelected || this.onTextInput ); this.showItem( "context-sep-selectall", this.isTextSelected );
initClipboardItems : function () { // Copy depends on whether there is selected text. // Enabling this context menu item is now done through the global // command updating system // this.setItemAttr( "context-copy", "disabled", !this.isTextSelected() ); goUpdateGlobalEditMenuItems(); this.showItem( "context-undo", this.onTextInput ); this.showItem( "context-sep-undo", this.onTextInput ); this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-copy", this.isTextSelected || this.onTextInput ); this.showItem( "context-paste", this.onTextInput ); this.showItem( "context-delete", this.onTextInput ); this.showItem( "context-sep-paste", this.onTextInput ); this.showItem( "context-selectall", true ); this.showItem( "context-sep-selectall", this.isTextSelected && !this.onTextInput ); // XXX dr // ------ // nsDocumentViewer.cpp has code to determine whether we're // on a link or an image. we really ought to be using that... // Copy email link depends on whether we're on an email link. this.showItem( "context-copyemail", this.onMailtoLink ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); this.showItem( "context-sep-copylink", this.onLink && this.onImage); // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); this.showItem( "context-sep-copyimage", this.onImage ); },
#ifndef XP_UNIX #ifndef XP_OS2
#ifdef CONTEXT_COPY_IMAGE_CONTENTS
initClipboardItems : function () { // Copy depends on whether there is selected text. // Enabling this context menu item is now done through the global // command updating system // this.setItemAttr( "context-copy", "disabled", !this.isTextSelected() ); goUpdateGlobalEditMenuItems(); this.showItem( "context-undo", this.onTextInput ); this.showItem( "context-sep-undo", this.onTextInput ); this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-copy", this.isTextSelected || this.onTextInput ); this.showItem( "context-paste", this.onTextInput ); this.showItem( "context-delete", this.onTextInput ); this.showItem( "context-sep-paste", this.onTextInput ); this.showItem( "context-selectall", !( this.onLink || this.onImage ) ); this.showItem( "context-sep-selectall", this.isTextSelected ); // XXX dr // ------ // nsDocumentViewer.cpp has code to determine whether we're // on a link or an image. we really ought to be using that... // Copy email link depends on whether we're on an email link. this.showItem( "context-copyemail", this.onMailtoLink ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); this.showItem( "context-sep-copylink", this.onLink && this.onImage);#ifndef XP_UNIX#ifndef XP_OS2 // Copy image contents depends on whether we're on an image. this.showItem( "context-copyimage-contents", this.onImage );#endif#endif // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); this.showItem( "context-sep-copyimage", this.onImage ); },
#endif
initClipboardItems : function () { // Copy depends on whether there is selected text. // Enabling this context menu item is now done through the global // command updating system // this.setItemAttr( "context-copy", "disabled", !this.isTextSelected() ); goUpdateGlobalEditMenuItems(); this.showItem( "context-undo", this.onTextInput ); this.showItem( "context-sep-undo", this.onTextInput ); this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-copy", this.isTextSelected || this.onTextInput ); this.showItem( "context-paste", this.onTextInput ); this.showItem( "context-delete", this.onTextInput ); this.showItem( "context-sep-paste", this.onTextInput ); this.showItem( "context-selectall", !( this.onLink || this.onImage ) ); this.showItem( "context-sep-selectall", this.isTextSelected ); // XXX dr // ------ // nsDocumentViewer.cpp has code to determine whether we're // on a link or an image. we really ought to be using that... // Copy email link depends on whether we're on an email link. this.showItem( "context-copyemail", this.onMailtoLink ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); this.showItem( "context-sep-copylink", this.onLink && this.onImage);#ifndef XP_UNIX#ifndef XP_OS2 // Copy image contents depends on whether we're on an image. this.showItem( "context-copyimage-contents", this.onImage );#endif#endif // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); this.showItem( "context-sep-copyimage", this.onImage ); },
this.showItem( "context-copy", this.isTextSelected || this.onTextInput);
this.showItem( "context-copy", this.isContentSelected || this.onTextInput);
initClipboardItems : function () { // Copy depends on whether there is selected text. // Enabling this context menu item is now done through the global // command updating system // this.setItemAttr( "context-copy", "disabled", !this.isTextSelected() ); goUpdateGlobalEditMenuItems(); this.showItem( "context-undo", this.onTextInput ); this.showItem( "context-redo", this.onTextInput ); this.showItem( "context-sep-undo", this.onTextInput ); this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-copy", this.isTextSelected || this.onTextInput); this.showItem( "context-paste", this.onTextInput ); this.showItem( "context-delete", this.onTextInput ); this.showItem( "context-sep-paste", this.onTextInput ); this.showItem( "context-selectall", !( this.onLink || this.onImage ) ); this.showItem( "context-sep-selectall", this.isTextSelected && !this.onTextInput ); // In a text area there will be nothing after select all, so we don't want a sep // Otherwise, if there's text selected then there are extra menu items // (search for selection and view selection source), so we do want a sep // XXX dr // ------ // nsDocumentViewer.cpp has code to determine whether we're // on a link or an image. we really ought to be using that... // Copy email link depends on whether we're on an email link. this.showItem( "context-copyemail", this.onMailtoLink ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); this.showItem( "context-sep-copylink", this.onLink ); // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); this.showItem( "context-sep-copyimage", this.onImage ); },
this.showItem( "context-sep-selectall", this.isTextSelected && !this.onTextInput );
this.showItem( "context-sep-selectall", this.isContentSelected && !this.onTextInput );
initClipboardItems : function () { // Copy depends on whether there is selected text. // Enabling this context menu item is now done through the global // command updating system // this.setItemAttr( "context-copy", "disabled", !this.isTextSelected() ); goUpdateGlobalEditMenuItems(); this.showItem( "context-undo", this.onTextInput ); this.showItem( "context-redo", this.onTextInput ); this.showItem( "context-sep-undo", this.onTextInput ); this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-copy", this.isTextSelected || this.onTextInput); this.showItem( "context-paste", this.onTextInput ); this.showItem( "context-delete", this.onTextInput ); this.showItem( "context-sep-paste", this.onTextInput ); this.showItem( "context-selectall", !( this.onLink || this.onImage ) ); this.showItem( "context-sep-selectall", this.isTextSelected && !this.onTextInput ); // In a text area there will be nothing after select all, so we don't want a sep // Otherwise, if there's text selected then there are extra menu items // (search for selection and view selection source), so we do want a sep // XXX dr // ------ // nsDocumentViewer.cpp has code to determine whether we're // on a link or an image. we really ought to be using that... // Copy email link depends on whether we're on an email link. this.showItem( "context-copyemail", this.onMailtoLink ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); this.showItem( "context-sep-copylink", this.onLink ); // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); this.showItem( "context-sep-copyimage", this.onImage ); },
updateStyleSheetForObject(calendars[j]);
updateStyleSheetForObject(calendars[j], gCachedStyleSheet);
function initColors() { var calendars = getCalendarManager().getCalendars({}); for (var j in calendars) updateStyleSheetForObject(calendars[j]); var categoryPrefBranch = prefService.getBranch("calendar.category.color."); var prefArray = categoryPrefBranch.getChildList("", {}); for (var i = 0; i < prefArray.length; i++) updateStyleSheetForObject(prefArray[i]); // Setup css classes for category colors var catergoryPrefBranch = prefService.getBranch(""); var pbi = catergoryPrefBranch.QueryInterface( Components.interfaces.nsIPrefBranch2); pbi.addObserver("calendar.category.color.", categoryPrefObserver, false); categoryPrefObserver.observe(null, null, "");}
updateStyleSheetForObject(prefArray[i]);
updateStyleSheetForObject(prefArray[i], gCachedStyleSheet);
function initColors() { var calendars = getCalendarManager().getCalendars({}); for (var j in calendars) updateStyleSheetForObject(calendars[j]); var categoryPrefBranch = prefService.getBranch("calendar.category.color."); var prefArray = categoryPrefBranch.getChildList("", {}); for (var i = 0; i < prefArray.length; i++) updateStyleSheetForObject(prefArray[i]); // Setup css classes for category colors var catergoryPrefBranch = prefService.getBranch(""); var pbi = catergoryPrefBranch.QueryInterface( Components.interfaces.nsIPrefBranch2); pbi.addObserver("calendar.category.color.", categoryPrefObserver, false); categoryPrefObserver.observe(null, null, "");}
createDirectoriesList(false);
createDirectoriesList();
function initCompositionAndAddressing(identity){ createDirectoriesList(false); // if we are editing an existing identity, use it...otherwise copy our values from the default identity var addressingIdentity = identity ? identity : gAccount.defaultIdentity; document.getElementById('identity.directoryServer').value = addressingIdentity.directoryServer; document.getElementById('identity.overrideGlobalPref').value = addressingIdentity.overrideGlobalPref; document.getElementById('identity.composeHtml').checked = addressingIdentity.composeHtml; document.getElementById('identity.autoQuote').checked = addressingIdentity.autoQuote; document.getElementById('identity.replyOnTop').value = addressingIdentity.replyOnTop; document.getElementById('identity.sig_bottom').value = addressingIdentity.sigBottom; onInitCompositionAndAddressing(); // am-addressing.js method}
* XXX - console launch hookup requires some work that I'm not sure how to * do.
* XXX - console launch hookup requires some work that I'm not sure * how to do.
function initConsoleListener(){ /** * XXX - console launch hookup requires some work that I'm not sure how to * do. * * 1) ideally, the notification would disappear when the document that had the * error was flushed. how do I know when this happens? All the nsIScriptError * object I get tells me is the URL. Where is it located in the content area? * 2) the notification service should not display chrome script errors. * web developers and users are not interested in the failings of our shitty, * exception unsafe js. One could argue that this should also extend to * the console by default (although toggle-able via setting for chrome authors) * At any rate, no status indication should be given for chrome script * errors. * * As a result I am commenting out this for the moment. * var consoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService); if (consoleService) consoleService.registerListener(consoleListener); */}
* 1) ideally, the notification would disappear when the document that had the * error was flushed. how do I know when this happens? All the nsIScriptError * object I get tells me is the URL. Where is it located in the content area? * 2) the notification service should not display chrome script errors. * web developers and users are not interested in the failings of our shitty, * exception unsafe js. One could argue that this should also extend to * the console by default (although toggle-able via setting for chrome authors) * At any rate, no status indication should be given for chrome script * errors.
* 1) ideally, the notification would disappear when the * document that had the error was flushed. how do I know when * this happens? All the nsIScriptError object I get tells me * is the URL. Where is it located in the content area? * 2) the notification service should not display chrome * script errors. web developers and users are not interested * in the failings of our shitty, exception unsafe js. One * could argue that this should also extend to the console by * default (although toggle-able via setting for chrome * authors) At any rate, no status indication should be given * for chrome script errors.
function initConsoleListener(){ /** * XXX - console launch hookup requires some work that I'm not sure how to * do. * * 1) ideally, the notification would disappear when the document that had the * error was flushed. how do I know when this happens? All the nsIScriptError * object I get tells me is the URL. Where is it located in the content area? * 2) the notification service should not display chrome script errors. * web developers and users are not interested in the failings of our shitty, * exception unsafe js. One could argue that this should also extend to * the console by default (although toggle-able via setting for chrome authors) * At any rate, no status indication should be given for chrome script * errors. * * As a result I am commenting out this for the moment. * var consoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService); if (consoleService) consoleService.registerListener(consoleListener); */}
data.location = window.arguments[0]; data.contentType = window.arguments[1];
data.channel = window.arguments[0]; data.contentType = window.arguments[1]; data.location = data.channel.URI.spec;
function initData() { // Create data object and initialize. data = new Object; data.location = window.arguments[0]; data.contentType = window.arguments[1];}
mSelectEventsByRange = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?)"); mSelectEventsByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?) LIMIT ?");
mSelectEventsByRange = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_end >= ? AND time_start <= ?)"); mSelectEventsByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_end >= ? AND time_start <= ?) LIMIT ?");
initDB: function () { // these are columns that appear in all concrete items; SQLite could use // an "extends" thing like postgresql has const item_base_columns = "hashid, time_created, last_modified, " + "title, priority, flags, location, categories, " + "alarm_data, alarm_time, " + "recur_type, recur_interval, recur_data, recur_end, recur_flags"; try { mDB.createTable ("cal_events", item_base_columns + ", " + "time_start, time_end"); } catch (e) { } try { mDB.createTable ("cal_todos", item_base_columns + ", " + "time_entry, time_due, time_completed, percent_complete"); } catch (e) { } try { mDB.createTable ("cal_recur_exceptions", "item_id, skip_date"); } catch (e) { } try { mDB.createTable ("cal_event_attendees", "event_id, attendee, attendee_status"); } catch (e) { } try { mDB.createTable ("cal_event_attachments", "event_id, attachment_type, attachment_data"); } catch (e) { } try { mDB.executeSimpleSQL ("CREATE INDEX cal_events_hash_idx ON cal_events.hashid"); } catch (e) { } var qs; // event statements mSelectEventByHash = mDB.createStatement ("SELECT * FROM cal_events WHERE hashid = ? LIMIT 1"); mSelectEventByOid = mDB.createStatement ("SELECT * FROM cal_events WHERE oid = ? LIMIT 1"); // this needs to have the range bound like this: start, end, start, start, end, end mSelectEventsByRange = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?)"); mSelectEventsByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?) LIMIT ?"); mDeleteEventByHash = mDB.createStatement ("DELETE FROM cal_events WHERE hashid = ?"); qs = "?"; for (var i = 1; i < EV_COLUMN_COUNTER; i++) qs += ",?"; mInsertEvent = mDB.createStatement ("INSERT INTO cal_events VALUES (" + qs + ")"); // todo statements mSelectTodoByHash = mDB.createStatement ("SELECT * FROM cal_todos WHERE hashid = ? LIMIT 1"); mSelectTodoByOid = mDB.createStatement ("SELECT * from cal_todos WHERE oid = ? LIMIT 1"); mSelectTodosByRange = mDB.createStatement ("SELECT * FROM cal_todos WHERE (time_entry >= ? AND time_entry <= time_end)"); mSelectTodosByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_todos WHERE (time_entry >= ? AND time_entry <= time_end) LIMIT ?"); mDeleteTodoByHash = mDB.createStatement ("DELETE FROM cal_todos WHERE hashid = ?"); qs = "?"; for (var i = 1; i < TODO_COLUMN_COUNTER; i++) qs += ",?"; mInsertTodo = mDB.createStatement ("INSERT INTO cal_todos VALUES (" + qs + ")"); },
this.mDB = dbService.openSpecialDatabase("profile");
if ( "getProfileStorage" in dbService ) { this.mDB = dbService.getProfileStorage("profile"); } else { this.mDB = dbService.openSpecialDatabase("profile"); }
initDB: function() { var sqlTables = { cal_calendars: "id INTEGER PRIMARY KEY, type STRING, uri STRING", cal_calendars_prefs: "id INTEGER PRIMARY KEY, calendar INTEGER, name STRING, value STRING" }; var dbService = Components.classes[kStorageServiceContractID].getService(kStorageServiceIID); this.mDB = dbService.openSpecialDatabase("profile"); for (table in sqlTables) { try { this.mDB.createTable(table, sqlTables[table]); } catch (ex) { dump("error creating table " + table + " -- probably already exists\n"); } } this.mSelectCalendars = createStatement ( this.mDB, "SELECT oid,* FROM cal_calendars"); this.mFindCalendar = createStatement ( this.mDB, "SELECT id FROM cal_calendars WHERE type = :type AND uri = :uri"); this.mRegisterCalendar = createStatement ( this.mDB, "INSERT INTO cal_calendars (type, uri) " + "VALUES (:type, :uri)" ); this.mUnregisterCalendar = createStatement ( this.mDB, "DELETE FROM cal_calendars WHERE id = :id" ); this.mGetPref = createStatement ( this.mDB, "SELECT value FROM cal_calendars_prefs WHERE calendar = :calendar AND name = :name"); this.mDeletePref = createStatement ( this.mDB, "DELETE FROM cal_calendars_prefs WHERE calendar = :calendar AND name = :name"); this.mInsertPref = createStatement ( this.mDB, "INSERT INTO cal_calendars_prefs (calendar, name, value) " + "VALUES (:calendar, :name, :value)"); this.mDeletePrefs = createStatement ( this.mDB, "DELETE FROM cal_calendars_prefs WHERE calendar = :calendar"); },
flags: FILTER_SYSTEM | jsdIFilter.FLAG_ENABLED,
flags: FILTER_SYSTEM | FILTER_ENABLED,
function initDebugger(){ dd ("initDebugger {"); console._continueCodeStack = new Array(); /* top of stack is the default */ /* return code for the most */ /* recent debugTrap(). */ console.scripts = new Object(); /* create the debugger instance */ if (!Components.classes[JSD_CTRID]) throw new BadMojo (ERR_NO_DEBUGGER); console.jsds = Components.classes[JSD_CTRID].getService(jsdIDebuggerService); console.jsds.on(); console.jsds.breakpointHook = console._executionHook; console.jsds.debuggerHook = console._executionHook; console.jsds.debugHook = console._executionHook; console.jsds.errorHook = console._errorHook; console.jsds.scriptHook = console._scriptHook; var venkmanFilter1 = { /* glob based filter goes first, because it's the */ glob: this, /* easiest to match. */ flags: FILTER_SYSTEM | jsdIFilter.FLAG_ENABLED, urlPattern: null, startLine: 0, endLine: 0 }; var venkmanFilter2 = { /* url based filter for XPCOM callbacks that may */ glob: null, /* not happen under our glob. */ flags: FILTER_SYSTEM | jsdIFilter.FLAG_ENABLED, urlPattern: "chrome://venkman/*", startLine: 0, endLine: 0 }; console.jsds.appendFilter (venkmanFilter1); console.jsds.appendFilter (venkmanFilter2); console.throwMode = TMODE_IGNORE; console.errorMode = EMODE_IGNORE; var enumer = { enumerateScript: function _es (script) { realizeScript(script); } }; console.scriptsView.freeze(); console.jsds.enumerateScripts(enumer); console.scriptsView.thaw(); dd ("} initDebugger");}
console.jsds.flags = jsdIDebuggerService.ENABLE_NATIVE_FRAMES;
function initDebugger(){ dd ("initDebugger {"); console.instanceSequence = 0; console._continueCodeStack = new Array(); /* top of stack is the default */ /* return code for the most */ /* recent debugTrap(). */ console.scriptWrappers = new Object(); console.scriptManagers = new Object(); console.breaks = new Object(); console.fbreaks = new Object(); console.sbreaks = new Object(); /* create the debugger instance */ if (!(JSD_CTRID in Components.classes)) throw new BadMojo (ERR_NO_DEBUGGER); console.jsds = Components.classes[JSD_CTRID].getService(jsdIDebuggerService); console.jsds.on(); console.executionHook = { onExecute: jsdExecutionHook }; console.errorHook = { onError: jsdErrorHook }; console.callHook = { onCall: jsdCallHook }; console.jsds.flags = jsdIDebuggerService.ENABLE_NATIVE_FRAMES; console.jsdConsole = console.jsds.wrapValue(console); dispatch ("tmode", {mode: console.prefs["lastThrowMode"]}); dispatch ("emode", {mode: console.prefs["lastErrorMode"]}); var enumer = { enumerateScript: console.scriptHook.onScriptCreated }; console.jsds.scriptHook = console.scriptHook; console.jsds.enumerateScripts(enumer); console.jsds.breakpointHook = console.executionHook; console.jsds.debuggerHook = console.executionHook; console.jsds.debugHook = console.executionHook; console.jsds.errorHook = console.errorHook; dd ("} initDebugger");}
console.jsds.flags = jsdIDebuggerService.ENABLE_NATIVE_FRAMES;
function initDebugger(){ dd ("initDebugger {"); console.instanceSequence = 0; console._continueCodeStack = new Array(); /* top of stack is the default */ /* return code for the most */ /* recent debugTrap(). */ console.scriptWrappers = new Object(); console.scriptManagers = new Object(); console.breaks = new Object(); console.fbreaks = new Object(); console.sbreaks = new Object(); /* create the debugger instance */ if (!(JSD_CTRID in Components.classes)) throw new BadMojo (ERR_NO_DEBUGGER); console.jsds = Components.classes[JSD_CTRID].getService(jsdIDebuggerService); console.jsds.on(); console.executionHook = { onExecute: jsdExecutionHook }; console.errorHook = { onError: jsdErrorHook }; console.callHook = { onCall: jsdCallHook }; console.jsds.flags = jsdIDebuggerService.ENABLE_NATIVE_FRAMES; console.jsdConsole = console.jsds.wrapValue(console); dispatch ("tmode", {mode: console.prefs["lastThrowMode"]}); dispatch ("emode", {mode: console.prefs["lastErrorMode"]}); var enumer = { enumerateScript: console.scriptHook.onScriptCreated }; console.jsds.scriptHook = console.scriptHook; console.jsds.enumerateScripts(enumer); console.jsds.breakpointHook = console.executionHook; console.jsds.debuggerHook = console.executionHook; console.jsds.debugHook = console.executionHook; console.jsds.errorHook = console.errorHook; dd ("} initDebugger");}
console.addPref ("dbgContexts", false); console.addPref ("dbgDispatch", false); console.addPref ("dbgRealize", false); dispatch ("sync-debug");
function initDev(){ var cmdary = [["dumpcontexts", cmdDumpContexts, CMD_CONSOLE | CMD_NO_HELP], ["dumpfilters", cmdDumpFilters, CMD_CONSOLE | CMD_NO_HELP], ["reloadui", cmdReloadUI, CMD_CONSOLE | CMD_NO_HELP], ["testargs", cmdTestArgs, CMD_CONSOLE | CMD_NO_HELP], ["testargs1", cmdTestArgs, CMD_CONSOLE | CMD_NO_HELP], ["testfilters", cmdTestFilters, CMD_CONSOLE | CMD_NO_HELP], ["treetest", cmdTreeTest, CMD_CONSOLE | CMD_NO_HELP], ["multialias", "help pref; help props", CMD_CONSOLE | CMD_NO_HELP]]; defineVenkmanCommands (cmdary); return "Venkman development functions loaded OK.";}
["test", cmdTest, CMD_CONSOLE | CMD_NO_HELP],
function initDev(){ var cmdary = [["dumpcontexts", cmdDumpContexts, CMD_CONSOLE | CMD_NO_HELP], ["dumpfilters", cmdDumpFilters, CMD_CONSOLE | CMD_NO_HELP], ["dumpprofile", cmdDumpProfile, CMD_CONSOLE | CMD_NO_HELP], ["dumptree", cmdDumpTree, CMD_CONSOLE | CMD_NO_HELP], ["dumpscripts", cmdDumpScripts, CMD_CONSOLE | CMD_NO_HELP], ["reloadui", cmdReloadUI, CMD_CONSOLE | CMD_NO_HELP], ["sync-debug", cmdSyncDebug, CMD_CONSOLE | CMD_NO_HELP], ["testargs", cmdTestArgs, CMD_CONSOLE | CMD_NO_HELP], ["testargs1", cmdTestArgs, CMD_CONSOLE | CMD_NO_HELP], ["testfilters", cmdTestFilters, CMD_CONSOLE | CMD_NO_HELP], ["treetest", cmdTreeTest, CMD_CONSOLE | CMD_NO_HELP], ["multialias", "help pref; help props", CMD_CONSOLE | CMD_NO_HELP]]; console.commandManager.defineCommands (cmdary); if (!("devState" in console.pluginState)) { console.prefManager.addPref ("dbgContexts", false); console.prefManager.addPref ("dbgDispatch", false); console.prefManager.addPref ("dbgRealize", false); } console.pluginState.devState = true; dispatch ("sync-debug"); return "Venkman development functions loaded OK.";}
var brandBundle = srGetStrBundle("chrome: if ( brandBundle ) { var product = brandBundle.GetStringFromName( "brandShortName" ); text = text.replace( /#2/, product ); }
initDialog : function () { // "Always ask me" is always set (or else we wouldn't have got here!). document.getElementById( "alwaysAskMe" ).checked = true; // Pre-select the choice the user made last time. if ( this.appLauncher.MIMEInfo.preferredAction != this.nsIHelperAppLauncher.saveToDisk ) { // Run app. document.getElementById( "runApp" ).checked = true; this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler; if ( this.chosenApp ) { // If a user-chosen application, show its path. document.getElementById( "appName" ).value = this.chosenApp.unicodePath; } else { // If a system-specified one, show description. document.getElementById( "appName" ).value = this.appLauncher.MIMEInfo.applicationDescription; } } else { // Save to disk. document.getElementById( "saveToDisk" ).checked = true; // Disable choose app button. document.getElementById( "choseApp" ).setAttribute( "disabled", "true" ); } // Put content type into dialog text. var html = document.getElementById( "intro" ); if ( html && html.childNodes && html.childNodes.length ) { // Get raw text. var text = html.childNodes[ 0 ].nodeValue; // Substitute content type for "#1". text = text.replace( /#1/, this.appLauncher.MIMEInfo.MIMEType ); // Replace text in document. html.childNodes[ 0 ].nodeValue = text; } // Set up dialog button callbacks. var object = this; doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); },
moveToAlertPosition();
initDialog : function () { // "Always ask me" is always set (or else we wouldn't have got here!). document.getElementById( "alwaysAskMe" ).checked = true; // Pre-select the choice the user made last time. if ( this.appLauncher.MIMEInfo.preferredAction != this.nsIHelperAppLauncher.saveToDisk ) { // Run app. document.getElementById( "runApp" ).checked = true; this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler; if ( this.chosenApp ) { // If a user-chosen application, show its path. document.getElementById( "appName" ).value = this.chosenApp.unicodePath; } else { // If a system-specified one, show description. document.getElementById( "appName" ).value = this.appLauncher.MIMEInfo.applicationDescription; } } else { // Save to disk. document.getElementById( "saveToDisk" ).checked = true; // Disable choose app button. document.getElementById( "choseApp" ).setAttribute( "disabled", "true" ); } // Put content type into dialog text. var html = document.getElementById( "intro" ); if ( html && html.childNodes && html.childNodes.length ) { // Get raw text. var text = html.childNodes[ 0 ].nodeValue; // Substitute content type for "#1". text = text.replace( /#1/, this.appLauncher.MIMEInfo.MIMEType ); // Replace #2 with product name. var brandBundle = srGetStrBundle("chrome://global/locale/brand.properties"); if ( brandBundle ) { var product = brandBundle.GetStringFromName( "brandShortName" ); text = text.replace( /#2/, product ); } // Replace text in document. html.childNodes[ 0 ].nodeValue = text; } // Set up dialog button callbacks. var object = this; doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); },
if ( this.appLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk ) {
this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler; if ( this.chosenApp && this.appLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk ) {
initDialog : function () { // "Always ask me" is always set (or else we wouldn't have got here!). document.getElementById( "alwaysAskMe" ).checked = true; document.getElementById( "alwaysAskMe" ).setAttribute( "disabled", "true" ); // Pre-select the choice the user made last time. if ( this.appLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk ) { // Run app. document.getElementById( "runApp" ).checked = true; this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler; var applicationDescription = this.appLauncher.MIMEInfo.applicationDescription; if (applicationDescription != "") document.getElementById( "appName" ).value = applicationDescription; else // If a user-chosen application, show its path. document.getElementById( "appName" ).value = this.chosenApp.unicodePath; } else { // Save to disk. document.getElementById( "saveToDisk" ).checked = true; // Disable choose app button. document.getElementById( "chooseApp" ).setAttribute( "disabled", "true" ); } // Put content type into dialog text. var html = document.getElementById( "intro" ); if ( html && html.childNodes && html.childNodes.length ) { // Get raw text. var text = html.childNodes[ 0 ].nodeValue; // Substitute content type for "#1". text = text.replace( /#1/, this.appLauncher.MIMEInfo.MIMEType ); // Replace #2 with product name. var brandBundle = srGetStrBundle("chrome://global/locale/brand.properties"); if ( brandBundle ) { var product = brandBundle.GetStringFromName( "brandShortName" ); text = text.replace( /#2/, product ); } // Replace text in document. html.childNodes[ 0 ].nodeValue = text; } // Set up dialog button callbacks. var object = this; doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); moveToAlertPosition(); },
document.getElementById( "runApp" ).checked = true; this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler; var applicationDescription = this.appLauncher.MIMEInfo.applicationDescription; if (applicationDescription != "") document.getElementById( "appName" ).value = applicationDescription; else document.getElementById( "appName" ).value = this.chosenApp.unicodePath;
document.getElementById( "runApp" ).checked = true;
initDialog : function () { // "Always ask me" is always set (or else we wouldn't have got here!). document.getElementById( "alwaysAskMe" ).checked = true; document.getElementById( "alwaysAskMe" ).setAttribute( "disabled", "true" ); // Pre-select the choice the user made last time. if ( this.appLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk ) { // Run app. document.getElementById( "runApp" ).checked = true; this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler; var applicationDescription = this.appLauncher.MIMEInfo.applicationDescription; if (applicationDescription != "") document.getElementById( "appName" ).value = applicationDescription; else // If a user-chosen application, show its path. document.getElementById( "appName" ).value = this.chosenApp.unicodePath; } else { // Save to disk. document.getElementById( "saveToDisk" ).checked = true; // Disable choose app button. document.getElementById( "chooseApp" ).setAttribute( "disabled", "true" ); } // Put content type into dialog text. var html = document.getElementById( "intro" ); if ( html && html.childNodes && html.childNodes.length ) { // Get raw text. var text = html.childNodes[ 0 ].nodeValue; // Substitute content type for "#1". text = text.replace( /#1/, this.appLauncher.MIMEInfo.MIMEType ); // Replace #2 with product name. var brandBundle = srGetStrBundle("chrome://global/locale/brand.properties"); if ( brandBundle ) { var product = brandBundle.GetStringFromName( "brandShortName" ); text = text.replace( /#2/, product ); } // Replace text in document. html.childNodes[ 0 ].nodeValue = text; } // Set up dialog button callbacks. var object = this; doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); moveToAlertPosition(); },
} var applicationDescription = this.appLauncher.MIMEInfo.applicationDescription; if (applicationDescription != "") document.getElementById( "appName" ).value = applicationDescription; else if (this.chosenApp) { document.getElementById( "appName" ).value = this.chosenApp.unicodePath;
initDialog : function () { // "Always ask me" is always set (or else we wouldn't have got here!). document.getElementById( "alwaysAskMe" ).checked = true; document.getElementById( "alwaysAskMe" ).setAttribute( "disabled", "true" ); // Pre-select the choice the user made last time. if ( this.appLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk ) { // Run app. document.getElementById( "runApp" ).checked = true; this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler; var applicationDescription = this.appLauncher.MIMEInfo.applicationDescription; if (applicationDescription != "") document.getElementById( "appName" ).value = applicationDescription; else // If a user-chosen application, show its path. document.getElementById( "appName" ).value = this.chosenApp.unicodePath; } else { // Save to disk. document.getElementById( "saveToDisk" ).checked = true; // Disable choose app button. document.getElementById( "chooseApp" ).setAttribute( "disabled", "true" ); } // Put content type into dialog text. var html = document.getElementById( "intro" ); if ( html && html.childNodes && html.childNodes.length ) { // Get raw text. var text = html.childNodes[ 0 ].nodeValue; // Substitute content type for "#1". text = text.replace( /#1/, this.appLauncher.MIMEInfo.MIMEType ); // Replace #2 with product name. var brandBundle = srGetStrBundle("chrome://global/locale/brand.properties"); if ( brandBundle ) { var product = brandBundle.GetStringFromName( "brandShortName" ); text = text.replace( /#2/, product ); } // Replace text in document. html.childNodes[ 0 ].nodeValue = text; } // Set up dialog button callbacks. var object = this; doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); moveToAlertPosition(); },
prompt.setAttribute( "onclick", "dialog.dumpInfo()" );
prompt.setAttribute( "onclick", "dialog.doDebug()" );
initDialog : function() { // Put product brand short name in prompt. var prompt = this.dialogElement( "prompt" ); var modified = this.replaceInsert( prompt.firstChild.nodeValue, 1, this.getString( "brandShortName" ) ); prompt.firstChild.nodeValue = modified; // Put file name in window title. var win = this.dialogElement( "nsHelperAppDlg" ); var url = this.mLauncher.source.QueryInterface( Components.interfaces.nsIURL ); var fname = ""; this.mSourcePath = url.prePath; if ( url ) { // A url, use file name from it. fname = url.fileName; this.mSourcePath += url.directory; } else { // A generic uri, use path. fname = this.mLauncher.source.path; this.mSourcePath += url.path; } var title = this.replaceInsert( win.getAttribute( "title" ), 1, fname ); win.setAttribute( "title", title ); // Put content type and location into intro. this.initIntro(); // Add special debug hook. if ( this.debug ) { var prompt = this.dialogElement( "prompt" ); prompt.setAttribute( "onclick", "dialog.dumpInfo()" ); } // Put explanation into text box. this.initExplanation(); // Set default selection (always the "default"). this.dialogElement( "default" ).checked = true; // If default is not to save to disk, then make that the alternative. if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.saveToDisk ) { this.dialogElement( "saveToDisk" ).checked = true; } else { this.dialogElement( "openUsing" ).checked = true; } // Disable selection under "different action". this.option(); // Set up dialog button callbacks. var object = this; // "this.onOK()" doesn't work ?! this.mDialog.doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); // Position it. if ( this.mDialog.opener ) { this.mDialog.moveToAlertPosition(); } else { this.mDialog.centerWindowOnScreen(); } },
var win = this.dialogElement( "nsHelperAppDlg" );
initDialog : function() { // Put product brand short name in prompt. var prompt = this.dialogElement( "prompt" ); var modified = this.replaceInsert( prompt.firstChild.nodeValue, 1, this.getString( "brandShortName" ) ); prompt.firstChild.nodeValue = modified; // Put file name in window title. var win = this.dialogElement( "nsHelperAppDlg" ); var suggestedFileName = this.mLauncher.suggestedFileName; // Some URIs do not implement nsIURL, so we can't just QI. var url = this.mLauncher.source; var fname = ""; this.mSourcePath = url.prePath; try { url = url.QueryInterface( Components.interfaces.nsIURL ); // A url, use file name from it. fname = url.fileName; this.mSourcePath += url.directory; } catch (ex) { // A generic uri, use path. fname = url.path; this.mSourcePath += url.path; } if (suggestedFileName) fname = suggestedFileName; this.mTitle = this.replaceInsert( win.getAttribute( "title" ), 1, fname); this.mDialog.title = this.mTitle; // Put content type, filename and location into intro. this.initIntro(url, fname); var iconString = "moz-icon://" + fname + "?size=32&contentType=" + this.mLauncher.MIMEInfo.MIMEType; this.dialogElement("contentTypeImage").setAttribute("src", iconString); this.initAppAndSaveToDiskValues(); // Initialize "always ask me" box. This should always be disabled // and set to true for the ambiguous type application/octet-stream. // Same if this dialog was forced var alwaysHandleCheckbox = this.dialogElement( "alwaysHandle" ); if (this.mForced || this.mLauncher.MIMEInfo.MIMEType == "application/octet-stream"){ alwaysHandleCheckbox.checked = false; alwaysHandleCheckbox.disabled = true; } else { alwaysHandleCheckbox.checked = !this.mLauncher.MIMEInfo.alwaysAskBeforeHandling; } // Position it. if ( this.mDialog.opener ) { this.mDialog.moveToAlertPosition(); } else { this.mDialog.sizeToContent(); this.mDialog.centerWindowOnScreen(); } // Set initial focus this.dialogElement( "mode" ).focus(); },
this.mTitle = this.replaceInsert( win.getAttribute( "title" ), 1, fname); this.mDialog.title = this.mTitle;
this.mTitle = this.replaceInsert( this.mDialog.document.title, 1, fname); this.mDialog.document.title = this.mTitle;
initDialog : function() { // Put product brand short name in prompt. var prompt = this.dialogElement( "prompt" ); var modified = this.replaceInsert( prompt.firstChild.nodeValue, 1, this.getString( "brandShortName" ) ); prompt.firstChild.nodeValue = modified; // Put file name in window title. var win = this.dialogElement( "nsHelperAppDlg" ); var suggestedFileName = this.mLauncher.suggestedFileName; // Some URIs do not implement nsIURL, so we can't just QI. var url = this.mLauncher.source; var fname = ""; this.mSourcePath = url.prePath; try { url = url.QueryInterface( Components.interfaces.nsIURL ); // A url, use file name from it. fname = url.fileName; this.mSourcePath += url.directory; } catch (ex) { // A generic uri, use path. fname = url.path; this.mSourcePath += url.path; } if (suggestedFileName) fname = suggestedFileName; this.mTitle = this.replaceInsert( win.getAttribute( "title" ), 1, fname); this.mDialog.title = this.mTitle; // Put content type, filename and location into intro. this.initIntro(url, fname); var iconString = "moz-icon://" + fname + "?size=32&contentType=" + this.mLauncher.MIMEInfo.MIMEType; this.dialogElement("contentTypeImage").setAttribute("src", iconString); this.initAppAndSaveToDiskValues(); // Initialize "always ask me" box. This should always be disabled // and set to true for the ambiguous type application/octet-stream. // Same if this dialog was forced var alwaysHandleCheckbox = this.dialogElement( "alwaysHandle" ); if (this.mForced || this.mLauncher.MIMEInfo.MIMEType == "application/octet-stream"){ alwaysHandleCheckbox.checked = false; alwaysHandleCheckbox.disabled = true; } else { alwaysHandleCheckbox.checked = !this.mLauncher.MIMEInfo.alwaysAskBeforeHandling; } // Position it. if ( this.mDialog.opener ) { this.mDialog.moveToAlertPosition(); } else { this.mDialog.sizeToContent(); this.mDialog.centerWindowOnScreen(); } // Set initial focus this.dialogElement( "mode" ).focus(); },