|
|
@ -32,15 +32,17 @@ var backendEndBasePath = "/api/device-mgt/v1.0";
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
var kioskConfigs = {
|
|
|
|
var kioskConfigs = {
|
|
|
|
"adminComponentName" : "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME",
|
|
|
|
"adminComponentName": "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME",
|
|
|
|
"wifiSSID" : "android.app.extra.PROVISIONING_WIFI_SSID",
|
|
|
|
"wifiSSID": "android.app.extra.PROVISIONING_WIFI_SSID",
|
|
|
|
"wifiPassword" : "android.app.extra.PROVISIONING_WIFI_PASSWORD",
|
|
|
|
"wifiPassword": "android.app.extra.PROVISIONING_WIFI_PASSWORD",
|
|
|
|
"wifiSecurity" : "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE",
|
|
|
|
"wifiSecurity": "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE",
|
|
|
|
"skipEncryption" : "android.app.extra.PROVISIONING_SKIP_ENCRYPTION",
|
|
|
|
"skipEncryption": "android.app.extra.PROVISIONING_SKIP_ENCRYPTION",
|
|
|
|
"checksum" : "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM",
|
|
|
|
"checksum": "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM",
|
|
|
|
"downloadURL" : "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION",
|
|
|
|
"downloadURL": "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION",
|
|
|
|
"androidExtra" : "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE",
|
|
|
|
"androidExtra": "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE",
|
|
|
|
"accessToken" : "android.app.extra.token"
|
|
|
|
"accessToken": "android.app.extra.token",
|
|
|
|
|
|
|
|
"defaultOwnership": "android.app.extra.defaultOwner",
|
|
|
|
|
|
|
|
"serverIp": "android.app.extra.serverIp"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -68,19 +70,19 @@ function hidePopup() {
|
|
|
|
$(modalPopupContent).html("");
|
|
|
|
$(modalPopupContent).html("");
|
|
|
|
$(modalPopupContent).removeClass("operation-data");
|
|
|
|
$(modalPopupContent).removeClass("operation-data");
|
|
|
|
$(modalPopup).modal('hide');
|
|
|
|
$(modalPopup).modal('hide');
|
|
|
|
$('body').removeClass('modal-open').css('padding-right','0px');
|
|
|
|
$('body').removeClass('modal-open').css('padding-right', '0px');
|
|
|
|
$('.modal-backdrop').remove();
|
|
|
|
$('.modal-backdrop').remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* QR-code generation function.
|
|
|
|
* QR-code generation function.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function generateQRCode(qrCodeClass) {
|
|
|
|
function generateQRCode() {
|
|
|
|
var enrollmentURL = $("#qr-code-modal").data("enrollment-url");
|
|
|
|
var enrollmentURL = $("#qr-code-modal").data("enrollment-url");
|
|
|
|
$(qrCodeClass).qrcode({
|
|
|
|
$(qrCodeClass).qrcode({
|
|
|
|
text: enrollmentURL,
|
|
|
|
text: enrollmentURL,
|
|
|
|
width: 200,
|
|
|
|
width: 150,
|
|
|
|
height: 200
|
|
|
|
height: 150
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -89,19 +91,26 @@ function generateQRCode(qrCodeClass) {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function generateKIOSKQRCode(qrCodeClass) {
|
|
|
|
function generateKIOSKQRCode(qrCodeClass) {
|
|
|
|
|
|
|
|
|
|
|
|
var androidConfigAPI = "/api/device-mgt/android/v1.0/configuration";
|
|
|
|
|
|
|
|
var payload = {};
|
|
|
|
var payload = {};
|
|
|
|
|
|
|
|
var androidConfigAPI = "/api/device-mgt/android/v1.0/configuration";
|
|
|
|
|
|
|
|
|
|
|
|
var isKioskConfigured = false;
|
|
|
|
var isKioskConfigured = false;
|
|
|
|
|
|
|
|
var defaultOwnerVal = {};
|
|
|
|
|
|
|
|
var serverIp = {};
|
|
|
|
|
|
|
|
$("#android-qr-code").show();
|
|
|
|
|
|
|
|
$("#enrollment_qr_content").show();
|
|
|
|
|
|
|
|
$("#qr-code-img").hide();
|
|
|
|
|
|
|
|
$("#enroll-qr-heading").show();
|
|
|
|
|
|
|
|
var ownership_type = $("#android-device-ownership").find("option:selected").attr("value");
|
|
|
|
|
|
|
|
|
|
|
|
invokerUtil.get(
|
|
|
|
invokerUtil.get(
|
|
|
|
androidConfigAPI,
|
|
|
|
androidConfigAPI,
|
|
|
|
function (data) {
|
|
|
|
function(data) {
|
|
|
|
data = JSON.parse(data);
|
|
|
|
data = JSON.parse(data);
|
|
|
|
if (data != null && data.configuration != null) {
|
|
|
|
if (data != null && data.configuration != null) {
|
|
|
|
|
|
|
|
if (ownership_type == "COSU") {
|
|
|
|
for (var i = 0; i < data.configuration.length; i++) {
|
|
|
|
for (var i = 0; i < data.configuration.length; i++) {
|
|
|
|
var config = data.configuration[i];
|
|
|
|
var config = data.configuration[i];
|
|
|
|
|
|
|
|
|
|
|
|
if (config.name === kioskConfigs["adminComponentName"]) {
|
|
|
|
if (config.name === kioskConfigs["adminComponentName"]) {
|
|
|
|
isKioskConfigured = true;
|
|
|
|
isKioskConfigured = true;
|
|
|
|
payload[config.name] = config.value;
|
|
|
|
payload[config.name] = config.value;
|
|
|
@ -117,10 +126,28 @@ function generateKIOSKQRCode(qrCodeClass) {
|
|
|
|
payload[config.name] = config.value;
|
|
|
|
payload[config.name] = config.value;
|
|
|
|
} else if (config.name === kioskConfigs["skipEncryption"]) {
|
|
|
|
} else if (config.name === kioskConfigs["skipEncryption"]) {
|
|
|
|
payload[config.name] = Boolean(config.value);
|
|
|
|
payload[config.name] = Boolean(config.value);
|
|
|
|
|
|
|
|
} else if (config.name === kioskConfigs["defaultOwnership"]) {
|
|
|
|
|
|
|
|
defaultOwnerVal[config.name] = ownership_type;
|
|
|
|
|
|
|
|
} else if (config.name === kioskConfigs["serverIp"]) {
|
|
|
|
|
|
|
|
serverIp[config.name] = config.value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
for (var i = 0; i < data.configuration.length; i++) {
|
|
|
|
|
|
|
|
var config = data.configuration[i];
|
|
|
|
|
|
|
|
if (config.name === kioskConfigs["adminComponentName"]) {
|
|
|
|
|
|
|
|
isKioskConfigured = true;
|
|
|
|
|
|
|
|
payload[config.name] = config.value;
|
|
|
|
|
|
|
|
} else if (config.name === kioskConfigs["defaultOwnership"]) {
|
|
|
|
|
|
|
|
defaultOwnerVal[config.name] = ownership_type;
|
|
|
|
|
|
|
|
} else if (config.name === kioskConfigs["serverIp"]) {
|
|
|
|
|
|
|
|
serverIp[config.name] = config.value;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, function (data) {
|
|
|
|
},
|
|
|
|
|
|
|
|
function(data) {
|
|
|
|
console.log(data);
|
|
|
|
console.log(data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -129,27 +156,57 @@ function generateKIOSKQRCode(qrCodeClass) {
|
|
|
|
|
|
|
|
|
|
|
|
var accessToken = {};
|
|
|
|
var accessToken = {};
|
|
|
|
accessToken[kioskConfigs["accessToken"]] = tokenPair["accessToken"];
|
|
|
|
accessToken[kioskConfigs["accessToken"]] = tokenPair["accessToken"];
|
|
|
|
payload[kioskConfigs["androidExtra"]] = accessToken;
|
|
|
|
var sumExtra = $.extend(accessToken, defaultOwnerVal, serverIp);
|
|
|
|
|
|
|
|
payload[kioskConfigs["androidExtra"]] = sumExtra;
|
|
|
|
|
|
|
|
$(".kiosk-enrollment-qr-container").empty();
|
|
|
|
if (isKioskConfigured) {
|
|
|
|
if (isKioskConfigured) {
|
|
|
|
$(qrCodeClass).qrcode({
|
|
|
|
$(qrCodeClass).qrcode({
|
|
|
|
text: JSON.stringify(payload),
|
|
|
|
text: JSON.stringify(payload),
|
|
|
|
width: 300,
|
|
|
|
width: 350,
|
|
|
|
height: 300
|
|
|
|
height: 350
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$("#kiosk_heading").hide();
|
|
|
|
$("#android-configurations-alert").fadeToggle(500);
|
|
|
|
$("#kiosk_content").hide();
|
|
|
|
$("#kiosk_content").hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function displayAgentDownloadQR() {
|
|
|
|
|
|
|
|
$(".enrollment-qr-container").empty();
|
|
|
|
|
|
|
|
generateQRCode(".enrollment-qr-container");
|
|
|
|
|
|
|
|
$("#download-agent-qr").fadeToggle(1000);
|
|
|
|
|
|
|
|
$("#enroll-agent-qr").fadeOut(1000);
|
|
|
|
|
|
|
|
$("#android-enroll-manually-instructions").fadeOut(1000);
|
|
|
|
|
|
|
|
$('html,body').animate({
|
|
|
|
|
|
|
|
scrollTop: $('#download-agent-qr').position().top
|
|
|
|
|
|
|
|
}, 800);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function displayEnrollmentQR() {
|
|
|
|
|
|
|
|
$("#download-agent-qr").fadeOut(1000);
|
|
|
|
|
|
|
|
$("#enroll-agent-qr").fadeToggle(1000);
|
|
|
|
|
|
|
|
$("#android-enroll-manually-instructions").fadeOut(1000);
|
|
|
|
|
|
|
|
$('html,body').animate({
|
|
|
|
|
|
|
|
scrollTop: $('#enroll-agent-qr').position().top
|
|
|
|
|
|
|
|
}, 800);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function manualEnrollmentGuide() {
|
|
|
|
|
|
|
|
$("#enroll-agent-qr").fadeOut(1000);
|
|
|
|
|
|
|
|
$("#download-agent-qr").fadeOut(1000);
|
|
|
|
|
|
|
|
$("#android-enroll-manually-instructions").fadeToggle(1000);
|
|
|
|
|
|
|
|
$('html,body').animate({
|
|
|
|
|
|
|
|
scrollTop: $('#android-enroll-manually-instructions').position().top
|
|
|
|
|
|
|
|
}, 800);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function toggleEnrollment() {
|
|
|
|
function toggleEnrollment() {
|
|
|
|
$(".modal-content").html($("#qr-code-modal").html());
|
|
|
|
$(".modal-content").html($("#qr-code-modal").html());
|
|
|
|
generateQRCode(".modal-content .qr-code");
|
|
|
|
generateQRCode(".modal-content .qr-code");
|
|
|
|
modalDialog.show();
|
|
|
|
modalDialog.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var updateNotificationCountOnSuccess = function (data, textStatus, jqXHR) {
|
|
|
|
var updateNotificationCountOnSuccess = function(data, textStatus, jqXHR) {
|
|
|
|
var notificationBubble = "#notification-bubble";
|
|
|
|
var notificationBubble = "#notification-bubble";
|
|
|
|
if (jqXHR.status == 200 && data) {
|
|
|
|
if (jqXHR.status == 200 && data) {
|
|
|
|
var responsePayload = JSON.parse(data);
|
|
|
|
var responsePayload = JSON.parse(data);
|
|
|
@ -187,12 +244,12 @@ function loadNewNotifications() {
|
|
|
|
var notifications = $("#notifications");
|
|
|
|
var notifications = $("#notifications");
|
|
|
|
var currentUser = notifications.data("currentUser");
|
|
|
|
var currentUser = notifications.data("currentUser");
|
|
|
|
|
|
|
|
|
|
|
|
$.template("notification-listing", notifications.attr("src"), function (template) {
|
|
|
|
$.template("notification-listing", notifications.attr("src"), function(template) {
|
|
|
|
var serviceURL = backendEndBasePath + "/notifications?offset=0&limit=5&status=NEW";
|
|
|
|
var serviceURL = backendEndBasePath + "/notifications?offset=0&limit=5&status=NEW";
|
|
|
|
invokerUtil.get(
|
|
|
|
invokerUtil.get(
|
|
|
|
serviceURL,
|
|
|
|
serviceURL,
|
|
|
|
// on success
|
|
|
|
// on success
|
|
|
|
function (data, textStatus, jqXHR) {
|
|
|
|
function(data, textStatus, jqXHR) {
|
|
|
|
if (jqXHR.status == 200 && data) {
|
|
|
|
if (jqXHR.status == 200 && data) {
|
|
|
|
var viewModel = {};
|
|
|
|
var viewModel = {};
|
|
|
|
var responsePayload = JSON.parse(data);
|
|
|
|
var responsePayload = JSON.parse(data);
|
|
|
@ -214,7 +271,7 @@ function loadNewNotifications() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// on error
|
|
|
|
// on error
|
|
|
|
function (jqXHR) {
|
|
|
|
function(jqXHR) {
|
|
|
|
if (jqXHR.status = 500) {
|
|
|
|
if (jqXHR.status = 500) {
|
|
|
|
$(messageSideBar).html("<h4 class ='message-danger'>Unexpected error occurred while trying " +
|
|
|
|
$(messageSideBar).html("<h4 class ='message-danger'>Unexpected error occurred while trying " +
|
|
|
|
"to retrieve any new notifications.</h4>");
|
|
|
|
"to retrieve any new notifications.</h4>");
|
|
|
@ -230,7 +287,7 @@ function loadNewNotifications() {
|
|
|
|
* notification listing sidebar.
|
|
|
|
* notification listing sidebar.
|
|
|
|
* @return {Null}
|
|
|
|
* @return {Null}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$.sidebar_toggle = function (action, target, container) {
|
|
|
|
$.sidebar_toggle = function(action, target, container) {
|
|
|
|
var elem = '[data-toggle=sidebar]',
|
|
|
|
var elem = '[data-toggle=sidebar]',
|
|
|
|
button,
|
|
|
|
button,
|
|
|
|
containerOffsetLeft,
|
|
|
|
containerOffsetLeft,
|
|
|
@ -244,7 +301,7 @@ $.sidebar_toggle = function (action, target, container) {
|
|
|
|
buttonParent;
|
|
|
|
buttonParent;
|
|
|
|
|
|
|
|
|
|
|
|
var sidebar_window = {
|
|
|
|
var sidebar_window = {
|
|
|
|
update: function (target, container, button) {
|
|
|
|
update: function(target, container, button) {
|
|
|
|
containerOffsetLeft = $(container).data('offset-left') ? $(container).data('offset-left') : 0;
|
|
|
|
containerOffsetLeft = $(container).data('offset-left') ? $(container).data('offset-left') : 0;
|
|
|
|
containerOffsetRight = $(container).data('offset-right') ? $(container).data('offset-right') : 0;
|
|
|
|
containerOffsetRight = $(container).data('offset-right') ? $(container).data('offset-right') : 0;
|
|
|
|
targetOffsetLeft = $(target).data('offset-left') ? $(target).data('offset-left') : 0;
|
|
|
|
targetOffsetLeft = $(target).data('offset-left') ? $(target).data('offset-left') : 0;
|
|
|
@ -259,7 +316,7 @@ $.sidebar_toggle = function (action, target, container) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
show: function () {
|
|
|
|
show: function() {
|
|
|
|
if ($(target).data('sidebar-fixed') == true) {
|
|
|
|
if ($(target).data('sidebar-fixed') == true) {
|
|
|
|
$(target).height($(window).height() - $(target).data('fixed-offset'));
|
|
|
|
$(target).height($(window).height() - $(target).data('fixed-offset'));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -303,7 +360,7 @@ $.sidebar_toggle = function (action, target, container) {
|
|
|
|
$(target).trigger('shown.sidebar');
|
|
|
|
$(target).trigger('shown.sidebar');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
hide: function () {
|
|
|
|
hide: function() {
|
|
|
|
$(target).trigger('hide.sidebar');
|
|
|
|
$(target).trigger('hide.sidebar');
|
|
|
|
$(target).removeClass('toggled');
|
|
|
|
$(target).removeClass('toggled');
|
|
|
|
if (button !== undefined) {
|
|
|
|
if (button !== undefined) {
|
|
|
@ -350,7 +407,7 @@ $.sidebar_toggle = function (action, target, container) {
|
|
|
|
// binding click function
|
|
|
|
// binding click function
|
|
|
|
var body = 'body';
|
|
|
|
var body = 'body';
|
|
|
|
$(body).off('click', elem);
|
|
|
|
$(body).off('click', elem);
|
|
|
|
$(body).on('click', elem, function (e) {
|
|
|
|
$(body).on('click', elem, function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
button = $(this);
|
|
|
|
button = $(this);
|
|
|
|
container = button.data('container');
|
|
|
|
container = button.data('container');
|
|
|
@ -368,41 +425,41 @@ $.sidebar_toggle = function (action, target, container) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$.fn.collapse_nav_sub = function () {
|
|
|
|
$.fn.collapse_nav_sub = function() {
|
|
|
|
var navSelector = 'ul.nav';
|
|
|
|
var navSelector = 'ul.nav';
|
|
|
|
|
|
|
|
|
|
|
|
if (!$(navSelector).hasClass('collapse-nav-sub')) {
|
|
|
|
if (!$(navSelector).hasClass('collapse-nav-sub')) {
|
|
|
|
$(navSelector + ' > li', this).each(function () {
|
|
|
|
$(navSelector + ' > li', this).each(function() {
|
|
|
|
var position = $(this).offset().left - $(this).parent().scrollLeft();
|
|
|
|
var position = $(this).offset().left - $(this).parent().scrollLeft();
|
|
|
|
$(this).attr('data-absolute-position', (position + 5));
|
|
|
|
$(this).attr('data-absolute-position', (position + 5));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(navSelector + ' li', this).each(function () {
|
|
|
|
$(navSelector + ' li', this).each(function() {
|
|
|
|
if ($('ul', this).length !== 0) {
|
|
|
|
if ($('ul', this).length !== 0) {
|
|
|
|
$(this).addClass('has-sub');
|
|
|
|
$(this).addClass('has-sub');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(navSelector + ' > li', this).each(function () {
|
|
|
|
$(navSelector + ' > li', this).each(function() {
|
|
|
|
$(this).css({
|
|
|
|
$(this).css({
|
|
|
|
'left': $(this).data('absolute-position'),
|
|
|
|
'left': $(this).data('absolute-position'),
|
|
|
|
'position': 'absolute'
|
|
|
|
'position': 'absolute'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(navSelector + ' li.has-sub', this).on('click', function () {
|
|
|
|
$(navSelector + ' li.has-sub', this).on('click', function() {
|
|
|
|
var elem = $(this);
|
|
|
|
var elem = $(this);
|
|
|
|
if (elem.attr('aria-expanded') !== 'true') {
|
|
|
|
if (elem.attr('aria-expanded') !== 'true') {
|
|
|
|
elem.siblings().fadeOut(100, function () {
|
|
|
|
elem.siblings().fadeOut(100, function() {
|
|
|
|
elem.animate({'left': '15'}, 200, function () {
|
|
|
|
elem.animate({ 'left': '15' }, 200, function() {
|
|
|
|
$(elem).first().children('ul').fadeIn(200);
|
|
|
|
$(elem).first().children('ul').fadeIn(200);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
elem.siblings().attr('aria-expanded', 'false');
|
|
|
|
elem.siblings().attr('aria-expanded', 'false');
|
|
|
|
elem.attr('aria-expanded', 'true');
|
|
|
|
elem.attr('aria-expanded', 'true');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(elem).first().children('ul').fadeOut(100, function () {
|
|
|
|
$(elem).first().children('ul').fadeOut(100, function() {
|
|
|
|
elem.animate({'left': $(elem).data('absolute-position')}, 200, function () {
|
|
|
|
elem.animate({ 'left': $(elem).data('absolute-position') }, 200, function() {
|
|
|
|
elem.siblings().fadeIn(100);
|
|
|
|
elem.siblings().fadeIn(100);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -411,27 +468,24 @@ $.fn.collapse_nav_sub = function () {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(navSelector + ' > li.has-sub ul', this).on('click', function (e) {
|
|
|
|
$(navSelector + ' > li.has-sub ul', this).on('click', function(e) {
|
|
|
|
e.stopPropagation();
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$(navSelector).addClass('collapse-nav-sub');
|
|
|
|
$(navSelector).addClass('collapse-nav-sub');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(document).ready(function() {
|
|
|
|
$.sidebar_toggle();
|
|
|
|
$.sidebar_toggle();
|
|
|
|
|
|
|
|
|
|
|
|
generateQRCode(".enrollment-qr-container");
|
|
|
|
|
|
|
|
generateKIOSKQRCode(".kiosk-enrollment-qr-container");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof $.fn.collapse == 'function') {
|
|
|
|
if (typeof $.fn.collapse == 'function') {
|
|
|
|
$('.navbar-collapse.tiles').on('shown.bs.collapse', function () {
|
|
|
|
$('.navbar-collapse.tiles').on('shown.bs.collapse', function() {
|
|
|
|
$(this).collapse_nav_sub();
|
|
|
|
$(this).collapse_nav_sub();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
loadNewNotificationsOnSideViewPanel();
|
|
|
|
loadNewNotificationsOnSideViewPanel();
|
|
|
|
$("#right-sidebar").on("click", ".new-notification", function () {
|
|
|
|
$("#right-sidebar").on("click", ".new-notification", function() {
|
|
|
|
var notificationId = $(this).data("id");
|
|
|
|
var notificationId = $(this).data("id");
|
|
|
|
var redirectUrl = $(this).data("url");
|
|
|
|
var redirectUrl = $(this).data("url");
|
|
|
|
var markAsReadNotificationsEpr = backendEndBasePath + "/notifications/" + notificationId + "/mark-checked";
|
|
|
|
var markAsReadNotificationsEpr = backendEndBasePath + "/notifications/" + notificationId + "/mark-checked";
|
|
|
@ -441,14 +495,14 @@ $(document).ready(function () {
|
|
|
|
markAsReadNotificationsEpr,
|
|
|
|
markAsReadNotificationsEpr,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
// on success
|
|
|
|
// on success
|
|
|
|
function (data) {
|
|
|
|
function(data) {
|
|
|
|
data = JSON.parse(data);
|
|
|
|
data = JSON.parse(data);
|
|
|
|
if (data.statusCode == responseCodes["ACCEPTED"]) {
|
|
|
|
if (data.statusCode == responseCodes["ACCEPTED"]) {
|
|
|
|
location.href = redirectUrl;
|
|
|
|
location.href = redirectUrl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// on error
|
|
|
|
// on error
|
|
|
|
function () {
|
|
|
|
function() {
|
|
|
|
var content = "<li class='message message-danger'><h4><i class='icon fw fw-error'></i>Warning</h4>" +
|
|
|
|
var content = "<li class='message message-danger'><h4><i class='icon fw fw-error'></i>Warning</h4>" +
|
|
|
|
"<p>Unexpected error occurred while loading notification. Please refresh the pa{{#if isCloud}}ge and" +
|
|
|
|
"<p>Unexpected error occurred while loading notification. Please refresh the pa{{#if isCloud}}ge and" +
|
|
|
|
" try again</p></li>";
|
|
|
|
" try again</p></li>";
|
|
|
|