-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add options: custom width, always show buttons (#103)
- Loading branch information
Showing
12 changed files
with
531 additions
and
25 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<title>Extension Manager</title> | ||
<link href="style.css" rel="stylesheet" /> | ||
<script defer src="main.js"></script> | ||
<script type="module" src="main.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import OptionsSync from 'webext-options-sync'; | ||
|
||
const optionsStorage = new OptionsSync({ | ||
defaults: { | ||
showButtons: 'on-demand', // Or 'always' | ||
width: '', | ||
}, | ||
}); | ||
|
||
export default optionsStorage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!DOCTYPE html> | ||
<meta charset="UTF-8" /> | ||
<title>One Click Extension Manager options</title> | ||
<style> | ||
@import './webext-base.css'; | ||
input[type='text'] { | ||
border: solid 1px; | ||
border-radius: 2px; | ||
} | ||
label { | ||
display: block; | ||
} | ||
#width { | ||
width: 5em; | ||
} | ||
ul { | ||
padding-left: 1em; | ||
} | ||
</style> | ||
<form id="options-form"> | ||
<p> | ||
<label for="showButtons">Show buttons</label> | ||
<select name="showButtons" id="showButtons"> | ||
<option value="on-demand">On demand (default)</option> | ||
<option value="always">Always</option> | ||
</select> | ||
</p> | ||
<p> | ||
<label for="width" | ||
>List width <small>(CSS value or leave empty)</small></label | ||
> | ||
<input type="text" name="width" id="width" placeholder="400px" /> | ||
</p> | ||
</form> | ||
<hr /> | ||
<p> | ||
If you find this useful, consider supporting its development by donating or | ||
leaving a review. | ||
</p> | ||
<ul> | ||
<li> | ||
<a | ||
href="https://chrome.google.com/webstore/detail/refined-github/hlepfoohegkhhmjieoechaddaejaokhf/reviews" | ||
>Reviews</a | ||
> | ||
</li> | ||
<li><a href="https://github.com/sponsors/fregante">Donations</a></li> | ||
<li> | ||
<a href="https://github.com/hankxdev/one-click-extensions-manager" | ||
>Open source on GitHub</a | ||
> | ||
</li> | ||
</ul> | ||
<p> | ||
Made by <a href="https://fregante.com">fregante</a> 🇮🇹 and | ||
<a href="https://momane.com/">Hank Yang</a> 🇨🇳 | ||
</p> | ||
<script type="module" src="options.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import optionsStorage from '../options-storage.js'; | ||
|
||
optionsStorage.syncForm(document.querySelector('form')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
/* Vendored until a better build is added */ | ||
|
||
/*! https://npm.im/webext-base-css */ | ||
|
||
/* Firefox only: @-moz-document */ | ||
/* Firefox only: var(--in-content-*) */ | ||
/* Chrome only: -webkit-hyphens */ | ||
/* Safari only: _::-webkit-full-page-media */ | ||
|
||
/* webpackIgnore: true */ | ||
@import url('chrome://global/skin/in-content/common.css') | ||
(min--moz-device-pixel-ratio: 0); /* Firefox-only */ | ||
|
||
:root { | ||
--background-color-for-chrome: #292a2d; | ||
max-width: 700px; | ||
margin: auto; | ||
} | ||
|
||
body { | ||
--body-margin-h: 8px; | ||
margin-left: var(--body-margin-h); | ||
margin-right: var(--body-margin-h); | ||
} | ||
|
||
/* Selector matches Firefox’ */ | ||
input[type='number'], | ||
input[type='password'], | ||
input[type='search'], | ||
input[type='text'], | ||
input[type='url'], | ||
input:not([type]), | ||
textarea { | ||
display: block; | ||
box-sizing: border-box; | ||
margin-left: 0; | ||
width: 100%; | ||
resize: vertical; | ||
-moz-tab-size: 4 !important; | ||
tab-size: 4 !important; | ||
} | ||
|
||
input[type='checkbox'] { | ||
vertical-align: -0.15em; | ||
} | ||
|
||
@supports (not (-webkit-hyphens: none)) and (not (-moz-appearance: none)) and | ||
(list-style-type: '*') { | ||
textarea:focus { | ||
/* Inexplicably missing from Chrome’s input style https://github.com/chromium/chromium/blob/6bea0557fe/extensions/renderer/resources/extension.css#L287 */ | ||
border-color: #4d90fe; | ||
transition: border-color 200ms; | ||
} | ||
} | ||
|
||
hr { | ||
margin-right: calc(-1 * var(--body-margin-h)); | ||
margin-left: calc(-1 * var(--body-margin-h)); | ||
border: none; | ||
border-bottom: 1px solid #aaa4; | ||
} | ||
|
||
img { | ||
vertical-align: middle; | ||
} | ||
|
||
_::-webkit-full-page-media, | ||
_:future, | ||
:root { | ||
font-family: -apple-system, BlinkMacSystemFont, sans-serif, | ||
'Apple Color Emoji'; | ||
} | ||
|
||
_::-webkit-full-page-media, | ||
_:future, | ||
input[type='number'], | ||
input[type='password'], | ||
input[type='search'], | ||
input[type='text'], | ||
input[type='url'], | ||
input:not([type]), | ||
textarea { | ||
border: solid 1px #888; | ||
padding: 0.4em; | ||
font: inherit; | ||
-webkit-appearance: none; | ||
} | ||
|
||
@-moz-document url-prefix('') { | ||
:root, /* Visible on a options_page */ | ||
body { | ||
--body-margin-h: 6px; /* Must be a variable so <hr>’s margin is changed too */ /* Visible on a options_page and options_ui */ | ||
color: var(--in-content-page-color); | ||
|
||
/* Also supports dark themes in Firefox */ | ||
/* !important is to override the dark-mode setting for Chrome below */ | ||
background-color: var(--in-content-box-background) !important; | ||
min-height: 250px; /* Without this there’s a white space at the bottom in dark mode */ | ||
} | ||
|
||
body > * { | ||
margin-left: var(--body-margin-h); | ||
margin-right: var(--body-margin-h); | ||
} | ||
|
||
input[type='checkbox'] { | ||
vertical-align: -0.4em; | ||
} | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
:root { | ||
color-scheme: dark; | ||
background-color: var(--background-color-for-chrome); | ||
} | ||
|
||
body, | ||
h3 { | ||
/* Chrome #3 */ | ||
color: var(--in-content-page-color, #e8eaed); | ||
} | ||
|
||
a { | ||
color: var(--in-content-link-color, #8ab4f8); | ||
} | ||
|
||
input[type='number'], | ||
input[type='password'], | ||
input[type='search'], | ||
input[type='text'], | ||
input[type='url'], | ||
input:not([type]), | ||
textarea { | ||
color: inherit; | ||
background-color: transparent; | ||
} | ||
} |