Bug 1478572 - Turn on ESLint in mail/components/preferences (manual changes). r=aceman
This commit is contained in:
Родитель
47d44c6d73
Коммит
5b169467ce
|
@ -0,0 +1,14 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = { // eslint-disable-line no-undef
|
||||||
|
"globals": {
|
||||||
|
// preferences.js
|
||||||
|
"AppConstants": true,
|
||||||
|
"MailServices": true,
|
||||||
|
"Services": true,
|
||||||
|
"ExtensionSupport": true,
|
||||||
|
|
||||||
|
// subdialogs.js
|
||||||
|
"gSubDialog": true,
|
||||||
|
},
|
||||||
|
};
|
|
@ -103,9 +103,9 @@
|
||||||
this.lastSelected = aPaneElement.id;
|
this.lastSelected = aPaneElement.id;
|
||||||
this.currentPane = aPaneElement;
|
this.currentPane = aPaneElement;
|
||||||
|
|
||||||
let targetHeight = parseInt(window.getComputedStyle(this._paneDeckContainer, "").height);
|
let targetHeight = parseInt(window.getComputedStyle(this._paneDeckContainer).height);
|
||||||
let verticalPadding = parseInt(window.getComputedStyle(aPaneElement, "").paddingTop);
|
let verticalPadding = parseInt(window.getComputedStyle(aPaneElement).paddingTop);
|
||||||
verticalPadding += parseInt(window.getComputedStyle(aPaneElement, "").paddingBottom);
|
verticalPadding += parseInt(window.getComputedStyle(aPaneElement).paddingBottom);
|
||||||
if (aPaneElement.contentHeight + verticalPadding < targetHeight)
|
if (aPaneElement.contentHeight + verticalPadding < targetHeight)
|
||||||
aPaneElement._content.style.height = targetHeight - verticalPadding + "px";
|
aPaneElement._content.style.height = targetHeight - verticalPadding + "px";
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// mail/base/content/aboutDialog-appUpdater.js
|
||||||
|
/* globals appUpdater, gAppUpdater */
|
||||||
|
|
||||||
// Load DownloadUtils module for convertByteUnits
|
// Load DownloadUtils module for convertByteUnits
|
||||||
ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
|
ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
|
||||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
@ -73,8 +76,7 @@ var gAdvancedPane = {
|
||||||
// If the shell service is not working, disable the "Check now" button
|
// If the shell service is not working, disable the "Check now" button
|
||||||
// and "perform check at startup" checkbox.
|
// and "perform check at startup" checkbox.
|
||||||
try {
|
try {
|
||||||
let shellSvc = Cc["@mozilla.org/mail/shell-service;1"]
|
Cc["@mozilla.org/mail/shell-service;1"].getService(Ci.nsIShellService);
|
||||||
.getService(Ci.nsIShellService);
|
|
||||||
this.mShellServiceWorking = true;
|
this.mShellServiceWorking = true;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// The elements may not exist if HAVE_SHELL_SERVICE is off.
|
// The elements may not exist if HAVE_SHELL_SERVICE is off.
|
||||||
|
@ -138,7 +140,7 @@ var gAdvancedPane = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gAppUpdater = new appUpdater();
|
gAppUpdater = new appUpdater(); // eslint-disable-line no-global-assign
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mInitialized = true;
|
this.mInitialized = true;
|
||||||
|
@ -213,10 +215,7 @@ var gAdvancedPane = {
|
||||||
actualSizeLabel.value = prefStrBundle.getString("actualDiskCacheSizeCalculated");
|
actualSizeLabel.value = prefStrBundle.getString("actualDiskCacheSizeCalculated");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let cacheService =
|
Services.cache2.asyncGetDiskConsumption(this.observer);
|
||||||
Cc["@mozilla.org/netwerk/cache-storage-service;1"]
|
|
||||||
.getService(Ci.nsICacheStorageService);
|
|
||||||
cacheService.asyncGetDiskConsumption(this.observer);
|
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -257,81 +256,71 @@ var gAdvancedPane = {
|
||||||
*/
|
*/
|
||||||
clearCache() {
|
clearCache() {
|
||||||
try {
|
try {
|
||||||
let cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
|
Services.cache2.clear();
|
||||||
.getService(Ci.nsICacheStorageService);
|
|
||||||
cache.clear();
|
|
||||||
} catch (ex) {}
|
} catch (ex) {}
|
||||||
this.updateActualCacheSize();
|
this.updateActualCacheSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateButtons(aButtonID, aPreferenceID) {
|
/**
|
||||||
var button = document.getElementById(aButtonID);
|
* Selects the item of the radiogroup based on the pref values and locked
|
||||||
var preference = document.getElementById(aPreferenceID);
|
* states.
|
||||||
// This is actually before the value changes, so the value is not as you expect.
|
*
|
||||||
button.disabled = preference.value == true;
|
* UI state matrix for update preference conditions
|
||||||
return undefined;
|
*
|
||||||
|
* UI Components: Preferences
|
||||||
|
* Radiogroup i = app.update.auto
|
||||||
|
*/
|
||||||
|
updateReadPrefs() {
|
||||||
|
let autoPref = document.getElementById("app.update.auto");
|
||||||
|
let radiogroup = document.getElementById("updateRadioGroup");
|
||||||
|
|
||||||
|
if (autoPref.value)
|
||||||
|
radiogroup.value = "auto"; // Automatically install updates
|
||||||
|
else
|
||||||
|
radiogroup.value = "checkOnly"; // Check, but let me choose
|
||||||
|
|
||||||
|
let canCheck = Cc["@mozilla.org/updates/update-service;1"].
|
||||||
|
getService(Ci.nsIApplicationUpdateService).
|
||||||
|
canCheckForUpdates;
|
||||||
|
|
||||||
|
// canCheck is false if the binary platform or OS version is not known.
|
||||||
|
// A locked pref is sufficient to disable the radiogroup.
|
||||||
|
radiogroup.disabled = !canCheck || autoPref.locked;
|
||||||
|
|
||||||
|
if (AppConstants.MOZ_MAINTENANCE_SERVICE) {
|
||||||
|
// Check to see if the maintenance service is installed.
|
||||||
|
// If it is don't show the preference at all.
|
||||||
|
let installed;
|
||||||
|
try {
|
||||||
|
let wrk = Cc["@mozilla.org/windows-registry-key;1"]
|
||||||
|
.createInstance(Ci.nsIWindowsRegKey);
|
||||||
|
wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
|
||||||
|
"SOFTWARE\\Mozilla\\MaintenanceService",
|
||||||
|
wrk.ACCESS_READ | wrk.WOW64_64);
|
||||||
|
installed = wrk.readIntValue("Installed");
|
||||||
|
wrk.close();
|
||||||
|
} catch (e) { }
|
||||||
|
if (installed != 1) {
|
||||||
|
document.getElementById("useService").hidden = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects the item of the radiogroup based on the pref values and locked
|
* Sets the pref values based on the selected item of the radiogroup.
|
||||||
* states.
|
*/
|
||||||
*
|
updateWritePrefs() {
|
||||||
* UI state matrix for update preference conditions
|
let autoPref = document.getElementById("app.update.auto");
|
||||||
*
|
let radiogroup = document.getElementById("updateRadioGroup");
|
||||||
* UI Components: Preferences
|
switch (radiogroup.value) {
|
||||||
* Radiogroup i = app.update.auto
|
case "auto": // Automatically install updates
|
||||||
*/
|
autoPref.value = true;
|
||||||
updateReadPrefs() {
|
break;
|
||||||
var autoPref = document.getElementById("app.update.auto");
|
case "checkOnly": // Check, but but let me choose
|
||||||
var radiogroup = document.getElementById("updateRadioGroup");
|
autoPref.value = false;
|
||||||
|
break;
|
||||||
if (autoPref.value)
|
|
||||||
radiogroup.value = "auto"; // Automatically install updates
|
|
||||||
else
|
|
||||||
radiogroup.value = "checkOnly"; // Check, but let me choose
|
|
||||||
|
|
||||||
var canCheck = Cc["@mozilla.org/updates/update-service;1"].
|
|
||||||
getService(Ci.nsIApplicationUpdateService).
|
|
||||||
canCheckForUpdates;
|
|
||||||
|
|
||||||
// canCheck is false if the binary platform or OS version is not known.
|
|
||||||
// A locked pref is sufficient to disable the radiogroup.
|
|
||||||
radiogroup.disabled = !canCheck || autoPref.locked;
|
|
||||||
|
|
||||||
if (AppConstants.MOZ_MAINTENANCE_SERVICE) {
|
|
||||||
// Check to see if the maintenance service is installed.
|
|
||||||
// If it is don't show the preference at all.
|
|
||||||
let installed;
|
|
||||||
try {
|
|
||||||
let wrk = Cc["@mozilla.org/windows-registry-key;1"]
|
|
||||||
.createInstance(Ci.nsIWindowsRegKey);
|
|
||||||
wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
|
|
||||||
"SOFTWARE\\Mozilla\\MaintenanceService",
|
|
||||||
wrk.ACCESS_READ | wrk.WOW64_64);
|
|
||||||
installed = wrk.readIntValue("Installed");
|
|
||||||
wrk.close();
|
|
||||||
} catch (e) { }
|
|
||||||
if (installed != 1) {
|
|
||||||
document.getElementById("useService").hidden = true;
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the pref values based on the selected item of the radiogroup.
|
|
||||||
*/
|
|
||||||
updateWritePrefs() {
|
|
||||||
var autoPref = document.getElementById("app.update.auto");
|
|
||||||
var radiogroup = document.getElementById("updateRadioGroup");
|
|
||||||
switch (radiogroup.value) {
|
|
||||||
case "auto": // Automatically install updates
|
|
||||||
autoPref.value = true;
|
|
||||||
break;
|
|
||||||
case "checkOnly": // Check, but but let me choose
|
|
||||||
autoPref.value = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
showUpdates() {
|
showUpdates() {
|
||||||
gSubDialog.open("chrome://mozapps/content/update/history.xul");
|
gSubDialog.open("chrome://mozapps/content/update/history.xul");
|
||||||
|
@ -484,13 +473,10 @@ updateWritePrefs() {
|
||||||
},
|
},
|
||||||
|
|
||||||
formatLocaleSetLabels() {
|
formatLocaleSetLabels() {
|
||||||
const localeService =
|
|
||||||
Cc["@mozilla.org/intl/localeservice;1"]
|
|
||||||
.getService(Ci.mozILocaleService);
|
|
||||||
const osprefs =
|
const osprefs =
|
||||||
Cc["@mozilla.org/intl/ospreferences;1"]
|
Cc["@mozilla.org/intl/ospreferences;1"]
|
||||||
.getService(Ci.mozIOSPreferences);
|
.getService(Ci.mozIOSPreferences);
|
||||||
let appLocale = localeService.getAppLocalesAsBCP47()[0];
|
let appLocale = Services.locale.getAppLocalesAsBCP47()[0];
|
||||||
let rsLocale = osprefs.getRegionalPrefsLocales()[0];
|
let rsLocale = osprefs.getRegionalPrefsLocales()[0];
|
||||||
let names = Services.intl.getLocaleDisplayNames(undefined, [appLocale, rsLocale]);
|
let names = Services.intl.getLocaleDisplayNames(undefined, [appLocale, rsLocale]);
|
||||||
let appLocaleRadio = document.getElementById("appLocale");
|
let appLocaleRadio = document.getElementById("appLocale");
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// applications.js
|
||||||
|
/* globals gApplicationsPane */
|
||||||
|
|
||||||
var gAppManagerDialog = {
|
var gAppManagerDialog = {
|
||||||
_removed: [],
|
_removed: [],
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,14 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
//* ***************************************************************************//
|
// applications.inc.xul
|
||||||
|
/* globals ICON_URL_APP */
|
||||||
|
// mail/base/content/contentAreaClick.js
|
||||||
|
/* globals openLinkExternally */
|
||||||
|
// toolkit/content/globalOverlay.js
|
||||||
|
/* globals goUpdateCommand */
|
||||||
|
|
||||||
|
// ------------------------------
|
||||||
// Constants & Enumeration Values
|
// Constants & Enumeration Values
|
||||||
|
|
||||||
var PREF_DISABLED_PLUGIN_TYPES = "plugin.disable_full_page_plugin_for_types";
|
var PREF_DISABLED_PLUGIN_TYPES = "plugin.disable_full_page_plugin_for_types";
|
||||||
|
@ -29,7 +36,7 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||||
|
|
||||||
//* ***************************************************************************//
|
// ---------
|
||||||
// Utilities
|
// Utilities
|
||||||
|
|
||||||
function getDisplayNameForFile(aFile) {
|
function getDisplayNameForFile(aFile) {
|
||||||
|
@ -87,7 +94,7 @@ ArrayEnumerator.prototype = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
//* ***************************************************************************//
|
// ------------------
|
||||||
// HandlerInfoWrapper
|
// HandlerInfoWrapper
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,16 +123,13 @@ HandlerInfoWrapper.prototype = {
|
||||||
// we haven't (yet?) implemented, so we make it a public property.
|
// we haven't (yet?) implemented, so we make it a public property.
|
||||||
wrappedHandlerInfo: null,
|
wrappedHandlerInfo: null,
|
||||||
|
|
||||||
//* *************************************************************************//
|
// -----------------
|
||||||
// Convenience Utils
|
// Convenience Utils
|
||||||
|
|
||||||
_handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"]
|
_handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"]
|
||||||
.getService(Ci.nsIHandlerService),
|
.getService(Ci.nsIHandlerService),
|
||||||
|
|
||||||
_categoryMgr: Cc["@mozilla.org/categorymanager;1"]
|
// --------------
|
||||||
.getService(Ci.nsICategoryManager),
|
|
||||||
|
|
||||||
//* *************************************************************************//
|
|
||||||
// nsIHandlerInfo
|
// nsIHandlerInfo
|
||||||
|
|
||||||
// The MIME type or protocol scheme.
|
// The MIME type or protocol scheme.
|
||||||
|
@ -164,8 +168,10 @@ HandlerInfoWrapper.prototype = {
|
||||||
|
|
||||||
addPossibleApplicationHandler(aNewHandler) {
|
addPossibleApplicationHandler(aNewHandler) {
|
||||||
try {
|
try {
|
||||||
|
/* eslint-disable mozilla/use-includes-instead-of-indexOf */
|
||||||
if (this.possibleApplicationHandlers.indexOf(0, aNewHandler) != -1)
|
if (this.possibleApplicationHandlers.indexOf(0, aNewHandler) != -1)
|
||||||
return;
|
return;
|
||||||
|
/* eslint-enable mozilla/use-includes-instead-of-indexOf */
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
this.possibleApplicationHandlers.appendElement(aNewHandler);
|
this.possibleApplicationHandlers.appendElement(aNewHandler);
|
||||||
},
|
},
|
||||||
|
@ -252,8 +258,7 @@ HandlerInfoWrapper.prototype = {
|
||||||
this.wrappedHandlerInfo.alwaysAskBeforeHandling = aNewValue;
|
this.wrappedHandlerInfo.alwaysAskBeforeHandling = aNewValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// -----------
|
||||||
//* *************************************************************************//
|
|
||||||
// nsIMIMEInfo
|
// nsIMIMEInfo
|
||||||
|
|
||||||
// The primary file extension associated with this type, if any.
|
// The primary file extension associated with this type, if any.
|
||||||
|
@ -271,8 +276,7 @@ HandlerInfoWrapper.prototype = {
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ---------------
|
||||||
//* *************************************************************************//
|
|
||||||
// Plugin Handling
|
// Plugin Handling
|
||||||
|
|
||||||
// A plugin that can handle this type, if any.
|
// A plugin that can handle this type, if any.
|
||||||
|
@ -321,9 +325,7 @@ HandlerInfoWrapper.prototype = {
|
||||||
disabledPluginTypes.join(","));
|
disabledPluginTypes.join(","));
|
||||||
|
|
||||||
// Update the category manager so existing browser windows update.
|
// Update the category manager so existing browser windows update.
|
||||||
this._categoryMgr.deleteCategoryEntry("Gecko-Content-Viewers",
|
Services.catMan.deleteCategoryEntry("Gecko-Content-Viewers", this.type, false);
|
||||||
this.type,
|
|
||||||
false);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
enablePluginType() {
|
enablePluginType() {
|
||||||
|
@ -336,16 +338,14 @@ HandlerInfoWrapper.prototype = {
|
||||||
disabledPluginTypes.join(","));
|
disabledPluginTypes.join(","));
|
||||||
|
|
||||||
// Update the category manager so existing browser windows update.
|
// Update the category manager so existing browser windows update.
|
||||||
this._categoryMgr.
|
Services.catMan.addCategoryEntry(
|
||||||
addCategoryEntry("Gecko-Content-Viewers",
|
"Gecko-Content-Viewers", this.type,
|
||||||
this.type,
|
"@mozilla.org/content/plugin/document-loader-factory;1",
|
||||||
"@mozilla.org/content/plugin/document-loader-factory;1",
|
false, true
|
||||||
false,
|
);
|
||||||
true);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// -------
|
||||||
//* *************************************************************************//
|
|
||||||
// Storage
|
// Storage
|
||||||
|
|
||||||
store() {
|
store() {
|
||||||
|
@ -356,8 +356,7 @@ HandlerInfoWrapper.prototype = {
|
||||||
this._handlerSvc.remove(this.wrappedHandlerInfo);
|
this._handlerSvc.remove(this.wrappedHandlerInfo);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// -----
|
||||||
//* *************************************************************************//
|
|
||||||
// Icons
|
// Icons
|
||||||
|
|
||||||
get smallIcon() {
|
get smallIcon() {
|
||||||
|
@ -618,9 +617,11 @@ var gCloudFileTab = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let accountInfo = {account,
|
let accountInfo = {
|
||||||
listItem: aItem,
|
account,
|
||||||
result: Cr.NS_ERROR_NOT_AVAILABLE};
|
listItem: aItem,
|
||||||
|
result: Cr.NS_ERROR_NOT_AVAILABLE,
|
||||||
|
};
|
||||||
|
|
||||||
this._accountCache[accountKey] = accountInfo;
|
this._accountCache[accountKey] = accountInfo;
|
||||||
|
|
||||||
|
@ -804,7 +805,7 @@ var gCloudFileTab = {
|
||||||
"nsISupportsWeakReference"]),
|
"nsISupportsWeakReference"]),
|
||||||
};
|
};
|
||||||
|
|
||||||
//* ***************************************************************************//
|
// -------------------
|
||||||
// Prefpane Controller
|
// Prefpane Controller
|
||||||
|
|
||||||
var gApplicationsPane = {
|
var gApplicationsPane = {
|
||||||
|
@ -828,7 +829,7 @@ var gApplicationsPane = {
|
||||||
_visibleTypeDescriptionCount: new Map(),
|
_visibleTypeDescriptionCount: new Map(),
|
||||||
|
|
||||||
|
|
||||||
//* *************************************************************************//
|
// -----------------------------------
|
||||||
// Convenience & Performance Shortcuts
|
// Convenience & Performance Shortcuts
|
||||||
|
|
||||||
// These get defined by init().
|
// These get defined by init().
|
||||||
|
@ -837,16 +838,15 @@ var gApplicationsPane = {
|
||||||
_list: null,
|
_list: null,
|
||||||
_filter: null,
|
_filter: null,
|
||||||
|
|
||||||
_mimeSvc: Cc["@mozilla.org/mime;1"]
|
_mimeSvc: Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService),
|
||||||
.getService(Ci.nsIMIMEService),
|
|
||||||
|
|
||||||
_helperAppSvc: Cc["@mozilla.org/uriloader/external-helper-app-service;1"]
|
_helperAppSvc: Cc["@mozilla.org/uriloader/external-helper-app-service;1"]
|
||||||
.getService(Ci.nsIExternalHelperAppService),
|
.getService(Ci.nsIExternalHelperAppService),
|
||||||
|
|
||||||
_handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"]
|
_handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"]
|
||||||
.getService(Ci.nsIHandlerService),
|
.getService(Ci.nsIHandlerService),
|
||||||
|
|
||||||
//* *************************************************************************//
|
// ----------------------------
|
||||||
// Initialization & Destruction
|
// Initialization & Destruction
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
@ -901,13 +901,12 @@ var gApplicationsPane = {
|
||||||
Services.prefs.removeObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this);
|
Services.prefs.removeObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// -----------
|
||||||
//* *************************************************************************//
|
|
||||||
// nsISupports
|
// nsISupports
|
||||||
|
|
||||||
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
|
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
|
||||||
|
|
||||||
//* *************************************************************************//
|
// -----------
|
||||||
// nsIObserver
|
// nsIObserver
|
||||||
|
|
||||||
observe(aSubject, aTopic, aData) {
|
observe(aSubject, aTopic, aData) {
|
||||||
|
@ -928,8 +927,7 @@ var gApplicationsPane = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// -------------
|
||||||
//* *************************************************************************//
|
|
||||||
// EventListener
|
// EventListener
|
||||||
|
|
||||||
handleEvent(aEvent) {
|
handleEvent(aEvent) {
|
||||||
|
@ -937,8 +935,7 @@ var gApplicationsPane = {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ---------------------------
|
||||||
//* *************************************************************************//
|
|
||||||
// Composed Model Construction
|
// Composed Model Construction
|
||||||
|
|
||||||
_loadData() {
|
_loadData() {
|
||||||
|
@ -1010,7 +1007,7 @@ var gApplicationsPane = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//* *************************************************************************//
|
// -----------------
|
||||||
// View Construction
|
// View Construction
|
||||||
|
|
||||||
_rebuildVisibleTypes() {
|
_rebuildVisibleTypes() {
|
||||||
|
@ -1405,9 +1402,6 @@ var gApplicationsPane = {
|
||||||
if (handlerInfo.alwaysAskBeforeHandling)
|
if (handlerInfo.alwaysAskBeforeHandling)
|
||||||
menu.selectedItem = askMenuItem;
|
menu.selectedItem = askMenuItem;
|
||||||
else switch (handlerInfo.preferredAction) {
|
else switch (handlerInfo.preferredAction) {
|
||||||
case Ci.nsIHandlerInfo.handleInternally:
|
|
||||||
menu.selectedItem = internalMenuItem;
|
|
||||||
break;
|
|
||||||
case Ci.nsIHandlerInfo.useSystemDefault:
|
case Ci.nsIHandlerInfo.useSystemDefault:
|
||||||
menu.selectedItem = defaultMenuItem;
|
menu.selectedItem = defaultMenuItem;
|
||||||
break;
|
break;
|
||||||
|
@ -1429,8 +1423,7 @@ var gApplicationsPane = {
|
||||||
menu.previousSelectedItem = menu.selectedItem || askMenuItem;
|
menu.previousSelectedItem = menu.selectedItem || askMenuItem;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// -------------------
|
||||||
//* *************************************************************************//
|
|
||||||
// Sorting & Filtering
|
// Sorting & Filtering
|
||||||
|
|
||||||
_sortColumn: null,
|
_sortColumn: null,
|
||||||
|
@ -1495,7 +1488,7 @@ var gApplicationsPane = {
|
||||||
this._filter.select();
|
this._filter.select();
|
||||||
},
|
},
|
||||||
|
|
||||||
//* *************************************************************************//
|
// -------
|
||||||
// Changes
|
// Changes
|
||||||
|
|
||||||
onSelectAction(aActionItem) {
|
onSelectAction(aActionItem) {
|
||||||
|
@ -1682,7 +1675,6 @@ var gApplicationsPane = {
|
||||||
this.onDelete(aEvent);
|
this.onDelete(aEvent);
|
||||||
else {
|
else {
|
||||||
// They hit cancel, so return them to the previously selected item.
|
// They hit cancel, so return them to the previously selected item.
|
||||||
let typeItem = this._list.selectedItem;
|
|
||||||
let menu = document.getAnonymousElementByAttribute(this._list.selectedItem,
|
let menu = document.getAnonymousElementByAttribute(this._list.selectedItem,
|
||||||
"class", "actionsMenu");
|
"class", "actionsMenu");
|
||||||
menu.selectedItem = menu.previousSelectedItem;
|
menu.selectedItem = menu.previousSelectedItem;
|
||||||
|
|
|
@ -21,9 +21,9 @@ var gAttachmentReminderOptionsDialog = {
|
||||||
Ci.nsIPrefLocalizedString);
|
Ci.nsIPrefLocalizedString);
|
||||||
if (!keywordsInCsv)
|
if (!keywordsInCsv)
|
||||||
return;
|
return;
|
||||||
var keywordsInCsv = keywordsInCsv.data;
|
keywordsInCsv = keywordsInCsv.data;
|
||||||
var keywordsInArr = keywordsInCsv.split(",");
|
var keywordsInArr = keywordsInCsv.split(",");
|
||||||
for (var i = 0; i < keywordsInArr.length; i++) {
|
for (let i = 0; i < keywordsInArr.length; i++) {
|
||||||
if (keywordsInArr[i])
|
if (keywordsInArr[i])
|
||||||
this.keywordListBox.appendItem(keywordsInArr[i], keywordsInArr[i]);
|
this.keywordListBox.appendItem(keywordsInArr[i], keywordsInArr[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// messagestyle.js
|
||||||
|
/* globals previewObserver */
|
||||||
|
|
||||||
var gChatPane = {
|
var gChatPane = {
|
||||||
init() {
|
init() {
|
||||||
previewObserver.load();
|
previewObserver.load();
|
||||||
|
@ -14,8 +17,9 @@ var gChatPane = {
|
||||||
if (document.getElementById("messenger.status.reportIdle").value) {
|
if (document.getElementById("messenger.status.reportIdle").value) {
|
||||||
broadcaster.removeAttribute("disabled");
|
broadcaster.removeAttribute("disabled");
|
||||||
this.updateMessageDisabledState();
|
this.updateMessageDisabledState();
|
||||||
} else
|
} else {
|
||||||
broadcaster.setAttribute("disabled", "true");
|
broadcaster.setAttribute("disabled", "true");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateMessageDisabledState() {
|
updateMessageDisabledState() {
|
||||||
|
|
|
@ -162,7 +162,7 @@ var gComposePane = {
|
||||||
.getService(Ci.nsIFontEnumerator);
|
.getService(Ci.nsIFontEnumerator);
|
||||||
var localFontCount = { value: 0 };
|
var localFontCount = { value: 0 };
|
||||||
var localFonts = enumerator.EnumerateAllFonts(localFontCount);
|
var localFonts = enumerator.EnumerateAllFonts(localFontCount);
|
||||||
for (var i = 0; i < localFonts.length; ++i) {
|
for (let i = 0; i < localFonts.length; ++i) {
|
||||||
// Remove Linux system generic fonts that collide with CSS generic fonts.
|
// Remove Linux system generic fonts that collide with CSS generic fonts.
|
||||||
if (localFonts[i] != "" && localFonts[i] != "serif" &&
|
if (localFonts[i] != "" && localFonts[i] != "serif" &&
|
||||||
localFonts[i] != "sans-serif" && localFonts[i] != "monospace")
|
localFonts[i] != "sans-serif" && localFonts[i] != "monospace")
|
||||||
|
|
|
@ -48,8 +48,9 @@ var gCookiesWindow = {
|
||||||
window.arguments[2].filterString) {
|
window.arguments[2].filterString) {
|
||||||
this.setFilter(window.arguments[2].filterString);
|
this.setFilter(window.arguments[2].filterString);
|
||||||
}
|
}
|
||||||
} else if (document.getElementById("filter").value != "")
|
} else if (document.getElementById("filter").value != "") {
|
||||||
this.filter();
|
this.filter();
|
||||||
|
}
|
||||||
|
|
||||||
this._saveState();
|
this._saveState();
|
||||||
},
|
},
|
||||||
|
@ -114,8 +115,9 @@ var gCookiesWindow = {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (hostItem.open)
|
} else if (hostItem.open) {
|
||||||
rowIndex += hostItem.cookies.length;
|
rowIndex += hostItem.cookies.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Just walk the filter list to find the item. It doesn't matter that
|
// Just walk the filter list to find the item. It doesn't matter that
|
||||||
|
@ -194,14 +196,14 @@ var gCookiesWindow = {
|
||||||
count = hostIndex = cacheItem.count;
|
count = hostIndex = cacheItem.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = start; i < gCookiesWindow._hostOrder.length; ++i) { // var host in gCookiesWindow._hosts) {
|
for (let i = start; i < gCookiesWindow._hostOrder.length; ++i) {
|
||||||
var currHost = gCookiesWindow._hosts[gCookiesWindow._hostOrder[i]]; // gCookiesWindow._hosts[host];
|
let currHost = gCookiesWindow._hosts[gCookiesWindow._hostOrder[i]];
|
||||||
if (!currHost) continue;
|
if (!currHost) continue;
|
||||||
if (count == aIndex)
|
if (count == aIndex)
|
||||||
return currHost;
|
return currHost;
|
||||||
hostIndex = count;
|
hostIndex = count;
|
||||||
|
|
||||||
var cacheEntry = { "start": i, "count": count };
|
let cacheEntry = { start: i, count };
|
||||||
var cacheStart = count;
|
var cacheStart = count;
|
||||||
|
|
||||||
if (currHost.open) {
|
if (currHost.open) {
|
||||||
|
@ -209,9 +211,9 @@ var gCookiesWindow = {
|
||||||
// We are looking for an entry within this host's children,
|
// We are looking for an entry within this host's children,
|
||||||
// enumerate them looking for the index.
|
// enumerate them looking for the index.
|
||||||
++count;
|
++count;
|
||||||
for (var i = 0; i < currHost.cookies.length; ++i) {
|
for (let j = 0; j < currHost.cookies.length; ++j) {
|
||||||
if (count == aIndex) {
|
if (count == aIndex) {
|
||||||
var cookie = currHost.cookies[i];
|
let cookie = currHost.cookies[j];
|
||||||
cookie.parentIndex = hostIndex;
|
cookie.parentIndex = hostIndex;
|
||||||
return cookie;
|
return cookie;
|
||||||
}
|
}
|
||||||
|
@ -224,11 +226,13 @@ var gCookiesWindow = {
|
||||||
// host value too.
|
// host value too.
|
||||||
count += currHost.cookies.length + 1;
|
count += currHost.cookies.length + 1;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
++count;
|
++count;
|
||||||
|
}
|
||||||
|
|
||||||
for (var j = cacheStart; j < count; j++)
|
for (let j = cacheStart; j < count; j++) {
|
||||||
this._cacheItems[j] = cacheEntry;
|
this._cacheItems[j] = cacheEntry;
|
||||||
|
}
|
||||||
this._cacheValid = count - 1;
|
this._cacheValid = count - 1;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -239,9 +243,9 @@ var gCookiesWindow = {
|
||||||
if (this._filtered) {
|
if (this._filtered) {
|
||||||
// remove the cookies from the unfiltered set so that they
|
// remove the cookies from the unfiltered set so that they
|
||||||
// don't reappear when the filter is changed. See bug 410863.
|
// don't reappear when the filter is changed. See bug 410863.
|
||||||
for (var i = aIndex; i < aIndex + removeCount; ++i) {
|
for (let i = aIndex; i < aIndex + removeCount; ++i) {
|
||||||
var item = this._filterSet[i];
|
let item = this._filterSet[i];
|
||||||
var parent = gCookiesWindow._hosts[item.rawHost];
|
let parent = gCookiesWindow._hosts[item.rawHost];
|
||||||
for (var j = 0; j < parent.cookies.length; ++j) {
|
for (var j = 0; j < parent.cookies.length; ++j) {
|
||||||
if (item == parent.cookies[j]) {
|
if (item == parent.cookies[j]) {
|
||||||
parent.cookies.splice(j, 1);
|
parent.cookies.splice(j, 1);
|
||||||
|
@ -253,14 +257,14 @@ var gCookiesWindow = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var item = this._getItemAtIndex(aIndex);
|
let item = this._getItemAtIndex(aIndex);
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
this._invalidateCache(aIndex - 1);
|
this._invalidateCache(aIndex - 1);
|
||||||
if (item.container) {
|
if (item.container) {
|
||||||
gCookiesWindow._hosts[item.rawHost] = null;
|
gCookiesWindow._hosts[item.rawHost] = null;
|
||||||
} else {
|
} else {
|
||||||
var parent = this._getItemAtIndex(item.parentIndex);
|
let parent = this._getItemAtIndex(item.parentIndex);
|
||||||
for (var i = 0; i < parent.cookies.length; ++i) {
|
for (let i = 0; i < parent.cookies.length; ++i) {
|
||||||
var cookie = parent.cookies[i];
|
var cookie = parent.cookies[i];
|
||||||
if (item.rawHost == cookie.rawHost &&
|
if (item.rawHost == cookie.rawHost &&
|
||||||
item.name == cookie.name &&
|
item.name == cookie.name &&
|
||||||
|
@ -280,16 +284,20 @@ var gCookiesWindow = {
|
||||||
getCellText(aIndex, aColumn) {
|
getCellText(aIndex, aColumn) {
|
||||||
if (!this._filtered) {
|
if (!this._filtered) {
|
||||||
var item = this._getItemAtIndex(aIndex);
|
var item = this._getItemAtIndex(aIndex);
|
||||||
if (!item)
|
if (!item) {
|
||||||
return "";
|
return "";
|
||||||
if (aColumn.id == "domainCol")
|
}
|
||||||
|
if (aColumn.id == "domainCol") {
|
||||||
return item.rawHost;
|
return item.rawHost;
|
||||||
else if (aColumn.id == "nameCol")
|
}
|
||||||
|
if (aColumn.id == "nameCol") {
|
||||||
return ("name" in item) ? item.name : "";
|
return ("name" in item) ? item.name : "";
|
||||||
} else if (aColumn.id == "domainCol")
|
}
|
||||||
return this._filterSet[aIndex].rawHost;
|
} else if (aColumn.id == "domainCol") {
|
||||||
else if (aColumn.id == "nameCol")
|
return this._filterSet[aIndex].rawHost;
|
||||||
return ("name" in this._filterSet[aIndex]) ? this._filterSet[aIndex].name : "";
|
} else if (aColumn.id == "nameCol") {
|
||||||
|
return ("name" in this._filterSet[aIndex]) ? this._filterSet[aIndex].name : "";
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -357,10 +365,9 @@ var gCookiesWindow = {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var parent = this._getItemAtIndex(item.parentIndex);
|
let parent = this._getItemAtIndex(item.parentIndex);
|
||||||
if (parent && parent.container)
|
if (parent && parent.container)
|
||||||
return aIndex < item.parentIndex + parent.cookies.length;
|
return aIndex < item.parentIndex + parent.cookies.length;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return aIndex < this.rowCount - 1;
|
return aIndex < this.rowCount - 1;
|
||||||
|
@ -423,11 +430,13 @@ var gCookiesWindow = {
|
||||||
|
|
||||||
_addCookie(aStrippedHost, aCookie, aHostCount) {
|
_addCookie(aStrippedHost, aCookie, aHostCount) {
|
||||||
if (!(aStrippedHost in this._hosts) || !this._hosts[aStrippedHost]) {
|
if (!(aStrippedHost in this._hosts) || !this._hosts[aStrippedHost]) {
|
||||||
this._hosts[aStrippedHost] = { cookies: [],
|
this._hosts[aStrippedHost] = {
|
||||||
rawHost: aStrippedHost,
|
cookies: [],
|
||||||
level: 0,
|
rawHost: aStrippedHost,
|
||||||
open: false,
|
level: 0,
|
||||||
container: true };
|
open: false,
|
||||||
|
container: true,
|
||||||
|
};
|
||||||
this._hostOrder.push(aStrippedHost);
|
this._hostOrder.push(aStrippedHost);
|
||||||
++aHostCount.value;
|
++aHostCount.value;
|
||||||
}
|
}
|
||||||
|
@ -437,19 +446,19 @@ var gCookiesWindow = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_makeCookieObject(aStrippedHost, aCookie) {
|
_makeCookieObject(aStrippedHost, aCookie) {
|
||||||
let host = aCookie.host;
|
let c = {
|
||||||
let formattedHost = host.startsWith(".") ? host.substring(1) : host;
|
name: aCookie.name,
|
||||||
let c = { name: aCookie.name,
|
value: aCookie.value,
|
||||||
value: aCookie.value,
|
isDomain: aCookie.isDomain,
|
||||||
isDomain: aCookie.isDomain,
|
host: aCookie.host,
|
||||||
host: aCookie.host,
|
rawHost: aStrippedHost,
|
||||||
rawHost: aStrippedHost,
|
path: aCookie.path,
|
||||||
path: aCookie.path,
|
isSecure: aCookie.isSecure,
|
||||||
isSecure: aCookie.isSecure,
|
expires: aCookie.expires,
|
||||||
expires: aCookie.expires,
|
level: 1,
|
||||||
level: 1,
|
container: false,
|
||||||
container: false,
|
originAttributes: aCookie.originAttributes,
|
||||||
originAttributes: aCookie.originAttributes };
|
};
|
||||||
return c;
|
return c;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -463,8 +472,9 @@ var gCookiesWindow = {
|
||||||
if (cookie && cookie instanceof Ci.nsICookie) {
|
if (cookie && cookie instanceof Ci.nsICookie) {
|
||||||
var strippedHost = this._makeStrippedHost(cookie.host);
|
var strippedHost = this._makeStrippedHost(cookie.host);
|
||||||
this._addCookie(strippedHost, cookie, hostCount);
|
this._addCookie(strippedHost, cookie, hostCount);
|
||||||
} else
|
} else {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this._view._rowCount = hostCount.value;
|
this._view._rowCount = hostCount.value;
|
||||||
},
|
},
|
||||||
|
@ -538,7 +548,7 @@ var gCookiesWindow = {
|
||||||
++selectedCookieCount;
|
++selectedCookieCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var item = this._view._getItemAtIndex(seln.currentIndex);
|
item = this._view._getItemAtIndex(seln.currentIndex);
|
||||||
if (item && seln.count == 1 && item.container && item.open)
|
if (item && seln.count == 1 && item.container && item.open)
|
||||||
selectedCookieCount += 2;
|
selectedCookieCount += 2;
|
||||||
|
|
||||||
|
@ -612,7 +622,7 @@ var gCookiesWindow = {
|
||||||
var ci = seln.currentIndex;
|
var ci = seln.currentIndex;
|
||||||
nextSelected = ci;
|
nextSelected = ci;
|
||||||
var invalidateRow = -1;
|
var invalidateRow = -1;
|
||||||
var item = this._view._getItemAtIndex(ci);
|
let item = this._view._getItemAtIndex(ci);
|
||||||
if (item.container) {
|
if (item.container) {
|
||||||
rowCountImpact -= (item.open ? item.cookies.length : 0) + 1;
|
rowCountImpact -= (item.open ? item.cookies.length : 0) + 1;
|
||||||
deleteItems = deleteItems.concat(item.cookies);
|
deleteItems = deleteItems.concat(item.cookies);
|
||||||
|
@ -665,8 +675,7 @@ var gCookiesWindow = {
|
||||||
if (Services.prefs.prefHasUserValue("network.cookie.blockFutureCookies"))
|
if (Services.prefs.prefHasUserValue("network.cookie.blockFutureCookies"))
|
||||||
blockFutureCookies = Services.prefs
|
blockFutureCookies = Services.prefs
|
||||||
.getBoolPref("network.cookie.blockFutureCookies");
|
.getBoolPref("network.cookie.blockFutureCookies");
|
||||||
for (i = 0; i < deleteItems.length; ++i) {
|
for (let item of deleteItems) {
|
||||||
var item = deleteItems[i];
|
|
||||||
Services.cookies.remove(item.host, item.name, item.path,
|
Services.cookies.remove(item.host, item.name, item.path,
|
||||||
item.originAttributes, blockFutureCookies);
|
item.originAttributes, blockFutureCookies);
|
||||||
}
|
}
|
||||||
|
@ -780,8 +789,8 @@ var gCookiesWindow = {
|
||||||
_filterCookies(aFilterValue) {
|
_filterCookies(aFilterValue) {
|
||||||
this._view._filterValue = aFilterValue;
|
this._view._filterValue = aFilterValue;
|
||||||
var cookies = [];
|
var cookies = [];
|
||||||
for (var i = 0; i < gCookiesWindow._hostOrder.length; ++i) { // var host in gCookiesWindow._hosts) {
|
for (let i = 0; i < gCookiesWindow._hostOrder.length; ++i) {
|
||||||
var currHost = gCookiesWindow._hosts[gCookiesWindow._hostOrder[i]]; // gCookiesWindow._hosts[host];
|
let currHost = gCookiesWindow._hosts[gCookiesWindow._hostOrder[i]];
|
||||||
if (!currHost) continue;
|
if (!currHost) continue;
|
||||||
for (var j = 0; j < currHost.cookies.length; ++j) {
|
for (var j = 0; j < currHost.cookies.length; ++j) {
|
||||||
var cookie = currHost.cookies[j];
|
var cookie = currHost.cookies[j];
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// toolkit/mozapps/preferences/fontbuilder.js
|
||||||
|
/* globals FontBuilder */
|
||||||
|
|
||||||
var gDisplayPane = {
|
var gDisplayPane = {
|
||||||
mInitialized: false,
|
mInitialized: false,
|
||||||
mTagListBox: null,
|
mTagListBox: null,
|
||||||
|
@ -226,15 +229,13 @@ var gDisplayPane = {
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
var tagElToEdit = this.mTagListBox.getItemAtIndex(index);
|
var tagElToEdit = this.mTagListBox.getItemAtIndex(index);
|
||||||
var args = {result: "", keyToEdit: tagElToEdit.getAttribute("value"), okCallback: editTagCallback};
|
var args = {result: "", keyToEdit: tagElToEdit.getAttribute("value"), okCallback: editTagCallback};
|
||||||
let dialog = gSubDialog.open("chrome://messenger/content/newTagDialog.xul",
|
gSubDialog.open("chrome://messenger/content/newTagDialog.xul", "resizable=no", args);
|
||||||
"resizable=no", args);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addTag() {
|
addTag() {
|
||||||
var args = {result: "", okCallback: addTagCallback};
|
var args = {result: "", okCallback: addTagCallback};
|
||||||
let dialog = gSubDialog.open("chrome://messenger/content/newTagDialog.xul",
|
gSubDialog.open("chrome://messenger/content/newTagDialog.xul", "resizable=no", args);
|
||||||
"resizable=no", args);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onSelect() {
|
onSelect() {
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
var requestAlways;
|
|
||||||
var requestAlwaysPref;
|
|
||||||
|
|
||||||
var requestOnSuccess;
|
|
||||||
var requestOnSuccessPref;
|
|
||||||
|
|
||||||
var requestOnFailure;
|
|
||||||
var requestOnFailurePref;
|
|
||||||
|
|
||||||
var requestOnDelay;
|
|
||||||
var requestOnDelayPref;
|
|
||||||
|
|
||||||
var requestNever;
|
|
||||||
var requestNeverPref;
|
|
||||||
|
|
||||||
function onInit()
|
|
||||||
{
|
|
||||||
requestAlways = document.getElementById("always_request_on");
|
|
||||||
requestAlwaysPref = document.getElementById("mail.dsn.always_request_on");
|
|
||||||
|
|
||||||
requestOnSuccess = document.getElementById("request_on_success_on");
|
|
||||||
requestOnSuccessPref = document.getElementById("mail.dsn.request_on_success_on");
|
|
||||||
|
|
||||||
requestOnFailure = document.getElementById("request_on_failure_on");
|
|
||||||
requestOnFailurePref = document.getElementById("mail.dsn.request_on_failure_on");
|
|
||||||
|
|
||||||
requestOnDelay = document.getElementById("request_on_delay_on");
|
|
||||||
requestOnDelayPref = document.getElementById("mail.dsn.request_on_delay_on");
|
|
||||||
|
|
||||||
requestNever = document.getElementById("request_never_on");
|
|
||||||
requestNeverPref = document.getElementById("mail.dsn.request_never_on");
|
|
||||||
|
|
||||||
EnableDisableAllowedDSNRequests(new Object());
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function EnableDisableAllowedDSNRequests(target)
|
|
||||||
{
|
|
||||||
var s = requestOnSuccess.checked;
|
|
||||||
var f = requestOnFailure.checked;
|
|
||||||
var d = requestOnDelay.checked;
|
|
||||||
var n = requestNever.checked;
|
|
||||||
|
|
||||||
// Case when the checkbox requestAlways must be enabled
|
|
||||||
if (s || f || d || n) {
|
|
||||||
requestAlways.disabled = false;
|
|
||||||
|
|
||||||
// Case when the checkbox requestAlways must be disabled
|
|
||||||
} else if (!d && !n && !s && !f) {
|
|
||||||
requestAlwaysPref.value = false;
|
|
||||||
requestAlways.disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Checkbox requestNever is exclusive with checkboxes requestOnSuccess, requestOnFailure, requestOnDelay
|
|
||||||
if (target == requestNever) {
|
|
||||||
requestOnSuccessPref.value = requestOnFailurePref.value = requestOnDelayPref.value = false;
|
|
||||||
|
|
||||||
} else if (target == requestOnSuccess || target == requestOnFailure || target == requestOnDelay) {
|
|
||||||
requestNeverPref.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,100 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
|
|
||||||
# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
|
||||||
|
|
||||||
<!DOCTYPE prefwindow [
|
|
||||||
<!ENTITY % dsnDTD SYSTEM "chrome://messenger/locale/preferences/dsn.dtd">
|
|
||||||
%dsnDTD;
|
|
||||||
]>
|
|
||||||
|
|
||||||
<prefwindow id="DSNDialog" type="child"
|
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
||||||
dlgbuttons="accept,cancel"
|
|
||||||
title="&dialog.title;">
|
|
||||||
|
|
||||||
<script type="application/javascript" src="chrome://messenger/content/preferences/dsn.js"/>
|
|
||||||
|
|
||||||
<prefpane id="DSNDialogPane" onpaneload="onInit();">
|
|
||||||
<preferences id="DSNPreferences">
|
|
||||||
<preference id="mail.dsn.request_on_success_on"
|
|
||||||
name="mail.dsn.request_on_success_on"
|
|
||||||
type="bool"/>
|
|
||||||
|
|
||||||
<preference id="mail.dsn.request_on_failure_on"
|
|
||||||
name="mail.dsn.request_on_failure_on"
|
|
||||||
type="bool"/>
|
|
||||||
|
|
||||||
<preference id="mail.dsn.request_on_delay_on"
|
|
||||||
name="mail.dsn.request_on_delay_on"
|
|
||||||
type="bool"/>
|
|
||||||
|
|
||||||
<preference id="mail.dsn.request_never_on"
|
|
||||||
name="mail.dsn.request_never_on"
|
|
||||||
type="bool"/>
|
|
||||||
|
|
||||||
<preference id="mail.dsn.always_request_on"
|
|
||||||
name="mail.dsn.always_request_on"
|
|
||||||
type="bool"/>
|
|
||||||
|
|
||||||
<preference id="mail.dsn.ret_full_on"
|
|
||||||
name="mail.dsn.ret_full_on"
|
|
||||||
type="bool"/>
|
|
||||||
</preferences>
|
|
||||||
|
|
||||||
<description>&optionTitle.label;</description>
|
|
||||||
|
|
||||||
<!-- When this checkbox is checked, DSN request is sent with SUCCESS option -->
|
|
||||||
<checkbox id="request_on_success_on"
|
|
||||||
label="&requestOnSucess.label;"
|
|
||||||
preference="mail.dsn.request_on_success_on"
|
|
||||||
accesskey="&requestOnSucess.accesskey;"
|
|
||||||
oncommand="EnableDisableAllowedDSNRequests(this)"/>
|
|
||||||
|
|
||||||
<!-- When this checkbox is checked, DSN request is sent with FAILURE option -->
|
|
||||||
<checkbox id="request_on_failure_on"
|
|
||||||
label="&requestOnFailure.label;"
|
|
||||||
preference="mail.dsn.request_on_failure_on"
|
|
||||||
accesskey="&requestOnFailure.accesskey;"
|
|
||||||
oncommand="EnableDisableAllowedDSNRequests(this)"/>
|
|
||||||
|
|
||||||
<!-- When this checkbox is checked, DSN request is sent with DELAY option -->
|
|
||||||
<checkbox id="request_on_delay_on"
|
|
||||||
label="&requestOnDelay.label;"
|
|
||||||
preference="mail.dsn.request_on_delay_on"
|
|
||||||
accesskey="&requestOnDelay.accesskey;"
|
|
||||||
oncommand="EnableDisableAllowedDSNRequests(this)"/>
|
|
||||||
|
|
||||||
<!-- When this checkbox is checked, DSN request is sent with NEVER option -->
|
|
||||||
<checkbox id="request_never_on"
|
|
||||||
label="&requestNever.label;"
|
|
||||||
preference="mail.dsn.request_never_on"
|
|
||||||
accesskey="&requestNever.accesskey;"
|
|
||||||
oncommand="EnableDisableAllowedDSNRequests(this)"/>
|
|
||||||
|
|
||||||
<separator class="thin"/>
|
|
||||||
<separator class="groove"/>
|
|
||||||
<separator class="thin"/>
|
|
||||||
|
|
||||||
<checkbox id="always_request_on"
|
|
||||||
label="&requestAlways.label;"
|
|
||||||
preference="mail.dsn.always_request_on"
|
|
||||||
accesskey="&requestAlways.accesskey;"/>
|
|
||||||
|
|
||||||
<separator class="thin"/>
|
|
||||||
<separator class="groove"/>
|
|
||||||
<separator class="thin"/>
|
|
||||||
|
|
||||||
<label value="&RET_FailureMessage.label;" control="ret_full_on"/>
|
|
||||||
<radiogroup id="ret_full_on" preference="mail.dsn.ret_full_on" orient="horizontal">
|
|
||||||
<radio value="true" label="&RET_FULL.label;" accesskey="&RET_FULL.accesskey;" />
|
|
||||||
<radio value="false" label="&RET_HDRS.label;" accesskey="&RET_HDRS.accesskey;" />
|
|
||||||
</radiogroup>
|
|
||||||
|
|
||||||
<separator class="thin"/>
|
|
||||||
</prefpane>
|
|
||||||
</prefwindow>
|
|
|
@ -3,6 +3,11 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// toolkit/content/preferencesBindings.js
|
||||||
|
/* globals Preferences */
|
||||||
|
// toolkit/mozapps/preferences/fontbuilder.js
|
||||||
|
/* globals FontBuilder */
|
||||||
|
|
||||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
var kDefaultFontType = "font.default.%LANG%";
|
var kDefaultFontType = "font.default.%LANG%";
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
<!-- Overriding listitem -->
|
<!-- Overriding listitem -->
|
||||||
<property name="selected" onget="return this.getAttribute('selected') == 'true';">
|
<property name="selected" onget="return this.getAttribute('selected') == 'true';">
|
||||||
<setter><![CDATA[
|
<setter><![CDATA[
|
||||||
|
// applications.js
|
||||||
|
/* globals gApplicationsPane */
|
||||||
if (val) {
|
if (val) {
|
||||||
this.setAttribute("selected", "true");
|
this.setAttribute("selected", "true");
|
||||||
gApplicationsPane.rebuildActionsMenu();
|
gApplicationsPane.rebuildActionsMenu();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
var jsProtoHelper = {};
|
var jsProtoHelper = {};
|
||||||
ChromeUtils.import("resource:///modules/jsProtoHelper.jsm", jsProtoHelper);
|
ChromeUtils.import("resource:///modules/jsProtoHelper.jsm", jsProtoHelper);
|
||||||
ChromeUtils.import("resource:///modules/imThemes.jsm");
|
const { getThemeByName, getThemeVariants } = ChromeUtils.import("resource:///modules/imThemes.jsm", null);
|
||||||
|
|
||||||
function Conversation(aName) {
|
function Conversation(aName) {
|
||||||
this._name = aName;
|
this._name = aName;
|
||||||
|
@ -55,8 +55,6 @@ var previewObserver = {
|
||||||
previewObserver.conv = conv;
|
previewObserver.conv = conv;
|
||||||
|
|
||||||
let themeName = document.getElementById("messagestyle-themename");
|
let themeName = document.getElementById("messagestyle-themename");
|
||||||
if (themeName.value && !themeName.selectedItem)
|
|
||||||
themeName.value = themeName.value;
|
|
||||||
previewObserver.browser = document.getElementById("previewbrowser");
|
previewObserver.browser = document.getElementById("previewbrowser");
|
||||||
document.getElementById("showHeaderCheckbox")
|
document.getElementById("showHeaderCheckbox")
|
||||||
.addEventListener("CheckboxStateChange",
|
.addEventListener("CheckboxStateChange",
|
||||||
|
|
|
@ -13,7 +13,8 @@ var gOfflineDialog = {
|
||||||
offlineStartupStatePref.disabled = offlineAutoDetection.value;
|
offlineStartupStatePref.disabled = offlineAutoDetection.value;
|
||||||
if (offlineStartupStatePref.disabled) {
|
if (offlineStartupStatePref.disabled) {
|
||||||
offlineStartupStatePref.value = kAutomatic;
|
offlineStartupStatePref.value = kAutomatic;
|
||||||
} else if (offlineStartupStatePref.value == kAutomatic)
|
} else if (offlineStartupStatePref.value == kAutomatic) {
|
||||||
offlineStartupStatePref.value = kRememberLastState;
|
offlineStartupStatePref.value = kRememberLastState;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// toolkit/content/treeUtils.js
|
||||||
|
/* globals gTreeUtils */
|
||||||
|
|
||||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||||
|
|
||||||
|
@ -224,7 +227,7 @@ var gPermissionManager = {
|
||||||
|
|
||||||
var permissionsText = document.getElementById("permissionsText");
|
var permissionsText = document.getElementById("permissionsText");
|
||||||
while (permissionsText.hasChildNodes())
|
while (permissionsText.hasChildNodes())
|
||||||
permissionsText.removeChild(permissionsText.firstChild);
|
permissionsText.firstChild.remove();
|
||||||
permissionsText.appendChild(document.createTextNode(aParams.introText));
|
permissionsText.appendChild(document.createTextNode(aParams.introText));
|
||||||
|
|
||||||
document.title = aParams.windowTitle;
|
document.title = aParams.windowTitle;
|
||||||
|
@ -378,7 +381,6 @@ var gPermissionManager = {
|
||||||
this._permissions = [];
|
this._permissions = [];
|
||||||
|
|
||||||
// load permissions into a table
|
// load permissions into a table
|
||||||
var count = 0;
|
|
||||||
var enumerator = Services.perms.enumerator;
|
var enumerator = Services.perms.enumerator;
|
||||||
while (enumerator.hasMoreElements()) {
|
while (enumerator.hasMoreElements()) {
|
||||||
var nextPermission = enumerator.getNext().QueryInterface(Ci.nsIPermission);
|
var nextPermission = enumerator.getNext().QueryInterface(Ci.nsIPermission);
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// mail/base/content/specialTabs.js
|
||||||
|
/* globals contentTabBaseType, DOMLinkHandler */
|
||||||
|
|
||||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
ChromeUtils.import("resource:///modules/errUtils.js");
|
ChromeUtils.import("resource:///modules/errUtils.js");
|
||||||
|
|
|
@ -60,13 +60,15 @@ var gPrivacyPane = {
|
||||||
*/
|
*/
|
||||||
showCookieExceptions() {
|
showCookieExceptions() {
|
||||||
let bundle = document.getElementById("bundlePreferences");
|
let bundle = document.getElementById("bundlePreferences");
|
||||||
let params = { blockVisible: true,
|
let params = {
|
||||||
sessionVisible: true,
|
blockVisible: true,
|
||||||
allowVisible: true,
|
sessionVisible: true,
|
||||||
prefilledHost: "",
|
allowVisible: true,
|
||||||
permissionType: "cookie",
|
prefilledHost: "",
|
||||||
windowTitle: bundle.getString("cookiepermissionstitle"),
|
permissionType: "cookie",
|
||||||
introText: bundle.getString("cookiepermissionstext") };
|
windowTitle: bundle.getString("cookiepermissionstitle"),
|
||||||
|
introText: bundle.getString("cookiepermissionstext"),
|
||||||
|
};
|
||||||
gSubDialog.open("chrome://messenger/content/preferences/permissions.xul",
|
gSubDialog.open("chrome://messenger/content/preferences/permissions.xul",
|
||||||
null, params);
|
null, params);
|
||||||
},
|
},
|
||||||
|
@ -118,13 +120,15 @@ var gPrivacyPane = {
|
||||||
*/
|
*/
|
||||||
showRemoteContentExceptions() {
|
showRemoteContentExceptions() {
|
||||||
let bundle = document.getElementById("bundlePreferences");
|
let bundle = document.getElementById("bundlePreferences");
|
||||||
let params = { blockVisible: true,
|
let params = {
|
||||||
sessionVisible: false,
|
blockVisible: true,
|
||||||
allowVisible: true,
|
sessionVisible: false,
|
||||||
prefilledHost: "",
|
allowVisible: true,
|
||||||
permissionType: "image",
|
prefilledHost: "",
|
||||||
windowTitle: bundle.getString("imagepermissionstitle"),
|
permissionType: "image",
|
||||||
introText: bundle.getString("imagepermissionstext") };
|
windowTitle: bundle.getString("imagepermissionstitle"),
|
||||||
|
introText: bundle.getString("imagepermissionstext"),
|
||||||
|
};
|
||||||
gSubDialog.open("chrome://messenger/content/preferences/permissions.xul",
|
gSubDialog.open("chrome://messenger/content/preferences/permissions.xul",
|
||||||
null, params);
|
null, params);
|
||||||
},
|
},
|
||||||
|
|
|
@ -69,8 +69,9 @@ var gSecurityPane = {
|
||||||
*/
|
*/
|
||||||
reloadMessageInOpener() {
|
reloadMessageInOpener() {
|
||||||
if (Services.prefs.getBoolPref("browser.preferences.instantApply") &&
|
if (Services.prefs.getBoolPref("browser.preferences.instantApply") &&
|
||||||
window.opener && typeof(window.opener.ReloadMessage) == "function")
|
window.opener && typeof(window.opener.ReloadMessage) == "function") {
|
||||||
window.opener.ReloadMessage();
|
window.opener.ReloadMessage();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,7 +148,8 @@ var gSecurityPane = {
|
||||||
},
|
},
|
||||||
|
|
||||||
updateDownloadedPhishingListState() {
|
updateDownloadedPhishingListState() {
|
||||||
document.getElementById("useDownloadedList").disabled = !document.getElementById("enablePhishingDetector").checked;
|
document.getElementById("useDownloadedList").disabled =
|
||||||
|
!document.getElementById("enablePhishingDetector").checked;
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,6 @@ var gSendOptionsDialog = {
|
||||||
this.mHTMLListBox = document.getElementById("html_domains");
|
this.mHTMLListBox = document.getElementById("html_domains");
|
||||||
this.mPlainTextListBox = document.getElementById("plaintext_domains");
|
this.mPlainTextListBox = document.getElementById("plaintext_domains");
|
||||||
|
|
||||||
var htmlDomainPrefString = document.getElementById("mailnews.html_domains").value;
|
|
||||||
this.loadDomains(document.getElementById("mailnews.html_domains").value,
|
this.loadDomains(document.getElementById("mailnews.html_domains").value,
|
||||||
this.mHTMLListBox);
|
this.mHTMLListBox);
|
||||||
this.loadDomains(document.getElementById("mailnews.plaintext_domains").value,
|
this.loadDomains(document.getElementById("mailnews.plaintext_domains").value,
|
||||||
|
@ -27,7 +26,7 @@ var gSendOptionsDialog = {
|
||||||
var num_domains = 0;
|
var num_domains = 0;
|
||||||
var pref_string = "";
|
var pref_string = "";
|
||||||
|
|
||||||
for (var item = listbox.firstChild; item != null; item = item.nextSibling) {
|
for (let item = listbox.firstChild; item != null; item = item.nextSibling) {
|
||||||
var domainid = item.firstChild.getAttribute("value");
|
var domainid = item.firstChild.getAttribute("value");
|
||||||
if (domainid.length > 1) {
|
if (domainid.length > 1) {
|
||||||
num_domains++;
|
num_domains++;
|
||||||
|
@ -44,13 +43,12 @@ var gSendOptionsDialog = {
|
||||||
},
|
},
|
||||||
|
|
||||||
loadDomains(aPrefString, aListBox) {
|
loadDomains(aPrefString, aListBox) {
|
||||||
var arrayOfPrefs = aPrefString.split(",");
|
for (let str of aPrefString.split(",")) {
|
||||||
if (arrayOfPrefs)
|
str = str.replace(/ /g, "");
|
||||||
for (var i = 0; i < arrayOfPrefs.length; i++) {
|
if (str) {
|
||||||
var str = arrayOfPrefs[i].replace(/ /g, "");
|
this.addItemToDomainList(aListBox, str);
|
||||||
if (str)
|
|
||||||
this.addItemToDomainList(aListBox, str);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
removeDomains(aHTML) {
|
removeDomains(aHTML) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче