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

unused code removed

parent 96913c7c
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -174,25 +174,6 @@ GuiConnector.updateMouseCoordinates = function(x, y) {
this.yPos = y;
};
GuiConnector.referenceToHtml = function(reference) {
var result;
if (reference.summary !== undefined && reference.summary !== "") {
result = '<div title="' + reference.summary + '">';
result += '<a href="' + reference.link + '" target="_blank">' + reference.name + "</a>";
// + reference.name + "(" + reference.type + ")</a>";
result += "</div>";
return result;
} else {
result = '<div><a href="' + reference.link + '" target="_blank">' + reference.name + "</a></div>";
// + reference.name + "(" + reference.type + ")</a></div>";
return result;
}
};
GuiConnector.getObjectByPrimefaceId = function(id) {
return $(PrimeFaces.escapeClientId(id));
};
GuiConnector.alert = function(message) {
logger.error(message);
alert(message);
......
......@@ -6,104 +6,12 @@ var OriginalGuiConnector = require('../../main/js/GuiConnector');
var GuiConnectorMock = OriginalGuiConnector;
GuiConnectorMock.getImgPrefix = function() {
return "../resources/images/";
};
GuiConnectorMock.tabNaviShow = function(direction) {
GuiConnector.callListeners("onTabNaviShow: ", direction);
};
GuiConnectorMock.init = function() {
//list of available listener types
this.listeners = [];
this.getParams = [];
//add listener types
this.listeners.push("onTabNaviShow");
};
GuiConnectorMock.addListener = function(type, fun) {
if (GuiConnector.listeners.indexOf(type) < 0) {
throw new Error("Unknown listener type: " + type);
}
if (typeof fun !== "function") {
throw new Error("Second parameter must be a function but \"" + typeof (fun) + "\" found.");
}
var listenerList = this.listeners[type];
if (listenerList === null || listenerList === undefined) {
listenerList = [];
this.listeners[type] = listenerList;
}
listenerList.push(fun);
};
GuiConnectorMock.removeListener = function(type, fun) {
if (GuiConnector.listeners.indexOf(type) < 0) {
throw new Error("Unknown listener type: " + type);
}
if (typeof fun !== "function") {
throw new Error("Second parameter must be a function but \"" + typeof (fun) + "\" found.");
}
var listenerList = this.listeners[type];
if (listenerList !== undefined) {
var index = listenerList.indexOf(fun);
if (index > -1) {
listenerList.splice(index, 1);
}
}
};
GuiConnectorMock.callListeners = function(type) {
if (GuiConnector.listeners.indexOf(type) < 0) {
throw "Unknown listener type: " + type;
}
var listenerList = this.listeners[type];
if (listenerList !== undefined) {
logger.debug("GuiConnector is calling: " + type + ". " + listenerList.length + " listeners found.");
for ( var i in listenerList) {
var e = {
type : type,
object : this,
};
listenerList[i](e);
}
} else {
logger.debug("GuiConnector is calling: " + type + ". No listeners found.");
}
};
GuiConnectorMock.getObjectByPrimefaceId = function(id) {
var result = $('#' + id);
return result;
};
GuiConnectorMock.getLcsbLogoImg = function() {
return 'lcsb_logo.png';
};
GuiConnectorMock.getLoadingImg = function() {
return "icons/ajax-loader.gif";
};
GuiConnectorMock.referenceToHtml = function(reference) {
var result = "";
if (reference.summary !== null && reference.summary !== undefined && reference.summary !== "") {
result = '<div title="' + reference.summary + '">';
result += '<a href="' + reference.link + '" target="_blank">' + reference.name + "</a>";
// + reference.name + "(" + reference.type + ")</a>";
result += "</div>";
return result;
} else {
result = '<div><a href="' + reference.link + '" target="_blank">' + reference.name + "</a></div>";
// + reference.name + "(" + reference.type + ")</a></div>";
return result;
}
};
GuiConnectorMock.showRightClickMenu = function(x, y) {
......@@ -114,15 +22,6 @@ GuiConnectorMock.showSelectionMenu = function(x, y) {
logger.debug("showSelectionMenu:", x, y);
};
GuiConnectorMock.isRightMenuVisible = function() {
return this.contextMenuVisible;
};
GuiConnectorMock.updateMouseCoordinates = function(x, y) {
this.xPos = x;
this.yPos = y;
};
GuiConnectorMock.alert = function(message) {
logger.error(message);
throw new Error(message);
......
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