mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
fix settings page, closes #9
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Video Speed Controller",
|
||||
"short_name": "videospeed",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"manifest_version": 2,
|
||||
"description": "Speed up, slow down, and rewind any HTML5 video with quick shortcuts.",
|
||||
"homepage_url": "https://github.com/igrigorik/videospeed",
|
||||
|
20
options.js
20
options.js
@@ -81,7 +81,6 @@ function restore_options() {
|
||||
}
|
||||
|
||||
function restore_defaults() {
|
||||
|
||||
chrome.storage.sync.set({
|
||||
speedStep: 0.1,
|
||||
rewindTime: 10,
|
||||
@@ -98,11 +97,17 @@ function restore_defaults() {
|
||||
status.textContent = '';
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Event Listeners
|
||||
document.addEventListener('DOMContentLoaded', restore_options);
|
||||
function initShortcutInput(inputId) {
|
||||
document.getElementById(inputId).addEventListener('focus', inputFocus);
|
||||
document.getElementById(inputId).addEventListener('blur', inputBlur);
|
||||
document.getElementById(inputId).addEventListener('keypress', recordKeyPress);
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
restore_options();
|
||||
|
||||
document.getElementById('save').addEventListener('click', save_options);
|
||||
document.getElementById('restore').addEventListener('click', restore_defaults);
|
||||
|
||||
@@ -112,9 +117,4 @@ initShortcutInput('fasterKeyInput');
|
||||
|
||||
document.getElementById('rewindTime').addEventListener('keypress', inputFilterNumbersOnly);
|
||||
document.getElementById('speedStep').addEventListener('keypress', inputFilterNumbersOnly);
|
||||
|
||||
function initShortcutInput(inputId) {
|
||||
document.getElementById(inputId).addEventListener('focus', inputFocus);
|
||||
document.getElementById(inputId).addEventListener('blur', inputBlur);
|
||||
document.getElementById(inputId).addEventListener('keypress', recordKeyPress);
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user