summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-07-09 17:52:44 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-07-09 18:06:27 -0400
commitad897713e6acbcbd56962e8514ac866926da3cdd (patch)
tree7a16f525c2cc7a3ac2d1241544100f40091102fa /ext/bg
parent8b8482d2555342ee3e28b33f018b4246348e0702 (diff)
Add support for custom popup CSS
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/options.js3
-rw-r--r--ext/bg/js/settings.js2
-rw-r--r--ext/bg/settings.html14
3 files changed, 18 insertions, 1 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index bad56db6..f1fc2cf8 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -198,7 +198,8 @@ function optionsSetDefaults(options) {
showGuide: true,
compactTags: false,
compactGlossaries: false,
- mainDictionary: ''
+ mainDictionary: '',
+ customPopupCss: ''
},
scanning: {
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index 60a1886b..953120da 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -36,6 +36,7 @@ async function formRead() {
optionsNew.general.popupHeight = parseInt($('#popup-height').val(), 10);
optionsNew.general.popupHorizontalOffset = parseInt($('#popup-horizontal-offset').val(), 0);
optionsNew.general.popupVerticalOffset = parseInt($('#popup-vertical-offset').val(), 10);
+ optionsNew.general.customPopupCss = $('#custom-popup-css').val();
optionsNew.scanning.middleMouse = $('#middle-mouse-button-scan').prop('checked');
optionsNew.scanning.touchInputEnabled = $('#touch-input-enabled').prop('checked');
@@ -169,6 +170,7 @@ async function onReady() {
$('#popup-height').val(options.general.popupHeight);
$('#popup-horizontal-offset').val(options.general.popupHorizontalOffset);
$('#popup-vertical-offset').val(options.general.popupVerticalOffset);
+ $('#custom-popup-css').val(options.general.customPopupCss);
$('#middle-mouse-button-scan').prop('checked', options.scanning.middleMouse);
$('#touch-input-enabled').prop('checked', options.scanning.touchInputEnabled);
diff --git a/ext/bg/settings.html b/ext/bg/settings.html
index 1b4e5c84..086d67d2 100644
--- a/ext/bg/settings.html
+++ b/ext/bg/settings.html
@@ -30,6 +30,15 @@
padding-bottom: 1em;
}
+ #custom-popup-css {
+ width: 100%;
+ min-height: 34px;
+ height: 96px;
+ resize: vertical;
+ font-family: 'Courier New', Courier, monospace;
+ white-space: pre;
+ }
+
[data-show-for-browser] {
display: none;
}
@@ -123,6 +132,11 @@
<div class="col-xs-6"><input type="number" min="0" id="popup-vertical-offset" class="form-control"></div>
</div>
</div>
+
+ <div class="form-group options-advanced">
+ <label for="custom-popup-css">Custom popup CSS</label>
+ <div><textarea autocomplete="off" spellcheck="false" wrap="soft" id="custom-popup-css" class="form-control"></textarea></div>
+ </div>
</div>
<div>