$('#optionsHeader')[0].innerText = chrome.i18n.getMessage('optionsHeader');
$('#optionsPrompt')[0].innerText = chrome.i18n.getMessage('optionsPrompt');
$('#optionsTimeFor')[0].innerText = chrome.i18n.getMessage('optionsTimeFor');
+ $('#optionsCookies')[0].innerText = chrome.i18n.getMessage('optionsCookies');
$('#optionsSaved > b')[0].innerText = chrome.i18n.getMessage('optionsSaved');
// Bind all the callbacks
$('#opt-time input.opt-chk[type=radio]').forEach(function(e) {
e.onclick = toggle;
});
+ $('input.opt-chk[type=checkbox]').forEach(function(e) {
+ e.onclick = setCheck;
+ });
$('#opt-prompt input.opt-chk[type=checkbox]').forEach(function(e) {
e.onclick = setPrompt;
});
(localStorage['time'] = CONSTANTS.DEFAULT_TIME);
var showPrompt = localStorage['prompt'] ||
(localStorage['prompt'] = CONSTANTS.YES);
+ var clearCookies = localStorage['cookies'] || CONSTANTS.NO;
$('input[name=time][value="' + time + '"]')[0].checked = true;
$('input[name=prompt]')[0].checked = (showPrompt === CONSTANTS.YES);
+ $('input[name=cookies]')[0].checked = (clearCookies === CONSTANTS.YES);
}
/**
optionSaved();
}
+function setCheck() {
+ localStorage[this.name] = this.checked ? CONSTANTS.YES : CONSTANTS.NO;
+ optionSaved();
+}
+
// For rapid changes/saves
var isSaving = null;
/**