aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings
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/pages/settings
parentb3f54747eb2694bdc90bce72e5532e99d374ef08 (diff)
Allow trailing commas in ESLint (#1013)
* Update comma-dangle rule * Fix dangling commas
Diffstat (limited to 'ext/js/pages/settings')
-rw-r--r--ext/js/pages/settings/anki-controller.js22
-rw-r--r--ext/js/pages/settings/anki-deck-generator-controller.js8
-rw-r--r--ext/js/pages/settings/anki-templates-controller.js12
-rw-r--r--ext/js/pages/settings/audio-controller.js8
-rw-r--r--ext/js/pages/settings/backup-controller.js10
-rw-r--r--ext/js/pages/settings/dictionary-controller.js12
-rw-r--r--ext/js/pages/settings/dictionary-import-controller.js10
-rw-r--r--ext/js/pages/settings/generic-setting-controller.js10
-rw-r--r--ext/js/pages/settings/keyboard-mouse-input-field.js4
-rw-r--r--ext/js/pages/settings/keyboard-shortcuts-controller.js26
-rw-r--r--ext/js/pages/settings/permissions-origin-controller.js2
-rw-r--r--ext/js/pages/settings/popup-preview-controller.js2
-rw-r--r--ext/js/pages/settings/popup-preview-frame.js4
-rw-r--r--ext/js/pages/settings/profile-conditions-ui.js44
-rw-r--r--ext/js/pages/settings/profile-controller.js14
-rw-r--r--ext/js/pages/settings/scan-inputs-controller.js8
-rw-r--r--ext/js/pages/settings/scan-inputs-simple-controller.js10
-rw-r--r--ext/js/pages/settings/sentence-termination-characters-controller.js6
-rw-r--r--ext/js/pages/settings/settings-display-controller.js4
-rw-r--r--ext/js/pages/settings/sort-frequency-dictionary-controller.js2
-rw-r--r--ext/js/pages/settings/translation-text-replacements-controller.js8
21 files changed, 113 insertions, 113 deletions
diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js
index 1be41490..63717600 100644
--- a/ext/js/pages/settings/anki-controller.js
+++ b/ext/js/pages/settings/anki-controller.js
@@ -43,7 +43,7 @@ export class AnkiController {
ignoreSelector: null,
onAdded: this._createCardController.bind(this),
onRemoved: this._removeCardController.bind(this),
- isStale: this._isCardControllerStale.bind(this)
+ isStale: this._isCardControllerStale.bind(this),
});
/** @type {Intl.Collator} */
this._stringComparer = new Intl.Collator(); // Locale does not matter
@@ -95,7 +95,7 @@ export class AnkiController {
this._ankiEnableCheckbox.addEventListener(
/** @type {string} */ ('settingChanged'),
/** @type {EventListener} */ (this._onAnkiEnableChanged.bind(this)),
- false
+ false,
);
}
for (const input of ankiCardPrimaryTypeRadios) {
@@ -314,7 +314,7 @@ export class AnkiController {
const fieldMenuTargets = [
[['term'], 'anki-card-terms-field-menu'],
[['kanji'], 'anki-card-kanji-field-menu'],
- [['term', 'kanji'], 'anki-card-all-field-menu']
+ [['term', 'kanji'], 'anki-card-all-field-menu'],
];
const {templates} = this._settingsController;
for (const [types, templateName] of fieldMenuTargets) {
@@ -363,10 +363,10 @@ export class AnkiController {
this._setAnkiStatusChanging();
const [
[deckNames, getDeckNamesError],
- [modelNames, getModelNamesError]
+ [modelNames, getModelNamesError],
] = await Promise.all([
this._getDeckNames(),
- this._getModelNames()
+ this._getModelNames(),
]);
if (getDeckNamesError !== null) {
@@ -481,7 +481,7 @@ export class AnkiController {
'"よむ" deck:current',
'"よむ"',
'deck:current',
- ''
+ '',
];
let noteId = null;
@@ -864,7 +864,7 @@ class AnkiCardController {
await this._settingsController.modifyProfileSettings([{
action: 'set',
path: ObjectPropertyAccessor.getPathString(['anki', this._optionsType, 'deck']),
- value
+ value,
}]);
}
@@ -909,13 +909,13 @@ class AnkiCardController {
{
action: 'set',
path: ObjectPropertyAccessor.getPathString(['anki', this._optionsType, 'model']),
- value
+ value,
},
{
action: 'set',
path: ObjectPropertyAccessor.getPathString(['anki', this._optionsType, 'fields']),
- value: fields
- }
+ value: fields,
+ },
];
this._modelController.value = value;
@@ -1011,7 +1011,7 @@ class AnkiCardController {
['glossary', ['definition', 'meaning']],
['audio', ['sound']],
['dictionary', ['dict']],
- ['pitch-accents', ['pitch']]
+ ['pitch-accents', ['pitch']],
]);
const hyphenPattern = /-/g;
diff --git a/ext/js/pages/settings/anki-deck-generator-controller.js b/ext/js/pages/settings/anki-deck-generator-controller.js
index 416e2025..70533223 100644
--- a/ext/js/pages/settings/anki-deck-generator-controller.js
+++ b/ext/js/pages/settings/anki-deck-generator-controller.js
@@ -427,11 +427,11 @@ export class AnkiDeckGeneratorController {
url: window.location.href,
sentence: {
text: sentenceText,
- offset: 0
+ offset: 0,
},
documentTitle: document.title,
query: sentenceText,
- fullQuery: sentenceText
+ fullQuery: sentenceText,
};
const template = this._getAnkiTemplate(options);
const deckOptionsFields = options.anki.terms.fields;
@@ -460,7 +460,7 @@ export class AnkiDeckGeneratorController {
mediaOptions: mediaOptions,
requirements: requirements,
duplicateScope: options.anki.duplicateScope,
- duplicateScopeCheckAllModels: options.anki.duplicateScopeCheckAllModels
+ duplicateScopeCheckAllModels: options.anki.duplicateScopeCheckAllModels,
}));
return note;
}
@@ -476,7 +476,7 @@ export class AnkiDeckGeneratorController {
return {
dictionaryEntry: /** @type {import('dictionary').TermDictionaryEntry} */ (dictionaryEntries[0]),
- text: text
+ text: text,
};
}
diff --git a/ext/js/pages/settings/anki-templates-controller.js b/ext/js/pages/settings/anki-templates-controller.js
index d4f1dc10..7d4533e4 100644
--- a/ext/js/pages/settings/anki-templates-controller.js
+++ b/ext/js/pages/settings/anki-templates-controller.js
@@ -85,7 +85,7 @@ export class AnkiTemplatesController {
menuButton.addEventListener(
/** @type {string} */ ('menuClose'),
/** @type {EventListener} */ (this._onFieldMenuClose.bind(this)),
- false
+ false,
);
}
@@ -231,7 +231,7 @@ export class AnkiTemplatesController {
}
return {
dictionaryEntry: /** @type {import('dictionary').TermDictionaryEntry} */ (this._cachedDictionaryEntryValue),
- text: this._cachedDictionaryEntryText
+ text: this._cachedDictionaryEntryText,
};
}
@@ -257,11 +257,11 @@ export class AnkiTemplatesController {
url: window.location.href,
sentence: {
text: sentenceText,
- offset: 0
+ offset: 0,
},
documentTitle: document.title,
query: sentenceText,
- fullQuery: sentenceText
+ fullQuery: sentenceText,
};
const template = this._getAnkiTemplate(options);
const {general: {resultOutputMode, glossaryLayoutMode, compactTags}} = options;
@@ -273,11 +273,11 @@ export class AnkiTemplatesController {
deckName: '',
modelName: '',
fields: [
- ['field', field]
+ ['field', field],
],
resultOutputMode,
glossaryLayoutMode,
- compactTags
+ compactTags,
}));
result = note.fields.field;
allErrors.push(...errors);
diff --git a/ext/js/pages/settings/audio-controller.js b/ext/js/pages/settings/audio-controller.js
index ab7e377c..34d7adaa 100644
--- a/ext/js/pages/settings/audio-controller.js
+++ b/ext/js/pages/settings/audio-controller.js
@@ -97,7 +97,7 @@ export class AudioController extends EventDispatcher {
path: 'audio.sources',
start: index,
deleteCount: 1,
- items: []
+ items: [],
}]);
}
@@ -158,7 +158,7 @@ export class AudioController extends EventDispatcher {
[...speechSynthesis.getVoices()].map((voice, index) => ({
voice,
isJapanese: this._languageTagIsJapanese(voice.lang),
- index
+ index,
})) :
[]
);
@@ -221,7 +221,7 @@ export class AudioController extends EventDispatcher {
'jpod101',
'jpod101-alternate',
'jisho',
- 'custom'
+ 'custom',
];
for (const type of typesAvailable) {
if (!this._audioSourceEntries.some((entry) => entry.type === type)) {
@@ -243,7 +243,7 @@ export class AudioController extends EventDispatcher {
path: 'audio.sources',
start: index,
deleteCount: 0,
- items: [source]
+ items: [source],
}]);
}
}
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js
index f0876d3f..c4f3a97a 100644
--- a/ext/js/pages/settings/backup-controller.js
+++ b/ext/js/pages/settings/backup-controller.js
@@ -122,7 +122,7 @@ export class BackupController {
timeSeparator,
date.getUTCMinutes().toString().padStart(2, '0'),
timeSeparator,
- date.getUTCSeconds().toString().padStart(2, '0')
+ date.getUTCSeconds().toString().padStart(2, '0'),
];
return values.slice(0, resolution * 2 - 1).join('');
}
@@ -152,7 +152,7 @@ export class BackupController {
environment,
userAgent: navigator.userAgent,
permissions,
- options: optionsFull
+ options: optionsFull,
};
}
@@ -285,7 +285,7 @@ export class BackupController {
e.preventDefault();
complete({
result: true,
- sanitize: element.dataset.importSanitize === 'true'
+ sanitize: element.dataset.importSanitize === 'true',
});
modal.setVisible(false);
};
@@ -580,7 +580,7 @@ export class BackupController {
/** @type {unknown} */
// @ts-expect-error - The export function is declared as an extension which has no type information.
const blob = await db.export({
- progressCallback: this._databaseExportProgressCallback.bind(this)
+ progressCallback: this._databaseExportProgressCallback.bind(this),
});
db.close();
return /** @type {Blob} */ (blob);
@@ -644,7 +644,7 @@ export class BackupController {
async _importDatabase(_databaseName, file) {
await this._settingsController.application.api.purgeDatabase();
await Dexie.import(file, {
- progressCallback: this._databaseImportProgressCallback.bind(this)
+ progressCallback: this._databaseImportProgressCallback.bind(this),
});
void this._settingsController.application.api.triggerDatabaseUpdated('dictionary', 'import');
this._settingsController.application.triggerStorageChanged();
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js
index 291604e4..e7a9444f 100644
--- a/ext/js/pages/settings/dictionary-controller.js
+++ b/ext/js/pages/settings/dictionary-controller.js
@@ -216,7 +216,7 @@ class DictionaryEntry {
['Description', 'description'],
['Attribution', 'attribution'],
['Source Language', 'sourceLanguage'],
- ['Target Language', 'targetLanguage']
+ ['Target Language', 'targetLanguage'],
];
const dictionaryInfo = this._dictionaryInfo;
@@ -484,7 +484,7 @@ export class DictionaryController {
await this._settingsController.modifyProfileSettings([{
action: 'set',
path: 'dictionaries',
- value: dictionaries
+ value: dictionaries,
}]);
/** @type {import('settings-controller').EventArgument<'dictionarySettingsReordered'>} */
@@ -529,7 +529,7 @@ export class DictionaryController {
allowSecondarySearches: false,
definitionsCollapsible: 'not-collapsible',
partsOfSpeechFilter: true,
- useDeinflections: true
+ useDeinflections: true,
};
}
@@ -581,7 +581,7 @@ export class DictionaryController {
targets.push({
action: 'set',
path: `profiles[${i}].options.dictionaries`,
- value: dictionaryOptionsArray
+ value: dictionaryOptionsArray,
});
}
}
@@ -938,7 +938,7 @@ export class DictionaryController {
path,
start: j,
deleteCount: 1,
- items: []
+ items: [],
});
}
}
@@ -968,7 +968,7 @@ export class DictionaryController {
targets.push({
action: 'set',
path: `dictionaries[${i}].enabled`,
- value
+ value,
});
}
await this._settingsController.modifyProfileSettings(targets);
diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js
index 7090e296..c721a9dd 100644
--- a/ext/js/pages/settings/dictionary-import-controller.js
+++ b/ext/js/pages/settings/dictionary-import-controller.js
@@ -62,12 +62,12 @@ export class DictionaryImportController {
this._errorToStringOverrides = [
[
'A mutation operation was attempted on a database that did not allow mutations.',
- 'Access to IndexedDB appears to be restricted. Firefox seems to require that the history preference is set to "Remember history" before IndexedDB use of any kind is allowed.'
+ 'Access to IndexedDB appears to be restricted. Firefox seems to require that the history preference is set to "Remember history" before IndexedDB use of any kind is allowed.',
],
[
'The operation failed for reasons unrelated to the database itself and not covered by any other error code.',
- 'Unable to access IndexedDB due to a possibly corrupt user profile. Try using the "Refresh Firefox" feature to reset your user profile.'
- ]
+ 'Unable to access IndexedDB due to a possibly corrupt user profile. Try using the "Refresh Firefox" feature to reset your user profile.',
+ ],
];
}
@@ -319,7 +319,7 @@ export class DictionaryImportController {
const optionsFull = await this._settingsController.getOptionsFull();
const importDetails = {
- prefixWildcardsSupported: optionsFull.global.database.prefixWildcardsSupported
+ prefixWildcardsSupported: optionsFull.global.database.prefixWildcardsSupported,
};
let statusPrefix = '';
@@ -355,7 +355,7 @@ export class DictionaryImportController {
stepIndex: -1,
stepCount: 6,
index: 0,
- count: 0
+ count: 0,
});
if (statusFooter !== null) { statusFooter.setTaskActive(progressSelector, true); }
errors = [...errors, ...(await this._importDictionary(files[i], importDetails, onProgress) ?? [])];
diff --git a/ext/js/pages/settings/generic-setting-controller.js b/ext/js/pages/settings/generic-setting-controller.js
index 812520e4..15b3a6b1 100644
--- a/ext/js/pages/settings/generic-setting-controller.js
+++ b/ext/js/pages/settings/generic-setting-controller.js
@@ -36,7 +36,7 @@ export class GenericSettingController {
this._createElementMetadata.bind(this),
this._compareElementMetadata.bind(this),
this._getValues.bind(this),
- this._setValues.bind(this)
+ this._setValues.bind(this),
);
/** @type {Map<import('generic-setting-controller').TransformType, import('generic-setting-controller').TransformFunction>} */
this._transforms = new Map(/** @type {[key: import('generic-setting-controller').TransformType, value: import('generic-setting-controller').TransformFunction][]} */ ([
@@ -47,7 +47,7 @@ export class GenericSettingController {
['toNumber', this._toNumber.bind(this)],
['toBoolean', this._toBoolean.bind(this)],
['toString', this._toString.bind(this)],
- ['conditionalConvert', this._conditionalConvert.bind(this)]
+ ['conditionalConvert', this._conditionalConvert.bind(this)],
]));
}
@@ -82,7 +82,7 @@ export class GenericSettingController {
path,
scope: scope2 !== null ? scope2 : this._defaultScope,
transforms: this._getTransformDataArray(transformRaw),
- transformRaw
+ transformRaw,
};
}
@@ -112,7 +112,7 @@ export class GenericSettingController {
const target = {
path,
scope: typeof scope === 'string' ? scope : defaultScope,
- optionsContext: null
+ optionsContext: null,
};
settingsTargets.push(target);
}
@@ -135,7 +135,7 @@ export class GenericSettingController {
scope: typeof scope === 'string' ? scope : defaultScope,
action: 'set',
value: transformedValue,
- optionsContext: null
+ optionsContext: null,
};
settingsTargets.push(target);
}
diff --git a/ext/js/pages/settings/keyboard-mouse-input-field.js b/ext/js/pages/settings/keyboard-mouse-input-field.js
index 0c45d4bb..deced33e 100644
--- a/ext/js/pages/settings/keyboard-mouse-input-field.js
+++ b/ext/js/pages/settings/keyboard-mouse-input-field.js
@@ -75,7 +75,7 @@ export class KeyboardMouseInputField extends EventDispatcher {
/** @type {import('event-listener-collection').AddEventListenerArgs[]} */
const events = [
[this._inputNode, 'keydown', this._onModifierKeyDown.bind(this), false],
- [this._inputNode, 'keyup', this._onModifierKeyUp.bind(this), false]
+ [this._inputNode, 'keyup', this._onModifierKeyUp.bind(this), false],
];
if (mouseModifiersSupported && this._mouseButton !== null) {
events.push(
@@ -85,7 +85,7 @@ export class KeyboardMouseInputField extends EventDispatcher {
[this._mouseButton, 'pointerout', this._onMouseButtonPointerOut.bind(this), false],
[this._mouseButton, 'pointercancel', this._onMouseButtonPointerCancel.bind(this), false],
[this._mouseButton, 'mouseup', this._onMouseButtonMouseUp.bind(this), false],
- [this._mouseButton, 'contextmenu', this._onMouseButtonContextMenu.bind(this), false]
+ [this._mouseButton, 'contextmenu', this._onMouseButtonContextMenu.bind(this), false],
);
}
for (const args of events) {
diff --git a/ext/js/pages/settings/keyboard-shortcuts-controller.js b/ext/js/pages/settings/keyboard-shortcuts-controller.js
index a6d23d82..fd8bd471 100644
--- a/ext/js/pages/settings/keyboard-shortcuts-controller.js
+++ b/ext/js/pages/settings/keyboard-shortcuts-controller.js
@@ -71,7 +71,7 @@ export class KeyboardShortcutController {
['scanSelectedText', {scopes: new Set(['web'])}],
['scanTextAtSelection', {scopes: new Set(['web'])}],
['scanTextAtCaret', {scopes: new Set(['web'])}],
- ['toggleOption', {scopes: new Set(['popup', 'search']), argument: {template: 'hotkey-argument-setting-path', default: ''}}]
+ ['toggleOption', {scopes: new Set(['popup', 'search']), argument: {template: 'hotkey-argument-setting-path', default: ''}}],
]);
/* eslint-enable @stylistic/no-multi-spaces */
}
@@ -105,7 +105,7 @@ export class KeyboardShortcutController {
path: 'inputs.hotkeys',
start: hotkeys.length,
deleteCount: 0,
- items: [terminationCharacterEntry]
+ items: [terminationCharacterEntry],
}]);
await this._updateOptions();
@@ -128,7 +128,7 @@ export class KeyboardShortcutController {
path: 'inputs.hotkeys',
start: index,
deleteCount: 1,
- items: []
+ items: [],
}]);
await this._updateOptions();
@@ -214,7 +214,7 @@ export class KeyboardShortcutController {
key: null,
modifiers: [],
scopes: ['popup', 'search'],
- enabled: true
+ enabled: true,
};
await this.addEntry(newEntry);
}
@@ -460,13 +460,13 @@ class KeyboardShortcutHotkeyEntry {
{
action: 'set',
path: `${this._basePath}.key`,
- value: key
+ value: key,
},
{
action: 'set',
path: `${this._basePath}.modifiers`,
- value: modifiers
- }
+ value: modifiers,
+ },
]);
}
@@ -490,7 +490,7 @@ class KeyboardShortcutHotkeyEntry {
await this._modifyProfileSettings([{
action: 'set',
path: `${this._basePath}.scopes`,
- value: scopes
+ value: scopes,
}]);
this._updateScopesButton();
@@ -580,18 +580,18 @@ class KeyboardShortcutHotkeyEntry {
{
action: 'set',
path: `${this._basePath}.action`,
- value: this._data.action
+ value: this._data.action,
},
{
action: 'set',
path: `${this._basePath}.argument`,
- value: this._data.argument
+ value: this._data.argument,
},
{
action: 'set',
path: `${this._basePath}.scopes`,
- value: this._data.scopes
- }
+ value: this._data.scopes,
+ },
]);
this._updateScopesButton();
@@ -615,7 +615,7 @@ class KeyboardShortcutHotkeyEntry {
await this._modifyProfileSettings([{
action: 'set',
path: `${this._basePath}.argument`,
- value
+ value,
}]);
}
diff --git a/ext/js/pages/settings/permissions-origin-controller.js b/ext/js/pages/settings/permissions-origin-controller.js
index ec04e81e..c89a93ea 100644
--- a/ext/js/pages/settings/permissions-origin-controller.js
+++ b/ext/js/pages/settings/permissions-origin-controller.js
@@ -81,7 +81,7 @@ export class PermissionsOriginController {
let any = false;
const excludeOrigins = new Set([
- '<all_urls>'
+ '<all_urls>',
]);
const fragment = document.createDocumentFragment();
for (const origin of originsSet) {
diff --git a/ext/js/pages/settings/popup-preview-controller.js b/ext/js/pages/settings/popup-preview-controller.js
index e661b738..4a09d169 100644
--- a/ext/js/pages/settings/popup-preview-controller.js
+++ b/ext/js/pages/settings/popup-preview-controller.js
@@ -52,7 +52,7 @@ export class PopupPreviewController {
languageSelect.addEventListener(
/** @type {string} */ ('settingChanged'),
/** @type {EventListener} */ (this._onLanguageSelectChanged.bind(this)),
- false
+ false,
);
diff --git a/ext/js/pages/settings/popup-preview-frame.js b/ext/js/pages/settings/popup-preview-frame.js
index ad6e420f..37aca898 100644
--- a/ext/js/pages/settings/popup-preview-frame.js
+++ b/ext/js/pages/settings/popup-preview-frame.js
@@ -65,7 +65,7 @@ export class PopupPreviewFrame {
['setCustomCss', this._setCustomCss.bind(this)],
['setCustomOuterCss', this._setCustomOuterCss.bind(this)],
['updateOptionsContext', this._updateOptionsContext.bind(this)],
- ['setLanguageExampleText', this._setLanguageExampleText.bind(this)]
+ ['setLanguageExampleText', this._setLanguageExampleText.bind(this)],
]);
/* eslint-enable @stylistic/no-multi-spaces */
}
@@ -103,7 +103,7 @@ export class PopupPreviewFrame {
pageType: 'web',
allowRootFramePopupProxy: false,
childrenSupported: false,
- hotkeyHandler: this._hotkeyHandler
+ hotkeyHandler: this._hotkeyHandler,
});
this._frontend.setOptionsContextOverride(this._optionsContext);
await this._frontend.prepare();
diff --git a/ext/js/pages/settings/profile-conditions-ui.js b/ext/js/pages/settings/profile-conditions-ui.js
index 8f53232a..0d562e5c 100644
--- a/ext/js/pages/settings/profile-conditions-ui.js
+++ b/ext/js/pages/settings/profile-conditions-ui.js
@@ -65,9 +65,9 @@ export class ProfileConditionsUI extends EventDispatcher {
['lessThan', {displayName: '<', type: 'integer', defaultValue: '0', validate: validateInteger, normalize: normalizeInteger}],
['greaterThan', {displayName: '>', type: 'integer', defaultValue: '0', validate: validateInteger, normalize: normalizeInteger}],
['lessThanOrEqual', {displayName: '\u2264', type: 'integer', defaultValue: '0', validate: validateInteger, normalize: normalizeInteger}],
- ['greaterThanOrEqual', {displayName: '\u2265', type: 'integer', defaultValue: '0', validate: validateInteger, normalize: normalizeInteger}]
- ])
- }
+ ['greaterThanOrEqual', {displayName: '\u2265', type: 'integer', defaultValue: '0', validate: validateInteger, normalize: normalizeInteger}],
+ ]),
+ },
],
[
'url',
@@ -76,9 +76,9 @@ export class ProfileConditionsUI extends EventDispatcher {
defaultOperator: 'matchDomain',
operators: new Map([
['matchDomain', {displayName: 'Matches Domain', type: 'string', defaultValue: 'example.com', resetDefaultOnChange: true, validate: this._validateDomains.bind(this), normalize: this._normalizeDomains.bind(this)}],
- ['matchRegExp', {displayName: 'Matches RegExp', type: 'string', defaultValue: 'example\\.com', resetDefaultOnChange: true, validate: this._validateRegExp.bind(this)}]
- ])
- }
+ ['matchRegExp', {displayName: 'Matches RegExp', type: 'string', defaultValue: 'example\\.com', resetDefaultOnChange: true, validate: this._validateRegExp.bind(this)}],
+ ]),
+ },
],
[
'modifierKeys',
@@ -89,9 +89,9 @@ export class ProfileConditionsUI extends EventDispatcher {
['are', {displayName: 'Are', type: 'modifierKeys', defaultValue: ''}],
['areNot', {displayName: 'Are Not', type: 'modifierKeys', defaultValue: ''}],
['include', {displayName: 'Include', type: 'modifierKeys', defaultValue: ''}],
- ['notInclude', {displayName: 'Don\'t Include', type: 'modifierKeys', defaultValue: ''}]
- ])
- }
+ ['notInclude', {displayName: 'Don\'t Include', type: 'modifierKeys', defaultValue: ''}],
+ ]),
+ },
],
[
'flags',
@@ -102,15 +102,15 @@ export class ProfileConditionsUI extends EventDispatcher {
['are', {displayName: 'Are', type: 'string', defaultValue: '', validate: validateFlags, normalize: normalizeFlags}],
['areNot', {displayName: 'Are Not', type: 'string', defaultValue: '', validate: validateFlags, normalize: normalizeFlags}],
['include', {displayName: 'Include', type: 'string', defaultValue: '', validate: validateFlags, normalize: normalizeFlags}],
- ['notInclude', {displayName: 'Don\'t Include', type: 'string', defaultValue: '', validate: validateFlags, normalize: normalizeFlags}]
- ])
- }
- ]
+ ['notInclude', {displayName: 'Don\'t Include', type: 'string', defaultValue: '', validate: validateFlags, normalize: normalizeFlags}],
+ ]),
+ },
+ ],
]);
/* eslint-enable @stylistic/no-multi-spaces */
/** @type {Set<string>} */
this._validFlags = new Set([
- 'clipboard'
+ 'clipboard',
]);
}
@@ -225,7 +225,7 @@ export class ProfileConditionsUI extends EventDispatcher {
defaultValue = '',
resetDefaultOnChange = false,
validate = null,
- normalize = null
+ normalize = null,
} = (typeof info === 'undefined' ? {} : info);
return {
@@ -234,7 +234,7 @@ export class ProfileConditionsUI extends EventDispatcher {
defaultValue,
resetDefaultOnChange,
validate,
- normalize
+ normalize,
};
}
@@ -271,7 +271,7 @@ export class ProfileConditionsUI extends EventDispatcher {
path: this.getPath('conditionGroups'),
start: index,
deleteCount: 1,
- items: []
+ items: [],
}]);
this._triggerConditionGroupCountChanged(this._children.length);
@@ -327,7 +327,7 @@ export class ProfileConditionsUI extends EventDispatcher {
_onAddConditionGroupButtonClick() {
/** @type {import('settings').ProfileConditionGroup} */
const conditionGroup = {
- conditions: [this.getDefaultCondition()]
+ conditions: [this.getDefaultCondition()],
};
const index = this._children.length;
@@ -338,7 +338,7 @@ export class ProfileConditionsUI extends EventDispatcher {
path: this.getPath('conditionGroups'),
start: index,
deleteCount: 0,
- items: [conditionGroup]
+ items: [conditionGroup],
}]);
this._triggerConditionGroupCountChanged(this._children.length);
@@ -548,7 +548,7 @@ class ProfileConditionGroupUI {
path: this.getPath('conditions'),
start: index,
deleteCount: 1,
- items: []
+ items: [],
}]);
if (this._children.length === 0) {
@@ -586,7 +586,7 @@ class ProfileConditionGroupUI {
path: this.getPath('conditions'),
start: index,
deleteCount: 0,
- items: [condition]
+ items: [condition],
}]);
}
@@ -971,7 +971,7 @@ class ProfileConditionUI {
await this.settingsController.modifyGlobalSettings([
{action: 'set', path: this.getPath('type'), value: type},
{action: 'set', path: this.getPath('operator'), value: operator},
- {action: 'set', path: this.getPath('value'), value: defaultValue}
+ {action: 'set', path: this.getPath('value'), value: defaultValue},
]);
}
diff --git a/ext/js/pages/settings/profile-controller.js b/ext/js/pages/settings/profile-controller.js
index 9d4ed33b..558b45be 100644
--- a/ext/js/pages/settings/profile-controller.js
+++ b/ext/js/pages/settings/profile-controller.js
@@ -168,7 +168,7 @@ export class ProfileController {
await this._settingsController.modifyGlobalSettings([{
action: 'set',
path: `profiles[${destinationProfileIndex}].options`,
- value: options
+ value: options,
}]);
await this._settingsController.refresh();
@@ -199,7 +199,7 @@ export class ProfileController {
path: 'profiles',
start: index,
deleteCount: 0,
- items: [newProfile]
+ items: [newProfile],
}]);
// Update profile index
@@ -224,14 +224,14 @@ export class ProfileController {
path: 'profiles',
start: profileIndex,
deleteCount: 1,
- items: []
+ items: [],
}];
if (profileCurrentNew >= profileIndex) {
profileCurrentNew = Math.min(profileCurrentNew - 1, this._profiles.length - 1);
modifications.push({
action: 'set',
path: 'profileCurrent',
- value: profileCurrentNew
+ value: profileCurrentNew,
});
}
@@ -287,13 +287,13 @@ export class ProfileController {
const modifications = [{
action: 'swap',
path1: `profiles[${index1}]`,
- path2: `profiles[${index2}]`
+ path2: `profiles[${index2}]`,
}];
if (profileCurrentNew !== profileCurrent) {
modifications.push({
action: 'set',
path: 'profileCurrent',
- value: profileCurrentNew
+ value: profileCurrentNew,
});
}
@@ -534,7 +534,7 @@ export class ProfileController {
return [
/** @type {HTMLSelectElement} */ (this._profileActiveSelect),
/** @type {HTMLSelectElement} */ (this._profileTargetSelect),
- /** @type {HTMLSelectElement} */ (this._profileCopySourceSelect)
+ /** @type {HTMLSelectElement} */ (this._profileCopySourceSelect),
];
}
diff --git a/ext/js/pages/settings/scan-inputs-controller.js b/ext/js/pages/settings/scan-inputs-controller.js
index 839a6896..32910f6b 100644
--- a/ext/js/pages/settings/scan-inputs-controller.js
+++ b/ext/js/pages/settings/scan-inputs-controller.js
@@ -72,7 +72,7 @@ export class ScanInputsController {
path: 'scanning.inputs',
start: index,
deleteCount: 1,
- items: []
+ items: [],
}]);
return true;
}
@@ -149,7 +149,7 @@ export class ScanInputsController {
path: 'scanning.inputs',
start: index,
deleteCount: 0,
- items: [scanningInput]
+ items: [scanningInput],
}]);
// Scroll to bottom
@@ -218,8 +218,8 @@ export class ScanInputsController {
scanOnPenPress: true,
scanOnPenRelease: false,
preventTouchScrolling: true,
- preventPenScrolling: true
- }
+ preventPenScrolling: true,
+ },
};
}
}
diff --git a/ext/js/pages/settings/scan-inputs-simple-controller.js b/ext/js/pages/settings/scan-inputs-simple-controller.js
index 53a52922..ca9bb22d 100644
--- a/ext/js/pages/settings/scan-inputs-simple-controller.js
+++ b/ext/js/pages/settings/scan-inputs-simple-controller.js
@@ -132,7 +132,7 @@ export class ScanInputsSimpleController {
*/
_populateSelect(select, hasOther) {
const modifierKeys = [
- {value: 'none', name: 'No key'}
+ {value: 'none', name: 'No key'},
];
for (const value of /** @type {import('input').ModifierKey[]} */ (['alt', 'ctrl', 'shift', 'meta'])) {
const name = this._hotkeyUtil.getModifierDisplayValue(value);
@@ -182,7 +182,7 @@ export class ScanInputsSimpleController {
path: 'scanning.inputs',
start: insertionPosition,
deleteCount: 0,
- items: [input]
+ items: [input],
}]);
} else {
// Modify existing
@@ -192,7 +192,7 @@ export class ScanInputsSimpleController {
path: 'scanning.inputs',
start: index,
deleteCount: 1,
- items: []
+ items: [],
}]);
}
}
@@ -218,14 +218,14 @@ export class ScanInputsSimpleController {
path: 'scanning.inputs',
start: inputs.length,
deleteCount: 0,
- items: [input]
+ items: [input],
}]);
} else {
// Modify existing
await this._modifyProfileSettings([{
action: 'set',
path: `scanning.inputs[${index}].include`,
- value: value2
+ value: value2,
}]);
}
}
diff --git a/ext/js/pages/settings/sentence-termination-characters-controller.js b/ext/js/pages/settings/sentence-termination-characters-controller.js
index 7eee3d3e..0a8ae145 100644
--- a/ext/js/pages/settings/sentence-termination-characters-controller.js
+++ b/ext/js/pages/settings/sentence-termination-characters-controller.js
@@ -66,7 +66,7 @@ export class SentenceTerminationCharactersController {
path: 'sentenceParsing.terminationCharacters',
start: terminationCharacters.length,
deleteCount: 0,
- items: [terminationCharacterEntry]
+ items: [terminationCharacterEntry],
}]);
await this._updateOptions();
@@ -87,7 +87,7 @@ export class SentenceTerminationCharactersController {
path: 'sentenceParsing.terminationCharacters',
start: index,
deleteCount: 1,
- items: []
+ items: [],
}]);
await this._updateOptions();
@@ -153,7 +153,7 @@ export class SentenceTerminationCharactersController {
character1: '"',
character2: '"',
includeCharacterAtStart: false,
- includeCharacterAtEnd: false
+ includeCharacterAtEnd: false,
};
await this.addEntry(newEntry);
}
diff --git a/ext/js/pages/settings/settings-display-controller.js b/ext/js/pages/settings/settings-display-controller.js
index 6e740e13..f732f1ef 100644
--- a/ext/js/pages/settings/settings-display-controller.js
+++ b/ext/js/pages/settings/settings-display-controller.js
@@ -70,14 +70,14 @@ export class SettingsDisplayController {
const moreSelectorObserver = new SelectorObserver({
selector: '.more-toggle',
onAdded: this._onMoreSetup.bind(this),
- onRemoved: this._onMoreCleanup.bind(this)
+ onRemoved: this._onMoreCleanup.bind(this),
});
moreSelectorObserver.observe(document.documentElement, false);
const menuSelectorObserver = new SelectorObserver({
selector: '[data-menu]',
onAdded: this._onMenuSetup.bind(this),
- onRemoved: this._onMenuCleanup.bind(this)
+ onRemoved: this._onMenuCleanup.bind(this),
});
menuSelectorObserver.observe(document.documentElement, false);
diff --git a/ext/js/pages/settings/sort-frequency-dictionary-controller.js b/ext/js/pages/settings/sort-frequency-dictionary-controller.js
index 6be24eeb..e6f55f20 100644
--- a/ext/js/pages/settings/sort-frequency-dictionary-controller.js
+++ b/ext/js/pages/settings/sort-frequency-dictionary-controller.js
@@ -159,7 +159,7 @@ export class SortFrequencyDictionaryController {
const frequencies = await this._settingsController.application.api.getTermFrequencies(
terms.map((term) => ({term, reading: null})),
- [dictionary]
+ [dictionary],
);
/** @type {Map<string, {hasValue: boolean, minValue: number, maxValue: number}>} */
diff --git a/ext/js/pages/settings/translation-text-replacements-controller.js b/ext/js/pages/settings/translation-text-replacements-controller.js
index f2255ae0..59800ed7 100644
--- a/ext/js/pages/settings/translation-text-replacements-controller.js
+++ b/ext/js/pages/settings/translation-text-replacements-controller.js
@@ -56,14 +56,14 @@ export class TranslationTextReplacementsController {
path: 'translation.textReplacements.groups',
start: 0,
deleteCount: 0,
- items: [[newEntry]]
+ items: [[newEntry]],
} :
{
action: 'splice',
path: 'translation.textReplacements.groups[0]',
start: groups[0].length,
deleteCount: 0,
- items: [newEntry]
+ items: [newEntry],
}
);
@@ -91,14 +91,14 @@ export class TranslationTextReplacementsController {
path: 'translation.textReplacements.groups[0]',
start: index,
deleteCount: 1,
- items: []
+ items: [],
} :
{
action: 'splice',
path: 'translation.textReplacements.groups',
start: 0,
deleteCount: group0.length,
- items: []
+ items: [],
}
);