From 443d6d1956691861a5e0203e33726b8c2aa93eef Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 19 Dec 2020 20:07:55 -0500 Subject: [PATCH] Popup action bar options (#1140) * Add options for action bar visibility and location * Add settings * Update styles * Expose properties * Update styles * Update tests --- ext/bg/data/options-schema.json | 14 +++++++++- ext/bg/js/options.js | 4 +++ ext/bg/settings2.html | 28 ++++++++++++++++++++ ext/fg/float.html | 4 ++- ext/mixed/css/display.css | 46 ++++++++++++++++++++++++++++++++- ext/mixed/js/display.js | 2 ++ test/test-options-util.js | 4 ++- 7 files changed, 98 insertions(+), 4 deletions(-) diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json index b6b11b66..7fed4909 100644 --- a/ext/bg/data/options-schema.json +++ b/ext/bg/data/options-schema.json @@ -110,7 +110,9 @@ "usePopupShadowDom", "usePopupWindow", "maximumClipboardSearchLength", - "popupCurrentIndicatorMode" + "popupCurrentIndicatorMode", + "popupActionBarVisibility", + "popupActionBarLocation" ], "properties": { "enable": { @@ -271,6 +273,16 @@ "type": "string", "enum": ["none", "asterisk", "triangle", "bar-left", "bar-right", "dot-left", "dot-right"], "default": "bar-left" + }, + "popupActionBarVisibility": { + "type": "string", + "enum": ["auto", "always"], + "default": "auto" + }, + "popupActionBarLocation": { + "type": "string", + "enum": ["left", "right", "top", "bottom"], + "default": "right" } } }, diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 5492b97d..e946c461 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -663,9 +663,13 @@ class OptionsUtil { // Version 7 changes: // Added general.maximumClipboardSearchLength. // Added general.popupCurrentIndicatorMode. + // Added general.popupActionBarVisibility. + // Added general.popupActionBarLocation. for (const profile of options.profiles) { profile.options.general.maximumClipboardSearchLength = 1000; profile.options.general.popupCurrentIndicatorMode = 'bar-left'; + profile.options.general.popupActionBarVisibility = 'auto'; + profile.options.general.popupActionBarLocation = 'right'; } return options; } diff --git a/ext/bg/settings2.html b/ext/bg/settings2.html index bbd75c7f..a537daeb 100644 --- a/ext/bg/settings2.html +++ b/ext/bg/settings2.html @@ -437,6 +437,34 @@ +
+
+
+
Action bar appearance
+
Control when and where the action bar is visible.
+
+
+
+
+
Visibility
+ +
+
+
Location
+ +
+
+
+
+
Glossary layout
diff --git a/ext/fg/float.html b/ext/fg/float.html index 41e73a7e..4dc0696e 100644 --- a/ext/fg/float.html +++ b/ext/fg/float.html @@ -56,8 +56,10 @@