aboutsummaryrefslogtreecommitdiff
path: root/ext/js/app
diff options
context:
space:
mode:
authorJames Maa <jmaa@berkeley.edu>2024-05-31 08:06:52 -0700
committerGitHub <noreply@github.com>2024-05-31 15:06:52 +0000
commit76ca08bd59f0e8bfa1bb20ac813f48e7ab241265 (patch)
treebdba43d9ba704885383c7f308c6fe3f574c647c5 /ext/js/app
parentb3f54747eb2694bdc90bce72e5532e99d374ef08 (diff)
Allow trailing commas in ESLint (#1013)
* Update comma-dangle rule * Fix dangling commas
Diffstat (limited to 'ext/js/app')
-rw-r--r--ext/js/app/content-script-main.js2
-rw-r--r--ext/js/app/frontend.js38
-rw-r--r--ext/js/app/popup-factory.js16
-rw-r--r--ext/js/app/popup-window.js4
-rw-r--r--ext/js/app/popup.js22
-rw-r--r--ext/js/app/theme-controller.js2
6 files changed, 42 insertions, 42 deletions
diff --git a/ext/js/app/content-script-main.js b/ext/js/app/content-script-main.js
index c17acbfe..70329efb 100644
--- a/ext/js/app/content-script-main.js
+++ b/ext/js/app/content-script-main.js
@@ -39,7 +39,7 @@ await Application.main(false, async (application) => {
canUseWindowPopup: true,
allowRootFramePopupProxy: true,
childrenSupported: true,
- hotkeyHandler
+ hotkeyHandler,
});
await frontend.prepare();
});
diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js
index c856ae0f..39176475 100644
--- a/ext/js/app/frontend.js
+++ b/ext/js/app/frontend.js
@@ -45,7 +45,7 @@ export class Frontend {
canUseWindowPopup = true,
allowRootFramePopupProxy,
childrenSupported = true,
- hotkeyHandler
+ hotkeyHandler,
}) {
/** @type {import('../application.js').Application} */
this._application = application;
@@ -92,7 +92,7 @@ export class Frontend {
getSearchContext: this._getSearchContext.bind(this),
searchTerms: true,
searchKanji: true,
- textSourceGenerator: this._textSourceGenerator
+ textSourceGenerator: this._textSourceGenerator,
});
/** @type {boolean} */
this._textScannerHasBeenEnabled = false;
@@ -114,13 +114,13 @@ export class Frontend {
this._runtimeApiMap = createApiMap([
['frontendRequestReadyBroadcast', this._onMessageRequestFrontendReadyBroadcast.bind(this)],
['frontendSetAllVisibleOverride', this._onApiSetAllVisibleOverride.bind(this)],
- ['frontendClearAllVisibleOverride', this._onApiClearAllVisibleOverride.bind(this)]
+ ['frontendClearAllVisibleOverride', this._onApiClearAllVisibleOverride.bind(this)],
]);
this._hotkeyHandler.registerActions([
['scanSelectedText', this._onActionScanSelectedText.bind(this)],
['scanTextAtSelection', this._onActionScanTextAtSelection.bind(this)],
- ['scanTextAtCaret', this._onActionScanTextAtCaret.bind(this)]
+ ['scanTextAtCaret', this._onActionScanTextAtCaret.bind(this)],
]);
/* eslint-enable @stylistic/no-multi-spaces */
}
@@ -188,7 +188,7 @@ export class Frontend {
['frontendCopySelection', this._onApiCopySelection.bind(this)],
['frontendGetSelectionText', this._onApiGetSelectionText.bind(this)],
['frontendGetPopupInfo', this._onApiGetPopupInfo.bind(this)],
- ['frontendGetPageInfo', this._onApiGetPageInfo.bind(this)]
+ ['frontendGetPageInfo', this._onApiGetPageInfo.bind(this)],
]);
/* eslint-enable @stylistic/no-multi-spaces */
@@ -296,7 +296,7 @@ export class Frontend {
/** @type {import('cross-frame-api').ApiHandler<'frontendGetPopupInfo'>} */
_onApiGetPopupInfo() {
return {
- popupId: (this._popup !== null ? this._popup.id : null)
+ popupId: (this._popup !== null ? this._popup.id : null),
};
}
@@ -304,7 +304,7 @@ export class Frontend {
_onApiGetPageInfo() {
return {
url: window.location.href,
- documentTitle: document.title
+ documentTitle: document.title,
};
}
@@ -501,7 +501,7 @@ export class Frontend {
layoutAwareScan: scanningOptions.layoutAwareScan,
matchTypePrefix: scanningOptions.matchTypePrefix,
preventMiddleMouse,
- sentenceParsingOptions
+ sentenceParsingOptions,
});
this._updateTextScannerEnabled();
@@ -605,7 +605,7 @@ export class Frontend {
return await this._popupFactory.getOrCreatePopup({
frameId,
depth: this._depth,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
}
@@ -617,7 +617,7 @@ export class Frontend {
frameId: this._parentFrameId,
depth: this._depth,
parentPopupId: this._parentPopupId,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
}
@@ -641,7 +641,7 @@ export class Frontend {
const popup = await this._popupFactory.getOrCreatePopup({
frameId: targetFrameId,
id: popupId,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
popup.on('offsetNotFound', () => {
this._allowRootFramePopupProxy = false;
@@ -657,7 +657,7 @@ export class Frontend {
return await this._popupFactory.getOrCreatePopup({
depth: this._depth,
popupWindow: true,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
}
@@ -713,14 +713,14 @@ export class Frontend {
const detailsState = {
focusEntry: 0,
optionsContext,
- url
+ url,
};
if (sentence !== null) { detailsState.sentence = sentence; }
if (documentTitle !== null) { detailsState.documentTitle = documentTitle; }
const {tabId, frameId} = this._application;
/** @type {import('display').HistoryContent} */
const detailsContent = {
- contentOrigin: {tabId, frameId}
+ contentOrigin: {tabId, frameId},
};
if (dictionaryEntries !== null) {
detailsContent.dictionaryEntries = dictionaryEntries;
@@ -732,10 +732,10 @@ export class Frontend {
params: {
type,
query,
- wildcards: 'off'
+ wildcards: 'off',
},
state: detailsState,
- content: detailsContent
+ content: detailsContent,
};
if (textSource instanceof TextSourceElement && textSource.fullContent !== query) {
details.params.full = textSource.fullContent;
@@ -761,9 +761,9 @@ export class Frontend {
{
optionsContext,
sourceRects,
- writingMode: textSource.getWritingMode()
+ writingMode: textSource.getWritingMode(),
},
- details
+ details,
) :
Promise.resolve()
);
@@ -927,7 +927,7 @@ export class Frontend {
return {
optionsContext,
- detail: {documentTitle}
+ detail: {documentTitle},
};
}
diff --git a/ext/js/app/popup-factory.js b/ext/js/app/popup-factory.js
index 9cada2c8..2aeb23f4 100644
--- a/ext/js/app/popup-factory.js
+++ b/ext/js/app/popup-factory.js
@@ -62,7 +62,7 @@ export class PopupFactory {
['popupFactoryUpdateTheme', this._onApiUpdateTheme.bind(this)],
['popupFactorySetCustomOuterCss', this._onApiSetCustomOuterCss.bind(this)],
['popupFactoryGetFrameSize', this._onApiGetFrameSize.bind(this)],
- ['popupFactorySetFrameSize', this._onApiSetFrameSize.bind(this)]
+ ['popupFactorySetFrameSize', this._onApiSetFrameSize.bind(this)],
]);
/* eslint-enable @stylistic/no-multi-spaces */
}
@@ -78,7 +78,7 @@ export class PopupFactory {
parentPopupId = null,
depth = null,
popupWindow = false,
- childrenSupported = false
+ childrenSupported = false,
}) {
// Find by existing id
if (id !== null) {
@@ -124,7 +124,7 @@ export class PopupFactory {
this._application,
id,
depth,
- currentFrameId
+ currentFrameId,
);
this._popups.set(id, popup);
return popup;
@@ -138,7 +138,7 @@ export class PopupFactory {
id,
depth,
currentFrameId,
- childrenSupported
+ childrenSupported,
);
if (parent !== null) {
if (parent.child !== null) {
@@ -159,7 +159,7 @@ export class PopupFactory {
id,
parentPopupId,
frameId,
- childrenSupported
+ childrenSupported,
});
id = info.id;
const popup = new PopupProxy(
@@ -167,7 +167,7 @@ export class PopupFactory {
id,
info.depth,
info.frameId,
- useFrameOffsetForwarder ? this._frameOffsetForwarder : null
+ useFrameOffsetForwarder ? this._frameOffsetForwarder : null,
);
this._popups.set(id, popup);
return popup;
@@ -249,7 +249,7 @@ export class PopupFactory {
return {
id: popup.id,
depth: popup.depth,
- frameId: popup.frameId
+ frameId: popup.frameId,
};
}
@@ -402,7 +402,7 @@ export class PopupFactory {
const promise = popup.clearVisibleOverride(token)
.then(
(v) => v,
- () => false
+ () => false,
);
promises.push(promise);
}
diff --git a/ext/js/app/popup-window.js b/ext/js/app/popup-window.js
index 01696676..5657e569 100644
--- a/ext/js/app/popup-window.js
+++ b/ext/js/app/popup-window.js
@@ -286,7 +286,7 @@ export class PopupWindow extends EventDispatcher {
this._popupTabId,
frameId,
'displayPopupMessage2',
- message
+ message,
));
} catch (e) {
if (this._application.webExtension.unloaded) {
@@ -307,7 +307,7 @@ export class PopupWindow extends EventDispatcher {
this._popupTabId,
frameId,
'displayPopupMessage2',
- message
+ message,
));
}
}
diff --git a/ext/js/app/popup.js b/ext/js/app/popup.js
index e9c37d00..75e2bd84 100644
--- a/ext/js/app/popup.js
+++ b/ext/js/app/popup.js
@@ -424,7 +424,7 @@ export class Popup extends EventDispatcher {
if (injectPromise !== this._injectPromise) { return; }
this._injectPromiseComplete = true;
},
- () => {}
+ () => {},
);
}
return injectPromise;
@@ -489,7 +489,7 @@ export class Popup extends EventDispatcher {
parentFrameId: this._frameId,
childrenSupported: this._childrenSupported,
scale: this._contentScale,
- optionsContext: this._optionsContext
+ optionsContext: this._optionsContext,
};
await this._invokeSafe('displayConfigure', configureParams);
}
@@ -699,7 +699,7 @@ export class Popup extends EventDispatcher {
return /** @type {import('display').DirectApiReturn<TName>} */ (await this._application.crossFrame.invoke(
this._frameClient.frameId,
'displayPopupMessage1',
- /** @type {import('display').DirectApiFrameClientMessageAny} */ (wrappedMessage)
+ /** @type {import('display').DirectApiFrameClientMessageAny} */ (wrappedMessage),
));
}
@@ -837,7 +837,7 @@ export class Popup extends EventDispatcher {
frameWidth,
viewport.left,
viewport.right,
- true
+ true,
);
const [top, height, below] = this._getConstrainedPositionBinary(
sourceRect.top - verticalOffset,
@@ -845,7 +845,7 @@ export class Popup extends EventDispatcher {
frameHeight,
viewport.top,
viewport.bottom,
- preferBelow
+ preferBelow,
);
return {left, top, width, height, after, below};
}
@@ -868,7 +868,7 @@ export class Popup extends EventDispatcher {
frameWidth,
viewport.left,
viewport.right,
- preferRight
+ preferRight,
);
const [top, height, below] = this._getConstrainedPosition(
sourceRect.bottom - verticalOffset,
@@ -876,7 +876,7 @@ export class Popup extends EventDispatcher {
frameHeight,
viewport.top,
viewport.bottom,
- true
+ true,
);
return {left, top, width, height, after, below};
}
@@ -984,7 +984,7 @@ export class Popup extends EventDispatcher {
left,
top,
right: left + width,
- bottom: top + height
+ bottom: top + height,
};
} else {
const scale = visualViewport.scale;
@@ -992,7 +992,7 @@ export class Popup extends EventDispatcher {
left: 0,
top: 0,
right: Math.max(left + width, width * scale),
- bottom: Math.max(top + height, height * scale)
+ bottom: Math.max(top + height, height * scale),
};
}
}
@@ -1001,7 +1001,7 @@ export class Popup extends EventDispatcher {
left: 0,
top: 0,
right: window.innerWidth,
- bottom: window.innerHeight
+ bottom: window.innerHeight,
};
}
@@ -1121,7 +1121,7 @@ export class Popup extends EventDispatcher {
left: rect.left * scale,
top: rect.top * scale,
right: rect.right * scale,
- bottom: rect.bottom * scale
+ bottom: rect.bottom * scale,
};
}
}
diff --git a/ext/js/app/theme-controller.js b/ext/js/app/theme-controller.js
index 384fbcc8..3d4f8269 100644
--- a/ext/js/app/theme-controller.js
+++ b/ext/js/app/theme-controller.js
@@ -212,7 +212,7 @@ export class ThemeController {
Number.parseInt(m[1], 10),
Number.parseInt(m[2], 10),
Number.parseInt(m[3], 10),
- m4 ? Math.max(0, Math.min(1, Number.parseFloat(m4))) : 1
+ m4 ? Math.max(0, Math.min(1, Number.parseFloat(m4))) : 1,
];
}
}