-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6866426
commit 8a3a5b4
Showing
4 changed files
with
56 additions
and
3 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,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head><title>Just Tweet Settings</title></head> | ||
<body> | ||
prefix : <input type="text" id="prefix"/> | ||
|
||
<div id="status"></div> | ||
<button id="save">Save</button> | ||
|
||
<script src="settings.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,25 @@ | ||
const save_options = () => { | ||
const _prefix = document.getElementById('prefix').value; | ||
|
||
chrome.storage.sync.set({ | ||
prefix: _prefix, | ||
}, () => { | ||
const status = document.getElementById('status'); | ||
status.textContent = 'saved!'; | ||
setTimeout( () => { | ||
status.textContent = ''; | ||
}, 750); | ||
} | ||
); | ||
} | ||
|
||
const restore_options = () => { | ||
chrome.storage.sync.get({ | ||
prefix: ' \u00BB ' | ||
}, (settings) => { | ||
document.getElementById('prefix').value = settings.prefix; | ||
}); | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', restore_options); | ||
document.getElementById('save').addEventListener('click',save_options); |