initial commit

This commit is contained in:
Lurkars
2017-12-07 18:16:26 +01:00
commit 240332c0d2
21 changed files with 6586 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form>
<label>Muffcast URL<input type="url" id="muffcast-url" /></label> <br />
<label>Muffcast Sync Interval<input type="number" id="muffcast-sync-interval" min="1000" step="1000" /></label> <br />
<button type="submit">Save</button>
</form>
<script src="options.js"></script>
</body>
</html>
+19
View File
@@ -0,0 +1,19 @@
function saveOptions(e) {
e.preventDefault();
browser.storage.local.set({
"muffcast": {
"url": document.querySelector("#muffcast-url").value,
"syncInterval": document.querySelector("#muffcast-sync-interval").value
}
});
}
function restoreOptions() {
browser.storage.local.get("muffcast").then(function(result) {
document.querySelector("#muffcast-url").value = result.muffcast && result.muffcast.url || "http://localhost:8128";
document.querySelector("#muffcast-sync-interval").value = result.muffcast && result.muffcast.syncInterval || 30000;
});
}
document.addEventListener("DOMContentLoaded", restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);