-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_layout.html
132 lines (107 loc) · 4.59 KB
/
custom_layout.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
<!doctype html>
<head xmlns="http://www.w3.org/1999/html">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Parse Server -->
<script src="/customClasses/parse_server.js"></script>
<script type="text/javascript" src="/customClasses/parse-latest.js"></script>
<!-- Favicon -->
<link rel="shortcut icon" href="/img/favicon.png">
<!-- JBox -->
<script src="/JBox/jquery-1.11.1.min.js"></script>
<script src="/JBox/jBox.min.js"></script>
<link href="/JBox/jBox.css" rel="stylesheet">
<!-- JQuery Mobile -->
<link rel="stylesheet" href="/css/jquery1.4.5.css"/>
<script src="/customClasses/jquery-2.1.3.min.js"></script>
<script src="/customClasses/jquery.mobile-1.4.5.min.js"></script>
<!-- Main CSS -->
<link rel="stylesheet" href="/css/jqm-demos.css"/>
<link rel="stylesheet" href="/css/main.css"/>
<!-- Main Scripts -->
<script src="/customClasses/smartUtils.js"></script>
<script src="/customClasses/parseFunctions.js"></script>
<script src="/script/paho-mqtt.js"></script>
<script src="/script/mqtt_utils.js"></script>
<script id="panel-init">
$(function () {
$("body>[data-role='panel']").panel();
});
</script>
</head>
<style>
h3, h4 {
text-align: center;
}
span {
font-weight: bold;
}
</style>
<body onload="" style="height: 100%;overflow: hidden">
<div class="jqm-demos custom-page" data-role="page" id="board_detail">
<div data-role="panel" id="left-panel" data-position="left" data-display="overlay">
</div><!-- /panel -->
<!-- Header -->
<div class="custom-header" id="header" data-role="header" data-position="fixed">
<h1 style="text-shadow:none; color:#ffffff">Smartface</h1>
<!-- Left Panel -->
<a onclick="$('#left-panel').panel('open')"
class="ui-btn ui-corner-all ui-nodisc-icon ui-icon-back ui-btn-icon-notext ui-icon-bars ui-btn-white">Menu</a>
</div>
<div id="custom_layout"></div>
<!-- SCRIPTS -->
<script>
var lang = getLanguage();
console.log("Language: " + lang);
if (lang != "en" && lang != "it") {
lang = "en";
}
var setUI = function () {
var saveData = JSON.parse(localStorage.saveData || null) || {};
var username = saveData.username;
// Set Custom Layout
if (saveData.webInterface != null) {
document.getElementById("custom_layout").innerHTML = saveData.webInterface;
}
// Set Custom Script
if (saveData.webInterfaceScript != null) {
var s = document.createElement('script');
s.innerHTML = saveData.webInterfaceScript;
document.body.appendChild(s);
}
// Left Panel
var content =
'<ul data-split-icon="gear" style="margin: -1.44em -1em 1em; padding: .46857em 0 0;" data-role="listview" class="ui-alt-icon ui-nodisc-icon">' +
'<li id="connected-user" data-role="list-divider">' + localization[lang]['connected-as'] + '<i> ' + username + '</i>' + '</li>' +
//'<li><a onclick="setTab(id)" id="notifications" class="ui-icon-mail" data-icon="mail">' + localization[lang]['notifications'] + '</a></li>' +
'<li><a onclick="logOut()" id="logout-btn" class="ui-icon-user" data-icon="lock">' + localization[lang]['log-out'] + '</a></li>' +
'<li></li>' +
'<li></li>' +
'<li><a onclick="getUserData()" id="refresh-btn" class="ui-icon-refresh" data-icon="refresh">' + localization[lang]['refresh'] + '</a></li>' +
'</ul>';
$('#left-panel').append(content);
};
var getLocalizationFromStorage = function () {
var json = undefined;
try {
json = JSON.parse(localStorage.localization);
}
catch (e) {
}
return json;
};
var localization = getLocalizationFromStorage();
if (localization == undefined) {
console.log("Loading strings...");
$.getJSON('/localization/strings.json', function (json) {
console.log(json);
localization = json;
localStorage.localization = JSON.stringify(localization);
setUI();
});
}
else {
setUI();
}
</script>
</div>
</body>