"optionsTitle": {"message": "Options for Clear History [Advance Fork]"},
"optionsHeader": {"message": "Clear History [Advance Fork]"},
"optionsTimeFor": {"message": "Delete history for:"},
+ "optionsTimeStart": {"message": "Clear entries newer than the selected time (otherwise, entries older than the selection will be cleared)"},
"optionsTime": {
"message": "Last $num$ $units$",
"placeholders": {
chrome.history.deleteAll(didClearHistory);
} else {
// Create the range
+ var timeStart = localStorage['timeStart'] === CONSTANTS.YES;
var now = (new Date).getTime();
+ var startTime = (now - time * 60 * 60 * 1000); // time from hrs to ms
+ if (timeStart) {
+ var endTime = now;
+ } else {
+ var endTime = startTime;
+ startTime = 0;
+ }
var range = {
- startTime: (now - time * 60 * 60 * 1000), // time from hrs to ms
- endTime: now
+ startTime: startTime,
+ endTime: endTime
};
// Delete history in the range
chrome.history.deleteRange(range, didClearHistory);
$('#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');
});
// 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);
<div id="opt-time">
<div class="opt-name">
<b id="optionsTimeFor"></b>
+ <br><br>
+ <div class="opt-timeStart">
+ <input name="timeStart" class="opt-chk" type="checkbox" checked>
+ <div class="opt-label" id="optionsTimeStart"></div>
+ </div>
</div>
<div class="opt-value">
<div class="opt-option"> <!-- 1 hour -->