Skip to content

Commit 7646b46

Browse files
add option to hide search flag buttons (close #4)
1 parent 7ab91fa commit 7646b46

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/common/options.js

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const model = {
3030
default: false,
3131
input: { type: 'boolean', suffix: `<details><summary>Regular Expression:</summary>Search by (JavaScript) regular expression instead of plain string. If you don't know what this is, then you probably don't want it.</details>`, },
3232
},
33+
hideOptions: {
34+
default: false,
35+
input: { type: 'boolean', suffix: `<details><summary>Hide Search Options:</summary>Don't show the buttons for the three search options above in the search box. Note that what is selected on this page will still apply to the search.`, },
36+
},
3337
darkTheme: {
3438
default: null,
3539
input: { type: 'menulist', options: [

src/content/embed.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ document.addEventListener('keydown', event => {
3232
const options = (await messages.request('getOptions'));
3333
names.slice(1).forEach(name => { inputs[name].checked = options[name]; });
3434
inputs.term.placeholder = options.placeholder;
35+
document.documentElement.classList.toggle('hide-options', options.hideOptions);
3536
if (options.darkTheme != null) {
3637
document.documentElement.classList.toggle('dark-theme', options.darkTheme);
3738
} else {

src/content/form.html

+3
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,7 @@
7171
--button-bdc: #fff5;
7272
--button-fgc: #fff;
7373
}
74+
75+
:root.hide-options #term { padding-right: 5px; width: calc(100% - 10px); }
76+
:root.hide-options #options { display: none; }
7477
</style>

0 commit comments

Comments
 (0)