aboutsummaryrefslogtreecommitdiffstats
path: root/settings.html
diff options
context:
space:
mode:
authorilya2009-11-15 18:55:55 -0800
committerilya2009-11-15 18:55:55 -0800
commit1d126397d4ecb131f83ee8709df2e2568967ac9c (patch)
tree0ab7a846a265968c9a6da1ed4089b04a4292a6dd /settings.html
parent50d376c0663fe7474149541c22de5bb5cbe192b4 (diff)
downloadvimium-1d126397d4ecb131f83ee8709df2e2568967ac9c.tar.bz2
First pass at a settings page. Hooked up scrollStepSize as our first setting.
Diffstat (limited to 'settings.html')
-rw-r--r--settings.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/settings.html b/settings.html
new file mode 100644
index 00000000..8e89de92
--- /dev/null
+++ b/settings.html
@@ -0,0 +1,37 @@
+<html>
+ <head>
+ <title>Vimium Settings</title>
+ </head>
+
+ <script type="text/javascript">
+
+ // Saves options to localStorage.
+ function save_options() {
+ var scrollStepSize = document.getElementById("scrollStepSize").value;
+ localStorage["scrollStepSize"] = scrollStepSize;
+
+ // Update status to let user know options were saved.
+ var status = document.getElementById("status");
+ status.innerHTML = "Settings Saved.";
+ setTimeout(function() { status.innerHTML = ""; }, 750);
+ }
+
+ // Restores select box state to saved value from localStorage.
+ function restore_options() {
+ // TODO(ilya): Create a single option list with defaults somewhere to share across various scripts.
+ var scrollStepSize = localStorage["scrollStepSize"];
+ if (!scrollStepSize) { scrollStepSize = 60; }
+
+ document.getElementById("scrollStepSize").value = scrollStepSize;
+ }
+ </script>
+
+ <body onload="restore_options()">
+ <h1>Vimium - Settings</h1>
+ Scroll Step Size: <input id="scrollStepSize" type="text"> px (default: 60)
+ <br>
+
+ <button onclick="save_options()">Save Settings</button>
+ <div id="status"></div>
+ </body>
+</html>