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.
48 lines
1.8 KiB
HTML
48 lines
1.8 KiB
HTML
<div class="app-dock-container">
|
|
<div class="app-dock" id="app-dock">
|
|
<div style="margin-top: 50px;">
|
|
<svg class="spinner" width="65px" height="65px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
|
|
<circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>
|
|
</svg>
|
|
</div>
|
|
<div style="width: 100%;"></div>
|
|
<p class="loading-text">Loading...</p>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function loadapps() {
|
|
$(".loading-text").html("Loading Apps...");
|
|
$.post(localStorage.getItem("syncurl"), {
|
|
username: localStorage.getItem("username"),
|
|
key: localStorage.getItem("key"),
|
|
action: "listapps"
|
|
}, function (data) {
|
|
if (data.status === 'OK') {
|
|
$("#loading-text").text("One moment...");
|
|
$('#app-dock').html("");
|
|
Object.keys(data.apps).forEach(function (k) {
|
|
var app = data.apps[k];
|
|
var iconurl = app.icon;
|
|
if (!app.icon.startsWith("http")) {
|
|
iconurl = app.url + app.icon;
|
|
}
|
|
$("<div class=\"app-dock-item\" onclick=\"openapp('" + k + "', '" + app.mobileapi + "', '" + app.url + "', '" + iconurl + "', '" + app.title + "')\"><p><img src=\"" + iconurl + "\" class=\"img-responsive app-icon\" /><span>" + app.title + "</span></p></div>").hide().appendTo("#app-dock").fadeIn(200);
|
|
});
|
|
} else {
|
|
navigator.notification.alert(data.msg, null, "Error", 'Dismiss');
|
|
openscreen("homeloaderror");
|
|
}
|
|
}, "json").fail(function () {
|
|
navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss');
|
|
openscreen("homeloaderror");
|
|
});
|
|
}
|
|
|
|
if (localStorage.getItem('setupcomplete')) {
|
|
setnavbar("home");
|
|
loadapps();
|
|
} else {
|
|
openscreen("setup1");
|
|
}
|
|
</script> |