[Pale-Moon] Issue MoonchildProductions/UXP#516 - Remove named function syntax from palemoon/components/preferences.

This commit is contained in:
athenian200 2020-02-06 06:51:58 -06:00 • committed by Roy Tam
commit 0764896876
5 changed files with 18 additions and 18 deletions

View file

@ -233,7 +233,7 @@ var gAdvancedPane = {
Visitor.prototype = { Visitor.prototype = {
expected: 0, expected: 0,
sum: 0, sum: 0,
QueryInterface: function listener_qi(iid) { QueryInterface: function (iid) {
if (iid.equals(Components.interfaces.nsISupports) || if (iid.equals(Components.interfaces.nsISupports) ||
iid.equals(Components.interfaces.nsICacheStorageVisitor)) { iid.equals(Components.interfaces.nsICacheStorageVisitor)) {
return this; return this;

View file

@ -10,7 +10,7 @@ var Ci = Components.interfaces;
var gAppManagerDialog = { var gAppManagerDialog = {
_removed: [], _removed: [],
init: function appManager_init() { init: function () {
this.handlerInfo = window.arguments[0]; this.handlerInfo = window.arguments[0];
var bundle = document.getElementById("appManagerBundle"); var bundle = document.getElementById("appManagerBundle");
@ -44,7 +44,7 @@ var gAppManagerDialog = {
list.selectedIndex = 0; list.selectedIndex = 0;
}, },
onOK: function appManager_onOK() { onOK: function () {
if (!this._removed.length) { if (!this._removed.length) {
// return early to avoid calling the |store| method. // return early to avoid calling the |store| method.
return; return;
@ -56,11 +56,11 @@ var gAppManagerDialog = {
this.handlerInfo.store(); this.handlerInfo.store();
}, },
onCancel: function appManager_onCancel() { onCancel: function () {
// do nothing // do nothing
}, },
remove: function appManager_remove() { remove: function () {
var list = document.getElementById("appList"); var list = document.getElementById("appList");
this._removed.push(list.selectedItem.app); this._removed.push(list.selectedItem.app);
var index = list.selectedIndex; var index = list.selectedIndex;
@ -78,7 +78,7 @@ var gAppManagerDialog = {
} }
}, },
onSelect: function appManager_onSelect() { onSelect: function () {
var list = document.getElementById("appList"); var list = document.getElementById("appList");
if (!list.selectedItem) { if (!list.selectedItem) {
document.getElementById("remove").disabled = true; document.getElementById("remove").disabled = true;

View file

@ -575,7 +575,7 @@ var gCookiesWindow = {
removeSelectedCookies.disabled = !hasRows || !hasSelection; removeSelectedCookies.disabled = !hasRows || !hasSelection;
}, },
performDeletion: function gCookiesWindow_performDeletion(deleteItems) { performDeletion: function (deleteItems) {
var psvc = Components.classes["@mozilla.org/preferences-service;1"] var psvc = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(Components.interfaces.nsIPrefBranch);
var blockFutureCookies = false; var blockFutureCookies = false;
@ -883,7 +883,7 @@ var gCookiesWindow = {
} }
}, },
_updateRemoveAllButton: function gCookiesWindow__updateRemoveAllButton() { _updateRemoveAllButton: function () {
let removeAllCookies = document.getElementById("removeAllCookies"); let removeAllCookies = document.getElementById("removeAllCookies");
removeAllCookies.disabled = this._view._rowCount == 0; removeAllCookies.disabled = this._view._rowCount == 0;

View file

@ -112,7 +112,7 @@ var gPrivacyPane = {
/** /**
* Initialize the history mode menulist based on the privacy preferences * Initialize the history mode menulist based on the privacy preferences
*/ */
initializeHistoryMode: function PPP_initializeHistoryMode() initializeHistoryMode: function ()
{ {
let mode; let mode;
let getVal = function (aPref) let getVal = function (aPref)
@ -133,7 +133,7 @@ var gPrivacyPane = {
/** /**
* Update the selected pane based on the history mode menulist * Update the selected pane based on the history mode menulist
*/ */
updateHistoryModePane: function PPP_updateHistoryModePane() updateHistoryModePane: function ()
{ {
let selectedIndex = -1; let selectedIndex = -1;
switch (document.getElementById("historyMode").value) { switch (document.getElementById("historyMode").value) {
@ -154,7 +154,7 @@ var gPrivacyPane = {
* Update the private browsing auto-start pref and the history mode * Update the private browsing auto-start pref and the history mode
* micro-management prefs based on the history mode menulist * micro-management prefs based on the history mode menulist
*/ */
updateHistoryModePrefs: function PPP_updateHistoryModePrefs() updateHistoryModePrefs: function ()
{ {
let pref = document.getElementById("browser.privatebrowsing.autostart"); let pref = document.getElementById("browser.privatebrowsing.autostart");
switch (document.getElementById("historyMode").value) { switch (document.getElementById("historyMode").value) {
@ -187,7 +187,7 @@ var gPrivacyPane = {
* Update the privacy micro-management controls based on the * Update the privacy micro-management controls based on the
* value of the private browsing auto-start checkbox. * value of the private browsing auto-start checkbox.
*/ */
updatePrivacyMicroControls: function PPP_updatePrivacyMicroControls() updatePrivacyMicroControls: function ()
{ {
if (document.getElementById("historyMode").value == "custom") { if (document.getElementById("historyMode").value == "custom") {
let disabled = this._autoStartPrivateBrowsing = let disabled = this._autoStartPrivateBrowsing =
@ -229,7 +229,7 @@ var gPrivacyPane = {
/** /**
* Initialize the starting state for the auto-start private browsing mode pref reverter. * Initialize the starting state for the auto-start private browsing mode pref reverter.
*/ */
initAutoStartPrivateBrowsingReverter: function PPP_initAutoStartPrivateBrowsingReverter() initAutoStartPrivateBrowsingReverter: function ()
{ {
let mode = document.getElementById("historyMode"); let mode = document.getElementById("historyMode");
let autoStart = document.getElementById("privateBrowsingAutoStart"); let autoStart = document.getElementById("privateBrowsingAutoStart");
@ -239,7 +239,7 @@ var gPrivacyPane = {
_lastMode: null, _lastMode: null,
_lasCheckState: null, _lasCheckState: null,
updateAutostart: function PPP_updateAutostart() { updateAutostart: function () {
let mode = document.getElementById("historyMode"); let mode = document.getElementById("historyMode");
let autoStart = document.getElementById("privateBrowsingAutoStart"); let autoStart = document.getElementById("privateBrowsingAutoStart");
let pref = document.getElementById("browser.privatebrowsing.autostart"); let pref = document.getElementById("browser.privatebrowsing.autostart");

View file

@ -15,7 +15,7 @@
* closes. * closes.
*/ */
var SelectBookmarkDialog = { var SelectBookmarkDialog = {
init: function SBD_init() { init: function () {
document.getElementById("bookmarks").place = document.getElementById("bookmarks").place =
"place:queryType=1&folder=" + PlacesUIUtils.allBookmarksFolderId; "place:queryType=1&folder=" + PlacesUIUtils.allBookmarksFolderId;
@ -27,7 +27,7 @@ var SelectBookmarkDialog = {
* Update the disabled state of the OK button as the user changes the * Update the disabled state of the OK button as the user changes the
* selection within the view. * selection within the view.
*/ */
selectionChanged: function SBD_selectionChanged() { selectionChanged: function () {
var accept = document.documentElement.getButton("accept"); var accept = document.documentElement.getButton("accept");
var bookmarks = document.getElementById("bookmarks"); var bookmarks = document.getElementById("bookmarks");
var disableAcceptButton = true; var disableAcceptButton = true;
@ -38,7 +38,7 @@ var SelectBookmarkDialog = {
accept.disabled = disableAcceptButton; accept.disabled = disableAcceptButton;
}, },
onItemDblClick: function SBD_onItemDblClick() { onItemDblClick: function () {
var bookmarks = document.getElementById("bookmarks"); var bookmarks = document.getElementById("bookmarks");
var selectedNode = bookmarks.selectedNode; var selectedNode = bookmarks.selectedNode;
if (selectedNode && PlacesUtils.nodeIsURI(selectedNode)) { if (selectedNode && PlacesUtils.nodeIsURI(selectedNode)) {
@ -54,7 +54,7 @@ var SelectBookmarkDialog = {
* User accepts their selection. Set all the selected URLs or the contents * User accepts their selection. Set all the selected URLs or the contents
* of the selected folder as the list of homepages. * of the selected folder as the list of homepages.
*/ */
accept: function SBD_accept() { accept: function () {
var bookmarks = document.getElementById("bookmarks"); var bookmarks = document.getElementById("bookmarks");
NS_ASSERT(bookmarks.hasSelection, NS_ASSERT(bookmarks.hasSelection,
"Should not be able to accept dialog if there is no selected URL!"); "Should not be able to accept dialog if there is no selected URL!");