-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: add options ui for auto-forwarding
now we can auto forward to official web PTT
- Loading branch information
1 parent
19d7b82
commit 6d77f80
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
</head> | ||
<body> | ||
<div><input id="checkbox_auto_forward" type="checkbox">Auto forward to web PTT</input></div> | ||
<script type="text/javascript" src="./options.js"></script> | ||
</body> | ||
</html> |
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,16 @@ | ||
(() => { | ||
const OPTIONS_AUTO_ENABLED = 'enabled_auto_forward'; | ||
|
||
let checkbox = document.getElementById('checkbox_auto_forward'); | ||
|
||
browser.storage.local.get(OPTIONS_AUTO_ENABLED).then((r) => { | ||
checkbox.checked = !!r[OPTIONS_AUTO_ENABLED]; | ||
|
||
checkbox.addEventListener('change', () => { | ||
var obj = {}; | ||
obj[OPTIONS_AUTO_ENABLED] = checkbox.checked; | ||
browser.storage.local.set(obj); | ||
}); | ||
}); | ||
|
||
})(); |