Pre branch

This commit is contained in:
Martin Donnelly 2016-07-26 16:40:12 +01:00
parent 36fdb22c8c
commit 71b5de20bb
47 changed files with 183 additions and 14 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/fav/mstile-70x70.png"/>
<square150x150logo src="/fav/mstile-150x150.png"/>
<square310x310logo src="/fav/mstile-310x310.png"/>
<wide310x150logo src="/fav/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/fav/mstile-70x70.png"/>
<square150x150logo src="/fav/mstile-150x150.png"/>
<square310x310logo src="/fav/mstile-310x310.png"/>
<wide310x150logo src="/fav/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

View File

@ -20,8 +20,7 @@ var SOController = (function() {
var iosConfig = {
badge: true, sound: true, alert: true
};
var calendarData;
var extendTimer;

1
data/iostokens.json Normal file
View File

@ -0,0 +1 @@
[]

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/fav/mstile-70x70.png"/>
<square150x150logo src="/fav/mstile-150x150.png"/>
<square310x310logo src="/fav/mstile-310x310.png"/>
<wide310x150logo src="/fav/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -0,0 +1,43 @@
{
"name": "Censis Smart Office ",
"icons": [
{
"src": "\/fav\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": 0.75
},
{
"src": "\/fav\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": 1
},
{
"src": "\/fav\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": 1.5
},
{
"src": "\/fav\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": 2
},
{
"src": "\/fav\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": 3
},
{
"src": "\/fav\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": 4
}
],
"display": "standalone",
"orientation": "portrait"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,46 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="991.000000pt" height="991.000000pt" viewBox="0 0 991.000000 991.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,991.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M7465 9503 c-480 -60 -867 -422 -967 -903 -28 -132 -21 -345 16 -517
40 -184 56 -315 56 -460 0 -146 -15 -244 -54 -347 -36 -96 -38 -98 -89 -80
-71 25 -267 73 -372 90 -219 35 -551 33 -774 -5 -973 -169 -1752 -917 -1945
-1871 -14 -67 -27 -124 -30 -127 -9 -9 -162 19 -235 43 -168 56 -304 137 -577
345 -209 157 -328 222 -489 266 -93 25 -114 27 -290 27 -207 0 -253 -8 -420
-73 -270 -104 -514 -347 -624 -623 -113 -281 -105 -620 20 -887 113 -241 291
-426 524 -541 311 -154 673 -157 985 -9 107 51 172 95 328 226 311 258 558
392 752 405 l44 3 17 -70 c115 -492 361 -914 725 -1247 354 -324 795 -530
1294 -604 80 -12 177 -17 320 -17 222 0 346 14 545 58 254 57 407 0 493 -183
25 -52 27 -68 27 -177 -1 -119 -1 -121 -49 -245 -66 -173 -86 -263 -93 -410
-21 -494 279 -940 743 -1106 352 -126 754 -67 1054 156 84 62 205 187 259 269
62 91 126 231 157 341 38 140 45 372 14 520 -96 469 -473 820 -950 886 -179
25 -223 35 -297 69 -85 39 -159 105 -199 177 -27 49 -29 61 -29 158 0 95 3
110 27 156 15 28 70 102 123 165 239 281 410 611 500 963 57 223 70 332 70
596 0 264 -13 373 -70 595 -115 448 -379 885 -712 1179 -57 50 -103 95 -103
100 0 19 92 136 150 189 119 110 264 194 490 282 80 31 176 69 215 86 333 142
568 418 656 770 29 120 36 325 15 448 -84 482 -453 849 -931 926 -82 14 -245
18 -320 8z m-879 -2369 c179 -72 362 -175 526 -296 l67 -49 -23 -52 c-78 -176
-73 -421 13 -642 17 -45 63 -137 103 -205 210 -367 298 -727 268 -1103 -53
-664 -433 -1233 -1019 -1527 -295 -148 -564 -207 -891 -197 -233 7 -398 39
-600 114 -449 168 -823 510 -1029 943 -42 89 -123 311 -116 318 2 2 44 -11 95
-28 199 -66 403 -188 797 -477 211 -155 338 -226 497 -278 766 -251 1582 242
1721 1041 20 113 19 336 0 450 -95 545 -532 983 -1079 1081 -125 22 -354 22
-470 -1 -279 -54 -482 -162 -716 -377 -330 -304 -539 -447 -753 -514 -117 -37
-118 -37 -101 33 82 320 239 603 467 839 161 167 310 274 522 379 232 113 430
166 690 184 357 24 460 45 614 125 111 57 194 125 255 209 26 36 54 66 60 66
7 0 52 -16 102 -36z m-701 -1448 c90 -24 232 -98 307 -160 122 -101 217 -251
259 -411 28 -105 30 -279 4 -380 -91 -359 -405 -608 -770 -608 -123 0 -231 25
-350 83 -165 80 -284 199 -364 363 -54 109 -72 180 -78 308 -11 224 60 417
215 581 109 116 254 198 407 232 87 19 283 15 370 -8z m-2044 -463 c-10 -56
-15 -144 -14 -313 0 -211 3 -246 25 -348 l24 -114 -30 6 c-106 20 -209 26
-353 20 l-162 -6 -6 24 c-31 139 -44 479 -25 664 6 65 13 120 13 120 1 1 114
5 252 9 137 3 252 8 254 11 2 2 12 4 21 4 15 0 15 -6 1 -77z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,41 @@
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(Material_Icons-normal-400.woff) format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 300;
src: url(Ubuntu-normal-300.woff) format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 400;
src: url(Ubuntu-normal-400.woff) format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 500;
src: url(Ubuntu-normal-500.woff) format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 700;
src: url(Ubuntu-normal-700.woff) format('woff');
}
@font-face {
font-family: 'Ubuntu Condensed';
font-style: normal;
font-weight: 400;
src: url(Ubuntu_Condensed-normal-400.woff) format('woff');
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
var lights={off:['frontLightOff','middleLightOff','backLightOff'],on:['frontLightOn','middleLightOn','backLightOn']};var tempColours=[{t:0,r:80,g:181,b:221},{t:1,r:80,g:181,b:221},{t:2,r:80,g:181,b:221},{t:3,r:80,g:181,b:221},{t:4,r:80,g:181,b:221},{t:5,r:80,g:181,b:221},{t:6,r:78,g:178,b:206},{t:7,r:76,g:176,b:190},{t:8,r:73,g:173,b:175},{t:9,r:72,g:171,b:159},{t:10,r:70,g:168,b:142},{t:11,r:68,g:166,b:125},{t:12,r:66,g:164,b:108},{t:13,r:102,g:173,b:94},{t:14,r:135,g:190,b:64},{t:15,r:179,g:204,b:26},{t:16,r:214,g:213,b:28},{t:17,r:249,g:202,b:3},{t:18,r:246,g:181,b:3},{t:19,r:244,g:150,b:26},{t:20,r:236,g:110,b:5},{t:21,r:234,g:90,b:36},{t:22,r:228,g:87,b:43},{t:23,r:225,g:74,b:41},{t:24,r:224,g:65,b:39},{t:25,r:217,g:55,b:43},{t:26,r:214,g:49,b:41},{t:27,r:209,g:43,b:43},{t:28,r:205,g:40,b:47},{t:29,r:200,g:36,b:50},{t:30,r:195,g:35,b:52},{t:31,r:190,g:33,b:56},{t:32,r:185,g:32,b:59}];var prevDate,prevTime;function updateCalendar(d){'use strict';var $calendar=$('#calendar');if(d.current!==null&&d.current.hasOwnProperty('dtstart')){var calString=`<div class="mui--text-subhead">${d.current.summary}</div>`;$('#caltext').html(calString);$calendar.slideDown();}else{$calendar.slideUp();}}
function updateDateTime(){var now=Date.create(new Date());var $date=$('#date');var $time=$('#time');var curTime=now.format('<span class="hour">{24hr}</span>{mm}');var curDate=now.format('{yyyy}-{MM}-{dd}');if(prevTime!==curTime){$time.html(curTime);prevTime=curTime;}
if(prevDate!==curDate){$date.html(now.format('<span class="wd-{do}">{Weekday}</span><br><span class="mo mo-{M}">{Month} {dd}</span><br>{yyyy}'));prevDate=curDate;}}
function turnOnLights(id){var _id=parseInt(id)-1;var $lightsOff=['#',lights.off[_id]].join('');var $lightsOn=['#',lights.on[_id]].join('');$.post('api/v1/lighting/on',{light:id},function(res){$($lightsOff).show();$($lightsOn).hide();});}
function turnOffLights(id){var _id=['a','b','c'].indexOf(id);var $lightsOff=['#',lights.off[_id]].join('');var $lightsOn=['#',lights.on[_id]].join('');$.post('api/v1/lighting/off',{light:id},function(res){$($lightsOff).hide();$($lightsOn).show();});}
function turnOnHeating(){var $heatingOn=$('#heatingOn');var $heatingOff=$('#heatingOff');$.post('api/v1/heating/on',{},function(repsonse){$($heatingOff).show();$($heatingOn).hide();});}
function turnOffHeating(){var $heatingOn=$('#heatingOn');var $heatingOff=$('#heatingOff');$.post('api/v1/heating/off',{},function(repsonse){$($heatingOn).show();$($heatingOff).hide();});}
function turnOnProjector(){var $projectorOn=$('#projectorOn');var $projectorOff=$('#projectorOff');$.post('api/v1/projector/on',{},function(repsonse){$($projectorOff).show();$($projectorOn).hide();});}
function turnOffProjector(){var $projectorOn=$('#projectorOn');var $projectorOff=$('#projectorOff');$.post('api/v1/projector/off',{},function(repsonse){$($projectorOff).hide();$($projectorOn).show();});}
$('#projectorOn').on('click',function(){turnOnProjector();});$('#projectorOff').on('click',function(){turnOffProjector();});$('#heatingOn').on('click',function(){turnOnHeating();});$('#heatingOff').on('click',function(){turnOffHeating();});$('#frontLightOn').on('click',function(){turnOnLights(1);});$('#middleLightOn').on('click',function(){turnOnLights(2);});$('#backLightOn').on('click',function(){turnOnLights(3);});$('#frontLightOff').on('click',function(){turnOffLights('a');});$('#middleLightOff').on('click',function(){turnOffLights('b');});$('#backLightOff').on('click',function(){turnOffLights('c');});function rgb(cv){return['rgb(',cv.r,',',cv.g,',',cv.b,')'].join('');}
function clock(){'use strict';updateDateTime();var now=new Date;var mod=60000-(now.getTime()%60000);setTimeout(function(){clock();},mod+10);}
var SOWEBSOCKET=function(){this.socket=null;this.retry=0;this.timer=0;this.previousTemp=0;this.startWebSocket=function(){'use strict';console.log('Starting socket?');var url='ws://localhost:8080';var wsCtor=window['MozWebSocket']?MozWebSocket:WebSocket;this.socket=new wsCtor(url,'stream');this.socket.onopen=this.handleWebsocketOnOpen.bind(this);this.socket.onmessage=this.handleWebsocketMessage.bind(this);this.socket.onclose=this.handleWebsocketClose.bind(this);this.socket.onerror=function(e){console.log('whoops');console.error(e);};};this.updateHeating=function(obj){var $curTemp=$('#curTemp');if(this.previousTemp!==obj.temp){$curTemp.text(obj.temp);$curTemp.css('color',rgb(tempColours[parseInt(obj.temp)]));this.previousTemp=obj.temp;}};this.updateLighting=function(obj){$('#lightR').text(obj.Red);$('#lightG').text(obj.Green);$('#lightB').text(obj.Blue);var r=parseInt(obj.Red);var g=parseInt(obj.Green);var b=parseInt(obj.Blue);var shiftR=(r&0xff00)>>8;var newR=Math.floor(((r/65535.0)*100)*255);var newG=Math.floor(((g/65535.0)*100)*255);var newB=Math.floor(((b/65535.0)*100)*255);var w='#'+('0'+parseInt(newR).toString(16)).substr(-2,2)+('0'+parseInt(newG).toString(16)).substr(-2,2)+('0'+parseInt(newB).toString(16)).substr(-2,2);$('#lightW').text(w);$('#lightW').css('background-color',w);};this.updateProj=function(obj){var r=parseInt(obj.Red);var g=parseInt(obj.Green);var b=parseInt(obj.Blue);var newR=Math.floor(((r/65535.0)*100)*255);var newG=Math.floor(((g/65535.0)*100)*255);var newB=Math.floor(((b/65535.0)*100)*255);$('#projR').text(newR);$('#projG').text(newG);$('#projB').text(newB);var y=Math.floor((0.2126*newR+0.7152*newG+0.0722*newB));var w='#'+('0'+parseInt(y).toString(16)).substr(-2,2)+('0'+parseInt(y).toString(16)).substr(-2,2)+('0'+parseInt(y).toString(16)).substr(-2,2);$('#projW').text(w);$('#projW').css('background-color',w);};this.handleData=function(d){switch(d.id){case'LightingDataReceived':break;case'ProjectorDataReceived':break;case'HeatingDataReceived':this.updateHeating(d.sensorData.d);break;case'calendar':updateCalendar(d);break;default:console.log(d);break;}};this.handleWebsocketOnOpen=function(){'use strict';this.retry=0;$('#longWait').hide();$('#noSocket').slideUp();};this.handleWebsocketMessage=function(message){var command;try{command=JSON.parse(message.data);this.updateDateTime();}
catch(e){}
if(command){this.handleData.call(this,command);}};this.handleWebsocketClose=function(){console.error('WebSocket Connection Closed.');$('#noSocket').slideDown();var self=this;this.retry++;if(this.retry>12){this.retry=1;}
if(this.retry===3){$('#longWait').fadeIn();}
console.log('Waiting ',5000*this.retry);this.timer=setTimeout(function(){self.startWebSocket();},5000*this.retry);};this.startWebSocket();};(function(){var iOS=['iPad','iPhone','iPod'].indexOf(navigator.platform)>=0;if(iOS){$('#iosTaskbar').show();}
clock();var soWebSocket=new SOWEBSOCKET();})();

File diff suppressed because one or more lines are too long