2016-06-27 01:45:38 +02:00
|
|
|
|
function makeAjaxCall(pType, pUrl, pSuccess, pData, pComplete) {
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: pType,
|
|
|
|
|
|
url: pUrl,
|
|
|
|
|
|
data: pData,
|
|
|
|
|
|
success: pSuccess,
|
|
|
|
|
|
error: showAjaxError,
|
|
|
|
|
|
complete: pComplete
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-06-29 16:35:19 +02:00
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
function removeElementFromArray(pArray, pKey) {
|
2018-06-29 16:35:19 +02:00
|
|
|
|
var newArray = {};
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2018-06-29 16:35:19 +02:00
|
|
|
|
for(var key in pArray) {
|
|
|
|
|
|
var keyAsNumber = Number(key);
|
2017-02-01 13:53:59 +01:00
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
if(keyAsNumber !== pKey) {
|
|
|
|
|
|
newArray[keyAsNumber] = pArray[keyAsNumber];
|
2017-02-01 13:53:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
return newArray;
|
2018-01-29 12:57:10 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
function toggleLabel(inputId) {
|
2018-06-29 16:35:19 +02:00
|
|
|
|
var label = $('label[for="' + inputId + '"]');
|
2018-04-18 14:33:21 +02:00
|
|
|
|
var topValue;
|
2018-01-29 12:57:10 +01:00
|
|
|
|
|
2018-06-22 20:25:13 +02:00
|
|
|
|
if($('#' + inputId).is(":focus")) {
|
2018-04-18 14:33:21 +02:00
|
|
|
|
$(label).animate({ top: "-6px" }, 100);
|
|
|
|
|
|
return;
|
2018-01-29 12:57:10 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
topValue = "12px";
|
2018-01-29 12:57:10 +01:00
|
|
|
|
|
2018-06-22 20:25:13 +02:00
|
|
|
|
if($('#' + inputId).val()) {
|
2018-04-18 14:33:21 +02:00
|
|
|
|
topValue = "-6px";
|
|
|
|
|
|
}
|
2018-01-29 12:57:10 +01:00
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
$(label).animate({ top: topValue }, 75);
|
2018-03-12 12:07:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
function adjustLabel(inputId) {
|
2018-06-29 16:35:19 +02:00
|
|
|
|
var label = $('label[for="' + inputId + '"]');
|
2018-04-18 14:33:21 +02:00
|
|
|
|
var topValue;
|
2018-03-12 12:07:53 +01:00
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
topValue = "12px";
|
2018-03-12 12:07:53 +01:00
|
|
|
|
|
2018-06-22 20:25:13 +02:00
|
|
|
|
if($('#' + inputId).val()) {
|
2018-04-18 14:33:21 +02:00
|
|
|
|
topValue = "-6px";
|
2018-03-12 12:07:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-04-18 14:33:21 +02:00
|
|
|
|
$(label).animate({ top: topValue }, 75);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function isInEditingMode() {
|
|
|
|
|
|
return $("#isInEditModeIndicator").val() == "true";
|
2018-05-22 17:19:56 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function isElementInArray(array, element) {
|
|
|
|
|
|
try {
|
2018-06-29 16:35:19 +02:00
|
|
|
|
|
|
|
|
|
|
var contains = false;
|
|
|
|
|
|
array.forEach(function (e, index) {
|
|
|
|
|
|
if (e === element) {
|
|
|
|
|
|
contains = true;
|
2018-05-22 17:19:56 +02:00
|
|
|
|
}
|
2018-06-29 16:35:19 +02:00
|
|
|
|
});
|
2018-05-22 17:19:56 +02:00
|
|
|
|
|
2018-06-29 16:35:19 +02:00
|
|
|
|
return contains;
|
|
|
|
|
|
} catch (error) {
|
2018-05-22 17:19:56 +02:00
|
|
|
|
console.log(error.message);
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2018-06-22 20:25:13 +02:00
|
|
|
|
}
|
2018-06-29 16:35:19 +02:00
|
|
|
|
|
2018-11-24 14:28:46 -04:00
|
|
|
|
function hideElement(element) {
|
|
|
|
|
|
element.css("display", "none");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function showElement(element) {
|
|
|
|
|
|
element.css("display", "block");
|
|
|
|
|
|
}
|