aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/text-scanner.js
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/language/text-scanner.js
parentb3f54747eb2694bdc90bce72e5532e99d374ef08 (diff)
Allow trailing commas in ESLint (#1013)
* Update comma-dangle rule * Fix dangling commas
Diffstat (limited to 'ext/js/language/text-scanner.js')
-rw-r--r--ext/js/language/text-scanner.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js
index 0d8e49b1..0270a025 100644
--- a/ext/js/language/text-scanner.js
+++ b/ext/js/language/text-scanner.js
@@ -40,7 +40,7 @@ export class TextScanner extends EventDispatcher {
searchKanji = false,
searchOnClick = false,
searchOnClickOnly = false,
- textSourceGenerator
+ textSourceGenerator,
}) {
super();
/** @type {import('../comm/api.js').API} */
@@ -253,7 +253,7 @@ export class TextScanner extends EventDispatcher {
layoutAwareScan,
preventMiddleMouse,
sentenceParsingOptions,
- matchTypePrefix
+ matchTypePrefix,
}) {
if (Array.isArray(inputs)) {
this._inputs = inputs.map((input) => this._convertInput(input));
@@ -482,7 +482,7 @@ export class TextScanner extends EventDispatcher {
inputInfo,
textSource,
optionsContext,
- detail
+ detail,
});
} else {
this._triggerSearchEmpty(inputInfo);
@@ -491,7 +491,7 @@ export class TextScanner extends EventDispatcher {
this.trigger('searchError', {
error: error instanceof Error ? error : new Error(`A search error occurred: ${error}`),
textSource,
- inputInfo
+ inputInfo,
});
}
}
@@ -580,7 +580,7 @@ export class TextScanner extends EventDispatcher {
metaKey: modifiers.includes('meta'),
button: this._lastMouseMove.button,
buttons: this._lastMouseMove.buttons,
- relatedTarget: this._lastMouseMove.relatedTarget
+ relatedTarget: this._lastMouseMove.relatedTarget,
});
this._onMouseMove(syntheticMouseEvent);
}
@@ -1126,7 +1126,7 @@ export class TextScanner extends EventDispatcher {
[this._node, 'touchmove', this._onTouchMovePreventScroll.bind(this), {passive: false, capture}],
[this._node, 'mousedown', this._onMouseDown.bind(this), capture],
[this._node, 'click', this._onClick.bind(this), capture],
- [this._node, 'auxclick', this._onAuxClick.bind(this), capture]
+ [this._node, 'auxclick', this._onAuxClick.bind(this), capture],
];
}
@@ -1140,7 +1140,7 @@ export class TextScanner extends EventDispatcher {
[this._node, 'mousemove', this._onMouseMove.bind(this), capture],
[this._node, 'mouseover', this._onMouseOver.bind(this), capture],
[this._node, 'mouseout', this._onMouseOut.bind(this), capture],
- [this._node, 'click', this._onClick.bind(this), capture]
+ [this._node, 'click', this._onClick.bind(this), capture],
];
}
@@ -1150,7 +1150,7 @@ export class TextScanner extends EventDispatcher {
*/
_getKeyboardEventListeners(capture) {
return [
- [this._node, 'keydown', this._onKeyDown.bind(this), capture]
+ [this._node, 'keydown', this._onKeyDown.bind(this), capture],
];
}
@@ -1165,7 +1165,7 @@ export class TextScanner extends EventDispatcher {
[this._node, 'touchend', this._onTouchEnd.bind(this), capture],
[this._node, 'touchcancel', this._onTouchCancel.bind(this), capture],
[this._node, 'touchmove', this._onTouchMove.bind(this), {passive: false, capture}],
- [this._node, 'contextmenu', this._onContextMenu.bind(this), capture]
+ [this._node, 'contextmenu', this._onContextMenu.bind(this), capture],
];
}
@@ -1175,7 +1175,7 @@ export class TextScanner extends EventDispatcher {
*/
_getMouseClickOnlyEventListeners(capture) {
return [
- [this._node, 'click', this._onClick.bind(this), capture]
+ [this._node, 'click', this._onClick.bind(this), capture],
];
}
@@ -1187,7 +1187,7 @@ export class TextScanner extends EventDispatcher {
const {documentElement} = document;
/** @type {import('event-listener-collection').AddEventListenerArgs[]} */
const entries = [
- [document, 'selectionchange', this._onSelectionChange.bind(this)]
+ [document, 'selectionchange', this._onSelectionChange.bind(this)],
];
if (documentElement !== null) {
entries.push([documentElement, 'mousedown', this._onSearchClickMouseDown.bind(this), capture]);
@@ -1271,7 +1271,7 @@ export class TextScanner extends EventDispatcher {
sentenceTerminateAtNewlines,
sentenceTerminatorMap,
sentenceForwardQuoteMap,
- sentenceBackwardQuoteMap
+ sentenceBackwardQuoteMap,
);
return {dictionaryEntries, sentence, type: 'terms'};
@@ -1303,7 +1303,7 @@ export class TextScanner extends EventDispatcher {
sentenceTerminateAtNewlines,
sentenceTerminatorMap,
sentenceForwardQuoteMap,
- sentenceBackwardQuoteMap
+ sentenceBackwardQuoteMap,
);
return {dictionaryEntries, sentence, type: 'kanji'};
@@ -1335,7 +1335,7 @@ export class TextScanner extends EventDispatcher {
const textSource = this._textSourceGenerator.getRangeFromPoint(x, y, {
deepContentScan: this._deepContentScan,
- normalizeCssZoom: this._normalizeCssZoom
+ normalizeCssZoom: this._normalizeCssZoom,
});
if (textSource !== null) {
try {
@@ -1545,7 +1545,7 @@ export class TextScanner extends EventDispatcher {
scanOnPenPress: this._getInputBoolean(options.scanOnPenPress),
scanOnPenRelease: this._getInputBoolean(options.scanOnPenRelease),
preventTouchScrolling: this._getInputBoolean(options.preventTouchScrolling),
- preventPenScrolling: this._getInputBoolean(options.preventPenScrolling)
+ preventPenScrolling: this._getInputBoolean(options.preventPenScrolling),
};
}