Move Ginnie to N5x

This commit is contained in:
Neale Pickett 2015-11-22 15:27:58 +00:00
parent 44992d81a0
commit b15ab92e59
7 changed files with 157 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,78 @@
<!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">Features</div>
<div class="item-container-content">
<label class="item">
Display second hand
<input type="checkbox" class="item-toggle" name="seconds" checked>
</label>
</div>
<!--
<div class="item-container-content">
<label class="item">
Monitor phone connection
<div class="item-subtitle">Vibrate when Pebble loses connection to phone</div>
<input type="checkbox" class="item-toggle" name="bluetooth" checked>
</label>
</div>
-->
</div>
<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>
<label class="item">
Numeral color
<input type="text" class="item-color item-color-normal" name="color-num" value="0xFFFFFF">
</label>
<label class="item">
Date color
<input type="text" class="item-color item-color-normal" name="color-day" value="0xFFFFFF">
</label>
<label class="item">
Month color
<input type="text" class="item-color item-color-normal" name="color-mon" value="0xFFFFFF">
</label>
<label class="item">
Tic color
<div class="item-subtitle">5-Minute markers on the watch face</div>
<input type="text" class="item-color item-color-normal" name="color-tic" value="0xFFFFFF">
</label>
<label class="item">
Second hand color
<input type="text" class="item-color item-color-normal" name="color-sec" value="0xAA5500">
</label>
<label class="item">
Minute hand color
<input type="text" class="item-color item-color-normal" name="color-min" value="0xFFFFFF">
</label>
<label class="item">
Hour hand color
<input type="text" class="item-color item-color-normal" name="color-hr" value="0xFFFFFF">
</label>
</div>
</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>

1
misc/twatch-config/slate.min.css vendored Normal file

File diff suppressed because one or more lines are too long

2
misc/twatch-config/slate.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,74 @@
function getQueryParam(variable, defaultValue) {
var query = location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (pair[0] === variable) {
return decodeURIComponent(pair[1]);
}
}
return defaultValue || false;
}
function submit() {
var form = document.getElementById("main-form");
var inputs = form.getElementsByTagName("input");
var return_to = getQueryParam('return_to', 'pebblejs://close#');
var options = {};
console.log("Submitting");
for (var i = 0; i < inputs.length; i += 1) {
var input = inputs[i];
var k = input.name;
var t = input.type;
var v;
if (t == "checkbox") {
v = input.checked;
} else if (t == "text") {
v = Number(input.value);
} else {
continue;
}
localStorage[k] = v;
options[k] = v;
}
document.location = return_to + encodeURIComponent(JSON.stringify(options));
}
function restore() {
var form = document.getElementById("main-form");
var inputs = form.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i += 1) {
var input = inputs[i];
var k = input.name;
var t = input.type;
var v = localStorage[k];
console.log(k);
if (v != undefined) {
if (t == "checkbox") {
input.checked = (v=="true")?true:false;
} else if (k.slice(0, 6) == "color-") {
var val = ("000000" + Number(v).toString(16)).slice(-6);
var hex = "0x" + val;
var color = "#" + val;
var $valueDisplay = $(input).parent().find('.value');
$valueDisplay.css('background', color);
$(input).val(hex);
}
}
}
}
function init() {
var submit_btn = document.getElementById("submit");
submit_btn.addEventListener("click", submit);
restore();
console.log("Initialized");
}
window.addEventListener("load", init);

View File

@ -7,9 +7,9 @@ import (
"sync"
)
// Internal port: 19132
var hosts = []HostEntry{
{"h.woozle.org:26548", "Ginnie (tablet)"},
{"g.dirtbags.net:44321", "Ginnie"},
{"h.woozle.org:26548", "Ginnie"},
{"n.dirtbags.net:29837", "Neale"},
}