From 849a6e51da0fcafb99cbfcb4c1a0bc2c7b6e613f Mon Sep 17 00:00:00 2001 From: Jared Hirsch Date: Mon, 15 Oct 2018 20:10:29 +0000 Subject: [PATCH] Bug 1498410 - Part 4 - Export comma-dangle refactoring as a separate commit to ease reviews; r=ianbicking MozReview-Commit-ID: 455LZbfCGfy Differential Revision: https://phabricator.services.mozilla.com/D8506 --HG-- extra : rebase_source : 698bd15f7d81b9815a9f176359c28f2cc97132e4 extra : source : 01fa6937f05fc51562205eac8e895c62324452f8 --- .../screenshots/background/analytics.js | 58 +++++++++---------- .../extensions/screenshots/background/auth.js | 4 +- .../screenshots/background/deviceInfo.js | 2 +- .../extensions/screenshots/background/main.js | 10 ++-- .../screenshots/background/selectorLoader.js | 14 ++--- .../screenshots/background/senderror.js | 26 ++++----- .../screenshots/background/startBackground.js | 4 +- .../screenshots/background/takeshot.js | 14 ++--- .../extensions/screenshots/build/selection.js | 4 +- .../screenshots/build/thumbnailGenerator.js | 2 +- browser/extensions/screenshots/catcher.js | 2 +- .../screenshots/onboarding/slides.js | 4 +- .../screenshots/selector/shooter.js | 18 +++--- browser/extensions/screenshots/selector/ui.js | 18 +++--- .../screenshots/selector/uicontrol.js | 34 +++++------ .../extensions/screenshots/selector/util.js | 2 +- 16 files changed, 108 insertions(+), 108 deletions(-) diff --git a/browser/extensions/screenshots/background/analytics.js b/browser/extensions/screenshots/background/analytics.js index 13e5c06c5f56..768ea25160e1 100644 --- a/browser/extensions/screenshots/background/analytics.js +++ b/browser/extensions/screenshots/background/analytics.js @@ -16,7 +16,7 @@ this.analytics = (function() { method: "POST", mode: "cors", headers: { "content-type": "application/json" }, - credentials: "include" + credentials: "include", }; function flushEvents() { @@ -63,7 +63,7 @@ this.analytics = (function() { timingCategory, timingLabel, timingVar, - timingValue + timingValue, }); if (!timingsTimeoutHandle) { timingsTimeoutHandle = setTimeout(() => { @@ -115,7 +115,7 @@ this.analytics = (function() { event: eventCategory, action, label, - options + options, }); if (!eventsTimeoutHandle) { eventsTimeoutHandle = setTimeout(() => { @@ -173,8 +173,8 @@ this.analytics = (function() { cancel: [ { action: "cancel-shot" }, { action: "internal", label: "document-hidden" }, - { action: "internal", label: "unhide-onboarding-frame" } - ] + { action: "internal", label: "unhide-onboarding-frame" }, + ], }, { name: "context-menu", start: { action: "start-shot", label: "context-menu" }, @@ -182,8 +182,8 @@ this.analytics = (function() { cancel: [ { action: "cancel-shot" }, { action: "internal", label: "document-hidden" }, - { action: "internal", label: "unhide-onboarding-frame" } - ] + { action: "internal", label: "unhide-onboarding-frame" }, + ], }, { name: "page-action-onboarding", start: { action: "start-shot", label: "toolbar-button" }, @@ -191,8 +191,8 @@ this.analytics = (function() { cancel: [ { action: "cancel-shot" }, { action: "internal", label: "document-hidden" }, - { action: "internal", label: "unhide-preselection-frame" } - ] + { action: "internal", label: "unhide-preselection-frame" }, + ], }, { name: "context-menu-onboarding", start: { action: "start-shot", label: "context-menu" }, @@ -200,84 +200,84 @@ this.analytics = (function() { cancel: [ { action: "cancel-shot" }, { action: "internal", label: "document-hidden" }, - { action: "internal", label: "unhide-preselection-frame" } - ] + { action: "internal", label: "unhide-preselection-frame" }, + ], }, { name: "capture-full-page", start: { action: "capture-full-page" }, end: { action: "internal", label: "unhide-preview-frame" }, cancel: [ { action: "cancel-shot" }, - { action: "internal", label: "document-hidden" } - ] + { action: "internal", label: "document-hidden" }, + ], }, { name: "capture-visible", start: { action: "capture-visible" }, end: { action: "internal", label: "unhide-preview-frame" }, cancel: [ { action: "cancel-shot" }, - { action: "internal", label: "document-hidden" } - ] + { action: "internal", label: "document-hidden" }, + ], }, { name: "make-selection", start: { action: "make-selection" }, end: { action: "internal", label: "unhide-selection-frame" }, cancel: [ { action: "cancel-shot" }, - { action: "internal", label: "document-hidden" } - ] + { action: "internal", label: "document-hidden" }, + ], }, { name: "save-shot", start: { action: "save-shot" }, end: { action: "internal", label: "open-shot-tab" }, - cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }] + cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }], }, { name: "save-visible", start: { action: "save-visible" }, end: { action: "internal", label: "open-shot-tab" }, - cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }] + cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }], }, { name: "save-full-page", start: { action: "save-full-page" }, end: { action: "internal", label: "open-shot-tab" }, - cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }] + cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }], }, { name: "save-full-page-truncated", start: { action: "save-full-page-truncated" }, end: { action: "internal", label: "open-shot-tab" }, - cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }] + cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }], }, { name: "download-shot", start: { action: "download-shot" }, end: { action: "internal", label: "deactivate" }, cancel: [ { action: "cancel-shot" }, - { action: "internal", label: "document-hidden" } - ] + { action: "internal", label: "document-hidden" }, + ], }, { name: "download-full-page", start: { action: "download-full-page" }, end: { action: "internal", label: "deactivate" }, cancel: [ { action: "cancel-shot" }, - { action: "internal", label: "document-hidden" } - ] + { action: "internal", label: "document-hidden" }, + ], }, { name: "download-full-page-truncated", start: { action: "download-full-page-truncated" }, end: { action: "internal", label: "deactivate" }, cancel: [ { action: "cancel-shot" }, - { action: "internal", label: "document-hidden" } - ] + { action: "internal", label: "document-hidden" }, + ], }, { name: "download-visible", start: { action: "download-visible" }, end: { action: "internal", label: "deactivate" }, cancel: [ { action: "cancel-shot" }, - { action: "internal", label: "document-hidden" } - ] + { action: "internal", label: "document-hidden" }, + ], }]; // Match a filter (action and optional label) against an action and label. diff --git a/browser/extensions/screenshots/background/auth.js b/browser/extensions/screenshots/background/auth.js index 41c8f6ca89ab..3f9f20ffe991 100644 --- a/browser/extensions/screenshots/background/auth.js +++ b/browser/extensions/screenshots/background/auth.js @@ -40,7 +40,7 @@ this.auth = (function() { const info = { deviceId: `anon${makeUuid()}`, secret: makeUuid(), - registered: false + registered: false, }; return info; } @@ -76,7 +76,7 @@ this.auth = (function() { req.send(JSON.stringify({ deviceId: registrationInfo.deviceId, secret: registrationInfo.secret, - deviceInfo: JSON.stringify(deviceInfo()) + deviceInfo: JSON.stringify(deviceInfo()), })); }); } diff --git a/browser/extensions/screenshots/background/deviceInfo.js b/browser/extensions/screenshots/background/deviceInfo.js index 4baad3de4357..4c3fcb9ec6f0 100644 --- a/browser/extensions/screenshots/background/deviceInfo.js +++ b/browser/extensions/screenshots/background/deviceInfo.js @@ -27,7 +27,7 @@ this.deviceInfo = (function() { // platformVersion: system.platformVersion, userAgent: navigator.userAgent, appVendor: appName, - appName + appName, }; }; diff --git a/browser/extensions/screenshots/background/main.js b/browser/extensions/screenshots/background/main.js index f20333f75a10..0ecf047b7c0c 100644 --- a/browser/extensions/screenshots/background/main.js +++ b/browser/extensions/screenshots/background/main.js @@ -132,7 +132,7 @@ this.main = (function() { return; } senderror.showError({ - popupMessage: "UNSHOOTABLE_PAGE" + popupMessage: "UNSHOOTABLE_PAGE", }); return; } @@ -200,7 +200,7 @@ this.main = (function() { type: "basic", iconUrl: "../icons/copied-notification.svg", title: browser.i18n.getMessage("notificationLinkCopiedTitle"), - message: browser.i18n.getMessage("notificationLinkCopiedDetails", pasteSymbol) + message: browser.i18n.getMessage("notificationLinkCopiedDetails", pasteSymbol), }); } return null; @@ -234,7 +234,7 @@ this.main = (function() { type: "basic", iconUrl: "../icons/copied-notification.svg", title: browser.i18n.getMessage("notificationImageCopiedTitle"), - message: browser.i18n.getMessage("notificationImageCopiedDetails", pasteSymbol) + message: browser.i18n.getMessage("notificationImageCopiedDetails", pasteSymbol), }); }); }); @@ -261,7 +261,7 @@ this.main = (function() { return browser.downloads.download({ url, incognito: windowInfo.incognito, - filename: info.filename + filename: info.filename, }).catch((error) => { // We are not logging error message when user cancels download if (error && error.message && !error.message.includes("canceled")) { @@ -286,7 +286,7 @@ this.main = (function() { // Note, we only show the error but don't report it, as we know that we can't // take shots of these pages: senderror.showError({ - popupMessage: "UNSHOOTABLE_PAGE" + popupMessage: "UNSHOOTABLE_PAGE", }); }); diff --git a/browser/extensions/screenshots/background/selectorLoader.js b/browser/extensions/screenshots/background/selectorLoader.js index 382daae74fb3..fe7a28563e3b 100644 --- a/browser/extensions/screenshots/background/selectorLoader.js +++ b/browser/extensions/screenshots/background/selectorLoader.js @@ -19,7 +19,7 @@ this.selectorLoader = (function() { "blobConverters.js", "background/selectorLoader.js", "selector/callBackground.js", - "selector/util.js" + "selector/util.js", ]; const selectorScripts = [ @@ -33,20 +33,20 @@ this.selectorLoader = (function() { "selector/documentMetadata.js", "selector/ui.js", "selector/shooter.js", - "selector/uicontrol.js" + "selector/uicontrol.js", ]; // These are loaded on request (by the selector worker) to activate the onboarding: const onboardingScripts = [ "build/onboardingCss.js", "build/onboardingHtml.js", - "onboarding/slides.js" + "onboarding/slides.js", ]; exports.unloadIfLoaded = function(tabId) { return browser.tabs.executeScript(tabId, { code: "this.selectorLoader && this.selectorLoader.unloadModules()", - runAt: "document_start" + runAt: "document_start", }).then(result => { return result && result[0]; }); @@ -58,7 +58,7 @@ this.selectorLoader = (function() { } return browser.tabs.executeScript(tabId, { code: "!!this.selectorLoader", - runAt: "document_start" + runAt: "document_start", }).then(result => { return result && result[0]; }); @@ -100,7 +100,7 @@ this.selectorLoader = (function() { // scripts, but not the scripts in the underlying page. For more // details, see https://mdn.io/WebExtensions/Content_scripts#Content_script_environment code: `window.downloadOnly = ${downloadOnly}`, - runAt: "document_start" + runAt: "document_start", }); }); }); @@ -114,7 +114,7 @@ this.selectorLoader = (function() { lastPromise = lastPromise.then(() => { return browser.tabs.executeScript(tabId, { file, - runAt: "document_start" + runAt: "document_start", }).catch((error) => { log.error("error in script:", file, error); error.scriptName = file; diff --git a/browser/extensions/screenshots/background/senderror.js b/browser/extensions/screenshots/background/senderror.js index 1037409b941a..704df8d842ed 100644 --- a/browser/extensions/screenshots/background/senderror.js +++ b/browser/extensions/screenshots/background/senderror.js @@ -13,42 +13,42 @@ this.senderror = (function() { const messages = { REQUEST_ERROR: { title: browser.i18n.getMessage("requestErrorTitle"), - info: browser.i18n.getMessage("requestErrorDetails") + info: browser.i18n.getMessage("requestErrorDetails"), }, CONNECTION_ERROR: { title: browser.i18n.getMessage("connectionErrorTitle"), - info: browser.i18n.getMessage("connectionErrorDetails") + info: browser.i18n.getMessage("connectionErrorDetails"), }, LOGIN_ERROR: { title: browser.i18n.getMessage("requestErrorTitle"), - info: browser.i18n.getMessage("loginErrorDetails") + info: browser.i18n.getMessage("loginErrorDetails"), }, LOGIN_CONNECTION_ERROR: { title: browser.i18n.getMessage("connectionErrorTitle"), - info: browser.i18n.getMessage("connectionErrorDetails") + info: browser.i18n.getMessage("connectionErrorDetails"), }, UNSHOOTABLE_PAGE: { title: browser.i18n.getMessage("unshootablePageErrorTitle"), - info: browser.i18n.getMessage("unshootablePageErrorDetails") + info: browser.i18n.getMessage("unshootablePageErrorDetails"), }, SHOT_PAGE: { - title: browser.i18n.getMessage("selfScreenshotErrorTitle") + title: browser.i18n.getMessage("selfScreenshotErrorTitle"), }, MY_SHOTS: { - title: browser.i18n.getMessage("selfScreenshotErrorTitle") + title: browser.i18n.getMessage("selfScreenshotErrorTitle"), }, EMPTY_SELECTION: { - title: browser.i18n.getMessage("emptySelectionErrorTitle") + title: browser.i18n.getMessage("emptySelectionErrorTitle"), }, PRIVATE_WINDOW: { title: browser.i18n.getMessage("privateWindowErrorTitle"), - info: browser.i18n.getMessage("privateWindowErrorDetails") + info: browser.i18n.getMessage("privateWindowErrorDetails"), }, generic: { title: browser.i18n.getMessage("genericErrorTitle"), info: browser.i18n.getMessage("genericErrorDetails"), - showMessage: true - } + showMessage: true, + }, }; communication.register("reportError", (sender, error) => { @@ -82,7 +82,7 @@ this.senderror = (function() { type: "basic", // FIXME: need iconUrl for an image, see #2239 title, - message + message, }); } }; @@ -123,7 +123,7 @@ this.senderror = (function() { tags: {category: e.popupMessage}, release: manifest.version, message: exception.message, - extra: rest + extra: rest, }); }; diff --git a/browser/extensions/screenshots/background/startBackground.js b/browser/extensions/screenshots/background/startBackground.js index 93d8876bdbf3..0cdedb22db93 100644 --- a/browser/extensions/screenshots/background/startBackground.js +++ b/browser/extensions/screenshots/background/startBackground.js @@ -26,7 +26,7 @@ this.startBackground = (function() { "background/analytics.js", "background/deviceInfo.js", "background/takeshot.js", - "background/main.js" + "background/main.js", ]; browser.pageAction.onClicked.addListener(tab => { @@ -41,7 +41,7 @@ this.startBackground = (function() { id: "create-screenshot", title: browser.i18n.getMessage("contextMenuLabel"), contexts: ["page"], - documentUrlPatterns: [""] + documentUrlPatterns: [""], }); browser.contextMenus.onClicked.addListener((info, tab) => { diff --git a/browser/extensions/screenshots/background/takeshot.js b/browser/extensions/screenshots/background/takeshot.js index 781486da3058..c0ee8352998f 100644 --- a/browser/extensions/screenshots/background/takeshot.js +++ b/browser/extensions/screenshots/background/takeshot.js @@ -27,9 +27,9 @@ this.takeshot = (function() { location: selectedPos, dimensions: { x: selectedPos.right - selectedPos.left, - y: selectedPos.bottom - selectedPos.top - } - } + y: selectedPos.bottom - selectedPos.top, + }, + }, }); }); } @@ -94,7 +94,7 @@ this.takeshot = (function() { top: pos.top - scroll.scrollY, left: pos.left - scroll.scrollX, bottom: pos.bottom - scroll.scrollY, - right: pos.right - scroll.scrollX + right: pos.right - scroll.scrollX, }; pos.width = pos.right - pos.left; pos.height = pos.bottom - pos.top; @@ -177,7 +177,7 @@ this.takeshot = (function() { body = concatBuffers(body, tail.buffer); return { "content-type": `multipart/form-data; boundary=${boundary}`, - body + body, }; }); } @@ -199,7 +199,7 @@ this.takeshot = (function() { } return { "content-type": "application/json", - body: JSON.stringify(shot) + body: JSON.stringify(shot), }; }).then((submission) => { @@ -209,7 +209,7 @@ this.takeshot = (function() { method: "PUT", mode: "cors", headers, - body: submission.body + body: submission.body, }); }).then((resp) => { if (!resp.ok) { diff --git a/browser/extensions/screenshots/build/selection.js b/browser/extensions/screenshots/build/selection.js index 556d7b2c311c..f02db010bc75 100644 --- a/browser/extensions/screenshots/build/selection.js +++ b/browser/extensions/screenshots/build/selection.js @@ -62,7 +62,7 @@ this.selection = (function () {let exports={}; class Selection { top: Math.floor(this.top), left: Math.floor(this.left), bottom: Math.floor(this.bottom), - right: Math.floor(this.right) + right: Math.floor(this.right), }; } @@ -94,7 +94,7 @@ this.selection = (function () {let exports={}; class Selection { left: this.left, right: this.right, top: this.top, - bottom: this.bottom + bottom: this.bottom, }; } diff --git a/browser/extensions/screenshots/build/thumbnailGenerator.js b/browser/extensions/screenshots/build/thumbnailGenerator.js index 9f5aaf6d95be..c890f4327a87 100644 --- a/browser/extensions/screenshots/build/thumbnailGenerator.js +++ b/browser/extensions/screenshots/build/thumbnailGenerator.js @@ -48,7 +48,7 @@ function getThumbnailDimensions(imageWidth, imageHeight) { width: thumbnailImageWidth, height: thumbnailImageHeight, scaledX, - scaledY + scaledY, }; } diff --git a/browser/extensions/screenshots/catcher.js b/browser/extensions/screenshots/catcher.js index 7855cdc05fbc..46ebea14a4b2 100644 --- a/browser/extensions/screenshots/catcher.js +++ b/browser/extensions/screenshots/catcher.js @@ -34,7 +34,7 @@ this.catcher = (function() { fromMakeError: true, name: exc.name || "ERROR", message: String(exc), - stack: exc.stack + stack: exc.stack, }; for (const attr in exc) { result[attr] = exc[attr]; diff --git a/browser/extensions/screenshots/onboarding/slides.js b/browser/extensions/screenshots/onboarding/slides.js index 69268121d123..9ef247103a73 100644 --- a/browser/extensions/screenshots/onboarding/slides.js +++ b/browser/extensions/screenshots/onboarding/slides.js @@ -94,11 +94,11 @@ this.slides = (function() { const sentinelSplitter = "!!!"; const linkTexts = { [termsSentinel]: browser.i18n.getMessage("termsAndPrivacyNoticeTermsLink"), - [privacySentinel]: browser.i18n.getMessage("termsAndPrivacyNoticyPrivacyLink") + [privacySentinel]: browser.i18n.getMessage("termsAndPrivacyNoticyPrivacyLink"), }; const linkUrls = { [termsSentinel]: "https://www.mozilla.org/about/legal/terms/services/", - [privacySentinel]: "https://www.mozilla.org/privacy/firefox/" + [privacySentinel]: "https://www.mozilla.org/privacy/firefox/", }; const text = browser.i18n.getMessage( "termsAndPrivacyNotice2", diff --git a/browser/extensions/screenshots/selector/shooter.js b/browser/extensions/screenshots/selector/shooter.js index 90a70671f90b..61fc813ba68e 100644 --- a/browser/extensions/screenshots/selector/shooter.js +++ b/browser/extensions/screenshots/selector/shooter.js @@ -152,9 +152,9 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars location: selectedPos, dimensions: { x: selectedPos.right - selectedPos.left, - y: selectedPos.bottom - selectedPos.top - } - } + y: selectedPos.bottom - selectedPos.top, + }, + }, }); } catcher.watchPromise(callBackground("takeShot", { @@ -164,12 +164,12 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars scrollX: window.scrollX, scrollY: window.scrollY, innerHeight: window.innerHeight, - innerWidth: window.innerWidth + innerWidth: window.innerWidth, }, selectedPos, shotId: shotObject.id, shot: shotObject.toJSON(), - imageBlob + imageBlob, }).then((url) => { return clipboard.copy(url).then((copied) => { return callBackground("openShot", { url, copied }); @@ -206,7 +206,7 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars scrollX: window.scrollX, scrollY: window.scrollY, innerHeight: window.innerHeight, - innerWidth: window.innerWidth + innerWidth: window.innerWidth, }); } catcher.watchPromise(promise.then((dataUrl) => { @@ -218,8 +218,8 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars image: { url: dataUrl, type, - location: selectedPos - } + location: selectedPos, + }, }); ui.triggerDownload(dataUrl, shotObject.filename); uicontrol.deactivate(); @@ -272,7 +272,7 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars backend, randomString(RANDOM_STRING_LENGTH) + "/" + domainFromUrl(location), { - origin: shot.originFromUrl(location.href) + origin: shot.originFromUrl(location.href), } ); shotObject.update(documentMetadata()); diff --git a/browser/extensions/screenshots/selector/ui.js b/browser/extensions/screenshots/selector/ui.js index a02e3cb446df..6a9bf00f5941 100644 --- a/browser/extensions/screenshots/selector/ui.js +++ b/browser/extensions/screenshots/selector/ui.js @@ -130,7 +130,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars timer: null, windowDelayer: null, lastHeight: null, - lastWidth: null + lastWidth: null, }, document: null, display(installHandlerOnDocument) { @@ -262,7 +262,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars this.stopSizeWatch(); util.removeNode(this.element); this.element = this.document = null; - } + }, }; iframeSelection.onResize = watchFunction(assertIsTrusted(onResize.bind(iframeSelection)), true); @@ -376,7 +376,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars util.removeNode(this.element); this.element = null; this.document = null; - } + }, }; const iframePreview = exports.iframePreview = { @@ -480,7 +480,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars util.removeNode(this.element); this.element = null; this.document = null; - } + }, }; iframePreSelection.onResize = watchFunction(onResize.bind(iframePreSelection), true); @@ -544,7 +544,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars } this.currentIframe = iframePreview; this.unhide(); - } + }, }; const movements = ["topLeft", "top", "topRight", "left", "right", "bottomLeft", "bottom", "bottomRight"]; @@ -815,7 +815,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars boxTopEl: null, boxLeftEl: null, boxRightEl: null, - boxBottomEl: null + boxBottomEl: null, }; exports.HoverBox = { @@ -846,7 +846,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars remove() { util.removeNode(this.el); this.el = null; - } + }, }; exports.PixelDimensions = { @@ -870,7 +870,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars remove() { util.removeNode(this.el); this.el = this.xEl = this.yEl = null; - } + }, }; exports.Preview = { @@ -890,7 +890,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars contentCell[0].textContent = browser.i18n.getMessage("imageCropPopupWarning", buildSettings.maxImageHeight); iframe.document().querySelector(".preview-buttons").appendChild(imageCroppedEl); } - } + }, }; /** Removes every UI this module creates */ diff --git a/browser/extensions/screenshots/selector/uicontrol.js b/browser/extensions/screenshots/selector/uicontrol.js index 3c09bc8969a6..7e2b1b92eee0 100644 --- a/browser/extensions/screenshots/selector/uicontrol.js +++ b/browser/extensions/screenshots/selector/uicontrol.js @@ -74,7 +74,7 @@ this.uicontrol = (function() { function eventOptionsForBox(box) { return { cd1: round10(Math.abs(box.bottom - box.top)), - cd2: round10(Math.abs(box.right - box.left)) + cd2: round10(Math.abs(box.right - box.left)), }; } @@ -85,14 +85,14 @@ this.uicontrol = (function() { - (boxStart.bottom - boxStart.top)), cd2: round10( (boxEnd.right - boxEnd.left) - - (boxStart.right - boxStart.left)) + - (boxStart.right - boxStart.left)), }; } function eventOptionsForMove(posStart, posEnd) { return { cd1: round10(posEnd.y - posStart.y), - cd2: round10(posEnd.x - posStart.x) + cd2: round10(posEnd.x - posStart.x), }; } @@ -125,7 +125,7 @@ this.uicontrol = (function() { bottomLeft: ["x1", "y2"], bottom: [null, "y2"], bottomRight: ["x2", "y2"], - move: ["*", "*"] + move: ["*", "*"], }; const doNotAutoselectTags = { @@ -134,7 +134,7 @@ this.uicontrol = (function() { H3: true, H4: true, H5: true, - H6: true + H6: true, }; let captureType; @@ -161,7 +161,7 @@ this.uicontrol = (function() { }, copy: () => { sendEvent("copy-shot", "overlay-copy-button"); copyShot(); - } + }, }; const standardOverlayCallbacks = { @@ -225,7 +225,7 @@ this.uicontrol = (function() { onCopyPreview: () => { sendEvent(`copy-${captureType.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`, "copy-preview-button"); copyShot(); - } + }, }; /** Holds all the objects that handle events for each state: */ @@ -291,7 +291,7 @@ this.uicontrol = (function() { dataUrl = shooter.screenshotPage(selectedPos, captureType); ui.iframe.usePreview(); ui.Preview.display(dataUrl, captureType === "fullPageTruncated"); - } + }, }; stateHandlers.onboarding = { @@ -301,7 +301,7 @@ this.uicontrol = (function() { } sendEvent("internal", "unhide-onboarding-frame"); catcher.watchPromise(slides.display({ - onEnd: this.slidesOnEnd.bind(this) + onEnd: this.slidesOnEnd.bind(this), })); }, @@ -312,7 +312,7 @@ this.uicontrol = (function() { end() { slides.remove(); - } + }, }; stateHandlers.crosshairs = { @@ -499,7 +499,7 @@ this.uicontrol = (function() { end() { ui.HoverBox.remove(); ui.PixelDimensions.remove(); - } + }, }; stateHandlers.draggingReady = { @@ -590,7 +590,7 @@ this.uicontrol = (function() { end() { mouseupNoAutoselect = false; - } + }, }; @@ -619,14 +619,14 @@ this.uicontrol = (function() { top: selectedPos.y1, bottom: selectedPos.y2, left: selectedPos.x1, - right: selectedPos.x2 + right: selectedPos.x2, })); setState("selected"); }, end() { ui.PixelDimensions.remove(); - } + }, }; stateHandlers.selected = { @@ -653,7 +653,7 @@ this.uicontrol = (function() { } event.preventDefault(); return false; - } + }, }; stateHandlers.resizing = { @@ -732,14 +732,14 @@ this.uicontrol = (function() { resizeDirection = resizeStartPos = resizeStartSelected = null; selectedPos.sortCoords(); ui.PixelDimensions.remove(); - } + }, }; stateHandlers.cancel = { start() { ui.iframe.hide(); ui.Box.remove(); - } + }, }; function getDocumentWidth() { diff --git a/browser/extensions/screenshots/selector/util.js b/browser/extensions/screenshots/selector/util.js index 891a1fca9c86..b366d1bd2638 100644 --- a/browser/extensions/screenshots/selector/util.js +++ b/browser/extensions/screenshots/selector/util.js @@ -46,7 +46,7 @@ this.util = (function() { // eslint-disable-line no-unused-vars top: elBox.top + scrollY, bottom: elBox.bottom + scrollY, left: elBox.left + scrollX, - right: elBox.right + scrollX + right: elBox.right + scrollX, }; if (elBox.bottom < box.top || elBox.top > box.bottom ||