|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
<iframe id="appframe" src="views/appspinner.html" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0px;"></iframe>
|
|
|
|
|
<iframe id="appframe" src="" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0px;"></iframe>
|
|
|
|
|
<iframe id="loadframe" src="views/appspinner.html" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0px; z-index: 999999;"></iframe>
|
|
|
|
|
|
|
|
|
|
<script src="js/material-palette.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
var historyctr = -1;
|
|
|
|
|
/**
|
|
|
|
|
* Open an app with native Android UI elements
|
|
|
|
|
* @param String id Application ID
|
|
|
|
@ -27,10 +29,17 @@
|
|
|
|
|
action: "start_session"
|
|
|
|
|
}, function (data) {
|
|
|
|
|
if (data.status === 'OK') {
|
|
|
|
|
document.getElementById("loadframe").contentWindow.postMessage("loginok", "*");
|
|
|
|
|
if (typeof injectcode === 'undefined' || injectcode === true) {
|
|
|
|
|
$('#appframe').on("load", function () {
|
|
|
|
|
$("#loadframe").fadeOut(300);
|
|
|
|
|
historyctr++;
|
|
|
|
|
$.get("css/sidemenu.css", function (style) {
|
|
|
|
|
$('#appframe').contents().find('head').append("<style>" + style + "</style>");
|
|
|
|
|
$.get("js/jquery-ui.min.js", function (script) {
|
|
|
|
|
$('#appframe').contents().find('body').append("<script>" + script + "<\/script>");
|
|
|
|
|
$.get("js/hammer.min.js", function (script) {
|
|
|
|
|
$('#appframe').contents().find('body').append("<script>" + script + "<\/script>");
|
|
|
|
|
$.get("js/sidemenu.js", function (script) {
|
|
|
|
|
script = script.replace("%%JQUERYFXOFF%%", !(localStorage.getItem("animations") === null || localStorage.getItem("animations") === "true"));
|
|
|
|
|
script = script.replace("%%USERNAME%%", userinfo.realname);
|
|
|
|
@ -39,6 +48,8 @@
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// Only inject minimal CSS
|
|
|
|
|
$('#appframe').on("load", function () {
|
|
|
|
@ -59,10 +70,20 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var scanningactive = false;
|
|
|
|
|
var dedup = false;
|
|
|
|
|
window.addEventListener('message', function (event) {
|
|
|
|
|
console.log("app event: " + event.data);
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
dedup = false;
|
|
|
|
|
}, 500);
|
|
|
|
|
if (dedup) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
dedup = true;
|
|
|
|
|
if (event.data == "quit") {
|
|
|
|
|
openscreen("home");
|
|
|
|
|
} else if (event.data == "goneback") {
|
|
|
|
|
historyctr -= 1;
|
|
|
|
|
} else if (event.data.startsWith("setcolor ")) {
|
|
|
|
|
var color = event.data.split(" ", 2)[1];
|
|
|
|
|
if (cordova.platformId == 'android') {
|
|
|
|
|