Skip to content

Instantly share code, notes, and snippets.

@yoshimov
Created June 23, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshimov/9dc26302ac8d3863cd62 to your computer and use it in GitHub Desktop.
Save yoshimov/9dc26302ac8d3863cd62 to your computer and use it in GitHub Desktop.
Configuration page for Pebble-HabitRPG
<html>
<body>
<h2>HabitRPG for Pebble configuration</h2>
<table>
<tr>
<th>Your UUID: </th><td><input type="text" id="uuid" name="uuid" size="60" /></td>
</tr>
<tr>
<th>API Key: </th>
<td><input type="text" id="key" name="key" size="60" /></td>
</tr>
</table>
<input type="button" name="save" value="Save" onclick="save_option()" />
<script type="text/javascript">
function save_option() {
var uuidobj = document.getElementById("uuid");
var keyobj = document.getElementById("key");
var conf = {"uuid2": uuidobj.value, "key2": keyobj.value};
location.href = 'pebblejs://close#' + encodeURIComponent(JSON.stringify(conf));
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment