mirror of
https://git.mirrors.martin98.com/https://github.com/cilame/v_jstools
synced 2025-08-14 03:16:01 +08:00
add
This commit is contained in:
parent
660d1f0a52
commit
5300a40f9d
25
options.js
25
options.js
@ -48,4 +48,27 @@ function _mk_html(input, clsname){
|
||||
// Array.from(document.getElementsByClassName('getsets-e2')).map(function(e){e.style.display='none'})
|
||||
|
||||
_mk_html(getsets, 'getsets')
|
||||
_mk_html(funcs, 'funcs')
|
||||
_mk_html(funcs, 'funcs')
|
||||
|
||||
document.querySelectorAll("input").forEach(function(v){
|
||||
chrome.storage.sync.get([v.dataset.key], function (result) {
|
||||
if (v.type == 'checkbox'){
|
||||
v.checked = result[v.dataset.key];
|
||||
}
|
||||
if (v.type == 'text'){
|
||||
v.value = result[v.dataset.key] || '';
|
||||
}
|
||||
})
|
||||
v.addEventListener("change", function (e) {
|
||||
if (v.type == 'checkbox'){
|
||||
chrome.storage.sync.set({
|
||||
[e.target.dataset.key]: e.target.checked
|
||||
})
|
||||
}
|
||||
if (v.type == 'text'){
|
||||
chrome.storage.sync.set({
|
||||
[e.target.dataset.key]: e.target.value
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user