rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
goUpdateGlobalEditMenuItems();
initClipboardItems : function () { // Select All is always OK. // 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.isNoTextSelected() ); // Items for text areas this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-paste", this.onTextInput ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); },
#ifndef XP_UNIX this.showItem( "context-copyimage-contents", 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.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 && 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 ); },
this.showItem( "context-copy", true );
this.showItem( "context-copy", 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.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 ); // 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 ); },
gResultsTree = document.getElementById("abResultsTree");
gAbResultsTree = document.getElementById('abResultsTree');
function InitCommonJS(){ dirTree = document.getElementById("dirTree"); abList = document.getElementById("addressbookList"); gResultsTree = document.getElementById("abResultsTree");}
gAbResultsTree = document.getElementById('abResultsTree');
gAbResultsTree = document.getElementById("abResultsTree");
function InitCommonJS(){ dirTree = document.getElementById("dirTree"); abList = document.getElementById("addressbookList"); gAbResultsTree = document.getElementById('abResultsTree');}
var consoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService);
function initConsoleListener(){ var consoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService); /** * 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. **/ //if (consoleService) // consoleService.registerListener(consoleListener);}
**/
* var consoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService); if (consoleService) consoleService.registerListener(consoleListener); */
function initConsoleListener(){ var consoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService); /** * 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. **/ //if (consoleService) // consoleService.registerListener(consoleListener);}
var consoleService = nsJSComponentManager.getService("mozilla.consoleservice.1", "nsIConsoleService");
var consoleService = nsJSComponentManager.getService("@mozilla.org/consoleservice;1", "nsIConsoleService");
function initConsoleListener(){ var consoleService = nsJSComponentManager.getService("mozilla.consoleservice.1", "nsIConsoleService"); /** * 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. **/ //if (consoleService) // consoleService.registerListener(consoleListener);}
document.getElementById('identity.fccReplyFollowsParent').checked = copiesAndFoldersIdentity.fccReplyFollowsParent;
function initCopiesAndFolder(identity){ // if we are editing an existing identity, use it...otherwise copy our values from the default identity var copiesAndFoldersIdentity = identity ? identity : gAccount.defaultIdentity; document.getElementById('identity.fccFolder').value = copiesAndFoldersIdentity.fccFolder; document.getElementById('identity.draftFolder').value = copiesAndFoldersIdentity.draftFolder; document.getElementById('identity.stationeryFolder').value = copiesAndFoldersIdentity.stationeryFolder; document.getElementById('identity.fccFolderPickerMode').value = copiesAndFoldersIdentity.fccFolderPickerMode ? copiesAndFoldersIdentity.fccFolderPickerMode : 0; document.getElementById('identity.draftsFolderPickerMode').value = copiesAndFoldersIdentity.draftsFolderPickerMode ? copiesAndFoldersIdentity.draftsFolderPickerMode : 0; document.getElementById('identity.tmplFolderPickerMode').value = copiesAndFoldersIdentity.tmplFolderPickerMode ? copiesAndFoldersIdentity.tmplFolderPickerMode : 0; document.getElementById('identity.doBcc').checked = copiesAndFoldersIdentity.doBcc; document.getElementById('identity.doBccList').value = copiesAndFoldersIdentity.doBccList; document.getElementById('identity.doFcc').checked = copiesAndFoldersIdentity.doFcc; document.getElementById('identity.showSaveMsgDlg').checked = copiesAndFoldersIdentity.showSaveMsgDlg; onInitCopiesAndFolders(); // am-copies.js method}
data.contentDisp = window.arguments[2];
function initData() { // Create data object and initialize. data = new Object; data.channel = window.arguments[0]; data.contentType = window.arguments[1]; // Get location from channel. data.location = data.channel.URI.spec;}
var sqlTables = { cal_calendars: "id INTEGER PRIMARY KEY, name STRING, type STRING, uri STRING", cal_calendars_prefs: "id INTEGER PRIMARY KEY, calendar INTERGER, name STRING, value STRING"
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"
initDB: function() { var sqlTables = { cal_calendars: "id INTEGER PRIMARY KEY, name STRING, type STRING, uri STRING", cal_calendars_prefs: "id INTEGER PRIMARY KEY, calendar INTERGER, name STRING, value STRING" }; var dbService = Components.classes[kStorageServiceContractID].getService(kStorageServiceIID); this.mDB = dbService.getProfileStorage("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 name = :name AND type = :type AND uri = :uri"); this.mRegisterCalendar = createStatement ( this.mDB, "INSERT INTO cal_calendars (name, type, uri) " + "VALUES (:name, :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)"); },
"SELECT id FROM cal_calendars WHERE name = :name AND type = :type AND uri = :uri");
"SELECT id FROM cal_calendars WHERE type = :type AND uri = :uri");
initDB: function() { var sqlTables = { cal_calendars: "id INTEGER PRIMARY KEY, name STRING, type STRING, uri STRING", cal_calendars_prefs: "id INTEGER PRIMARY KEY, calendar INTERGER, name STRING, value STRING" }; var dbService = Components.classes[kStorageServiceContractID].getService(kStorageServiceIID); this.mDB = dbService.getProfileStorage("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 name = :name AND type = :type AND uri = :uri"); this.mRegisterCalendar = createStatement ( this.mDB, "INSERT INTO cal_calendars (name, type, uri) " + "VALUES (:name, :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)"); },
"INSERT INTO cal_calendars (name, type, uri) " + "VALUES (:name, :type, :uri)"
"INSERT INTO cal_calendars (type, uri) " + "VALUES (:type, :uri)"
initDB: function() { var sqlTables = { cal_calendars: "id INTEGER PRIMARY KEY, name STRING, type STRING, uri STRING", cal_calendars_prefs: "id INTEGER PRIMARY KEY, calendar INTERGER, name STRING, value STRING" }; var dbService = Components.classes[kStorageServiceContractID].getService(kStorageServiceIID); this.mDB = dbService.getProfileStorage("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 name = :name AND type = :type AND uri = :uri"); this.mRegisterCalendar = createStatement ( this.mDB, "INSERT INTO cal_calendars (name, type, uri) " + "VALUES (:name, :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)"); },
glob: null,
globalObject: null,
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; console.chromeFilter = { glob: null, flags: FILTER_SYSTEM | FILTER_ENABLED, urlPattern: "chrome:*", startLine: 0, endLine: 0 }; if (console.prefs["enableChromeFilter"]) { console.enableChromeFilter = true; console.jsds.appendFilter(console.chromeFilter); } else console.enableChromeFilter = false; var venkmanFilter1 = { /* glob based filter goes first, because it's the */ glob: this, /* easiest to match. */ flags: FILTER_SYSTEM | FILTER_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 | FILTER_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");}
var venkmanFilter1 = { glob: this,
var venkmanFilter1 = { globalObject: this,
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; console.chromeFilter = { glob: null, flags: FILTER_SYSTEM | FILTER_ENABLED, urlPattern: "chrome:*", startLine: 0, endLine: 0 }; if (console.prefs["enableChromeFilter"]) { console.enableChromeFilter = true; console.jsds.appendFilter(console.chromeFilter); } else console.enableChromeFilter = false; var venkmanFilter1 = { /* glob based filter goes first, because it's the */ glob: this, /* easiest to match. */ flags: FILTER_SYSTEM | FILTER_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 | FILTER_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");}
var venkmanFilter2 = { glob: null,
var venkmanFilter2 = { globalObject: null,
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; console.chromeFilter = { glob: null, flags: FILTER_SYSTEM | FILTER_ENABLED, urlPattern: "chrome:*", startLine: 0, endLine: 0 }; if (console.prefs["enableChromeFilter"]) { console.enableChromeFilter = true; console.jsds.appendFilter(console.chromeFilter); } else console.enableChromeFilter = false; var venkmanFilter1 = { /* glob based filter goes first, because it's the */ glob: this, /* easiest to match. */ flags: FILTER_SYSTEM | FILTER_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 | FILTER_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");}
throw BadMojo (ERR_NO_DEBUGGER);
throw new BadMojo (ERR_NO_DEBUGGER);
function initDebugger(){ console._continueCodeStack = new Array(); /* top of stack is the default */ /* return code for the most */ /* recent debugTrap(). */ console._breakpoints = new Array(); /* breakpoints in loaded scripts. */ console._futureBreaks = new Array(); /* breakpoints in scripts that we */ /* don't know about yet. */ console._scripts = new Object(); /* scripts, keyed by filename. */ console._sources = new Object(); /* source code, keyed by filename. */ console._stopLevel = 0; /* nest level. */ console._scriptCount = 0; /* active script count. */ /* create the debugger instance */ if (!Components.classes[JSD_CTRID]) throw 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.scriptHook = console._scriptHook; //dbg.interruptHook = interruptHooker; var enumer = new Object(); enumer.enumerateScript = function (script) { addScript(script); return true; } console.jsds.enumerateScripts(enumer);}
console.addPref ("dbgContexts", false); console.addPref ("dbgDispatch", false); console.addPref ("dbgRealize", false);
if (!("devState" in console.pluginState)) { console.addPref ("dbgContexts", false); console.addPref ("dbgDispatch", false); console.addPref ("dbgRealize", false); } console.pluginState.devState = true;
function initDev(){ var cmdary = [["dumpcontexts", cmdDumpContexts, CMD_CONSOLE | CMD_NO_HELP], ["dumpfilters", cmdDumpFilters, 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]]; defineVenkmanCommands (cmdary); console.addPref ("dbgContexts", false); console.addPref ("dbgDispatch", false); console.addPref ("dbgRealize", false); dispatch ("sync-debug"); return "Venkman development functions loaded OK.";}
this.mDialog.document.documentElement.getButton("accept").disabled = true; const nsITimer = Components.interfaces.nsITimer; this._timer = Components.classes["@mozilla.org/timer;1"] .createInstance(nsITimer); this._timer.initWithCallback(this, 250, nsITimer.TYPE_ONE_SHOT);
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 suggestedFileName = this.mLauncher.suggestedFileName; // Some URIs do not implement nsIURL, so we can't just QI. var url = this.mLauncher.source.clone(); url.userPass = ""; 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( this.mDialog.document.title, 1, fname); this.mDialog.document.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(); },
win.setAttribute( "title", this.mTitle );
win.document.title = this.mTitle;
initDialog : function() { // Put file name in window title. var win = this.dialogElement( "unknownContentType" ); 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.dialogElement("strings").getFormattedString("title", [fname]); win.setAttribute( "title", this.mTitle ); // Put content type, filename and location into intro. this.initIntro(url, fname); var iconString = "moz-icon://" + fname + "?size=16&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. // We don't also check for application/x-msdownload here since we // want users to be able to autodownload .exe files. var rememberChoice = this.dialogElement("rememberChoice"); if (this.mLauncher.MIMEInfo.MIMEType == "application/octet-stream") { rememberChoice.checked = false; rememberChoice.disabled = true; } else { rememberChoice.checked = !this.mLauncher.MIMEInfo.alwaysAskBeforeHandling; } this.toggleRememberChoice(rememberChoice); // XXXben - menulist won't init properly, hack. var openHandler = this.dialogElement("openHandler"); openHandler.parentNode.removeChild(openHandler); var openParent = this.dialogElement("open").parentNode; openParent.appendChild(openHandler); this.mDialog.setTimeout("dialog.postShowCallback()", 0); },
if (this.mForced ||
if (this.mReason != REASON_CANTHANDLE ||
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 suggestedFileName = this.mLauncher.suggestedFileName; // Some URIs do not implement nsIURL, so we can't just QI. var url = this.mLauncher.source.clone(); url.userPass = ""; 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( this.mDialog.document.title, 1, fname); this.mDialog.document.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.mDialog.document.documentElement.getButton("accept").disabled = true; const nsITimer = Components.interfaces.nsITimer; this._timer = Components.classes["@mozilla.org/timer;1"] .createInstance(nsITimer); this._timer.initWithCallback(this, 250, nsITimer.TYPE_ONE_SHOT); },
case "top": case "center": case "right": case "left": dialog.alignTypeSelect.data = align;
case "top": case "center": case "right": case "left": dialog.alignTypeSelect.value = align;
function InitDialog(){ // Set the controls to the image's attributes var str = globalElement.getAttribute("src"); if (str) { dialog.srcInput.value = str; GetImageFromURL(); } str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; // setup the height and width widgets var width = InitPixelOrPercentMenulist(globalElement, insertNew ? null : imageElement, "width", "widthUnitsMenulist", gPixel); var height = InitPixelOrPercentMenulist(globalElement, insertNew ? null : imageElement, "height", "heightUnitsMenulist", gPixel); // Set actual radio button if both set values are the same as actual if (actualWidth && actualHeight) dialog.actualSizeRadio.checked = (width == actualWidth) && (height == actualHeight); else if ( !(width || height) ) dialog.actualSizeRadio.checked = true; if (!dialog.actualSizeRadio.checked) dialog.customSizeRadio.checked = true; dialog.widthInput.value = constrainWidth = width ? width : (actualWidth ? actualWidth : ""); dialog.heightInput.value = constrainHeight = height ? height : (actualHeight ? actualHeight : ""); // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align = align.toLowerCase(); } var imgClass; var textID; switch ( align ) { case "top": case "center": case "right": case "left": dialog.alignTypeSelect.data = align; break; default: // Default or "bottom" dialog.alignTypeSelect.data = "bottom"; } // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !IsValidImage(dialog.srcInput.value); doOverallEnabling(); doDimensionEnabling();}
default: dialog.alignTypeSelect.data = "bottom";
default: dialog.alignTypeSelect.value = "bottom";
function InitDialog(){ // Set the controls to the image's attributes var str = globalElement.getAttribute("src"); if (str) { dialog.srcInput.value = str; GetImageFromURL(); } str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; // setup the height and width widgets var width = InitPixelOrPercentMenulist(globalElement, insertNew ? null : imageElement, "width", "widthUnitsMenulist", gPixel); var height = InitPixelOrPercentMenulist(globalElement, insertNew ? null : imageElement, "height", "heightUnitsMenulist", gPixel); // Set actual radio button if both set values are the same as actual if (actualWidth && actualHeight) dialog.actualSizeRadio.checked = (width == actualWidth) && (height == actualHeight); else if ( !(width || height) ) dialog.actualSizeRadio.checked = true; if (!dialog.actualSizeRadio.checked) dialog.customSizeRadio.checked = true; dialog.widthInput.value = constrainWidth = width ? width : (actualWidth ? actualWidth : ""); dialog.heightInput.value = constrainHeight = height ? height : (actualHeight ? actualHeight : ""); // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align = align.toLowerCase(); } var imgClass; var textID; switch ( align ) { case "top": case "center": case "right": case "left": dialog.alignTypeSelect.data = align; break; default: // Default or "bottom" dialog.alignTypeSelect.data = "bottom"; } // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !IsValidImage(dialog.srcInput.value); doOverallEnabling(); doDimensionEnabling();}
dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "widthInput","widthPixelOrPercentMenulist"); dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "heightInput","heightPixelOrPercentMenulist");
dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "widthInput","widthPixelOrPercentMenulist", gPercent); dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "heightInput","heightPixelOrPercentMenulist", gPixel);
function InitDialog(){ // Get default attributes set on the created table: // Get the width attribute of the element, stripping out "%" // This sets contents of select combobox list dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "widthInput","widthPixelOrPercentMenulist"); dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "heightInput","heightPixelOrPercentMenulist"); dialog.borderInput.value = globalElement.getAttribute("border");}
dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect");
dialog.widthInput.value = InitPixelOrPercentPopup(globalElement, imageElement, "width", "widthUnitsMenulist"); dialog.heightInput.value = InitPixelOrPercentPopup(globalElement, imageElement, "height", "heightUnitsMenulist");
function InitDialog(){ // Set the controls to the image's attributes str = globalElement.getAttribute("src"); if (str) dialog.srcInput.value = str; str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; if ( SeeMore ) { // setup the height and width widgets dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); // TODO: We need to get the actual image dimensions. // If different from attribute dimensions, then "custom" is checked. // For now, always check custom, so we don't trash existing values if ( dialog.widthInput.value.length && dialog.heightInput.value.length && dialog.widthInput.value != "0" && dialog.heightInput.value != "0") { dialog.isCustomSize = true; dialog.customsizeRadio.checked = true; } else { dialog.isCustomSize = false; dialog.originalsizeRadio.checked = true; } dump("custom size is: "+dialog.isCustomSize+"\n"); // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align = align.toLowerCase(); } switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "right": dialog.alignTypeSelect.selectedIndex = 3; break; case "left": dialog.alignTypeSelect.selectedIndex = 4; break; default: // Default or "bottom" dialog.alignTypeSelect.selectedIndex = 2; break; } } // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !IsValidImage(dialog.srcInput.value); doOverallEnabling();}
var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var index = gDialog.charsetTree.builderView.getIndexOfResource(RDF.GetResource(charset)); if (index >= 0) { var treeBox = gDialog.charsetTree.treeBoxObject; treeBox.selection.select(index); treeBox.ensureRowIsVisible(index); }
function InitDialog() { gDialog.TitleInput.value = editorShell.GetDocumentTitle(); charset = editorShell.GetDocumentCharacterSet();}
ListStyle = "ul";
if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = "";
function InitDialog(){ //TODO: Get the current list style and set in ListStyle variable ListStyle = "ul"; BuildBulletStyleList();/* if(!element) { dump("Failed to get selected element or create a new one!\n"); window.close(); }*/}
dialog.HeadSrcInput.value = editorShell.GetHeadContentsAsHTML();
function InitDialog(){ dialog.TitleInput.value = editorShell.GetDocumentTitle(); dialog.AuthorInput.value = authorElement.getAttribute("content"); dialog.DescriptionInput.value = descriptionElement.getAttribute("content"); // Get the entire contents of the "head" region. dialog.HeadSrcInput.value = editorShell.GetHeadContentsAsHTML();}
dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, imageElement, "width", "widthUnitsMenulist"); dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, imageElement, "height", "heightUnitsMenulist");
dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, imageElement, "width", "widthUnitsMenulist", gPixel); dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, imageElement, "height", "heightUnitsMenulist", gPixel);
function InitDialog(){ // Set the controls to the image's attributes str = globalElement.getAttribute("src"); if (str) dialog.srcInput.value = str; str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; // Check for image map if ( SeeMore ) { // setup the height and width widgets dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, imageElement, "width", "widthUnitsMenulist"); dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, imageElement, "height", "heightUnitsMenulist"); // TODO: We need to get the actual image dimensions. // If different from attribute dimensions, then "custom" is checked. // For now, always check custom, so we don't trash existing values if ( dialog.widthInput.value.length && dialog.heightInput.value.length && dialog.widthInput.value != "0" && dialog.heightInput.value != "0") { dialog.isCustomSize = true; dialog.customsizeRadio.checked = true; } else { dialog.isCustomSize = false; dialog.originalsizeRadio.checked = true; } // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align = align.toLowerCase(); } switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "right": dialog.alignTypeSelect.selectedIndex = 3; break; case "left": dialog.alignTypeSelect.selectedIndex = 4; break; default: // Default or "bottom" dialog.alignTypeSelect.selectedIndex = 2; break; } } // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !IsValidImage(dialog.srcInput.value); doOverallEnabling();}
dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement,"width","pixelOrPercentSelect");
dump("AFTER Calling InitPixelOrPercentMenulist\n");
function InitDialog(){ // Just to be confusing, "size" is used instead of height var height = globalElement.getAttribute("size"); if(!height) { dump("NO SIZE FOUND FOR HLINE"); height = 2; //Default value } // We will use "height" here and in UI dialog.heightInput.value = height; // Get the width attribute of the element, stripping out "%" // This sets contents of combobox (adds pixel and percent option elements) dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement,"width","pixelOrPercentSelect"); align = globalElement.getAttribute("align"); if (align == "center") { dialog.centerAlign.checked = true; } else if (align == "right") { dialog.rightAlign.checked = true; } else { dialog.leftAlign.checked = true; } // This is tricky! Since the "noshade" attribute doesn't have a value, // we can't use getAttribute to figure out if it's set! // This gets the attribute NODE from the attributes NamedNodeMap if (globalElement.attributes.getNamedItem("noshade")) dialog.shading.checked = false; else dialog.shading.checked = true;}
dump("Done with INIT\n");
function InitDialog(){ // Just to be confusing, "size" is used instead of height var height = globalElement.getAttribute("size"); if(!height) { dump("NO SIZE FOUND FOR HLINE"); height = 2; //Default value } // We will use "height" here and in UI dialog.heightInput.value = height; // Get the width attribute of the element, stripping out "%" // This sets contents of combobox (adds pixel and percent option elements) dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement,"width","pixelOrPercentSelect"); align = globalElement.getAttribute("align"); if (align == "center") { dialog.centerAlign.checked = true; } else if (align == "right") { dialog.rightAlign.checked = true; } else { dialog.leftAlign.checked = true; } // This is tricky! Since the "noshade" attribute doesn't have a value, // we can't use getAttribute to figure out if it's set! // This gets the attribute NODE from the attributes NamedNodeMap if (globalElement.attributes.getNamedItem("noshade")) dialog.shading.checked = false; else dialog.shading.checked = true;}
gDialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "width", "widthPixelOrPercentMenulist", gPercent);
gDialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, null, "width", "widthPixelOrPercentMenulist", gPercent);
function InitDialog(){ // Get default attributes set on the created table: // Get the width attribute of the element, stripping out "%" // This sets contents of menu combobox list gDialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "width", "widthPixelOrPercentMenulist", gPercent); gDialog.borderInput.value = globalElement.getAttribute("border");}
pickApp.setAttribute( "value", bundle.GetStringFromName("pick") );
pickApp.setAttribute( "label", bundle.GetStringFromName("pick") );
function initDialog() { // Create dialog object and initialize. dialog = new Object; dialog.contentType = document.getElementById("dialog.contentType"); dialog.more = document.getElementById("dialog.more"); bundle = srGetStrBundle("chrome://global/locale/unknownContent.properties"); var pickApp = document.getElementById("Button2"); pickApp.setAttribute( "style", "display: inherit" ); pickApp.setAttribute( "value", bundle.GetStringFromName("pick") ); var saveButton = document.getElementById("ok"); saveButton.setAttribute( "value", bundle.GetStringFromName("save") ); doSetOKCancel( save, null, pick, null );}
saveButton.setAttribute( "value", bundle.GetStringFromName("save") );
saveButton.setAttribute( "label", bundle.GetStringFromName("save") );
function initDialog() { // Create dialog object and initialize. dialog = new Object; dialog.contentType = document.getElementById("dialog.contentType"); dialog.more = document.getElementById("dialog.more"); bundle = srGetStrBundle("chrome://global/locale/unknownContent.properties"); var pickApp = document.getElementById("Button2"); pickApp.setAttribute( "style", "display: inherit" ); pickApp.setAttribute( "value", bundle.GetStringFromName("pick") ); var saveButton = document.getElementById("ok"); saveButton.setAttribute( "value", bundle.GetStringFromName("save") ); doSetOKCancel( save, null, pick, null );}
dialog.TableHeightInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "height", "TableHeightUnits", gPercent);
function InitDialog(){ // Get Table attributes dialog.TableRowsInput.value = rowCount; dialog.TableColumnsInput.value = colCount; dialog.TableHeightInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "height", "TableHeightUnits", gPercent); dialog.TableWidthInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "width", "TableWidthUnits", gPercent); dialog.BorderWidthInput.value = globalTableElement.border; dialog.SpacingInput.value = globalTableElement.cellSpacing; dialog.PaddingInput.value = globalTableElement.cellPadding; //BUG: The align strings are converted: e.g., "center" becomes "Center"; var halign = globalTableElement.align.toLowerCase(); if (halign == centerStr) dialog.TableAlignList.selectedIndex = 1; else if (halign == bottomStr) dialog.TableAlignList.selectedIndex = 2; else // Default = left dialog.TableAlignList.selectedIndex = 0; // Be sure to get caption from table in doc, not the copied "globalTableElement" TableCaptionElement = TableElement.caption; var index = 0; if (TableCaptionElement) { // Note: Other possible values are "left" and "right", // but "align" is deprecated, so should we even support "botton"? if (TableCaptionElement.vAlign == "bottom") index = 2; else index = 1; } dialog.TableCaptionList.selectedIndex = index; TableColor = globalTableElement.bgColor; SetColor("tableBackgroundCW", TableColor); InitCellPanel();}
dialog.widthInput.value = InitPixelOrPercentPopupButton(globalElement, "width", "pixelOrPercentButton");
dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement,"width","pixelOrPercentSelect");
function InitDialog(){ // Get default attributes set on the created table: // Get the width attribute of the element, stripping out "%" // This sets contents of button text and "percentChar" variable dialog.widthInput.value = InitPixelOrPercentPopupButton(globalElement, "width", "pixelOrPercentButton"); dialog.borderInput.value = globalElement.getAttribute("border");}
window.sizeToContent();
function InitDialog(){ // Get default attributes set on the created table: // Get the width attribute of the element, stripping out "%" // This sets contents of button text and "percentChar" variable dialog.widthInput.value = InitPixelOrPercentPopupButton(globalElement, "width", "pixelOrPercentButton"); dialog.borderInput.value = globalElement.getAttribute("border");}
author = prefs.CopyCharPref("editor.author");
author = prefs.getCharPref("editor.author");
function InitDialog(){ gDialog.TitleInput.value = editorShell.GetDocumentTitle(); var author = TrimString(authorElement.getAttribute("content")); if (author.length == 0) { // Fill in with value from editor prefs var prefs = GetPrefs(); if (prefs) author = prefs.CopyCharPref("editor.author"); } gDialog.AuthorInput.value = author; gDialog.DescriptionInput.value = descriptionElement.getAttribute("content");}
dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "heightInput","heightPixelOrPercentMenulist", gPixel);
function InitDialog(){ // Get default attributes set on the created table: // Get the width attribute of the element, stripping out "%" // This sets contents of menu combobox list dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "widthInput","widthPixelOrPercentMenulist", gPercent); dialog.heightInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "heightInput","heightPixelOrPercentMenulist", gPixel); dialog.borderInput.value = globalElement.getAttribute("border");}
dump("Calling InitPixelOrPercentMenulist\n");
function InitDialog(){ // Just to be confusing, "size" is used instead of height var height = globalElement.getAttribute("size"); if(!height) { dump("NO SIZE FOUND FOR HLINE"); height = 2; //Default value } // We will use "height" here and in UI dialog.heightInput.value = height;dump("Calling InitPixelOrPercentMenulist\n"); // Get the width attribute of the element, stripping out "%" // This sets contents of combobox (adds pixel and percent menuitems elements) dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, hLineElement, "width","pixelOrPercentMenulist");dump("AFTER Calling InitPixelOrPercentMenulist\n"); align = globalElement.getAttribute("align"); if (align == "center") { dialog.centerAlign.checked = true; } else if (align == "right") { dialog.rightAlign.checked = true; } else { dialog.leftAlign.checked = true; } // This is tricky! Since the "noshade" attribute doesn't have a value, // we can't use getAttribute to figure out if it's set! // This gets the attribute NODE from the attributes NamedNodeMap if (globalElement.attributes.getNamedItem("noshade")) dialog.shading.checked = false; else dialog.shading.checked = true;dump("Done with INIT\n");}
dump("AFTER Calling InitPixelOrPercentMenulist\n");
function InitDialog(){ // Just to be confusing, "size" is used instead of height var height = globalElement.getAttribute("size"); if(!height) { dump("NO SIZE FOUND FOR HLINE"); height = 2; //Default value } // We will use "height" here and in UI dialog.heightInput.value = height;dump("Calling InitPixelOrPercentMenulist\n"); // Get the width attribute of the element, stripping out "%" // This sets contents of combobox (adds pixel and percent menuitems elements) dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, hLineElement, "width","pixelOrPercentMenulist");dump("AFTER Calling InitPixelOrPercentMenulist\n"); align = globalElement.getAttribute("align"); if (align == "center") { dialog.centerAlign.checked = true; } else if (align == "right") { dialog.rightAlign.checked = true; } else { dialog.leftAlign.checked = true; } // This is tricky! Since the "noshade" attribute doesn't have a value, // we can't use getAttribute to figure out if it's set! // This gets the attribute NODE from the attributes NamedNodeMap if (globalElement.attributes.getNamedItem("noshade")) dialog.shading.checked = false; else dialog.shading.checked = true;dump("Done with INIT\n");}
dump("Table Editing:InitDialog()\n");
try { rowCount = editorShell.GetTableRowCount(globalTableElement); dialog.TableRowsInput.value = rowCount; colCount = editorShell.GetTableColumnCount(tableGlobatlElement); dialog.TableColumnsInput.value = colCount; } catch (ex) { dump("Failed to get table rows and/or columns count\n"); dialog.TableRowsInput.value = ""; dialog.TableColumnsInput.value = ""; } dialog.TableHeightInput.value = InitPixelOrPercentCombobox(globalTableElement, "height", "TableHeightUnits"); dialog.TableWidthInput.value = InitPixelOrPercentCombobox(globalTableElement, "width", "TableWidthUnits"); dialog.BorderWidthInput.value = globalTableElement.border; dialog.SpacingInput.value = globalTableElement.cellSpacing; dialog.PaddingInput.value = globalTableElement.cellPadding; var halign = globalTableElement.align.toLowerCase(); if (halign == centerStr) dialog.TableAlignSelect.selectedIndex = 1; else if (halign == bottomStr) dialog.TableAlignSelect.selectedIndex = 2; else dialog.TableAlignSelect.selectedIndex = 0; captionElement = globalTableElement.caption; dump("Caption Element = "+captionElement+"\n"); var index = 0; if (captionElement) { if(captionElement.vAlign == "top") index = 1; else index = 2; } dialog.CaptionSelect.selectedIndex = index; if (globalTableElement.background) dialog.TableImageInput.value = globalTableElement.background; SetColor("tableBackgroundCW", globalTableElement.bgColor); if (globalCellElement) { dialog.CellHeightInput.value = InitPixelOrPercentCombobox(globalCellElement, "height", "CellHeightUnits"); dialog.CellWidthInput.value = InitPixelOrPercentCombobox(globalCellElement, "width", "CellWidthUnits"); dump("RowSpan="+globalCellElement.rowSpan+" ColSpan="+globalCellElement.colSpan+"\n"); dialog.RowSpanInput.value = globalCellElement.getAttribute("rowspan"); dialog.ColSpanInput.value = globalCellElement.getAttribute("colspan"); var valign = globalCellElement.vAlign.toLowerCase(); if (valign == topStr) dialog.CellVAlignSelect.selectedIndex = 0; else if (valign == bottomStr) dialog.CellVAlignSelect.selectedIndex = 2; else dialog.CellVAlignSelect.selectedIndex = 1; var halign = globalCellElement.align.toLowerCase(); switch (halign) { case centerStr: dialog.CellHAlignSelect.selectedIndex = 1; break; case rightStr: dialog.CellHAlignSelect.selectedIndex = 2; break; case justifyStr: dialog.CellHAlignSelect.selectedIndex = 3; break; case charStr: var alignChar = globalCellElement.getAttribute(charStr); if (alignChar && alignChar.length == 1) { dialog.CellAlignCharInput.value = alignChar; dialog.CellHAlignSelect.selectedIndex = 4; } else { dialog.CellHAlignSelect.selectedIndex = 0; } break; default: dialog.CellHAlignSelect.selectedIndex = 0; break; } SelectCellHAlign(); CellIsHeader = (globalCellElement.nodeName == "TH"); dialog.HeaderCheck.checked = CellIsHeader; dialog.NoWrapCheck.checked = globalCellElement.noWrap; SetColor("cellBackgroundCW", globalCellElement.bgColor); if (globalCellElement.background) dialog.CellImageInput.value = globalCellElement.background; }
function InitDialog(){ dump("Table Editing:InitDialog()\n");}
dialog.widthInput.value = InitPixelOrPercentPopupButton(globalElement, "width", "pixelOrPercentButton");
dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement,"width","pixelOrPercentSelect"); window.sizeToContent();
function InitDialog(){ // Just to be confusing, "size" is used instead of height // We will use "height" here and in UI dialog.heightInput.value = globalElement.getAttribute("size"); // Get the width attribute of the element, stripping out "%" // This sets contents of button text and "percentChar" variable dialog.widthInput.value = InitPixelOrPercentPopupButton(globalElement, "width", "pixelOrPercentButton"); align = globalElement.getAttribute("align"); if (align == "center") { dialog.centerAlign.checked = true; } else if (align == "right") { dialog.rightAlign.checked = true; } else { dialog.leftAlign.checked = true; } noshade = globalElement.getAttribute("noshade"); dialog.shading.checked = (noshade == "");}
dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement,"width","pixelOrPercentSelect");
dialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, tableElement, "width","pixelOrPercentMenulist");
function InitDialog(){ // Get default attributes set on the created table: // Get the width attribute of the element, stripping out "%" // This sets contents of select combobox list dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement,"width","pixelOrPercentSelect"); dialog.borderInput.value = globalElement.getAttribute("border");}
applyButton.setAttribute("accesskey", GetString("ApplyAccessKey"));
function InitDialog(){// turn on Button3 to be "apply" var applyButton = document.getElementById("Button3"); if (applyButton) { applyButton.label = GetString("Apply"); applyButton.removeAttribute("collapsed"); } // Get Table attributes gDialog.TableRowsInput.value = rowCount; gDialog.TableColumnsInput.value = colCount; gDialog.TableWidthInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "width", "TableWidthUnits", gPercent); if (gUseCSS) { gDialog.TableHeightInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "height", "TableHeightUnits", gPercent); } gDialog.BorderWidthInput.value = globalTableElement.border; gDialog.SpacingInput.value = globalTableElement.cellSpacing; gDialog.PaddingInput.value = globalTableElement.cellPadding; var marginLeft = GetHTMLOrCSSStyleValue(globalTableElement, "align", "margin-left"); var marginRight = GetHTMLOrCSSStyleValue(globalTableElement, "align", "margin-right"); var halign = marginLeft.toLowerCase() + " " + marginRight.toLowerCase(); if (halign == "center center" || halign == "auto auto") gDialog.TableAlignList.selectedIndex = 1; else if (halign == "right right" || halign == "auto 0px") gDialog.TableAlignList.selectedIndex = 2; else // Default = left gDialog.TableAlignList.selectedIndex = 0; // Be sure to get caption from table in doc, not the copied "globalTableElement" TableCaptionElement = TableElement.caption; var index = 0; if (TableCaptionElement) { // Note: Other possible values are "left" and "right", // but "align" is deprecated, so should we even support "botton"? if (GetHTMLOrCSSStyleValue(TableCaptionElement, "align", "caption-side") == "bottom") index = 2; else index = 1; } gDialog.TableCaptionList.selectedIndex = index; TableColor = GetHTMLOrCSSStyleValue(globalTableElement, bgcolor, cssBackgroundColorStr); TableColor = ConvertRGBColorIntoHEXColor(TableColor); SetColor("tableBackgroundCW", TableColor); InitCellPanel();}
dialog.plexList = document.getElementById("plexList"); dialog.plexGroup = document.getElementById("plexGroup");
function initDialog(){ dialog = new Object; dialog.paperList = document.getElementById("paperList"); dialog.paperGroup = document.getElementById("paperGroup"); dialog.cmdLabel = document.getElementById("cmdLabel"); dialog.cmdInput = document.getElementById("cmdInput"); dialog.colorGroup = document.getElementById("colorGroup"); dialog.colorRadio = document.getElementById("colorRadio"); dialog.grayRadio = document.getElementById("grayRadio"); dialog.topInput = document.getElementById("topInput"); dialog.bottomInput = document.getElementById("bottomInput"); dialog.leftInput = document.getElementById("leftInput"); dialog.rightInput = document.getElementById("rightInput");}
dialog.cmdGroup = document.getElementById("cmdGroup");
function initDialog(){ dialog = new Object; dialog.paperList = document.getElementById("paperList"); dialog.paperGroup = document.getElementById("paperGroup"); dialog.cmdLabel = document.getElementById("cmdLabel"); dialog.cmdInput = document.getElementById("cmdInput"); dialog.colorGroup = document.getElementById("colorGroup"); dialog.colorRadio = document.getElementById("colorRadio"); dialog.grayRadio = document.getElementById("grayRadio"); dialog.topInput = document.getElementById("topInput"); dialog.bottomInput = document.getElementById("bottomInput"); dialog.leftInput = document.getElementById("leftInput"); dialog.rightInput = document.getElementById("rightInput");}
dialog.hrefInput.value = globalElement.href;
dialog.hrefInput.value = globalElement.getAttribute("href");
function InitDialog(){ dialog.hrefInput.value = globalElement.href;}
dialog.TableHeightInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "height", "TableHeightUnits"); dialog.TableWidthInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "width", "TableWidthUnits");
dialog.TableHeightInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "height", "TableHeightUnits", gPercent); dialog.TableWidthInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "width", "TableWidthUnits", gPercent);
function InitDialog(){ // Get Table attributes dialog.TableRowsInput.value = rowCount; dialog.TableColumnsInput.value = colCount; dialog.TableHeightInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "height", "TableHeightUnits"); dialog.TableWidthInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "width", "TableWidthUnits"); dialog.BorderWidthInput.value = globalTableElement.border; dialog.SpacingInput.value = globalTableElement.cellSpacing; dialog.PaddingInput.value = globalTableElement.cellPadding; //BUG: The align strings are converted: e.g., "center" becomes "Center"; var halign = globalTableElement.align.toLowerCase(); if (halign == centerStr) dialog.TableAlignList.selectedIndex = 1; else if (halign == bottomStr) dialog.TableAlignList.selectedIndex = 2; else // Default = left dialog.TableAlignList.selectedIndex = 0; TableCaptionElement = globalTableElement.caption;dump("Caption Element = "+TableCaptionElement+"\n"); var index = 0; if (TableCaptionElement) { // Note: Other possible values are "left" and "right", // but "align" is deprecated, so should we even support "botton"? if (TableCaptionElement.vAlign == "bottom") index = 2; else index = 1; } dialog.TableCaptionList.selectedIndex = index; if (globalTableElement.background) dialog.TableImageInput.value = globalTableElement.background; SetColor("tableBackgroundCW", globalTableElement.bgColor); InitCellPanel(SelectedCellsType);}
if (globalTableElement.background) dialog.TableImageInput.value = globalTableElement.background;
function InitDialog(){ // Get Table attributes dialog.TableRowsInput.value = rowCount; dialog.TableColumnsInput.value = colCount; dialog.TableHeightInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "height", "TableHeightUnits"); dialog.TableWidthInput.value = InitPixelOrPercentMenulist(globalTableElement, TableElement, "width", "TableWidthUnits"); dialog.BorderWidthInput.value = globalTableElement.border; dialog.SpacingInput.value = globalTableElement.cellSpacing; dialog.PaddingInput.value = globalTableElement.cellPadding; //BUG: The align strings are converted: e.g., "center" becomes "Center"; var halign = globalTableElement.align.toLowerCase(); if (halign == centerStr) dialog.TableAlignList.selectedIndex = 1; else if (halign == bottomStr) dialog.TableAlignList.selectedIndex = 2; else // Default = left dialog.TableAlignList.selectedIndex = 0; TableCaptionElement = globalTableElement.caption;dump("Caption Element = "+TableCaptionElement+"\n"); var index = 0; if (TableCaptionElement) { // Note: Other possible values are "left" and "right", // but "align" is deprecated, so should we even support "botton"? if (TableCaptionElement.vAlign == "bottom") index = 2; else index = 1; } dialog.TableCaptionList.selectedIndex = index; if (globalTableElement.background) dialog.TableImageInput.value = globalTableElement.background; SetColor("tableBackgroundCW", globalTableElement.bgColor); InitCellPanel(SelectedCellsType);}
wasEnableAll = !(dialog.srcInput.value.length > 0);
function initDialog() { // Get a single selected anchor element imageElement = editorShell.GetSelectedElement(tagName); if (imageElement) { // We found an element and don't need to insert one insertNew = false; } else { insertNew = true; // We don't have an element selected, // so create one with default attributes dump("Element not selected - calling createElementWithDefaults\n"); imageElement = editorShell.CreateElementWithDefaults(tagName); if( !imageElement ) { dump("Failed to get selected element or create a new one!\n"); window.close(); } } // Set the controls to the image's attributes str = imageElement.getAttribute("src"); if ( str == "null" ) { str = ""; } dialog.srcInput.value = str; str = imageElement.getAttribute("alt"); if ( str == "null" ) { str = ""; } dialog.altTextInput.value = str; // we want to force an update so initialize "wasEnabledAll" to be the opposite of what the actual state is wasEnabledAll = !((dialog.srcInput.value.length > 0) && (dialog.altTextInput.value.length > 0)); // set height and width // note: need to set actual image size if no attributes dimvalue = imageElement.getAttribute("width"); if ( dimvalue == "null" ) { dimvalue = ""; } dialog.imagewidthInput.value = dimvalue; dimvalue = imageElement.getAttribute("height"); if ( dimvalue == "null" ) { dimvalue = ""; } dialog.imageheightInput.value = dimvalue; // this is not the correct way to determine if custom or original if ( dimvalue != "" ) { dialog.customsizeRadio.checked = true; } alignpopup = document.getElementById("image.alignType"); if ( alignpopup ) { alignvalue = imageElement.getAttribute("align"); if ( alignvalue == "" ) { alignvalue = "at the bottom"; } dump( "popup value = " + alignvalue + "\n" ); alignpopup.setAttribute( "value", alignvalue ); } // set spacing editfields sizevalue = imageElement.getAttribute("hspace"); dialog.imagelrInput.value = sizevalue; sizevalue = imageElement.getAttribute("vspace"); dialog.imagetbInput.value = sizevalue; sizevalue = imageElement.getAttribute("border"); dialog.imageborderInput.value = sizevalue; doOverallEnabling();}
gReplaceDialog.findKey = document.getElementById("dialog.findKey"); gReplaceDialog.replaceKey = document.getElementById("dialog.replaceKey");
gReplaceDialog.findInput = document.getElementById("dialog.findInput"); gReplaceDialog.replaceInput = document.getElementById("dialog.replaceInput");
function initDialogObject(){ // Create gReplaceDialog object and initialize. gReplaceDialog = new Object(); gReplaceDialog.findKey = document.getElementById("dialog.findKey"); gReplaceDialog.replaceKey = document.getElementById("dialog.replaceKey"); gReplaceDialog.caseSensitive = document.getElementById("dialog.caseSensitive"); gReplaceDialog.wrap = document.getElementById("dialog.wrap"); gReplaceDialog.searchBackwards = document.getElementById("dialog.searchBackwards"); gReplaceDialog.findNext = document.getElementById("findNext"); gReplaceDialog.replace = document.getElementById("replace"); gReplaceDialog.replaceAll = document.getElementById("replaceAll"); gReplaceDialog.bundle = null; gReplaceDialog.editor = null;}
gReplaceDialog.bundle = null; gReplaceDialog.editor = null;
gEditor = null;
function initDialogObject(){ // Create gReplaceDialog object and initialize. gReplaceDialog = new Object(); gReplaceDialog.findKey = document.getElementById("dialog.findKey"); gReplaceDialog.replaceKey = document.getElementById("dialog.replaceKey"); gReplaceDialog.caseSensitive = document.getElementById("dialog.caseSensitive"); gReplaceDialog.wrap = document.getElementById("dialog.wrap"); gReplaceDialog.searchBackwards = document.getElementById("dialog.searchBackwards"); gReplaceDialog.findNext = document.getElementById("findNext"); gReplaceDialog.replace = document.getElementById("replace"); gReplaceDialog.replaceAll = document.getElementById("replaceAll"); gReplaceDialog.bundle = null; gReplaceDialog.editor = null;}
document.getElementById('virtualFolderPropertiesDialog').setAttribute('title',messengerBundle.getFormattedString('editVirtualFolderPropertiesTitle', [msgFolder.prettyName]));
document.title = messengerBundle.getFormattedString('editVirtualFolderPropertiesTitle', [msgFolder.prettyName]);
function InitDialogWithVirtualFolder(aVirtualFolderURI){ // when editing an existing folder, hide the folder picker that stores the parent location of the folder document.getElementById("chooseFolderLocationRow").collapsed = true; var folderNameField = document.getElementById("name"); folderNameField.disabled = true; var msgFolder = GetMsgFolderFromUri(aVirtualFolderURI); var msgDatabase = msgFolder.getMsgDatabase(msgWindow); var dbFolderInfo = msgDatabase.dBFolderInfo; gSearchFolderURIs = dbFolderInfo.getCharPtrProperty("searchFolderUri"); var searchTermString = dbFolderInfo.getCharPtrProperty("searchStr"); document.getElementById('searchOnline').checked = dbFolderInfo.getBooleanProperty("searchOnline", false); // work around to get our search term string converted into a real array of search terms var filterService = Components.classes["@mozilla.org/messenger/services/filters;1"].getService(Components.interfaces.nsIMsgFilterService); var filterList = filterService.getTempFilterList(msgFolder); gSearchTermSession = filterList.createFilter("temp"); filterList.parseCondition(gSearchTermSession, searchTermString); setupSearchRows(gSearchTermSession.searchTerms); // set the name of the folder folderNameField.value = msgFolder.prettyName; // update the window title based on the name of the saved search var messengerBundle = document.getElementById("bundle_messenger"); document.getElementById('virtualFolderPropertiesDialog').setAttribute('title',messengerBundle.getFormattedString('editVirtualFolderPropertiesTitle', [msgFolder.prettyName]));}
document.getElementById("nntp.downloadUnread").checked = downloadSettings.downloadUnreadOnly;
document.getElementById("nntp.notDownloadRead").checked = downloadSettings.downloadUnreadOnly;
function initDownloadSettings(){ var downloadSettings = gIncomingServer.downloadSettings; document.getElementById("nntp.downloadMsg").checked = downloadSettings.downloadByDate; document.getElementById("nntp.downloadUnread").checked = downloadSettings.downloadUnreadOnly; if(downloadSettings.ageLimitOfMsgsToDownload > 0) document.getElementById("nntp.downloadMsgMin").setAttribute("value", downloadSettings.ageLimitOfMsgsToDownload); else document.getElementById("nntp.downloadMsgMin").setAttribute("value", "30"); }
gAddressBookBundle = document.getElementById("bundle_addressBook");
function InitEditCard(){ // create editCard object that contains global variables for editCard.js editCard = new Object; // get pointer to nsIPref object var prefs = Components.classes["@mozilla.org/preferences;1"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); editCard.prefs = prefs; } } // get specific prefs that editCard will need if ( prefs ) { try { editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration"); editCard.lastFirstSeparator = ", "; editCard.firstLastSeparator = " "; } catch (ex) { dump("failed to get pref\n"); } }}
gEditCard = new Object;
gEditCard = new Object();
function InitEditCard(){ InitPhoneticFields(); gAddressBookBundle = document.getElementById("bundle_addressBook"); // Create gEditCard object that contains global variables for the current js // file. gEditCard = new Object; gEditCard.prefs = gPrefs; // get specific prefs that gEditCard will need try { var displayLastNameFirst = gPrefs.getComplexValue("mail.addr_book.displayName.lastnamefirst", Components.interfaces.nsIPrefLocalizedString).data; gEditCard.displayLastNameFirst = (displayLastNameFirst == "true"); gEditCard.generateDisplayName = gPrefs.getBoolPref("mail.addr_book.displayName.autoGeneration"); } catch (ex) { dump("ex: failed to get pref" + ex + "\n"); }}
var prefs = Components.classes["@mozilla.org/preferences;1"];
var prefs = Components.classes["@mozilla.org/preferences-service;1"];
function InitEditCard(){ gAddressBookBundle = document.getElementById("bundle_addressBook"); // create editCard object that contains global variables for editCard.js editCard = new Object; // get pointer to nsIPref object var prefs = Components.classes["@mozilla.org/preferences;1"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); editCard.prefs = prefs; } } // get specific prefs that editCard will need if ( prefs ) { try { editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration"); editCard.lastFirstSeparator = ", "; editCard.firstLastSeparator = " "; } catch (ex) { dump("failed to get pref\n"); } }}
prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
prefs = prefs.QueryInterface(Components.interfaces.nsIPrefBranch);
function InitEditCard(){ gAddressBookBundle = document.getElementById("bundle_addressBook"); // create editCard object that contains global variables for editCard.js editCard = new Object; // get pointer to nsIPref object var prefs = Components.classes["@mozilla.org/preferences;1"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); editCard.prefs = prefs; } } // get specific prefs that editCard will need if ( prefs ) { try { editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration"); editCard.lastFirstSeparator = ", "; editCard.firstLastSeparator = " "; } catch (ex) { dump("failed to get pref\n"); } }}
editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration");
editCard.displayLastNameFirst = prefs.getBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.getBoolPref("mail.addr_book.displayName.autoGeneration");
function InitEditCard(){ gAddressBookBundle = document.getElementById("bundle_addressBook"); // create editCard object that contains global variables for editCard.js editCard = new Object; // get pointer to nsIPref object var prefs = Components.classes["@mozilla.org/preferences;1"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); editCard.prefs = prefs; } } // get specific prefs that editCard will need if ( prefs ) { try { editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration"); editCard.lastFirstSeparator = ", "; editCard.firstLastSeparator = " "; } catch (ex) { dump("failed to get pref\n"); } }}
gEditor = editorShell.editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
function InitEditorShell(){ // get the editor shell from the parent window editorShell = window.opener.editorShell; if (editorShell) { editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); } if (!editorShell) { dump("EditorShell not found!!!\n"); window.close(); return false; } // Save as a property of the window so it can be used by child dialogs window.editorShell = editorShell; return true;}
aFI.fileExt = url.fileExtension;
function initFileInfo(aFI, aURL, aDocument, aContentType){ var docCharset = (aDocument ? aDocument.characterSet : null); try { // Get an nsIURI object from aURL if possible: try { aFI.uri = makeURI(aURL, docCharset); // Assuming nsiUri is valid, calling QueryInterface(...) on it will // populate extra object fields (eg filename and file extension). var url = aFI.uri.QueryInterface(Components.interfaces.nsIURL); } catch (e) { } // Get the default filename: aFI.fileName = getDefaultFileName((aFI.suggestedFileName || aFI.fileName), aFI.uri, aDocument); aFI.fileExt = url.fileExtension; // If aFI.fileExt is still blank, consider: aFI.suggestedFileName is supplied // if saveURL(...) was the original caller (hence both aContentType and // aDocument are blank). If they were saving a link to a website then make // the extension .htm . if (!aFI.fileExt && !aDocument && !aContentType && (aURL.length > 7) && aURL.substring(0,7).toUpperCase() == "HTTP://") { aFI.fileExt = "htm"; aFI.fileBaseName = aFI.fileName; } else { aFI.fileExt = getDefaultExtension(aFI.fileName, aFI.uri, aContentType); aFI.fileBaseName = getFileBaseName(aFI.fileName, aFI.fileExt); } } catch (e) { }}
var fastFind = getBrowser().fastFind; fastFind.focusLinks = true;
function initFindBar(){ getBrowser().addEventListener("keypress", onBrowserKeyPress, false); getBrowser().addEventListener("mouseup", onBrowserMouseUp, false); var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var pbi = prefService.QueryInterface(Components.interfaces.nsIPrefBranch2); gQuickFindTimeoutLength = prefService.getIntPref("accessibility.typeaheadfind.timeout"); gFlashFindBar = prefService.getIntPref("accessibility.typeaheadfind.flashBar"); pbi.addObserver(gTypeAheadFind.useTAFPref, gTypeAheadFind, false); pbi.addObserver(gTypeAheadFind.searchLinksPref, gTypeAheadFind, false); gUseTypeAheadFind = prefService.getBoolPref("accessibility.typeaheadfind"); gTypeAheadLinksOnly = prefService.getBoolPref("accessibility.typeaheadfind.linksonly");}
var faceType = menuItem.getAttribute("data");
var faceType = menuItem.getAttribute("value");
function initFontFaceMenu(menuPopup){ if (menuPopup) { var children = menuPopup.childNodes; if (!children) return; var firstHas = new Object; var anyHas = new Object; var allHas = new Object; allHas.value = false; // we need to set or clear the checkmark for each menu item since the selection // may be in a new location from where it was when the menu was previously opened // Fixed width (second menu item) is special case: old TT ("teletype") attribute editorShell.GetTextProperty("tt", "", "", firstHas, anyHas, allHas); children[1].setAttribute("checked", allHas.value); var fontWasFound = anyHas.value; // Skip over default, TT, and separator for (var i = 3; i < children.length; i++) { var menuItem = children[i]; var faceType = menuItem.getAttribute("data"); if (faceType) { editorShell.GetTextProperty("font", "face", faceType, firstHas, anyHas, allHas); // Check the item only if all of selection has the face... menuItem.setAttribute("checked", allHas.value); // ...but remember if ANY part of the selection has it fontWasFound |= anyHas.value; } } // Check the default item if no other item was checked // note that no item is checked in the case of "mixed" selection children[0].setAttribute("checked", !fontWasFound); } }
var url = getCharPref("privacyURL", "http: var privacyLink = document.getElementById("privacyPolicy"); privacyLink.setAttribute("href", url);
function initForm() { var strbundle=document.getElementById("strings"); var reportWizard = document.getElementById('reportWizard'); reportWizard.canRewind = false; document.getElementById('url').value = gURL; // Change next button to "submit report" reportWizard.getButton('next').label = strbundle.getString("submitReport") + ">"; // We don't let the user go forward until they fufill certain requirements - see validateform() reportWizard.canAdvance = false;}
window.isFocused = false; window.addEventListener("focus", onWindowFocus, true); window.addEventListener("blur", onWindowBlue, true);
function initHandlers(){ var node; node = document.getElementById("input"); node.addEventListener("keypress", onInputKeyPress, false); node = document.getElementById("multiline-input"); node.addEventListener("keypress", onMultilineInputKeyPress, false); node.active = false; window.onkeypress = onWindowKeyPress; client.inputPopup = null;}
console.windows.hookedWindows = new Array(); var enumerator = console.windowWatcher.getWindowEnumerator(); while (enumerator.hasMoreElements()) { var win = enumerator.getNext(); if (win.location.href != "chrome: { console.onWindowOpen(win); console.onWindowLoad(); } }
function initHandlers(){ function wwObserve (subject, topic, data) { //dd ("wwObserver::Observe " + subject + ", " + topic); if (topic == "domwindowopened") console.onWindowOpen (subject); else console.onWindowClose (subject); }; console.wwObserver = {observe: wwObserve}; console.windowWatcher.registerNotification (console.wwObserver);}
obj.munger.enabled = false;
obj.munger.enabled = true;
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (10); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = false; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); obj.munger.addRule ("link", /((http|mailto|ftp)\:\/\/[^\)\s]*|www\.\S+\.\S[^\)\s]*)/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, "rheet"); obj.munger.addRule ("bold", /(\*.*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS](\/.*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|.*\|)/, "teletype"); obj.munger.addRule ("underline", /(\_.*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#.*\#)/, "smallcap");}
("link", /((\w+)\:\/\/[^\<\>\(\)\'\"\s]*|www\.[^\<\>\(\)\'\"\s]+\.[^\<\>\(\)\'\"\s]*)/,
("link", /((\w+):\/\/[^<>()\'\"\s]+|www(\.[^.<>()\'\"\s]+){2,})/,
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); // obj.munger.addRule ("im-stalking-you", matchMyNick, "" ); obj.munger.addRule ("link", /((\w+)\:\/\/[^\<\>\(\)\'\"\s]*|www\.[^\<\>\(\)\'\"\s]+\.[^\<\>\(\)\'\"\s]*)/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, "rheet"); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS](\/[^\/]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
obj.munger.addRule ("rheet", /(rhee+t\!*)/i, "rheet");
obj.munger.addRule ("ear", /(\(\*)/, insertEar); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, insertRheet);
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); // obj.munger.addRule ("im-stalking-you", matchMyNick, "" ); obj.munger.addRule ("link", /((\w+)\:\/\/[^\<\>\(\)\'\"\s]*|www\.[^\<\>\(\)\'\"\s]+\.[^\<\>\(\)\'\"\s]*)/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, "rheet"); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS](\/[^\/]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
obj.munger.addRule ("italic", /[^sS](\/[^\/]*\/)/, "italic");
obj.munger.addRule ("italic", /[^sS\<](\/[^\/][^\>]*\/)/, "italic");
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); // obj.munger.addRule ("im-stalking-you", matchMyNick, "" ); obj.munger.addRule ("link", /((\w+)\:\/\/[^\<\>\(\)\'\"\s]*|www\.[^\<\>\(\)\'\"\s]+\.[^\<\>\(\)\'\"\s]*)/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, "rheet"); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS](\/[^\/]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
("face", /([\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\])/,
("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/,
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (10); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.freei.net", port: 6667}, {name: "irc.primenet.com", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); obj.munger.addRule ("link", /((http|mailto|ftp)\:\/\/[^\)\s]*|www\.\S+\.\S[^\)\s]*)/, insertLink); obj.munger.addRule ("face", /([\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\])/, insertSmiley); obj.munger.addRule ("rheet", /(rhe+t\!*)/i, "rheet"); obj.munger.addRule ("bold", /(\*.*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS](\/.*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|.*\|)/, "teletype"); obj.munger.addRule ("underline", /(\_.*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#.*\#)/, "smallcap");}
gHtmlDocument.write("<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>");
gHtmlString += "<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>";
function initHTMLView(){ //printwindow.document.open(); gHtmlDocument.write("<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>"); if (gMyTitle.length > 0) {// gHtmlDocument.write("<tr><td colspan=3 align=center style='font-size:26px;font-weight:bold;'>>");// gHtmlDocument.write("<tr><td colspan=2 align=center style='font-size:26px;font-weight:bold;'>");// gHtmlDocument.write(mytitle);// gHtmlDocument.write("</td></tr>"); gHtmlDocument.write("<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>"); gHtmlDocument.write(gMyTitle); gHtmlDocument.write("</td></tr></table>"); } return gHtmlDocument;}
gHtmlDocument.write("<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>"); gHtmlDocument.write(gMyTitle); gHtmlDocument.write("</td></tr></table>");
gHtmlString += "<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>"; gHtmlString += gMyTitle; gHtmlString += "</td></tr></table>";
function initHTMLView(){ //printwindow.document.open(); gHtmlDocument.write("<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>"); if (gMyTitle.length > 0) {// gHtmlDocument.write("<tr><td colspan=3 align=center style='font-size:26px;font-weight:bold;'>>");// gHtmlDocument.write("<tr><td colspan=2 align=center style='font-size:26px;font-weight:bold;'>");// gHtmlDocument.write(mytitle);// gHtmlDocument.write("</td></tr>"); gHtmlDocument.write("<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>"); gHtmlDocument.write(gMyTitle); gHtmlDocument.write("</td></tr></table>"); } return gHtmlDocument;}
return gHtmlDocument;
return;
function initHTMLView(){ //printwindow.document.open(); gHtmlDocument.write("<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>"); if (gMyTitle.length > 0) {// gHtmlDocument.write("<tr><td colspan=3 align=center style='font-size:26px;font-weight:bold;'>>");// gHtmlDocument.write("<tr><td colspan=2 align=center style='font-size:26px;font-weight:bold;'>");// gHtmlDocument.write(mytitle);// gHtmlDocument.write("</td></tr>"); gHtmlDocument.write("<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>"); gHtmlDocument.write(gMyTitle); gHtmlDocument.write("</td></tr></table>"); } return gHtmlDocument;}
gHtmlString += "<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>";
gHtmlString += "<html><head><link rel=stylesheet type=text/css href=chrome: gHtmlString += "<title>"+windowTitle+"</title></head><body>";
function initHTMLView(){ gHtmlString += "<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>"; if (gMyTitle.length > 0) {// gHtmlString += "<tr><td colspan=3 align=center style='font-size:26px;font-weight:bold;'>>";// gHtmlString += "<tr><td colspan=2 align=center style='font-size:26px;font-weight:bold;'>";// gHtmlString += mytitle;// gHtmlString += "</td></tr>"; gHtmlString += "<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>"; gHtmlString += gMyTitle; gHtmlString += "</td></tr></table>"; } return;}
gHtmlString += "<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>";
gHtmlString += "<table><tr><td valign=bottom align=center>";
function initHTMLView(){ gHtmlString += "<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>"; if (gMyTitle.length > 0) {// gHtmlString += "<tr><td colspan=3 align=center style='font-size:26px;font-weight:bold;'>>";// gHtmlString += "<tr><td colspan=2 align=center style='font-size:26px;font-weight:bold;'>";// gHtmlString += mytitle;// gHtmlString += "</td></tr>"; gHtmlString += "<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>"; gHtmlString += gMyTitle; gHtmlString += "</td></tr></table>"; } return;}
targetElement = gSearchBooleanRadiogroup.getElementsByAttribute("data", targetValue)[0];
targetElement = gSearchBooleanRadiogroup.getElementsByAttribute("value", targetValue)[0];
function initializeBooleanWidgets() { var booleanAnd = true; // get the boolean value from the first term var firstTerm = gSearchTerms[0]; if (firstTerm) booleanAnd = firstTerm.booleanAnd; // target radio items have data="and" or data="or" targetValue = "or"; if (booleanAnd) targetValue = "and"; targetElement = gSearchBooleanRadiogroup.getElementsByAttribute("data", targetValue)[0]; gSearchBooleanRadiogroup.selectedItem = targetElement;}
for (var i=1; i<gSearchTerms.length; i++) { document.getElementById('boolOp' + i).setAttribute('value', booleanAnd ? gBooleanAndText : gBooleanOrText); }
function initializeBooleanWidgets() { var booleanAnd = true; // get the boolean value from the first term var firstTerm = gSearchTerms[0].searchTerm; if (firstTerm) booleanAnd = firstTerm.booleanAnd; // target radio items have value="and" or value="or" gSearchBooleanRadiogroup.value = booleanAnd ? "and" : "or"; for (var i=1; i<gSearchTerms.length; i++) { document.getElementById('boolOp' + i).setAttribute('value', booleanAnd ? gBooleanAndText : gBooleanOrText); }}
gSearchBooleanRadiogroup.value = booleanAnd ? "and" : "or";
matchAll = firstTerm.matchAll; } gSearchBooleanRadiogroup.value = matchAll ? "matchAll" : (booleanAnd ? "and" : "or") var searchTerms = document.getElementById("searchTermList"); if (searchTerms) searchTerms.hidden = matchAll;
function initializeBooleanWidgets() { var booleanAnd = true; // get the boolean value from the first term var firstTerm = gSearchTerms[0].searchTerm; if (firstTerm) booleanAnd = firstTerm.booleanAnd; // target radio items have value="and" or value="or" gSearchBooleanRadiogroup.value = booleanAnd ? "and" : "or";}
gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0];
gActionElement.selectedItem=gActionElement.getElementsByAttribute("value", filter.action)[0];
function initializeDialog(filter){ var selectedPriority; gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { // preselect target folder // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.localName == "menuitem"){ gActionTargetElement.selectedItem = target; PickedMsgFolder(gActionTargetElement.selectedItem, gActionTargetElement.id) } } } else if (filter.action == nsMsgFilterAction.ChangePriority) { // initialize priority selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri);
var targets = gActionTargetElement.getElementsByAttribute("value", filter.actionTargetFolderUri);
function initializeDialog(filter){ var selectedPriority; gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { // preselect target folder // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.localName == "menuitem"){ gActionTargetElement.selectedItem = target; PickedMsgFolder(gActionTargetElement.selectedItem, gActionTargetElement.id) } } } else if (filter.action == nsMsgFilterAction.ChangePriority) { // initialize priority selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority);
selectedPriority = gActionPriority.getElementsByAttribute("value", filter.actionPriority);
function initializeDialog(filter){ var selectedPriority; gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { // preselect target folder // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.localName == "menuitem"){ gActionTargetElement.selectedItem = target; PickedMsgFolder(gActionTargetElement.selectedItem, gActionTargetElement.id) } } } else if (filter.action == nsMsgFilterAction.ChangePriority) { // initialize priority selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");
if (filter.searchTerms.Count() == 1) document.getElementById("less0").setAttribute("disabled", "true");
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; var actionList = filter.actionList; var numActions = actionList.Count(); for (var actionIndex=0; actionIndex < numActions; actionIndex++) { var filterAction = actionList.QueryElementAt(actionIndex, Components.interfaces.nsIMsgRuleAction); if (filterAction.type == nsMsgFilterAction.MoveToFolder) { // preselect target folder gMoveToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetMoveElement.id); } else if (filterAction.type == nsMsgFilterAction.CopyToFolder) { // preselect target folder gCopyToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetCopyElement.id); } else if (filterAction.type == nsMsgFilterAction.ChangePriority) { gChangePriorityCheckbox.checked = true; // initialize priority var selectedPriority = gActionPriority.getElementsByAttribute("value", filterAction.priority).item(0); if (selectedPriority) { gActionPriority.selectedItem = selectedPriority; } } else if (filterAction.type == nsMsgFilterAction.Label) { gLabelCheckbox.checked = true; // initialize label var selectedLabel = gActionLabel.getElementsByAttribute("value", filterAction.label).item(0); if (selectedLabel) { gActionLabel.selectedItem = selectedLabel; } } else if (filterAction.type == nsMsgFilterAction.JunkScore) { gJunkScoreCheckbox.checked = true; // initialize junk score var selectedJunkScore = gActionJunkScore.getElementsByAttribute("value", filterAction.junkScore).item(0); if (selectedJunkScore) { gActionJunkScore.selectedItem = selectedJunkScore; } } else if (filterAction.type == nsMsgFilterAction.MarkRead) gMarkReadCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.MarkFlagged) gMarkFlaggedCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.Delete) gDeleteCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.WatchThread) gWatchCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.KillThread) gKillCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.DeleteFromPop3Server) gDeleteFromServerCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.FetchBodyFromPop3Server) gFetchBodyFromServerCheckbox.checked = true; SetUpFilterActionList(getScope(filter)); } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
if (target.tagName == "menuitem")
if (target.localName == "menuitem")
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.tagName == "menuitem") gActionTargetElement.selectedItem = target; } } else if (filter.action == nsMsgFilterAction.ChangePriority) { dump("initializing priority..\n"); var selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { var selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms)}
if (filterAction.type == nsMsgFilterAction.MoveToFolder) { gMoveToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetMoveElement.id); } else if (filterAction.type == nsMsgFilterAction.CopyToFolder) { gCopyToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetCopyElement.id); } else if (filterAction.type == nsMsgFilterAction.ChangePriority) { gChangePriorityCheckbox.checked = true; var selectedPriority = gActionPriority.getElementsByAttribute("value", filterAction.priority).item(0);
var newActionRow = document.createElement('listitem'); newActionRow.setAttribute('initialActionIndex', actionIndex); newActionRow.className = 'ruleaction'; gFilterActionList.appendChild(newActionRow); newActionRow.setAttribute('value', gFilterActionStrings[filterAction.type]); }
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; var actionList = filter.actionList; var numActions = actionList.Count(); for (var actionIndex=0; actionIndex < numActions; actionIndex++) { var filterAction = actionList.QueryElementAt(actionIndex, Components.interfaces.nsIMsgRuleAction); if (filterAction.type == nsMsgFilterAction.MoveToFolder) { // preselect target folder gMoveToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetMoveElement.id); } else if (filterAction.type == nsMsgFilterAction.CopyToFolder) { // preselect target folder gCopyToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetCopyElement.id); } else if (filterAction.type == nsMsgFilterAction.ChangePriority) { gChangePriorityCheckbox.checked = true; // initialize priority var selectedPriority = gActionPriority.getElementsByAttribute("value", filterAction.priority).item(0); if (selectedPriority) gActionPriority.selectedItem = selectedPriority; } else if (filterAction.type == nsMsgFilterAction.Label) { gLabelCheckbox.checked = true; // initialize label var selectedLabel = gActionLabel.getElementsByAttribute("value", filterAction.label).item(0); if (selectedLabel) gActionLabel.selectedItem = selectedLabel; } else if (filterAction.type == nsMsgFilterAction.JunkScore) { gJunkScoreCheckbox.checked = true; // initialize junk score var selectedJunkScore = gActionJunkScore.getElementsByAttribute("value", filterAction.junkScore).item(0); if (selectedJunkScore) gActionJunkScore.selectedItem = selectedJunkScore; } else if (filterAction.type == nsMsgFilterAction.Forward) { gForwardToCheckbox.checked = true; gActionForwardTo.value = filterAction.strValue; } else if (filterAction.type == nsMsgFilterAction.Reply) { gReplyWithTemplateCheckbox.checked = true; gReplyWithTemplateUri = filterAction.strValue; } else if (filterAction.type == nsMsgFilterAction.MarkRead) gMarkReadCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.MarkFlagged) gMarkFlaggedCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.Delete) gDeleteCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.WatchThread) gWatchCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.KillThread) gKillCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.DeleteFromPop3Server) gDeleteFromServerCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.FetchBodyFromPop3Server) gFetchBodyFromServerCheckbox.checked = true; SetUpFilterActionList(getScope(filter)); } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms);}
if (selectedPriority) gActionPriority.selectedItem = selectedPriority; } else if (filterAction.type == nsMsgFilterAction.Label) { gLabelCheckbox.checked = true; var selectedLabel = gActionLabel.getElementsByAttribute("value", filterAction.label).item(0); if (selectedLabel) gActionLabel.selectedItem = selectedLabel; } else if (filterAction.type == nsMsgFilterAction.JunkScore) { gJunkScoreCheckbox.checked = true; var selectedJunkScore = gActionJunkScore.getElementsByAttribute("value", filterAction.junkScore).item(0); if (selectedJunkScore) gActionJunkScore.selectedItem = selectedJunkScore; } else if (filterAction.type == nsMsgFilterAction.Forward) { gForwardToCheckbox.checked = true; gActionForwardTo.value = filterAction.strValue; } else if (filterAction.type == nsMsgFilterAction.Reply) { gReplyWithTemplateCheckbox.checked = true; gReplyWithTemplateUri = filterAction.strValue; } else if (filterAction.type == nsMsgFilterAction.MarkRead) gMarkReadCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.MarkFlagged) gMarkFlaggedCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.Delete) gDeleteCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.WatchThread) gWatchCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.KillThread) gKillCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.DeleteFromPop3Server) gDeleteFromServerCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.FetchBodyFromPop3Server) gFetchBodyFromServerCheckbox.checked = true; SetUpFilterActionList(getScope(filter)); } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms);
var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms);
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; var actionList = filter.actionList; var numActions = actionList.Count(); for (var actionIndex=0; actionIndex < numActions; actionIndex++) { var filterAction = actionList.QueryElementAt(actionIndex, Components.interfaces.nsIMsgRuleAction); if (filterAction.type == nsMsgFilterAction.MoveToFolder) { // preselect target folder gMoveToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetMoveElement.id); } else if (filterAction.type == nsMsgFilterAction.CopyToFolder) { // preselect target folder gCopyToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetCopyElement.id); } else if (filterAction.type == nsMsgFilterAction.ChangePriority) { gChangePriorityCheckbox.checked = true; // initialize priority var selectedPriority = gActionPriority.getElementsByAttribute("value", filterAction.priority).item(0); if (selectedPriority) gActionPriority.selectedItem = selectedPriority; } else if (filterAction.type == nsMsgFilterAction.Label) { gLabelCheckbox.checked = true; // initialize label var selectedLabel = gActionLabel.getElementsByAttribute("value", filterAction.label).item(0); if (selectedLabel) gActionLabel.selectedItem = selectedLabel; } else if (filterAction.type == nsMsgFilterAction.JunkScore) { gJunkScoreCheckbox.checked = true; // initialize junk score var selectedJunkScore = gActionJunkScore.getElementsByAttribute("value", filterAction.junkScore).item(0); if (selectedJunkScore) gActionJunkScore.selectedItem = selectedJunkScore; } else if (filterAction.type == nsMsgFilterAction.Forward) { gForwardToCheckbox.checked = true; gActionForwardTo.value = filterAction.strValue; } else if (filterAction.type == nsMsgFilterAction.Reply) { gReplyWithTemplateCheckbox.checked = true; gReplyWithTemplateUri = filterAction.strValue; } else if (filterAction.type == nsMsgFilterAction.MarkRead) gMarkReadCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.MarkFlagged) gMarkFlaggedCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.Delete) gDeleteCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.WatchThread) gWatchCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.KillThread) gKillCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.DeleteFromPop3Server) gDeleteFromServerCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.FetchBodyFromPop3Server) gFetchBodyFromServerCheckbox.checked = true; SetUpFilterActionList(getScope(filter)); } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms);}
gFilterNameElement = document.getElementById("filterName"); gActionTargetMoveElement = document.getElementById("actionTargetFolder"); gActionTargetCopyElement = document.getElementById("actionTargetFolder2"); gActionValueDeck = document.getElementById("actionValueDeck"); gActionPriority = document.getElementById("actionValuePriority"); gActionJunkScore = document.getElementById("actionValueJunkScore"); gActionLabel = document.getElementById("actionValueLabel"); gActionForwardTo = document.getElementById("actionValueForward"); gMoveToFolderCheckbox = document.getElementById("moveToFolder"); gCopyToFolderCheckbox = document.getElementById("copyToFolder"); gLabelCheckbox = document.getElementById("label"); gChangePriorityCheckbox = document.getElementById("changePriority"); gJunkScoreCheckbox = document.getElementById("setJunkScore"); gForwardToCheckbox = document.getElementById("forwardTo"); gReplyWithTemplateCheckbox = document.getElementById("replyWithTemplate"); gMarkReadCheckbox = document.getElementById("markRead"); gMarkFlaggedCheckbox = document.getElementById("markFlagged"); gDeleteCheckbox = document.getElementById("delete"); gDeleteFromServerCheckbox = document.getElementById("deleteFromServer"); gFetchBodyFromServerCheckbox = document.getElementById("fetchBodyFromServer"); gKillCheckbox = document.getElementById("kill"); gWatchCheckbox = document.getElementById("watch"); gFilterActionList = document.getElementById("filterActionList");
gFilterNameElement = document.getElementById("filterName"); gFilterActionList = document.getElementById("filterActionList");
function initializeFilterWidgets(){ gFilterNameElement = document.getElementById("filterName"); gActionTargetMoveElement = document.getElementById("actionTargetFolder"); gActionTargetCopyElement = document.getElementById("actionTargetFolder2"); gActionValueDeck = document.getElementById("actionValueDeck"); gActionPriority = document.getElementById("actionValuePriority"); gActionJunkScore = document.getElementById("actionValueJunkScore"); gActionLabel = document.getElementById("actionValueLabel"); gActionForwardTo = document.getElementById("actionValueForward"); gMoveToFolderCheckbox = document.getElementById("moveToFolder"); gCopyToFolderCheckbox = document.getElementById("copyToFolder"); gLabelCheckbox = document.getElementById("label"); gChangePriorityCheckbox = document.getElementById("changePriority"); gJunkScoreCheckbox = document.getElementById("setJunkScore"); gForwardToCheckbox = document.getElementById("forwardTo"); gReplyWithTemplateCheckbox = document.getElementById("replyWithTemplate"); gMarkReadCheckbox = document.getElementById("markRead"); gMarkFlaggedCheckbox = document.getElementById("markFlagged"); gDeleteCheckbox = document.getElementById("delete"); gDeleteFromServerCheckbox = document.getElementById("deleteFromServer"); gFetchBodyFromServerCheckbox = document.getElementById("fetchBodyFromServer"); gKillCheckbox = document.getElementById("kill"); gWatchCheckbox = document.getElementById("watch"); gFilterActionList = document.getElementById("filterActionList");}
parent.UpdateWizardMap();
function initializeIspData(){ if (!document.getElementById("mailaccount").selected) { parent.SetCurrentAccountData(null); } // now reflect the datasource up into the parent var accountSelection = document.getElementById("acctyperadio"); var ispName = accountSelection.selectedItem.id; dump("initializing ISP data for " + ispName + "\n"); if (!ispName || ispName == "") return; parent.PrefillAccountForIsp(ispName); parent.UpdateWizardMap();}
hideMatchAllItem();
function initializeMailViewOverrides(){ // replace some text with something we want. Need to add some ids to searchOverlay.js //var orButton = document.getElementById('or'); //orButton.setAttribute('label', 'Any of the following'); //var andButton = document.getElementById('and'); //andButton.setAttribute('label', 'All of the following');}
getLocaleShortDateFormat();
initLocaleShortDateFormat();
function initializeSearchDateFormat(){ if (gSearchDateFormat) return; // get a search date format option and a seprator try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gSearchDateFormat = pref.getComplexValue("mailnews.search_date_format", Components.interfaces.nsIPrefLocalizedString); gSearchDateFormat = parseInt(gSearchDateFormat); // if the option is 0 then try to use the format of the current locale if (gSearchDateFormat == 0) getLocaleShortDateFormat(); else { if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3; gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); } } catch (ex) { // set to mm/dd/yyyy in case of error gSearchDateFormat = 3; gSearchDateSeparator = "/"; }}
gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString);
gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); gSearchDateLeadingZeros = (pref.getComplexValue("mailnews.search_date_leading_zeros", Components.interfaces.nsIPrefLocalizedString).data == "true");
function initializeSearchDateFormat(){ if (gSearchDateFormat) return; // get a search date format option and a seprator try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gSearchDateFormat = pref.getComplexValue("mailnews.search_date_format", Components.interfaces.nsIPrefLocalizedString); gSearchDateFormat = parseInt(gSearchDateFormat); // if the option is 0 then try to use the format of the current locale if (gSearchDateFormat == 0) getLocaleShortDateFormat(); else { if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3; gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); } } catch (ex) { // set to mm/dd/yyyy in case of error gSearchDateFormat = 3; gSearchDateSeparator = "/"; }}
} catch (ex) {
} catch (e) { dump("initializeSearchDateFormat: caught an exception: "+e+"\n");
function initializeSearchDateFormat(){ if (gSearchDateFormat) return; // get a search date format option and a seprator try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gSearchDateFormat = pref.getComplexValue("mailnews.search_date_format", Components.interfaces.nsIPrefLocalizedString); gSearchDateFormat = parseInt(gSearchDateFormat); // if the option is 0 then try to use the format of the current locale if (gSearchDateFormat == 0) getLocaleShortDateFormat(); else { if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3; gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); } } catch (ex) { // set to mm/dd/yyyy in case of error gSearchDateFormat = 3; gSearchDateSeparator = "/"; }}
gSearchDateLeadingZeros = true;
function initializeSearchDateFormat(){ if (gSearchDateFormat) return; // get a search date format option and a seprator try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gSearchDateFormat = pref.getComplexValue("mailnews.search_date_format", Components.interfaces.nsIPrefLocalizedString); gSearchDateFormat = parseInt(gSearchDateFormat); // if the option is 0 then try to use the format of the current locale if (gSearchDateFormat == 0) getLocaleShortDateFormat(); else { if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3; gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); } } catch (ex) { // set to mm/dd/yyyy in case of error gSearchDateFormat = 3; gSearchDateSeparator = "/"; }}
gSearchLessButton = document.getElementById("less"); if (!gSearchLessButton) dump("I couldn't find less button!");
function initializeSearchWidgets() { gSearchBooleanRadiogroup = document.getElementById("booleanAndGroup"); gSearchTermList = document.getElementById("searchTermList"); gSearchLessButton = document.getElementById("less"); if (!gSearchLessButton) dump("I couldn't find less button!"); // initialize some strings var bundle = document.getElementById('bundle_search'); gBooleanOrText = bundle.getString('orSearchText'); gBooleanAndText = bundle.getString('andSearchText'); gBooleanInitialText = bundle.getString('initialSearchText');}
gBooleanOrText = bundle.getString('orSearchText'); gBooleanAndText = bundle.getString('andSearchText'); gBooleanInitialText = bundle.getString('initialSearchText');
gMoreButtonTooltipText = bundle.getString('moreButtonTooltipText'); gLessButtonTooltipText = bundle.getString('lessButtonTooltipText');
function initializeSearchWidgets() { gSearchBooleanRadiogroup = document.getElementById("booleanAndGroup"); gSearchTermList = document.getElementById("searchTermList"); gSearchLessButton = document.getElementById("less"); if (!gSearchLessButton) dump("I couldn't find less button!"); // initialize some strings var bundle = document.getElementById('bundle_search'); gBooleanOrText = bundle.getString('orSearchText'); gBooleanAndText = bundle.getString('andSearchText'); gBooleanInitialText = bundle.getString('initialSearchText');}
hideMatchAllItem();
function initializeSearchWindowWidgets(){ gFolderPicker = document.getElementById("searchableFolders"); gSearchStopButton = document.getElementById("search-button"); gStatusBar = document.getElementById('statusbar-icon'); msgWindow = Components.classes[msgWindowContractID].createInstance(nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window); // functionality to enable/disable buttons using nsSearchResultsController // depending of whether items are selected in the search results thread pane. top.controllers.insertControllerAt(0, nsSearchResultsController);}
todoList.showCompleted = document.getElementById("completed-tasks-checkbox").checked; return;
function initializeTodoList(){ var todoList = document.getElementById("calendar-todo-list"); todoList.calendar = getCompositeCalendar(); todoList.addEventListener("todo-item-open", editTodoItem, false); todoList.addEventListener("todo-item-delete", deleteTodoItem, false); todoList.addEventListener("todo-empty-dblclick", newTodoItem, false);}
if ( this.mForced && desc ) { modified = this.replaceInsert( this.getString( "intro.attachment.label" ), 1, desc ); } else if ( this.mForced && !desc ) { modified = this.getString( "intro.attachment.noDesc.label" ); } else if ( desc ) { modified = this.replaceInsert( this.getString( "intro.withDesc" ), 1, desc ); }
if (desc) modified = this.replaceInsert( this.getString( text + "label" ), 1, desc );
initIntro: function(url, filename) { var intro = this.dialogElement( "intro" ); var desc = this.mLauncher.MIMEInfo.description; var modified; if ( this.mForced && desc ) { modified = this.replaceInsert( this.getString( "intro.attachment.label" ), 1, desc ); } else if ( this.mForced && !desc ) { modified = this.getString( "intro.attachment.noDesc.label" ); } else if ( desc ) { // Use intro with descriptive text. modified = this.replaceInsert( this.getString( "intro.withDesc" ), 1, desc ); } else { // Use intro without descriptive text. modified = this.getString( "intro.noDesc" ); } modified = this.replaceInsert( modified, 2, this.mLauncher.MIMEInfo.MIMEType ); modified = this.replaceInsert( modified, 3, filename); modified = this.replaceInsert( modified, 4, this.getString( "brandShortName" )); // if mSourcePath is a local file, then let's use the pretty path name instead of an ugly // url... var pathString = url.prePath; try { var fileURL = url.QueryInterface(Components.interfaces.nsIFileURL); if (fileURL) { var fileObject = fileURL.file; if (fileObject) { var parentObject = fileObject.parent; if (parentObject) { pathString = parentObject.path; } } } } catch(ex) {} intro.firstChild.nodeValue = ""; intro.firstChild.nodeValue = modified; // Set the location text, which is separate from the intro text so it can be cropped var location = this.dialogElement( "location" ); location.value = pathString; location.setAttribute( "tooltiptext", this.mSourcePath ); },
{ modified = this.getString( "intro.noDesc" ); }
modified = this.getString( text + "noDesc.label" );
initIntro: function(url, filename) { var intro = this.dialogElement( "intro" ); var desc = this.mLauncher.MIMEInfo.description; var modified; if ( this.mForced && desc ) { modified = this.replaceInsert( this.getString( "intro.attachment.label" ), 1, desc ); } else if ( this.mForced && !desc ) { modified = this.getString( "intro.attachment.noDesc.label" ); } else if ( desc ) { // Use intro with descriptive text. modified = this.replaceInsert( this.getString( "intro.withDesc" ), 1, desc ); } else { // Use intro without descriptive text. modified = this.getString( "intro.noDesc" ); } modified = this.replaceInsert( modified, 2, this.mLauncher.MIMEInfo.MIMEType ); modified = this.replaceInsert( modified, 3, filename); modified = this.replaceInsert( modified, 4, this.getString( "brandShortName" )); // if mSourcePath is a local file, then let's use the pretty path name instead of an ugly // url... var pathString = url.prePath; try { var fileURL = url.QueryInterface(Components.interfaces.nsIFileURL); if (fileURL) { var fileObject = fileURL.file; if (fileObject) { var parentObject = fileObject.parent; if (parentObject) { pathString = parentObject.path; } } } } catch(ex) {} intro.firstChild.nodeValue = ""; intro.firstChild.nodeValue = modified; // Set the location text, which is separate from the intro text so it can be cropped var location = this.dialogElement( "location" ); location.value = pathString; location.setAttribute( "tooltiptext", this.mSourcePath ); },