Add QC shifts, add proper icon, check for app permissions, adjust styles, fix UI bugs, prepare login UI for quick access mode
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
|
|
function openScreen(id) {
|
|
$('#content-frame').fadeOut('fast', function () {
|
|
$('#content-frame').load("pages/" + id + ".html", function () {
|
|
$('#content-frame').fadeIn('fast', function () {
|
|
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
function getApps(callback) {
|
|
$.post(accounthubapi, {
|
|
key: apikey,
|
|
action: "listapps"
|
|
}, function (resp) {
|
|
if (resp.status == "OK") {
|
|
callback(resp.apps);
|
|
} else {
|
|
alert(resp.msg);
|
|
}
|
|
}, "json");
|
|
}
|
|
|
|
var msgtimeout = null;
|
|
|
|
function showmsg(text, style, details, timeout) {
|
|
if (timeout == null) {
|
|
timeout = 5 * 1000;
|
|
}
|
|
if (details == null) {
|
|
details = "";
|
|
} else {
|
|
details = "<p>" + details + "</p>";
|
|
}
|
|
if (style == null) {
|
|
style = "info";
|
|
}
|
|
$("#alert-box")
|
|
.hide()
|
|
.html('<div class="alert alert-' + style + ' alert-dismissible fade show" role="alert" style="position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9999999;"><h5 class="alert-heading">' + text + '</h5>' + details + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button></div>')
|
|
.fadeIn("fast");
|
|
clearTimeout(msgtimeout);
|
|
if (timeout !== false) {
|
|
msgtimeout = setTimeout(function () {
|
|
$("#alert-box").fadeOut("fast");
|
|
}, timeout);
|
|
}
|
|
} |