');
@@ -94,36 +94,36 @@ migor.pageLocationEntries = new function () {
table.dataTable({
"bServerSide": true,
- "fnServerData": function(aSource, aoData, successCallback) {
- migor.rest.request(self.options.funcGetEntries, {}, function(data, totalRecords) {
+ "fnServerData": function (aSource, aoData, successCallback) {
+ migor.rest.request(self.options.funcGetEntries, {}, function (data, totalRecords) {
successCallback({aaData: data.locationMarks});
self.setLocationMarkers(data);
}, null, true);
},
- "aaData":data.locationMarks,
+ "aaData": data.locationMarks,
"bProcessing": false,
"bPaginate": false,
"bSort": false,
"bFilter": true,
"bJQueryUI": true,
"aLengthMenu": migor.configuration.dataTable.aLengthMenu,
- "iDisplayLength" : migor.configuration.dataTable.iDisplayLength,
+ "iDisplayLength": migor.configuration.dataTable.iDisplayLength,
"bDestroy": true,
"oLanguage": migor.configuration.dataTable.oLanguage,
"aoColumns": [
- { "mData": "locationMarkType", sTitle: "Type", sClass:"center", "bSortable": false, "bVisible": true, "sWidth": '50px',
- "mRender": function ( tableData, type, full ) {
+ { "mData": "locationMarkType", sTitle: "Type", sClass: "center", "bSortable": false, "bVisible": true, "sWidth": '50px',
+ "mRender": function (tableData, type, full) {
return migor.utils.escapeHtml(tableData);
}
},
- { "mData": "name", sTitle: "Name", sClass:"right", "bSortable": false, "bVisible": true,
- "mRender": function ( tableData, type, full ) {
+ { "mData": "name", sTitle: "Name", sClass: "right", "bSortable": false, "bVisible": true,
+ "mRender": function (tableData, type, full) {
return migor.utils.escapeHtml(tableData);
}
},
- { "mData": "lastModifiedAt", sTitle: "Modified At", sClass:"center", "bSortable": false, "bVisible": true, "sWidth": '250px',
- "mRender": function ( tableData, type, full ) {
+ { "mData": "lastModifiedAt", sTitle: "Modified At", sClass: "center", "bSortable": false, "bVisible": true, "sWidth": '250px',
+ "mRender": function (tableData, type, full) {
return migor.utils.escapeHtml(tableData);
}
}
diff --git a/org.migor.webclient.admin/src/main/webapp/js/pages/page-nodeStatus.js b/org.migor.webclient.admin/src/main/webapp/js/pages/page-nodeStatus.js
index 7c6b8a3..a699b7c 100644
--- a/org.migor.webclient.admin/src/main/webapp/js/pages/page-nodeStatus.js
+++ b/org.migor.webclient.admin/src/main/webapp/js/pages/page-nodeStatus.js
@@ -6,8 +6,8 @@
migor.pageNodeStatus = new function () {
this.options = {
- "id":'nodeStatus',
- "closable":true,
+ "id": 'nodeStatus',
+ "closable": true,
"label": 'Status',
// function defined in the js client stub
@@ -30,7 +30,7 @@ migor.pageNodeStatus = new function () {
}
}
);
- refreshButton.on('click', function() {
+ refreshButton.on('click', function () {
self.refresh();
});
content.append(refreshButton);
@@ -44,7 +44,7 @@ migor.pageNodeStatus = new function () {
};
- this.displayDataTable = function(content, data) {
+ this.displayDataTable = function (content, data) {
var self = this;
table = $('');
@@ -52,8 +52,8 @@ migor.pageNodeStatus = new function () {
table.dataTable({
"bServerSide": true,
- "fnServerData": function(aSource, aoData, successCallback) {
- migor.rest.request(self.options.funcGetEntries, {}, function(data, totalRecords) {
+ "fnServerData": function (aSource, aoData, successCallback) {
+ migor.rest.request(self.options.funcGetEntries, {}, function (data, totalRecords) {
successCallback({aaData: data, iTotalDisplayRecords: totalRecords, iTotalRecords: totalRecords});
}, null, true);
},
@@ -63,22 +63,22 @@ migor.pageNodeStatus = new function () {
"bFilter": true,
"bJQueryUI": true,
"aLengthMenu": migor.configuration.dataTable.aLengthMenu,
- "iDisplayLength" : migor.configuration.dataTable.iDisplayLength,
+ "iDisplayLength": migor.configuration.dataTable.iDisplayLength,
"bDestroy": true,
"oLanguage": migor.configuration.dataTable.oLanguage,
"aoColumns": [
- { "mData": "id", sTitle: "Node", sClass:"right", "bSortable": false, "bVisible": true,
- "mRender": function ( tableData, type, full ) {
+ { "mData": "id", sTitle: "Node", sClass: "right", "bSortable": false, "bVisible": true,
+ "mRender": function (tableData, type, full) {
return migor.utils.escapeHtml(tableData);
}
},
- { "mData": "startedAt", sTitle: "Started At", sClass:"center", "bSortable": false, "bVisible": true, "sWidth": '250px',
- "mRender": function ( tableData, type, full ) {
+ { "mData": "startedAt", sTitle: "Started At", sClass: "center", "bSortable": false, "bVisible": true, "sWidth": '250px',
+ "mRender": function (tableData, type, full) {
return migor.utils.escapeHtml(tableData);
}
},
- { "mData": "lastModifiedAt", sTitle: "Last Modified At", sClass:"center", "bSortable": false, "bVisible": true, "sWidth": '250px',
- "mRender": function ( tableData, type, full ) {
+ { "mData": "lastModifiedAt", sTitle: "Last Modified At", sClass: "center", "bSortable": false, "bVisible": true, "sWidth": '250px',
+ "mRender": function (tableData, type, full) {
return migor.utils.escapeHtml(tableData);
}
}
diff --git a/org.migor.webclient.admin/src/main/webapp/js/rest.js b/org.migor.webclient.admin/src/main/webapp/js/rest.js
index 32185d4..cf2f800 100644
--- a/org.migor.webclient.admin/src/main/webapp/js/rest.js
+++ b/org.migor.webclient.admin/src/main/webapp/js/rest.js
@@ -1,4 +1,4 @@
-migor.rest = new function() {
+migor.rest = new function () {
/**
*
@@ -8,7 +8,7 @@ migor.rest = new function() {
* @param [validationCallback]
* @param [loader]
*/
- this.request = function(restFunc, params, successCallback, validationCallback, loader) {
+ this.request = function (restFunc, params, successCallback, validationCallback, loader) {
if (typeof(restFunc) === 'function') {
@@ -17,7 +17,7 @@ migor.rest = new function() {
}
- params["$callback"] = function(code, request, response) {
+ params["$callback"] = function (code, request, response) {
// var response = ;
if (loader) {
$.unblockUI();
@@ -42,7 +42,7 @@ migor.rest = new function() {
break;
}
} else {
- migor.dialog.openErrorDialog(code + ': ' +request.responseText);
+ migor.dialog.openErrorDialog(code + ': ' + request.responseText);
}
};
@@ -72,7 +72,7 @@ migor.rest = new function() {
* @param [invalidFieldsCallback]
* @param [loader]
*/
- this.postSubmitJSON = function(url, urlReplacements, formObject, callbackFunction, invalidFieldsCallback, loader) {
+ this.postSubmitJSON = function (url, urlReplacements, formObject, callbackFunction, invalidFieldsCallback, loader) {
var self = this;
// self.block();
@@ -81,10 +81,10 @@ migor.rest = new function() {
}
formObject.ajaxSubmit({
type: "POST",
- url: self.replaceInUrl(url,urlReplacements),
- dataType:'json',
- iframe:true,
- success: function(data) {
+ url: self.replaceInUrl(url, urlReplacements),
+ dataType: 'json',
+ iframe: true,
+ success: function (data) {
if (loader) {
$.unblockUI();
}
@@ -100,7 +100,7 @@ migor.rest = new function() {
callbackFunction(data);
}
},
- error: function() {
+ error: function () {
if (loader) {
$.unblockUI();
}
@@ -109,7 +109,7 @@ migor.rest = new function() {
});
};
- this.generateArgsFromAoData = function(aoData) {
+ this.generateArgsFromAoData = function (aoData) {
var columns = aoData[1].value;
@@ -118,12 +118,12 @@ migor.rest = new function() {
args["span"] = aoData[4].value;
- for (var i=5; i<5+columns; i++) {
- var propIndex = i-5;
+ for (var i = 5; i < 5 + columns; i++) {
+ var propIndex = i - 5;
var propName = aoData[i].value;
- var searchValue = aoData[7+columns+(propIndex*3)].value;
- if (aoData[7+columns+(propIndex*3)+2].value == true && searchValue != null && searchValue != '' && searchValue != '~') {
+ var searchValue = aoData[7 + columns + (propIndex * 3)].value;
+ if (aoData[7 + columns + (propIndex * 3) + 2].value == true && searchValue != null && searchValue != '' && searchValue != '~') {
if (searchValue.indexOf("~") >= 0) {
args[propName] = searchValue.split('~');
@@ -141,14 +141,14 @@ migor.rest = new function() {
* @param urlReplacements
* @returns {*}
*/
- this.replaceInUrl = function(url, urlReplacements) {
+ this.replaceInUrl = function (url, urlReplacements) {
var self = this;
if (urlReplacements == null)
return url;
for (var key in urlReplacements) {
//noinspection JSUnfilteredForInLoop
- var value= urlReplacements[key];
+ var value = urlReplacements[key];
if (value == null || value == "") {
//noinspection JSUnfilteredForInLoop
url = url.replace(key, " ");
@@ -168,31 +168,31 @@ migor.rest = new function() {
*
* @param value string to encode
*/
- this.urlEncodePathParameter = function(value) {
+ this.urlEncodePathParameter = function (value) {
// be on the safe side
if (value == null) {
return null;
}
- var _value =''+value;
+ var _value = '' + value;
var encodeMe = {
- "?":"%3F",
- "%":"%25",
+ "?": "%3F",
+ "%": "%25",
"/": "%2F"
};
- var result="";
- for ( var i = 0; i < _value.length; i++ ) {
+ var result = "";
+ for (var i = 0; i < _value.length; i++) {
result += encodeMe[_value.charAt(i)] == undefined ? _value.charAt(i) : encodeMe[_value.charAt(i)];
}
return result;
};
- this.block = function() {
- $.blockUI({ message: $('#block'), css: { position:'relative', top:'0px', left:'0px', width:'100%', height:'100%', 'vertical-align':'middle', background: 'none', color: '#fff'} });
+ this.block = function () {
+ $.blockUI({ message: $('#block'), css: { position: 'relative', top: '0px', left: '0px', width: '100%', height: '100%', 'vertical-align': 'middle', background: 'none', color: '#fff'} });
};
- this.unblock = function() {
+ this.unblock = function () {
$.unblockUI();
};
diff --git a/org.migor.webclient.admin/src/main/webapp/js/utils.js b/org.migor.webclient.admin/src/main/webapp/js/utils.js
index 5733bed..b8a1786 100644
--- a/org.migor.webclient.admin/src/main/webapp/js/utils.js
+++ b/org.migor.webclient.admin/src/main/webapp/js/utils.js
@@ -3,22 +3,22 @@
* daniel.scheidle@ucs.at
* Unique Computing Solutions GmbH
*/
-migor.utils = new function() {
+migor.utils = new function () {
- this.getCities = function(callback) {
+ this.getCities = function (callback) {
// TODO implement service where only id and name is returned!
migor.rest.request(CityAdminService.getCities, {}, callback);
};
- this.getCaches = function(callback) {
+ this.getCaches = function (callback) {
migor.rest.request(CacheAdminService.getCaches, {}, callback);
};
- this.escapeHtml = function(string, trimLength) {
+ this.escapeHtml = function (string, trimLength) {
if (string != null) {
if (trimLength > 0 && string.length > trimLength) {
- return $(''+string.substring(0,trimLength) + '...'+'
').html();
+ return $('' + string.substring(0, trimLength) + '...' + '
').html();
} else {
return $('').text(string).html();
}
@@ -27,7 +27,7 @@ migor.utils = new function() {
}
};
- this.replaceString = function(text, string, replaceString) {
+ this.replaceString = function (text, string, replaceString) {
if (text != null) {
return text.replace(string, replaceString);
} else {
@@ -54,7 +54,7 @@ migor.utils = new function() {
* @param ts timestamp
* @return String a human readable and sortable date representation of the timestamp
*/
- this.formatTimeStamp = function(ts, displayShort) {
+ this.formatTimeStamp = function (ts, displayShort) {
if (ts == null || ts <= 0) {
return "";
}
@@ -66,9 +66,9 @@ migor.utils = new function() {
var minute = dateObject.getMinutes();
var second = dateObject.getSeconds();
if (!displayShort) {
- return year + "-" + (month < 10 ? ("0"+month) : month)+ "-" + (day < 10 ? ("0"+day) : day) + " " + (hour < 10 ? ("0"+hour) : hour) + ":" + (minute < 10 ? ("0"+minute) : minute) + ":" + (second < 10 ? ("0"+second) : second);
+ return year + "-" + (month < 10 ? ("0" + month) : month) + "-" + (day < 10 ? ("0" + day) : day) + " " + (hour < 10 ? ("0" + hour) : hour) + ":" + (minute < 10 ? ("0" + minute) : minute) + ":" + (second < 10 ? ("0" + second) : second);
}
- return year + "-" + (month < 10 ? ("0"+month) : month)+ "-" + (day < 10 ? ("0"+day) : day) + " " + (hour < 10 ? ("0"+hour) : hour) + ":" + (minute < 10 ? ("0"+minute): minute);
+ return year + "-" + (month < 10 ? ("0" + month) : month) + "-" + (day < 10 ? ("0" + day) : day) + " " + (hour < 10 ? ("0" + hour) : hour) + ":" + (minute < 10 ? ("0" + minute) : minute);
};
diff --git a/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-components.js b/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-components.js
index e6343c9..741d681 100644
--- a/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-components.js
+++ b/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-components.js
@@ -12,7 +12,7 @@ $(function () {
label: '',
clickCallback: null
},
- _create: function(){
+ _create: function () {
var that = this;
// create button link
@@ -28,7 +28,7 @@ $(function () {
that.element.addClass("hpip-button");
that.element.append(link);
},
- clickAction: function(event) {
+ clickAction: function (event) {
var that = this;
if (typeof(that.options.clickCallback) === 'function') {
that.options.clickCallback.call(this);
diff --git a/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-form.js b/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-form.js
index 213ee6b..74f10a1 100644
--- a/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-form.js
+++ b/org.migor.webclient.admin/src/main/webapp/js/widgets/widget-form.js
@@ -1,19 +1,21 @@
$.widget("hpip.form", {
tabs: null,
- elements:[],
+ elements: [],
options: {
data: null,
- elementOptions: [{name:"test", label:"Test"}],
+ elementOptions: [
+ {name: "test", label: "Test"}
+ ],
errorClass: 'ui-state-error ui-corner-all'
},
- _create:function () {
+ _create: function () {
this._load();
},
- _setOptions: function() {
- this._superApply( arguments );
+ _setOptions: function () {
+ this._superApply(arguments);
this._load();
},
- _load: function() {
+ _load: function () {
var self = this;
@@ -23,7 +25,7 @@ $.widget("hpip.form", {
self.tabs = $('');
var tabsHeader = $('');
- $.each(self.options.elementOptions.tabs, function(index, item) {
+ $.each(self.options.elementOptions.tabs, function (index, item) {
self._createTabContent(item, tabsHeader, self.tabs, index);
});
@@ -36,15 +38,15 @@ $.widget("hpip.form", {
self.element.append(self.tabs);
},
- _createTabContent: function(item, tabsHeader, content, tabIndex) {
+ _createTabContent: function (item, tabsHeader, content, tabIndex) {
var self = this;
- tabsHeader.append(''+item.title+'');
+ tabsHeader.append('' + item.title + '');
- var tabContent = $('');
+ var tabContent = $('');
var message = $('');
tabContent.append(message);
- for (var i=0; i').append(self.options.label + ': ' + (self.options.mandatory?'*':''));
+ label = $('').append(self.options.label + ': ' + (self.options.mandatory ? '*' : ''));
} else {
label = $('');
}
@@ -168,39 +170,39 @@ $.widget("hpip.formElement", {
switch (self.options.type) {
case 'hidden':
- self.input = $('');
+ self.input = $('');
label = self.input;
self.element.hide();
break;
case 'textOnly':
- self.input = $(''+value+'');
+ self.input = $('' + value + '');
label.append(self.input);
break;
case 'button':
self.input = $('');
- self.input.button( {
+ self.input.button({
label: self.options.name
});
if (typeof(self.options.click) === 'function') {
- self.input.on('click', function() {
+ self.input.on('click', function () {
self.options.click(self.element, self.input, self.options);
});
}
label.append(self.input);
break;
case 'select':
- self.input = $('');
+ self.input = $('');
if (typeof(self.options.changeElement) === 'function') {
- self.input.change(function() {
+ self.input.change(function () {
self.options.changeElement(self.element, self.input, self.options);
});
}
label.append(self.input);
break;
case 'multiselect':
- self.input = $('');
+ self.input = $('');
if (typeof(self.options.changeElement) === 'function') {
- self.input.change(function() {
+ self.input.change(function () {
self.options.changeElement(self.element, self.input, self.options);
});
}
@@ -220,33 +222,33 @@ $.widget("hpip.formElement", {
case 'textarea':
if (self.options.idAttributeName != null) {
- self.input = $('');
+ self.input = $('');
} else {
- self.input = $('');
+ self.input = $('');
}
label.append(self.input);
break;
case 'iframe':
if (self.options.idAttributeName != null) {
- self.input = $('');
+ self.input = $('');
} else {
- self.input = $('');
+ self.input = $('');
}
label.append(self.input);
break;
case 'image':
- self.input = $('
');
+ self.input = $('
');
label.append(self.input);
break;
case 'password':
- self.input = $('');
+ self.input = $('');
break;
case 'checkbox':
- self.input = $('');
+ self.input = $('');
label.append(self.input);
break;
case 'file':
- self.input = $('');
+ self.input = $('');
label.append(self.input);
break;
case 'table':
@@ -255,25 +257,25 @@ $.widget("hpip.formElement", {
var tableMarkup = ""; //dodaj NULL pointer check
if (self.options.value != null) {
tableMarkup += "";
- $.each(Object.keys(self.options.value[0]), function( index, value ) {
- tableMarkup += "| "+value+" | "
+ $.each(Object.keys(self.options.value[0]), function (index, value) {
+ tableMarkup += "" + value + " | "
});
tableMarkup += "
";
for (var i = 0; i < self.options.value.length; i++) {
tableMarkup += "";
- $.each(self.options.value[i], function( key, value1 ) {
- tableMarkup += "| "+value1+" | "
+ $.each(self.options.value[i], function (key, value1) {
+ tableMarkup += "" + value1 + " | "
});
tableMarkup += "
";
}
- self.input = $('