Add twatch chalice configuration

This commit is contained in:
Neale Pickett 2016-06-03 16:42:35 +00:00
parent 928aa6abb7
commit aaa39b95ee
2 changed files with 43 additions and 2 deletions

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0" name="viewport">
<title></title>
<link rel="stylesheet" href="slate.min.css">
<script src="twatch.js"></script>
<script src="slate.min.js"></script>
</head>
<body>
<form id="main-form">
<div class="item-container">
<div class="item-container-header">Appearance</div>
<div class="item-container-content">
<label class="item">
Face color
<input type="text" class="item-color item-color-normal" name="color-face" value="0x000000">
</label>
</div>
<div class="item-container-content">
<label class="item">
Style
<select name="int-style" dir="rtl" class="item-select">
<option class="item-select-option" value="0">Bold</option>
<option class="item-select-option" value="1">Thin</option>
</select>
</label>
</div>
<div class="item-container">
<div class="button-container">
<input type="button" class="item-button" id="submit" name="submit" value="SEND">
</div>
</div>
</form>
</body>
</html>

View File

@ -25,16 +25,17 @@ function submit() {
var t = input.type;
var v;
console.log(k, t, v);
if (t == "checkbox") {
v = input.checked;
} else if (t == "text") {
v = Number(input.value);
} else if (t == "select-one") {
v = input.value;
v = Number(input.value);
} else {
console.log("Unknown type: " + t);
continue;
}
console.log(k, t, v);
localStorage[k] = v;
options[k] = v;