]> git.wh0rd.org - chrome-ext/clearhistory-advance-fork.git/blobdiff - javascript/options.js
allow people to delete *old* history rather than *new* history
[chrome-ext/clearhistory-advance-fork.git] / javascript / options.js
index 62721cbdd7d44c888c5a25d7bb02584a64c5b992..17139d59e576a283115724d70f99b41135b1ac96 100644 (file)
@@ -30,6 +30,7 @@ function init() {
   $('#optionsHeader')[0].innerText = chrome.i18n.getMessage('optionsHeader');
   $('#optionsPrompt')[0].innerText = chrome.i18n.getMessage('optionsPrompt');
   $('#optionsTimeFor')[0].innerText = chrome.i18n.getMessage('optionsTimeFor');
+  $('#optionsTimeStart')[0].innerText = chrome.i18n.getMessage('optionsTimeStart');
   $('#optionsCookies')[0].innerText = chrome.i18n.getMessage('optionsCookies');
   $('#optionsSaved > b')[0].innerText = chrome.i18n.getMessage('optionsSaved');
 
@@ -45,12 +46,14 @@ function init() {
   });
 
   // Load or set localStorage data
+  var timeStart = localStorage['timeStart'] || CONSTANTS.YES;
   var time = ~~(localStorage['time']) ||
              (localStorage['time'] = CONSTANTS.DEFAULT_TIME);
   var showPrompt = localStorage['prompt'] ||
                    (localStorage['prompt'] = CONSTANTS.YES);
   var clearCookies = localStorage['cookies'] || CONSTANTS.NO;
 
+  $('input[name=timeStart]')[0].checked = (timeStart === CONSTANTS.YES);
   $('input[name=time][value="' + time + '"]')[0].checked = true;
   $('input[name=prompt]')[0].checked = (showPrompt === CONSTANTS.YES);
   $('input[name=cookies]')[0].checked = (clearCookies === CONSTANTS.YES);