diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-10-29 12:20:56 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-10-29 12:20:56 -0700 |
commit | c08dc6e00a0786438d785d3c7f62ce86205386fd (patch) | |
tree | 7f65834ec0e988b978418a6f331a95776b96c887 /ext/bg/js/settings.js | |
parent | d6603fd03155939ba98e8e74f98d1c5ce7ca9b0f (diff) |
add dictionary update nag screen
Diffstat (limited to 'ext/bg/js/settings.js')
-rw-r--r-- | ext/bg/js/settings.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js index 9a7b20b6..dcc9c43d 100644 --- a/ext/bg/js/settings.js +++ b/ext/bg/js/settings.js @@ -60,11 +60,11 @@ async function formRead() { optionsNew.general.mainDictionary = $('#dict-main').val(); $('.dict-group').each((index, element) => { const dictionary = $(element); - const title = dictionary.data('title'); - const priority = parseInt(dictionary.find('.dict-priority').val(), 10); - const enabled = dictionary.find('.dict-enabled').prop('checked'); - const allowSecondarySearches = dictionary.find('.dict-allow-secondary-searches').prop('checked'); - optionsNew.dictionaries[title] = {priority, enabled, allowSecondarySearches}; + optionsNew.dictionaries[dictionary.data('title')] = { + priority: parseInt(dictionary.find('.dict-priority').val(), 10), + enabled: dictionary.find('.dict-enabled').prop('checked'), + allowSecondarySearches: dictionary.find('.dict-allow-secondary-searches').prop('checked') + }; }); return {optionsNew, optionsOld}; @@ -277,14 +277,20 @@ async function dictionaryGroupsPopulate(options) { } for (const dictRow of dictRowsSort(dictRows, options)) { - const dictOptions = options.dictionaries[dictRow.title] || {enabled: false, priority: 0, allowSecondarySearches: false}; + const dictOptions = options.dictionaries[dictRow.title] || { + enabled: false, + priority: 0, + allowSecondarySearches: false + }; + const dictHtml = await apiTemplateRender('dictionary.html', { + enabled: dictOptions.enabled, + priority: dictOptions.priority, + allowSecondarySearches: dictOptions.allowSecondarySearches, title: dictRow.title, version: dictRow.version, revision: dictRow.revision, - priority: dictOptions.priority, - enabled: dictOptions.enabled, - allowSecondarySearches: dictOptions.allowSecondarySearches + outdated: dictRow.version < 3 }); dictGroups.append($(dictHtml)); |