aboutsummaryrefslogtreecommitdiffstats
path: root/options.js
diff options
context:
space:
mode:
authorTeddy Wing2014-03-30 15:08:47 -0400
committerTeddy Wing2014-03-30 15:08:47 -0400
commit859fc43f1156e2adfbe1580de7a9ba5728818760 (patch)
tree4eeb9d66a2d8b4c0b5fa61a94c3f00571c305a69 /options.js
parentb1dbb04522561d5877616b3b26d767aa41ab5ba5 (diff)
downloadchrome-copy-urls-from-all-tabs-859fc43f1156e2adfbe1580de7a9ba5728818760.tar.bz2
Store options & load values from storage
Diffstat (limited to 'options.js')
-rw-r--r--options.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/options.js b/options.js
index 3d3ac29..23bb4c5 100644
--- a/options.js
+++ b/options.js
@@ -1,10 +1,10 @@
// Saves options to chrome.storage
function save_options() {
- var color = document.getElementById('color').value;
- var likesColor = document.getElementById('like').checked;
+ var button_click_behaviour = document.getElementById('button-click-behaviour').value;
+ var file_format = document.getElementById('file-format').value;
chrome.storage.sync.set({
- favoriteColor: color,
- likesColor: likesColor
+ button_click_behaviour: button_click_behaviour,
+ file_format: file_format
}, function() {
// Update status to let user know options were saved.
var status = document.getElementById('status');
@@ -20,11 +20,11 @@ function save_options() {
function restore_options() {
// Use default value color = 'red' and likesColor = true.
chrome.storage.sync.get({
- favoriteColor: 'red',
- likesColor: true
+ button_click_behaviour: 'window',
+ file_format: 'text'
}, function(items) {
- document.getElementById('color').value = items.favoriteColor;
- document.getElementById('like').checked = items.likesColor;
+ document.getElementById('button-click-behaviour').value = items.button_click_behaviour;
+ document.getElementById('file-format').value = items.file_format;
});
}