Skip to content

Commit

Permalink
Bug 1331661 - Enable the 'quotes' rule for eslint and fix most of the…
Browse files Browse the repository at this point in the history
… errors with --fix. r=Gijs

MozReview-Commit-ID: 6tv0Z06CO4a
  • Loading branch information
msujaws committed Jan 17, 2017
1 parent 7e487b7 commit 9e55a3e
Show file tree
Hide file tree
Showing 471 changed files with 3,233 additions and 3,229 deletions.
26 changes: 13 additions & 13 deletions browser/base/content/aboutaccounts/aboutaccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ var wrapper = {
},

handleRemoteCommand(evt) {
log('command: ' + evt.detail.command);
log("command: " + evt.detail.command);
let data = evt.detail.data;

switch (evt.detail.command) {
Expand Down Expand Up @@ -420,19 +420,19 @@ function show(id, childId) {
let allTop = document.querySelectorAll("body > div, iframe");
for (let elt of allTop) {
if (elt.getAttribute("id") == id) {
elt.style.display = 'block';
elt.style.display = "block";
} else {
elt.style.display = 'none';
elt.style.display = "none";
}
}
if (childId) {
// child items are all <div>
let allSecond = document.querySelectorAll("#" + id + " > div");
for (let elt of allSecond) {
if (elt.getAttribute("id") == childId) {
elt.style.display = 'block';
elt.style.display = "block";
} else {
elt.style.display = 'none';
elt.style.display = "none";
}
}
}
Expand Down Expand Up @@ -500,17 +500,17 @@ function getDefaultProfilePath() {
document.addEventListener("DOMContentLoaded", function onload() {
document.removeEventListener("DOMContentLoaded", onload, true);
init();
var buttonGetStarted = document.getElementById('buttonGetStarted');
buttonGetStarted.addEventListener('click', getStarted);
var buttonGetStarted = document.getElementById("buttonGetStarted");
buttonGetStarted.addEventListener("click", getStarted);

var buttonRetry = document.getElementById('buttonRetry');
buttonRetry.addEventListener('click', retry);
var buttonRetry = document.getElementById("buttonRetry");
buttonRetry.addEventListener("click", retry);

var oldsync = document.getElementById('oldsync');
oldsync.addEventListener('click', handleOldSync);
var oldsync = document.getElementById("oldsync");
oldsync.addEventListener("click", handleOldSync);

var buttonOpenPrefs = document.getElementById('buttonOpenPrefs')
buttonOpenPrefs.addEventListener('click', openPrefs);
var buttonOpenPrefs = document.getElementById("buttonOpenPrefs")
buttonOpenPrefs.addEventListener("click", openPrefs);
}, true);

function initObservers() {
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/browser-places.js
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ var BookmarkingUI = {
clearTimeout(this._notificationTimeout);
}

if (this.notifier.style.transform == '') {
if (this.notifier.style.transform == "") {
// Get all the relevant nodes and computed style objects
let dropmarker = document.getAnonymousElementByAttribute(this.button, "anonid", "dropmarker");
let dropmarkerIcon = document.getAnonymousElementByAttribute(dropmarker, "class", "dropmarker-icon");
Expand Down Expand Up @@ -1742,8 +1742,8 @@ var BookmarkingUI = {
this.dropmarkerNotifier.removeAttribute("notification");
this.button.removeAttribute("notification");

this.dropmarkerNotifier.style.transform = '';
this.notifier.style.transform = '';
this.dropmarkerNotifier.style.transform = "";
this.notifier.style.transform = "";
}, 1000);
},

Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/browser-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ var gPluginHandler = {
appendNotification(message, "plugin-hidden", null,
notificationBox.PRIORITY_INFO_HIGH, buttons);
if (haveInsecure) {
n.classList.add('pluginVulnerable');
n.classList.add("pluginVulnerable");
}
}

Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/browser-syncui.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ var gSyncUI = {
})();
// It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago
if (date < sixDaysAgo) {
dateFormat = {month: 'long', day: 'numeric'};
dateFormat = {month: "long", day: "numeric"};
} else {
dateFormat = {weekday: 'long', hour: 'numeric', minute: 'numeric'};
dateFormat = {weekday: "long", hour: "numeric", minute: "numeric"};
}
let lastSyncDateString = date.toLocaleDateString(undefined, dateFormat);
return this._stringBundle.formatStringFromName("lastSync2.label", [lastSyncDateString], 1);
Expand Down
62 changes: 31 additions & 31 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() {
});

XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
return Services.strings.createBundle('chrome://browser/locale/browser.properties');
return Services.strings.createBundle("chrome://browser/locale/browser.properties");
});

XPCOMUtils.defineLazyGetter(this, "gCustomizeMode", function() {
Expand Down Expand Up @@ -753,7 +753,7 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
// because we need to be sure this last dot is the *only* dot, too.
// More generally, this is used for the pref and should stay in sync with
// the code in nsDefaultURIFixup::KeywordURIFixup .
if (asciiHost.indexOf('.') == asciiHost.length - 1) {
if (asciiHost.indexOf(".") == asciiHost.length - 1) {
asciiHost = asciiHost.slice(0, -1);
}

Expand Down Expand Up @@ -849,7 +849,7 @@ function _loadURIWithFlags(browser, uri, params) {
}
let flags = params.flags || 0;
let referrer = params.referrerURI;
let referrerPolicy = ('referrerPolicy' in params ? params.referrerPolicy :
let referrerPolicy = ("referrerPolicy" in params ? params.referrerPolicy :
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
let postData = params.postData;

Expand Down Expand Up @@ -1592,12 +1592,12 @@ if (AppConstants.platform == "macosx") {
// macBrowserOverlay
gBrowserInit.nonBrowserWindowStartup = function() {
// Disable inappropriate commands / submenus
var disabledItems = ['Browser:SavePage',
'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain',
'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs',
'View:PageInfo'];
var disabledItems = ["Browser:SavePage",
"Browser:SendLink", "cmd_pageSetup", "cmd_print", "cmd_find", "cmd_findAgain",
"viewToolbarsMenu", "viewSidebarMenuMenu", "Browser:Reload",
"viewFullZoomMenu", "pageStyleMenu", "charsetMenu", "View:PageSource", "View:FullScreen",
"viewHistorySidebar", "Browser:AddBookmarkAs", "Browser:BookmarkAllTabs",
"View:PageInfo"];
var element;

for (let disabledItem of disabledItems) {
Expand All @@ -1609,7 +1609,7 @@ if (AppConstants.platform == "macosx") {
// If no windows are active (i.e. we're the hidden window), disable the close, minimize
// and zoom menu commands as well
if (window.location.href == "chrome://browser/content/hiddenWindow.xul") {
var hiddenWindowDisabledItems = ['cmd_close', 'minimizeWindow', 'zoomWindow'];
var hiddenWindowDisabledItems = ["cmd_close", "minimizeWindow", "zoomWindow"];
for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) {
element = document.getElementById(hiddenWindowDisabledItem);
if (element)
Expand Down Expand Up @@ -1722,7 +1722,7 @@ function HandleAppCommandEvent(evt) {
gFindBar.onFindCommand();
break;
case "Help":
openHelpLink('firefox-help');
openHelpLink("firefox-help");
break;
case "Open":
BrowserOpenFileWindow();
Expand Down Expand Up @@ -2931,8 +2931,8 @@ var BrowserOnClick = {
Components.utils.reportError("Couldn't get ssl_override pref: " + e);
}

window.openDialog('chrome://pippki/content/exceptionDialog.xul',
'', 'chrome,centerscreen,modal', params);
window.openDialog("chrome://pippki/content/exceptionDialog.xul",
"", "chrome,centerscreen,modal", params);

// If the user added the exception cert, attempt to reload the page
if (params.exceptionAdded) {
Expand Down Expand Up @@ -3000,13 +3000,13 @@ var BrowserOnClick = {
// use the right strings and links for each.
let bucketName = "";
let sendTelemetry = false;
if (reason === 'malware') {
if (reason === "malware") {
sendTelemetry = true;
bucketName = "WARNING_MALWARE_PAGE_";
} else if (reason === 'phishing') {
} else if (reason === "phishing") {
sendTelemetry = true;
bucketName = "WARNING_PHISHING_PAGE_";
} else if (reason === 'unwanted') {
} else if (reason === "unwanted") {
sendTelemetry = true;
bucketName = "WARNING_UNWANTED_PAGE_";
}
Expand Down Expand Up @@ -3085,25 +3085,25 @@ var BrowserOnClick = {
}];

let title;
if (reason === 'malware') {
if (reason === "malware") {
title = gNavigatorBundle.getString("safebrowsing.reportedAttackSite");
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.accessKey"),
callback() {
openUILinkIn(gSafeBrowsing.getReportURL('MalwareMistake'), 'tab');
openUILinkIn(gSafeBrowsing.getReportURL("MalwareMistake"), "tab");
}
};
} else if (reason === 'phishing') {
} else if (reason === "phishing") {
title = gNavigatorBundle.getString("safebrowsing.deceptiveSite");
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.accessKey"),
callback() {
openUILinkIn(gSafeBrowsing.getReportURL('PhishMistake'), 'tab');
openUILinkIn(gSafeBrowsing.getReportURL("PhishMistake"), "tab");
}
};
} else if (reason === 'unwanted') {
} else if (reason === "unwanted") {
title = gNavigatorBundle.getString("safebrowsing.reportedUnwantedSite");
// There is no button for reporting errors since Google doesn't currently
// provide a URL endpoint for these reports.
Expand Down Expand Up @@ -3311,7 +3311,7 @@ function getDetailedCertErrorInfo(location, securityInfo) {
function getDERString(cert) {
var length = {};
var derArray = cert.getRawDER(length);
var derString = '';
var derString = "";
for (var i = 0; i < derArray.length; i++) {
derString += String.fromCharCode(derArray[i]);
}
Expand Down Expand Up @@ -4047,7 +4047,7 @@ function OpenBrowserWindow(options) {
var handler = Components.classes["@mozilla.org/browser/clh;1"]
.getService(Components.interfaces.nsIBrowserHandler);
var defaultArgs = handler.defaultArgs;
var wintype = document.documentElement.getAttribute('windowtype');
var wintype = document.documentElement.getAttribute("windowtype");

var extraFeatures = "";
if (options && options.private) {
Expand Down Expand Up @@ -4158,7 +4158,7 @@ function updateEditUIVisibility() {
*/
function openNewUserContextTab(event) {
openUILinkIn(BROWSER_NEW_TAB_URL, "tab", {
userContextId: parseInt(event.target.getAttribute('data-usercontextid')),
userContextId: parseInt(event.target.getAttribute("data-usercontextid")),
});
}

Expand Down Expand Up @@ -4455,16 +4455,16 @@ var XULBrowserWindow = {

// Disable menu entries for images, enable otherwise
if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType)) {
this.isImage.removeAttribute('disabled');
this.isImage.removeAttribute("disabled");
} else {
canViewSource = false;
this.isImage.setAttribute('disabled', 'true');
this.isImage.setAttribute("disabled", "true");
}

if (canViewSource) {
this.canViewSource.removeAttribute('disabled');
this.canViewSource.removeAttribute("disabled");
} else {
this.canViewSource.setAttribute('disabled', 'true');
this.canViewSource.setAttribute("disabled", "true");
}
}

Expand Down Expand Up @@ -4507,9 +4507,9 @@ var XULBrowserWindow = {

// Disable menu entries for images, enable otherwise
if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType))
this.isImage.removeAttribute('disabled');
this.isImage.removeAttribute("disabled");
else
this.isImage.setAttribute('disabled', 'true');
this.isImage.setAttribute("disabled", "true");

this.hideOverLinkImmediately = true;
this.setOverLink("", null);
Expand Down Expand Up @@ -5327,7 +5327,7 @@ var gHomeButton = {
homeButton = document.getElementById("home-button");
if (homeButton) {
var homePage = this.getHomePage();
homePage = homePage.replace(/\|/g, ', ');
homePage = homePage.replace(/\|/g, ", ");
if (["about:home", "about:newtab"].includes(homePage.toLowerCase()))
homeButton.setAttribute("tooltiptext", homeButton.getAttribute("aboutHomeOverrideTooltip"));
else
Expand Down
16 changes: 8 additions & 8 deletions browser/base/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ var AboutNetAndCertErrorListener = {
init(chromeGlobal) {
addMessageListener("CertErrorDetails", this);
addMessageListener("Browser:CaptivePortalFreed", this);
chromeGlobal.addEventListener('AboutNetErrorLoad', this, false, true);
chromeGlobal.addEventListener('AboutNetErrorOpenCaptivePortal', this, false, true);
chromeGlobal.addEventListener('AboutNetErrorSetAutomatic', this, false, true);
chromeGlobal.addEventListener('AboutNetErrorOverride', this, false, true);
chromeGlobal.addEventListener('AboutNetErrorResetPreferences', this, false, true);
chromeGlobal.addEventListener("AboutNetErrorLoad", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorOpenCaptivePortal", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorSetAutomatic", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorOverride", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorResetPreferences", this, false, true);
},

get isAboutNetError() {
Expand Down Expand Up @@ -547,11 +547,11 @@ var ClickEventHandler = {
},

onAboutBlocked(targetElement, ownerDoc) {
var reason = 'phishing';
var reason = "phishing";
if (/e=malwareBlocked/.test(ownerDoc.documentURI)) {
reason = 'malware';
reason = "malware";
} else if (/e=unwantedBlocked/.test(ownerDoc.documentURI)) {
reason = 'unwanted';
reason = "unwanted";
}
sendAsyncMessage("Browser:SiteBlockedError", {
location: ownerDoc.location.href,
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/contentSearchUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ ContentSearchUIController.prototype = {
let searchWithHeader = document.getElementById("contentSearchSearchWithHeader");
if (this.input.value) {
searchWithHeader.innerHTML = this._strings.searchForSomethingWith;
searchWithHeader.querySelector('.contentSearchSearchWithHeaderSearchText').textContent = this.input.value;
searchWithHeader.querySelector(".contentSearchSearchWithHeaderSearchText").textContent = this.input.value;
} else {
searchWithHeader.textContent = this._strings.searchWithHeader;
}
Expand Down
10 changes: 5 additions & 5 deletions browser/base/content/pageinfo/pageInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ const COPYCOL_META_CONTENT = 1;
const COPYCOL_IMAGE = COL_IMAGE_ADDRESS;

// one nsITreeView for each tree in the window
var gMetaView = new pageInfoTreeView('metatree', COPYCOL_META_CONTENT);
var gImageView = new pageInfoTreeView('imagetree', COPYCOL_IMAGE);
var gMetaView = new pageInfoTreeView("metatree", COPYCOL_META_CONTENT);
var gImageView = new pageInfoTreeView("imagetree", COPYCOL_IMAGE);

gImageView.getCellProperties = function(row, col) {
var data = gImageView.data[row];
Expand Down Expand Up @@ -1005,8 +1005,8 @@ function formatDate(datestr, unknown) {
const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIXULChromeRegistry)
.getSelectedLocale("global", true);
const dtOptions = { year: 'numeric', month: 'long', day: 'numeric',
hour: 'numeric', minute: 'numeric', second: 'numeric' };
const dtOptions = { year: "numeric", month: "long", day: "numeric",
hour: "numeric", minute: "numeric", second: "numeric" };
return date.toLocaleString(locale, dtOptions);
}

Expand All @@ -1019,7 +1019,7 @@ function doCopy() {
if (elem && "treeBoxObject" in elem) {
var view = elem.view;
var selection = view.selection;
var text = [], tmp = '';
var text = [], tmp = "";
var min = {}, max = {};

var count = selection.getRangeCount();
Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/pageinfo/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ function onCheckboxClick(aPartId) {
}

function onPluginRadioClick(aEvent) {
onRadioClick(aEvent.originalTarget.getAttribute("id").split('#')[0]);
onRadioClick(aEvent.originalTarget.getAttribute("id").split("#")[0]);
}

function onRadioClick(aPartId) {
var radioGroup = document.getElementById(aPartId + "RadioGroup");
var id = radioGroup.selectedItem.id;
var permission = id.split('#')[1];
var permission = id.split("#")[1];
SitePermissions.set(gPermURI, aPartId, permission);
}

Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/tab-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ addMessageListener("SecondScreen:tab-mirror", function(message) {

var AboutHomeListener = {
init(chromeGlobal) {
chromeGlobal.addEventListener('AboutHomeLoad', this, false, true);
chromeGlobal.addEventListener("AboutHomeLoad", this, false, true);
},

get isAboutHome() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ function getCertChain(securityInfoAsString) {
function getDERString(cert) {
var length = {};
var derArray = cert.getRawDER(length);
var derString = '';
var derString = "";
for (var i = 0; i < derArray.length; i++) {
derString += String.fromCharCode(derArray[i]);
}
Expand Down
Loading

0 comments on commit 9e55a3e

Please sign in to comment.