version 0.1.3
This commit is contained in:
parent
846dc6f8a4
commit
f4f252bfec
2 changed files with 6 additions and 0 deletions
|
@ -26,6 +26,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><textarea id="whitelist" rows="3"></textarea></td>
|
<td><textarea id="whitelist" rows="3"></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label><input type="checkbox" id="faqs"> Open FAQs page on updates</label></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p>
|
<p>
|
||||||
<button id="save">Save</button>
|
<button id="save">Save</button>
|
||||||
|
|
|
@ -8,6 +8,7 @@ function prepare(str) {
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
chrome.storage.local.set({
|
chrome.storage.local.set({
|
||||||
|
faqs: document.getElementById('faqs').checked,
|
||||||
blacklist: prepare(document.getElementById('blacklist').value),
|
blacklist: prepare(document.getElementById('blacklist').value),
|
||||||
whitelist: prepare(document.getElementById('whitelist').value),
|
whitelist: prepare(document.getElementById('whitelist').value),
|
||||||
mode: document.getElementById('mode-blacklist').checked ? 'blacklist' : 'whitelist'
|
mode: document.getElementById('mode-blacklist').checked ? 'blacklist' : 'whitelist'
|
||||||
|
@ -22,10 +23,12 @@ function save() {
|
||||||
|
|
||||||
function restore() {
|
function restore() {
|
||||||
chrome.storage.local.get({
|
chrome.storage.local.get({
|
||||||
|
faqs: true,
|
||||||
mode: 'blacklist',
|
mode: 'blacklist',
|
||||||
whitelist: [],
|
whitelist: [],
|
||||||
blacklist: []
|
blacklist: []
|
||||||
}, prefs => {
|
}, prefs => {
|
||||||
|
document.getElementById('faqs').checked = prefs.faqs;
|
||||||
document.getElementById('mode-blacklist').checked = prefs.mode === 'blacklist';
|
document.getElementById('mode-blacklist').checked = prefs.mode === 'blacklist';
|
||||||
document.getElementById('mode-whitelist').checked = prefs.mode === 'whitelist';
|
document.getElementById('mode-whitelist').checked = prefs.mode === 'whitelist';
|
||||||
document.getElementById('blacklist').value = prefs.blacklist.join(', ');
|
document.getElementById('blacklist').value = prefs.blacklist.join(', ');
|
||||||
|
|
Loading…
Reference in a new issue