Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (37 sloc) 1.15 KB
<!-- http://code.google.com/chrome/extensions/options.html for option page -->
<html>
<head><title>Chrome Couch Extension Options</title></head>
<script type="text/javascript">
// Saves options to localStorage.
function save_options() {
var couch = document.getElementById("preferred_couchdb").value;
localStorage["preferred_couchdb"] = couch;
// Update status to let user know options were saved.
var status = document.getElementById("status");
status.innerHTML = "Options Saved.";
setTimeout(function() {
status.innerHTML = "";
}, 750);
}
// Restores select box state to saved value from localStorage.
function restore_options() {
var favorite = localStorage["preferred_couchdb"];
if (!favorite)
{
document.getElementById("preferred_couchdb").value = "localhost:5984";
}
else
{
document.getElementById("preferred_couchdb").value = favorite;
}
}
</script>
<body onload="restore_options()">
<strong>TODO: Wire up option page to make changes in the couchdb?</strong><br/>
Preferred CouchDB
<input id="preferred_couchdb" type="text"/>
<br/>
<button onclick="save_options()">Save</button>
<div id="status"></div>
</body>
</html>