Files
minewatch/httpdocs/config/index.html
Dan Head 0fa7bd127f Update to v1.0.2
Change timeout to 30 seconds
Add version info to settings
2014-05-14 21:05:33 +01:00

66 lines
6.8 KiB
HTML

<!DOCTYPE html>
<head>
<title>MineWatch</title>
<meta name="viewport" content="width=device-width, user-scalable=no">
<style type="text/css">
body{margin:0;padding:0;font-family:"Verdana";background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(50%, #f3f3f3), color-stop(51%, #ededed), color-stop(100%, #fff));background:-webkit-linear-gradient(top, #fff 0%, #f3f3f3 50%, #ededed 51%, #fff 100%);background:linear-gradient(to bottom, #fff 0%, #f3f3f3 50%, #ededed 51%, #fff 100%)}h1{margin:0;padding:10px 5px;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #45484d), color-stop(100%, #000));background:-webkit-linear-gradient(top, #45484d 0%, #000 100%);background:linear-gradient(to bottom, #45484d 0%, #000 100%);color:white;display:block;text-align:center}h2{font-size:0.9em;margin:20px 10px 0 10px;padding-bottom:5px;border-bottom:2px solid #8e8e8e}h3{margin:5px 0;font-size:0.8em}p{font-size:0.8em;margin:1em 10px}ul.form{margin:0;padding:0;list-style:none}ul.form li{margin:0 10px;padding:10px 0;border-bottom:1px solid #8e8e8e}ul.form li p{display:inline-block;margin:0;line-height:2em}ul.form li input{float:right;width:116px;height:25px}ul.form li a{display:inline-block;float:right;width:120px;height:30px;position:relative;font-weight:bold;text-decoration:none;background-color:#c8c8c8}ul.form li a span{display:block;position:absolute;top:0;width:60px;height:16px;padding:7px 0;background-color:#8e8e8e;color:black;text-align:center;font-size:0.8em}ul.form li a.white span{background-color:white;color:black;right:0}ul.form li a.black span{background-color:black;color:white}ul.form li a.on span{background-color:blue;color:white;right:0}ul.form div.info{font-size:0.5em;margin-top:15px}ul.updates{list-style:none;margin:0;padding:0}ul.updates>li{margin:10px;padding-bottom:10px;border-bottom:1px solid #8e8e8e}ul.updates>li li{font-size:0.8em}ul.updates h3>span{color:red}a#save{display:block;width:60px;height:16px;padding:7px 0;text-align:center;font-weight:bold;text-decoration:none;margin:10px;background-color:blue;color:white}p#versioninfo{display:none;font-size:0.6em}
</style>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,!1);new form},!1);
var form=function(){this.el={bgcolour:document.getElementById("bgcolour"),notify:document.getElementById("notify"),flick:document.getElementById("flick"),update:document.getElementById("update"),submit:document.getElementById("submit"),apikey:document.getElementById("apikey"),save:document.getElementById("save")};this.config=this.getConfig();this.updateForm();this.showVersion(this.config.pblversion,this.config.jsversion);this.attach()};
form.prototype.getConfig=function(){var a=function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=(new RegExp("[\\?&]"+a+"=([^&#]*)")).exec(location.search);return null==a?"":decodeURIComponent(a[1].replace(/\+/g," "))},b={};b.jsversion=a("jsversion");b.pblversion=a("pblversion");b.apikey=a("apikey");b.update=a("update");b.dark="true"==a("dark")?!0:!1;b.notify="true"==a("notify")?!0:!1;b.flick="true"==a("flick")?!0:!1;return b};
form.prototype.updateForm=function(){0<this.config.apikey.length&&(this.el.apikey.value=this.config.apikey);0<this.config.update.length&&(this.el.update.value=this.config.update);this.config.dark?(this.el.bgcolour.className="black",this.el.bgcolour.children[0].innerHTML="BLACK"):(this.el.bgcolour.className="white",this.el.bgcolour.children[0].innerHTML="WHITE");this.config.notify?(this.el.notify.className="on",this.el.notify.children[0].innerHTML="ON"):(this.el.notify.className="off",this.el.notify.children[0].innerHTML=
"OFF");this.config.flick?(this.el.flick.className="on",this.el.flick.children[0].innerHTML="ON"):(this.el.flick.className="off",this.el.flick.children[0].innerHTML="OFF")};
form.prototype.showVersion=function(a,b){for(var f=a?a:b,d=document.getElementsByClassName("app-version"),c=0;c<d.length;c++)if(d[c].getAttribute("data-version")==f){var e=d[c].getElementsByTagName("h3")[0];e.innerHTML+=" &ndash; <span>INSTALLED</span>"}a&&b&&(document.getElementById("appversioninfo").innerHTML=a,document.getElementById("jsversioninfo").innerHTML=b,document.getElementById("versioninfo").style.display="inline")};
form.prototype.attach=function(){var a=this;this.el.bgcolour.addEventListener("click",function(b){b.preventDefault();a.config.dark=!a.config.dark;a.updateForm()});this.el.notify.addEventListener("click",function(b){b.preventDefault();a.config.notify=!a.config.notify;a.updateForm()});this.el.flick.addEventListener("click",function(b){b.preventDefault();a.config.flick=!a.config.flick;a.updateForm()});this.el.update.addEventListener("change",function(){a.config.update=this.value});this.el.apikey.addEventListener("change",
function(){a.config.apikey=this.value});this.el.save.addEventListener("click",function(b){b.preventDefault();b="pebblejs://close#"+encodeURIComponent(JSON.stringify(a.config));window.location.href=b})};
</script>
</head>
<body>
<h1>MineWatch</h1>
<h2>Settings</h2>
<ul class="form">
<li>
<p>Background colour</p>
<a class="white" id="bgcolour" href="#"><span>WHITE</span></a>
</li>
<li>
<p>Enable vibes</p>
<a class="off" id="notify" href="#"><span>OFF</span></a>
<div class="info">Pebble will vibrate when a worker goes offline.</div>
</li>
<li>
<p>Flick to update</p>
<a class="off" id="flick" href="#"><span>OFF</span></a>
<div class="info">Flick Pebble to force update (limit to once per min)</div>
</li>
<li><p>Update rate (mins)</p><input type="number" min="1" max="60" step="1" value="15" id="update"/></li>
<li><p>API Key</p><input type="text" id="apikey" maxlength="64"/></li>
</ul>
<a id="save" href="#">SAVE</a>
<h2>Updates</h2>
<ul class="updates">
<li class="app-version" data-version="1.0.2">
<h3>v1.0.2 (15<sup>th</sup> May 2014)</h3>
<ul>
<li>Increase timeout from 10 to 30 seconds</li>
<li>Update settings to show installed version</li>
</ul>
</li>
<li class="app-version" data-version="1.0.1">
<h3>v1.0.1 (8<sup>th</sup> May 2014)</h3>
<ul>
<li>Initial release</li>
<li>Support for Slush's pool</li>
</ul>
</li>
</ul>
<h2>Contact</h2>
<p>Please report any bugs and submit feature requests to <em>me@danielhead.com</em>.</p>
<p>Support for other mining pools can be accomodated upon request.</p>
<p>Like this watchface? Bitcoin donations, no matter how small are appreciated. My bitcoin address is: <em>1CCsuAXhEbLiL2a43x1yxuhk5F6hEt1EBQ</em></p>
<p>For further support and feedback, please visit <em>danielhead.com/minewatch</em></p>
<p id="versioninfo">App version: <span id="appversioninfo"></span> / JS version: <span id="jsversioninfo"></span></p></body>
</html>