diff options
| author | Teddy Wing | 2014-03-30 15:08:47 -0400 |
|---|---|---|
| committer | Teddy Wing | 2014-03-30 15:08:47 -0400 |
| commit | 859fc43f1156e2adfbe1580de7a9ba5728818760 (patch) | |
| tree | 4eeb9d66a2d8b4c0b5fa61a94c3f00571c305a69 | |
| parent | b1dbb04522561d5877616b3b26d767aa41ab5ba5 (diff) | |
| download | chrome-copy-urls-from-all-tabs-859fc43f1156e2adfbe1580de7a9ba5728818760.tar.bz2 | |
Store options & load values from storage
| -rw-r--r-- | options.js | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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; }); } |
