summaryrefslogtreecommitdiff
path: root/ext/js/app
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-16 20:04:56 -0500
committerGitHub <noreply@github.com>2023-12-17 01:04:56 +0000
commitb249627434d3a94420ac4d98c3ce720767e57b43 (patch)
treeec46e2c020c5a63a5c2babf56376f53e288ed7f2 /ext/js/app
parentdecbc60f7734e739c0e5c41da294f65f9eec92fe (diff)
Update eslint spacing rules (#366)
* Add space-infix-ops rule * Add no-multi-spaces --------- Co-authored-by: Darius Jahandarie <djahandarie@gmail.com>
Diffstat (limited to 'ext/js/app')
-rw-r--r--ext/js/app/frontend.js8
-rw-r--r--ext/js/app/popup-factory.js14
-rw-r--r--ext/js/app/popup.js2
3 files changed, 15 insertions, 9 deletions
diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js
index e1f8d8c9..a1bbb217 100644
--- a/ext/js/app/frontend.js
+++ b/ext/js/app/frontend.js
@@ -41,9 +41,9 @@ export class Frontend {
parentPopupId,
parentFrameId,
useProxyPopup,
- canUseWindowPopup=true,
+ canUseWindowPopup = true,
allowRootFramePopupProxy,
- childrenSupported=true,
+ childrenSupported = true,
hotkeyHandler
}) {
/** @type {import('frontend').PageType} */
@@ -106,6 +106,7 @@ export class Frontend {
/** @type {?import('settings').OptionsContext} */
this._optionsContextOverride = null;
+ /* eslint-disable no-multi-spaces */
/** @type {import('core').MessageHandlerMap} */
this._runtimeMessageHandlers = new Map(/** @type {import('core').MessageHandlerArray} */ ([
['Frontend.requestReadyBroadcast', {async: false, handler: this._onMessageRequestFrontendReadyBroadcast.bind(this)}],
@@ -117,6 +118,7 @@ export class Frontend {
['scanSelectedText', this._onActionScanSelectedText.bind(this)],
['scanTextAtCaret', this._onActionScanTextAtCaret.bind(this)]
]);
+ /* eslint-enable no-multi-spaces */
}
/**
@@ -174,6 +176,7 @@ export class Frontend {
this._textScanner.on('clear', this._onTextScannerClear.bind(this));
this._textScanner.on('searched', this._onSearched.bind(this));
+ /* eslint-disable no-multi-spaces */
yomitan.crossFrame.registerHandlers([
['Frontend.closePopup', {async: false, handler: this._onApiClosePopup.bind(this)}],
['Frontend.copySelection', {async: false, handler: this._onApiCopySelection.bind(this)}],
@@ -181,6 +184,7 @@ export class Frontend {
['Frontend.getPopupInfo', {async: false, handler: this._onApiGetPopupInfo.bind(this)}],
['Frontend.getPageInfo', {async: false, handler: this._onApiGetPageInfo.bind(this)}]
]);
+ /* eslint-enable no-multi-spaces */
this._prepareSiteSpecific();
this._updateContentScale();
diff --git a/ext/js/app/popup-factory.js b/ext/js/app/popup-factory.js
index 6fa50796..41984841 100644
--- a/ext/js/app/popup-factory.js
+++ b/ext/js/app/popup-factory.js
@@ -47,6 +47,7 @@ export class PopupFactory {
*/
prepare() {
this._frameOffsetForwarder.prepare();
+ /* eslint-disable no-multi-spaces */
yomitan.crossFrame.registerHandlers([
['PopupFactory.getOrCreatePopup', {async: true, handler: this._onApiGetOrCreatePopup.bind(this)}],
['PopupFactory.setOptionsContext', {async: true, handler: this._onApiSetOptionsContext.bind(this)}],
@@ -64,6 +65,7 @@ export class PopupFactory {
['PopupFactory.getFrameSize', {async: true, handler: this._onApiGetFrameSize.bind(this)}],
['PopupFactory.setFrameSize', {async: true, handler: this._onApiSetFrameSize.bind(this)}]
]);
+ /* eslint-enable no-multi-spaces */
}
/**
@@ -72,12 +74,12 @@ export class PopupFactory {
* @returns {Promise<import('popup').PopupAny>}
*/
async getOrCreatePopup({
- frameId=null,
- id=null,
- parentPopupId=null,
- depth=null,
- popupWindow=false,
- childrenSupported=false
+ frameId = null,
+ id = null,
+ parentPopupId = null,
+ depth = null,
+ popupWindow = false,
+ childrenSupported = false
}) {
// Find by existing id
if (id !== null) {
diff --git a/ext/js/app/popup.js b/ext/js/app/popup.js
index 7419785b..a2aa204a 100644
--- a/ext/js/app/popup.js
+++ b/ext/js/app/popup.js
@@ -718,7 +718,7 @@ export class Popup extends EventDispatcher {
* @param {string} action
* @param {import('core').SerializableObject} params
*/
- _invokeWindow(action, params={}) {
+ _invokeWindow(action, params = {}) {
const contentWindow = this._frame.contentWindow;
if (this._frameClient === null || !this._frameClient.isConnected() || contentWindow === null) { return; }