aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2017-10-15 05:19:16 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2017-10-15 05:19:16 +0300
commit03f7ca23e118c5ca804eef35cea05070e69779c7 (patch)
treef7f66ed1a2ad3b782af8cd84ffb5d3203b1928ac /ext/bg/js/settings.js
parent4203fda906a1b4a104187e54d256e5952d8ae55c (diff)
merged mode: add secondary searches
Diffstat (limited to 'ext/bg/js/settings.js')
-rw-r--r--ext/bg/js/settings.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index f59c3ad0..b9c59a4a 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -62,7 +62,8 @@ async function formRead() {
const priority = parseInt(dictionary.find('.dict-priority').val(), 10);
const enabled = dictionary.find('.dict-enabled').prop('checked');
const main = dictionary.find('.dict-main').prop('checked');
- optionsNew.dictionaries[title] = {priority, enabled, main};
+ const allowSecondarySearches = dictionary.find('.dict-allow-secondary-searches').prop('checked');
+ optionsNew.dictionaries[title] = {priority, enabled, main, allowSecondarySearches};
});
return {optionsNew, optionsOld};
@@ -262,14 +263,15 @@ async function dictionaryGroupsPopulate(options) {
}
for (const dictRow of dictRowsSort(dictRows, options)) {
- const dictOptions = options.dictionaries[dictRow.title] || {enabled: false, priority: 0, main: false};
+ const dictOptions = options.dictionaries[dictRow.title] || {enabled: false, priority: 0, main: false, allowSecondarySearches: false};
const dictHtml = await apiTemplateRender('dictionary.html', {
title: dictRow.title,
version: dictRow.version,
revision: dictRow.revision,
priority: dictOptions.priority,
enabled: dictOptions.enabled,
- main: dictOptions.main
+ main: dictOptions.main,
+ allowSecondarySearches: dictOptions.allowSecondarySearches
});
dictGroups.append($(dictHtml));
@@ -277,7 +279,7 @@ async function dictionaryGroupsPopulate(options) {
formUpdateVisibility(options);
- $('.dict-enabled, .dict-priority').change(e => {
+ $('.dict-enabled, .dict-priority, .dict-allow-secondary-searches').change(e => {
dictionaryGroupsSort();
onFormOptionsChanged(e);
});
@@ -329,7 +331,7 @@ async function onDictionaryImport(e) {
const options = await optionsLoad();
const summary = await utilDatabaseImport(e.target.files[0], updateProgress);
- options.dictionaries[summary.title] = {enabled: true, priority: 0, main: false};
+ options.dictionaries[summary.title] = {enabled: true, priority: 0, main: false, allowSecondarySearches: false};
await optionsSave(options);
await dictionaryGroupsPopulate(options);