--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -15,17 +15,17 @@ if (AppConstants.E10S_TESTING_ONLY) {
XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
"resource://gre/modules/UpdateUtils.jsm");
}
var gMainPane = {
/**
* Initialization of this.
*/
- init: function()
+ init()
{
function setEventListener(aId, aEventType, aCallback)
{
document.getElementById(aId)
.addEventListener(aEventType, aCallback.bind(gMainPane));
}
if (AppConstants.HAVE_SHELL_SERVICE) {
@@ -116,17 +116,17 @@ var gMainPane = {
}
// Notify observers that the UI is now ready
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(window, "main-pane-loaded", null);
},
- enableE10SChange: function()
+ enableE10SChange()
{
if (AppConstants.E10S_TESTING_ONLY) {
let e10sCheckbox = document.getElementById("e10sAutoStart");
let e10sPref = document.getElementById("browser.tabs.remote.autostart");
let e10sTempPref = document.getElementById("e10sTempPref");
let prefsToChange;
if (e10sCheckbox.checked) {
@@ -150,17 +150,17 @@ var gMainPane = {
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
}
// Revert the checkbox in case we didn't quit
e10sCheckbox.checked = e10sPref.value || e10sTempPref.value;
}
},
- separateProfileModeChange: function()
+ separateProfileModeChange()
{
if (AppConstants.MOZ_DEV_EDITION) {
function quitApp() {
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestartNotSameProfile);
}
function revertCheckbox(error) {
separateProfileModeCheckbox.checked = !separateProfileModeCheckbox.checked;
if (error) {
@@ -201,17 +201,17 @@ var gMainPane = {
return;
case CONFIRM_RESTART_PROMPT_RESTART_LATER:
createOrRemoveSpecialDevEditionFile();
return;
}
}
},
- onGetStarted: function(aEvent) {
+ onGetStarted(aEvent) {
if (AppConstants.MOZ_DEV_EDITION) {
const Cc = Components.classes, Ci = Components.interfaces;
let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator);
let win = wm.getMostRecentWindow("navigator:browser");
if (win) {
let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup");
@@ -236,17 +236,17 @@ var gMainPane = {
* 2: the last page the user visited (DEPRECATED)
* 3: windows and tabs from the last session (a.k.a. session restore)
*
* The deprecated option is not exposed in UI; however, if the user has it
* selected and doesn't change the UI for this preference, the deprecated
* option is preserved.
*/
- syncFromHomePref: function()
+ syncFromHomePref()
{
let homePref = document.getElementById("browser.startup.homepage");
// If the pref is set to about:home or about:newtab, set the value to ""
// to show the placeholder text (about:home title) rather than
// exposing those URLs to users.
let defaultBranch = Services.prefs.getDefaultBranch("");
let defaultValue = defaultBranch.getComplexValue("browser.startup.homepage",
@@ -262,32 +262,32 @@ var gMainPane = {
// to be shown.
if (homePref.value == "")
return "about:blank";
// Otherwise, show the actual pref value.
return undefined;
},
- syncToHomePref: function(value)
+ syncToHomePref(value)
{
// If the value is "", use about:home.
if (value == "")
return "about:home";
// Otherwise, use the actual textbox value.
return undefined;
},
/**
* Sets the home page to the current displayed page (or frontmost tab, if the
* most recent browser window contains multiple tabs), updating preference
* window UI to reflect this.
*/
- setHomePageToCurrent: function()
+ setHomePageToCurrent()
{
let homePage = document.getElementById("browser.startup.homepage");
let tabs = this._getTabsForHomePage();
function getTabURI(t) {
return t.linkedBrowser.currentURI.spec;
}
// FIXME Bug 244192: using dangerous "|" joiner!
@@ -295,40 +295,40 @@ var gMainPane = {
homePage.value = tabs.map(getTabURI).join("|");
},
/**
* Displays a dialog in which the user can select a bookmark to use as home
* page. If the user selects a bookmark, that bookmark's name is displayed in
* UI and the bookmark's address is stored to the home page preference.
*/
- setHomePageToBookmark: function()
+ setHomePageToBookmark()
{
var rv = { urls: null, names: null };
gSubDialog.open("chrome://browser/content/preferences/selectBookmark.xul",
"resizable=yes, modal=yes", rv,
this._setHomePageToBookmarkClosed.bind(this, rv));
},
- _setHomePageToBookmarkClosed: function(rv, aEvent) {
+ _setHomePageToBookmarkClosed(rv, aEvent) {
if (aEvent.detail.button != "accept")
return;
if (rv.urls && rv.names) {
var homePage = document.getElementById("browser.startup.homepage");
// XXX still using dangerous "|" joiner!
homePage.value = rv.urls.join("|");
}
},
/**
* Switches the "Use Current Page" button between its singular and plural
* forms.
*/
- _updateUseCurrentButton: function() {
+ _updateUseCurrentButton() {
let useCurrent = document.getElementById("useCurrent");
let tabs = this._getTabsForHomePage();
if (tabs.length > 1)
useCurrent.label = useCurrent.getAttribute("label2");
else
@@ -337,17 +337,17 @@ var gMainPane = {
// In this case, the button's disabled state is set by preferences.xml.
let prefName = "pref.browser.homepage.disable_button.current_page";
if (document.getElementById(prefName).locked)
return;
useCurrent.disabled = !tabs.length
},
- _getTabsForHomePage: function()
+ _getTabsForHomePage()
{
var win;
var tabs = [];
const Cc = Components.classes, Ci = Components.interfaces;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator);
win = wm.getMostRecentWindow("navigator:browser");
@@ -361,25 +361,25 @@ var gMainPane = {
}
return tabs;
},
/**
* Check to see if a tab is not about:preferences
*/
- isNotAboutPreferences: function(aElement, aIndex, aArray)
+ isNotAboutPreferences(aElement, aIndex, aArray)
{
return !aElement.linkedBrowser.currentURI.spec.startsWith("about:preferences");
},
/**
* Restores the default home page as the user's home page.
*/
- restoreDefaultHomePage: function()
+ restoreDefaultHomePage()
{
var homePage = document.getElementById("browser.startup.homepage");
homePage.value = homePage.defaultValue;
},
// DOWNLOADS
/*
@@ -411,17 +411,17 @@ var gMainPane = {
* browser.download.defaultFolder
* deprecated.
*/
/**
* Enables/disables the folder field and Browse button based on whether a
* default download directory is being used.
*/
- readUseDownloadDir: function()
+ readUseDownloadDir()
{
var downloadFolder = document.getElementById("downloadFolder");
var chooseFolder = document.getElementById("chooseFolder");
var preference = document.getElementById("browser.download.useDownloadDir");
downloadFolder.disabled = !preference.value || preference.locked;
chooseFolder.disabled = !preference.value || preference.locked;
// don't override the preference's value in UI
@@ -524,17 +524,17 @@ var gMainPane = {
iconUrlSpec = fph.getURLSpecFromFile(yield this._getDownloadsFolder("Desktop"));
}
downloadFolder.image = "moz-icon://" + iconUrlSpec + "?size=16";
}),
/**
* Returns the textual path of a folder in readable form.
*/
- _getDisplayNameOfFile: function(aFolder)
+ _getDisplayNameOfFile(aFolder)
{
// TODO: would like to add support for 'Downloads on Macintosh HD'
// for OS X users.
return aFolder ? aFolder.path : "";
},
/**
* Returns the Downloads folder. If aFolder is "Desktop", then the Downloads
@@ -598,17 +598,17 @@ var gMainPane = {
var currentDirPref = document.getElementById("browser.download.dir");
return currentDirPref.value;
}),
/**
* Hide/show the "Show my windows and tabs from last time" option based
* on the value of the browser.privatebrowsing.autostart pref.
*/
- updateBrowserStartupLastSession: function()
+ updateBrowserStartupLastSession()
{
let pbAutoStartPref = document.getElementById("browser.privatebrowsing.autostart");
let startupPref = document.getElementById("browser.startup.page");
let menu = document.getElementById("browserStartupPage");
let option = document.getElementById("browserStartupLastSession");
if (pbAutoStartPref.value) {
option.setAttribute("disabled", "true");
if (option.selected) {
@@ -645,44 +645,44 @@ var gMainPane = {
* False - Only the window is to be shown in Windows 7 taskbar.
*/
/**
* Determines where a link which opens a new window will open.
*
* @returns |true| if such links should be opened in new tabs
*/
- readLinkTarget: function() {
+ readLinkTarget() {
var openNewWindow = document.getElementById("browser.link.open_newwindow");
return openNewWindow.value != 2;
},
/**
* Determines where a link which opens a new window will open.
*
* @returns 2 if such links should be opened in new windows,
* 3 if such links should be opened in new tabs
*/
- writeLinkTarget: function() {
+ writeLinkTarget() {
var linkTargeting = document.getElementById("linkTargeting");
return linkTargeting.checked ? 3 : 2;
},
/*
* Preferences:
*
* browser.shell.checkDefault
* - true if a default-browser check (and prompt to make it so if necessary)
* occurs at startup, false otherwise
*/
/**
* Show button for setting browser as default browser or information that
* browser is already the default browser.
*/
- updateSetDefaultBrowser: function()
+ updateSetDefaultBrowser()
{
if (AppConstants.HAVE_SHELL_SERVICE) {
let shellSvc = getShellService();
let defaultBrowserBox = document.getElementById("defaultBrowserBox");
if (!shellSvc) {
defaultBrowserBox.hidden = true;
return;
}
@@ -693,17 +693,17 @@ var gMainPane = {
alwaysCheck.disabled = alwaysCheck.disabled ||
isDefault && alwaysCheck.checked;
}
},
/**
* Set browser as the operating system default browser.
*/
- setDefaultBrowser: function()
+ setDefaultBrowser()
{
if (AppConstants.HAVE_SHELL_SERVICE) {
let alwaysCheckPref = document.getElementById("browser.shell.checkDefaultBrowser");
alwaysCheckPref.value = true;
let shellSvc = getShellService();
if (!shellSvc)
return;