Skip to content
Snippets Groups Projects
Commit 42085912 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

formatting

parent 6572b43c
No related branches found
No related tags found
1 merge request!93Resolve "export should use API"
......@@ -26,11 +26,11 @@ GuiConnector.yPos = 0;
* List of GET params passed via url.
*/
GuiConnector.init = function() {
GuiConnector.init = function () {
var self = this;
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(pattern) {
String.prototype.endsWith = function (pattern) {
var d = this.length - pattern.length;
return d >= 0 && this.lastIndexOf(pattern) === d;
};
......@@ -41,7 +41,7 @@ GuiConnector.init = function() {
alert("This webpage works well with Chrome, Firefox and Safari.");
}
// bootstrap tab initialization
$("ul.nav-tabs a").click(function(e) {
$("ul.nav-tabs a").click(function (e) {
e.preventDefault();
$(this).tab('show');
});
......@@ -49,16 +49,17 @@ GuiConnector.init = function() {
self.getParams = [];
// find GuiConnector.getParams
window.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function() {
window.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
function decode(s) {
return decodeURIComponent(s.split("+").join(" "));
}
GuiConnector.getParams[decode(arguments[1])] = decode(arguments[2]);
});
// forser browser to update mouse coordinates whenever mouse move
jQuery(document).ready(function() {
$(document).mousemove(function(e) {
jQuery(document).ready(function () {
$(document).mousemove(function (e) {
GuiConnector.updateMouseCoordinates(e.pageX, e.pageY);
});
});
......@@ -70,7 +71,7 @@ GuiConnector.init = function() {
self.addWindowResizeEvent(window.onresize);
}
window.onresize = function() {
window.onresize = function () {
for (var i = 0; i < self._windowResizeEvents.length; i++) {
self._windowResizeEvents[i]();
}
......@@ -78,18 +79,18 @@ GuiConnector.init = function() {
}
};
GuiConnector.addWindowResizeEvent = function(handler) {
GuiConnector.addWindowResizeEvent = function (handler) {
this._windowResizeEvents.push(handler);
};
/**
* Returns name of the file with LCSB logo.
*
*
* @param bigLogo
* {@link Boolean} value determining if we want to have big logo or
* small one
*/
GuiConnector.getLcsbLogoImg = function(bigLogo) {
GuiConnector.getLcsbLogoImg = function (bigLogo) {
if (bigLogo) {
return 'lcsb_logo_mid.png';
} else {
......@@ -101,26 +102,26 @@ GuiConnector.getLcsbLogoImg = function(bigLogo) {
* Returns name of the file with image that should be presented when we are
* wainting for data to be loaded.
*/
GuiConnector.getLoadingImg = function() {
GuiConnector.getLoadingImg = function () {
return "icons/ajax-loader.gif";
};
/**
* Returns home directory for images in the application.
*/
GuiConnector.getImgPrefix = function() {
GuiConnector.getImgPrefix = function () {
return "resources/images/";
};
/**
* Updates coordinates of the mouse in the browser.
*/
GuiConnector.updateMouseCoordinates = function(x, y) {
GuiConnector.updateMouseCoordinates = function (x, y) {
this.xPos = x;
this.yPos = y;
};
GuiConnector.showProcessing = function(messageText) {
GuiConnector.showProcessing = function (messageText) {
var self = GuiConnector;
if (self._processingDialog === undefined) {
self._processingDialog = document.createElement("div");
......@@ -128,11 +129,11 @@ GuiConnector.showProcessing = function(messageText) {
self._processingDialog.appendChild(self._errorDialogContent);
document.body.appendChild(self._processingDialog);
$(self._processingDialog).dialog({
modal : true,
title : "PROCESSING",
width : "150px",
closeOnEscape : false,
open : function(event, ui) {
modal: true,
title: "PROCESSING",
width: "150px",
closeOnEscape: false,
open: function (event, ui) {
$(".ui-dialog-titlebar-close", ui).hide();
},
});
......@@ -141,8 +142,8 @@ GuiConnector.showProcessing = function(messageText) {
messageText = "PROCESSING";
}
var messageImg = Functions.createElement({
type : "img",
src : 'resources/images/icons/ajax-loader.gif',
type: "img",
src: 'resources/images/icons/ajax-loader.gif',
});
self._errorDialogContent.innerHTML = "";
self._errorDialogContent.style.textAlign = "center";
......@@ -153,12 +154,12 @@ GuiConnector.showProcessing = function(messageText) {
$(self._processingDialog).dialog("open");
};
GuiConnector.hideProcessing = function() {
GuiConnector.hideProcessing = function () {
var self = GuiConnector;
$(self._processingDialog).dialog("close");
};
GuiConnector.alert = function(error) {
GuiConnector.alert = function (error) {
var self = GuiConnector;
logger.error(error);
if (self._errorDialog === undefined) {
......@@ -167,11 +168,11 @@ GuiConnector.alert = function(error) {
self._errorDialog.appendChild(self._errorDialogContent);
document.body.appendChild(self._errorDialog);
$(self._errorDialog).dialog({
classes : {
"ui-dialog" : "ui-state-error"
classes: {
"ui-dialog": "ui-state-error"
},
modal : true,
title : "ERROR"
modal: true,
title: "ERROR"
}).siblings('.ui-dialog-titlebar').css("background", "red");
}
var message = error;
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment