mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-14 10:36:19 +02:00
prettify all src js files. Remove space rules from eslint
This commit is contained in:
@ -1,32 +1,38 @@
|
||||
// Restores preferences from chrome.storage.
|
||||
function restoreOptions() {
|
||||
chrome.storage.sync.get({
|
||||
preserveLastCode: true,
|
||||
replaceNewTab: false
|
||||
}, function(items) {
|
||||
document.forms.optionsForm.preserveLastCode.checked = items.preserveLastCode;
|
||||
document.forms.optionsForm.replaceNewTab.checked = items.replaceNewTab;
|
||||
});
|
||||
chrome.storage.sync.get(
|
||||
{
|
||||
preserveLastCode: true,
|
||||
replaceNewTab: false
|
||||
},
|
||||
function(items) {
|
||||
document.forms.optionsForm.preserveLastCode.checked =
|
||||
items.preserveLastCode;
|
||||
document.forms.optionsForm.replaceNewTab.checked = items.replaceNewTab;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function saveOptions(e) {
|
||||
var preserveLastCode = document.forms.optionsForm.preserveLastCode.checked;
|
||||
var replaceNewTab = document.forms.optionsForm.replaceNewTab.checked;
|
||||
|
||||
chrome.storage.sync.set({
|
||||
preserveLastCode: preserveLastCode,
|
||||
replaceNewTab: replaceNewTab
|
||||
}, function() {
|
||||
var status = document.getElementById('js-status');
|
||||
status.textContent = 'Settings saved.';
|
||||
setTimeout(function() {
|
||||
status.innerHTML = ' ';
|
||||
}, 750);
|
||||
});
|
||||
chrome.storage.sync.set(
|
||||
{
|
||||
preserveLastCode: preserveLastCode,
|
||||
replaceNewTab: replaceNewTab
|
||||
},
|
||||
function() {
|
||||
var status = document.getElementById('js-status');
|
||||
status.textContent = 'Settings saved.';
|
||||
setTimeout(function() {
|
||||
status.innerHTML = ' ';
|
||||
}, 750);
|
||||
}
|
||||
);
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', restoreOptions);
|
||||
document.forms.optionsForm.addEventListener('submit',
|
||||
saveOptions);
|
||||
document.forms.optionsForm.addEventListener('submit', saveOptions);
|
||||
|
Reference in New Issue
Block a user