You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MobileApp/www/views/app.html

42 lines
1.8 KiB
HTML

<iframe id="appframe" src="views/appspinner.html" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999; border: 0px;"></iframe>
<script>
function launchapp(id, api, url, icon, title) {
setnavbar(false);
$.post(url + api, {
username: localStorage.getItem("username"),
key: localStorage.getItem("key"),
password: localStorage.getItem("password"),
action: "start_session"
}, function (data) {
if (data.status === 'OK') {
$('#appframe').on("load", function () {
$.get("css/sidemenu.css", function (style) {
$('#appframe').contents().find('head').append("<style>" + style + "</style>");
$.get("js/sidemenu.js", function (script) {
script = script.replace("%%USERNAME%%", userinfo.realname);
script = script.replace("%%LOGO%%", icon);
$('#appframe').contents().find('body').append("<script>" + script + "<\/script>");
});
});
});
$('#appframe').attr('src', url);
} else {
navigator.notification.alert(data.msg, null, "Error", 'Dismiss');
openscreen("home");
}
}, "json").fail(function () {
navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss');
openscreen("home");
});
}
window.addEventListener('message', function (event) {
console.log(event.data);
switch (event.data) {
case "quit":
openscreen("home");
break;
}
}, false);
</script>