|
|
|
@ -102,11 +102,6 @@ function getDevicesByTypes(deviceList) {
|
|
|
|
|
return deviceTypes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//function unloadOperationBar() {
|
|
|
|
|
// $("#showOperationsBtn").addClass("hidden");
|
|
|
|
|
// $(".wr-operations").html("");
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
function loadOperationBar(deviceType, ownership, mode) {
|
|
|
|
|
var operationBar = $("#operations-bar");
|
|
|
|
|
var operationBarSrc = operationBar.attr("src");
|
|
|
|
@ -190,21 +185,20 @@ function loadOperationBar(deviceType, ownership, mode) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function runOperation(operationName) {
|
|
|
|
|
var deviceIdList = getSelectedDeviceIds();
|
|
|
|
|
var list = getDevicesByTypes(deviceIdList);
|
|
|
|
|
|
|
|
|
|
var successCallback = function (data) {
|
|
|
|
|
if (operationName == "NOTIFICATION") {
|
|
|
|
|
$(modalPopupContent).html($("#messageSuccess").html());
|
|
|
|
|
} else {
|
|
|
|
|
$(modalPopupContent).html($("#operationSuccess").html());
|
|
|
|
|
var messageTitle = $("#messageTitle").val();
|
|
|
|
|
var messageText = $("#messageText").val();
|
|
|
|
|
if (!messageTitle || !messageText) {
|
|
|
|
|
var errorMsg = "#notification-error-msg span";
|
|
|
|
|
var errorMsgWrapper = "#notification-error-msg";
|
|
|
|
|
$(errorMsg).text("Either the message title / message text or both are empty.");
|
|
|
|
|
$(errorMsgWrapper).removeClass("hidden");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
showPopup();
|
|
|
|
|
};
|
|
|
|
|
var errorCallback = function (data) {
|
|
|
|
|
$(modalPopupContent).html($("#errorOperationUnexpected").html());
|
|
|
|
|
showPopup();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var deviceIdList = getSelectedDeviceIds();
|
|
|
|
|
var list = getDevicesByTypes(deviceIdList);
|
|
|
|
|
|
|
|
|
|
var payload, serviceEndPoint;
|
|
|
|
|
if (list[platformTypeConstants.IOS]) {
|
|
|
|
@ -220,24 +214,19 @@ function runOperation(operationName) {
|
|
|
|
|
list[platformTypeConstants.WINDOWS]);
|
|
|
|
|
serviceEndPoint = operationModule.getWindowsServiceEndpoint(operationName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var successCallback = function () {
|
|
|
|
|
if (operationName == "NOTIFICATION") {
|
|
|
|
|
var errorMsgWrapper = "#notification-error-msg";
|
|
|
|
|
var errorMsg = "#notification-error-msg span";
|
|
|
|
|
var messageTitle = $("#messageTitle").val();
|
|
|
|
|
var messageText = $("#messageText").val();
|
|
|
|
|
if (!(messageTitle && messageText)) {
|
|
|
|
|
$(errorMsg).text("Enter a message. It cannot be empty.");
|
|
|
|
|
$(errorMsgWrapper).removeClass("hidden");
|
|
|
|
|
$(modalPopupContent).html($("#messageSuccess").html());
|
|
|
|
|
} else {
|
|
|
|
|
invokerUtil.post(serviceEndPoint, payload, successCallback, errorCallback);
|
|
|
|
|
$(modalPopupContent).removeData();
|
|
|
|
|
hidePopup();
|
|
|
|
|
$(modalPopupContent).html($("#operationSuccess").html());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
};
|
|
|
|
|
var errorCallback = function () {
|
|
|
|
|
$(modalPopupContent).html($("#errorOperationUnexpected").html());
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
invokerUtil.post(serviceEndPoint, payload, successCallback, errorCallback);
|
|
|
|
|
$(modalPopupContent).removeData();
|
|
|
|
|
hidePopup();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|