forked from dbemowsk/touchscreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
149 lines (138 loc) · 4.8 KB
/
index2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=windows-1200" http-equiv="content-type">
<title>touchscreen</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.4.0.js"></script>
<script type="text/javascript">
var curr_page = (typeof curr_page == 'undefined') ? "main_menu" : curr_page;
window.setInterval(ShowTime, 1000);
$(document).ready(function() {
LoadPage(curr_page);
});
function LoadPage(page_name) {
$('#content').load('./' + page_name + '.html');
}
function ShowTime() {
$("#dateTime").html(formatAMPM());
}
function GoPage(page_name) {
curr_page = page_name;
LoadPage(page_name);
}
function GetMhMode() {
var url = './sub?json(objects=mode_occupied)';
//Get the current MH mode using a JSON call
$.getJSON(url, function (data) {
var m, modestable = '<table id="modesTable" style="width: 100%;"><tbody>';
var mode = data.objects.mode_occupied.state;
var modes = data.objects.mode_occupied.states;
var count = Object.keys(modes).length;
modestable += '<tr><td colspan="' + (count - 1) + '" rowspan="1" align="center">';
modestable += '<img src="images/icons/' + mode + '_mode.png" alt="current mode" /></td></tr>';
modestable += '<tr>';
for (var i = 0;i < count; i++) {
if (modes[i] != mode) {
modestable += '<td align="center"><img src="images/icons/' + modes[i] + '_mode.png" alt="' + modes[i] + ' mode" /></td>';
}
}
modestable += '</tr></tbody></table>';
$('#modesList').html(modestable);
//$('#currentMode').html('<img src="images/icons/' + mode + '_mode.png" alt="current mode" />');
});
}
function formatAMPM() {
var d = new Date(),
minutes = d.getMinutes().toString().length == 1 ? '0'+d.getMinutes() : d.getMinutes(),
hours = d.getHours() > 12 ? d.getHours() - 12 : d.getHours(),
ampm = d.getHours() >= 12 ? 'pm' : 'am',
months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
return days[d.getDay()]+' '+months[d.getMonth()]+' '+d.getDate()+' '+d.getFullYear()+' '+hours+':'+minutes+ampm;
}
</script>
<link rel="stylesheet" href="css/jquery.mobile-1.4.0.css">
<style type="text/css">
body {
margin: 0;
padding: 0;
}
.page {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-image: url('./images/backgrounds/purple_black_1.png');
}
.header {
width: 100%;
height: 36px;
border: 0;
font-size: 1.25em;
color: white;
background: url('./images/footer_bkgnd_36.png') repeat;
}
.footer {
position: absolute;
height: 48px;
width: 100%;
border: 0;
font-size: 1.25em;
color: white;
left: 0;
bottom: 0;
background: url('./images/footer_bkgnd_48.png') repeat;
}
.footer img {
vertical-align: middle;
}
#header_right {
float: right;
}
#header_right img {
vertical-align: middle;
margin: 0;
padding: 0;
}
#dateTime {
position: relative;
line-height: 36px;
display: inline-block;
top: 0;
margin: 0;
padding: 0;
vertical-align: middle;
background: url('./images/black_button_center.png') repeat;
}
table {
width: 100%;
height: 100%;
}
.helper {
display: inline-block;
height: 100%;
vertical-align: middle;
}
</style>
</head>
<body>
<div data-role="page" class="page" data-theme="c">
<div data-role="header" class="header"><span class="helper"></span>
<div id="header_right"><img alt="button left cap" src="images/black_button_left.png"><span
id="dateTime"> </span><img alt="button left cap" src="images/black_button_right.png">
</div>
</div>
<!-- /header -->
<div data-role="main" class="main" data-theme="c">
<div id="content"> </div>
</div>
<!-- /content -->
<div data-role="footer" class="footer" data-theme="c">
<span class="helper"></span><img alt="power" src="images/icons/power_32.png">
</div>
<!-- /footer --> </div>
<!-- /page -->
</body>
</html>