parent
f95cec8999
commit
c6df27e818
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Enhanced Aniwatch Settings</title>
|
||||
<meta charset="utf-8">
|
||||
<head>
|
||||
|
||||
<body>
|
||||
<form>
|
||||
<h4>Enhanced Aniwatch Settings</h4>
|
||||
<label>Maximum Player Width <input type="number" id="maxPlayerWidth" min="1920" max="20000" value="1920" style="width: 75px; text-align:right;">
|
||||
<span style="margin-left:-82px; font-size:12px;">px:</label>
|
||||
<br>
|
||||
<label>Actual Player Width <input type="number" id="actualPlayerWidth" min="1370" max="10000" value="1370" style="width: 75px; text-align:right;">
|
||||
<span style="margin-left:-82px; font-size:12px;">px:</label>
|
||||
<br>
|
||||
<button id="save">Save</button>
|
||||
|
||||
</form>
|
||||
<script src="settings.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,25 @@
|
|||
// Saves settings to chrome.storage
|
||||
function save_settings() {
|
||||
let items = {
|
||||
maxPlayerWidth: document.getElementById('maxPlayerWidth').value,
|
||||
actualPlayerWidth: document.getElementById('actualPlayerWidth').value
|
||||
};
|
||||
|
||||
chrome.storage.local.set(items, function() {
|
||||
alert('Settings saved.');
|
||||
});
|
||||
}
|
||||
|
||||
// Restores the settings using stored in chrome.storage
|
||||
function restore_settings() {
|
||||
chrome.storage.local.get([
|
||||
'maxPlayerWidth',
|
||||
'actualPlayerWidth'
|
||||
], function(r) {
|
||||
document.getElementById('maxPlayerWidth').value = r.maxPlayerWidth;
|
||||
document.getElementById('actualPlayerWidth').value = r.actualPlayerWidth;
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('save').addEventListener('click', save_settings);
|
||||
document.addEventListener('DOMContentLoaded', restore_settings);
|
Loading…
Reference in a new issue