aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-08-15 19:56:14 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-08-15 19:56:14 -0400
commit3a5b06bd1078d39cf9b29cbc05a0cde13c96ca94 (patch)
tree9bf9d86869425a4364bd6fe9ae5c79c50f1a39b4 /ext/bg/js
parent0f0adf750c8cde668cdcf369cbe0ac173a9edf3f (diff)
Add screenshot settings
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options.js1
-rw-r--r--ext/bg/js/settings.js4
2 files changed, 5 insertions, 0 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 96e390f4..29d8a215 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -224,6 +224,7 @@ function optionsSetDefaults(options) {
server: 'http://127.0.0.1:8765',
tags: ['yomichan'],
sentenceExt: 200,
+ screenshot: {format: 'png', quality: 92},
terms: {deck: '', model: '', fields: {}},
kanji: {deck: '', model: '', fields: {}},
fieldTemplates: optionsFieldTemplates()
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index 594d53f7..75082f3e 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -51,6 +51,8 @@ async function formRead() {
optionsNew.anki.tags = $('#card-tags').val().split(/[,; ]+/);
optionsNew.anki.sentenceExt = parseInt($('#sentence-detection-extent').val(), 10);
optionsNew.anki.server = $('#interface-server').val();
+ optionsNew.anki.screenshot.format = $('#screenshot-format').val();
+ optionsNew.anki.screenshot.quality = parseInt($('#screenshot-quality').val(), 10);
optionsNew.anki.fieldTemplates = $('#field-templates').val();
if (optionsOld.anki.enable && !ankiErrorShown()) {
@@ -188,6 +190,8 @@ async function onReady() {
$('#card-tags').val(options.anki.tags.join(' '));
$('#sentence-detection-extent').val(options.anki.sentenceExt);
$('#interface-server').val(options.anki.server);
+ $('#screenshot-format').val(options.anki.screenshot.format);
+ $('#screenshot-quality').val(options.anki.screenshot.quality);
$('#field-templates').val(options.anki.fieldTemplates);
$('#field-templates-reset').click(utilAsync(onAnkiFieldTemplatesReset));
$('input, select, textarea').not('.anki-model').change(utilAsync(onFormOptionsChanged));