Commit 4dd90452 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

logoImg is obtained via API

parent 77e365d5
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
var ConfigurationType = { var ConfigurationType = {
DEFAULT_MAP : "DEFAULT_MAP", DEFAULT_MAP : "DEFAULT_MAP",
LOGO_IMG : "LOGO_IMG",
}; };
module.exports = ConfigurationType; module.exports = ConfigurationType;
...@@ -49,13 +49,6 @@ ServerConnector.lastActualization = 0; ...@@ -49,13 +49,6 @@ ServerConnector.lastActualization = 0;
ServerConnector._customMap = null; ServerConnector._customMap = null;
/**
* Get name of the file that should be used as logo.
*/
ServerConnector.getLogoImg = function() {
return document.getElementById('logoImg').value;
};
/** /**
* Get link to the website that should be accessed when clicking on * Get link to the website that should be accessed when clicking on
* {@link ServerConnector.getLogoImg}. * {@link ServerConnector.getLogoImg}.
...@@ -1041,6 +1034,10 @@ ServerConnector.getProjectId = function(projectId) { ...@@ -1041,6 +1034,10 @@ ServerConnector.getProjectId = function(projectId) {
} }
}; };
ServerConnector.getLogoImg = function() {
return this.getConfigurationParam(ConfigurationType.LOGO_IMG);
};
ServerConnector.getOverlayById = function(layoutId, projectId) { ServerConnector.getOverlayById = function(layoutId, projectId) {
var self = this; var self = this;
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
......
...@@ -106,11 +106,12 @@ CustomMap.prototype.createLogo = function() { ...@@ -106,11 +106,12 @@ CustomMap.prototype.createLogo = function() {
var logoControlDiv2 = document.createElement('DIV'); var logoControlDiv2 = document.createElement('DIV');
var logo2 = document.createElement('IMG'); var logo2 = document.createElement('IMG');
var url = ServerConnector.getLogoImg(); ServerConnector.getLogoImg().then(function(url){
if (!/^(f|ht)tps?:\/\//i.test(url)) { if (!/^(f|ht)tps?:\/\//i.test(url)) {
url = GuiConnector.getImgPrefix() + url; url = GuiConnector.getImgPrefix() + url;
} }
logo2.src = url; logo2.src = url;
});
logo2.style.cursor = 'pointer'; logo2.style.cursor = 'pointer';
logo2.style.width = "80px"; logo2.style.width = "80px";
logoControlDiv2.appendChild(logo2); logoControlDiv2.appendChild(logo2);
......
...@@ -84,10 +84,6 @@ ServerConnectorMock.callListeners = function(type, param) { ...@@ -84,10 +84,6 @@ ServerConnectorMock.callListeners = function(type, param) {
} }
}; };
ServerConnectorMock.getLogoImg = function() {
return "marker/empty.png";
};
ServerConnectorMock.getZoomLevel = function() { ServerConnectorMock.getZoomLevel = function() {
return this.zoomLevel; return this.zoomLevel;
}; };
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
<h:inputHidden id="selectedDrugPolygon" value="#{drugMB.polygon}"/> <h:inputHidden id="selectedDrugPolygon" value="#{drugMB.polygon}"/>
<input type="hidden" id="logoLink" value="#{configurationMB.logoLink}" readonly="true"/> <input type="hidden" id="logoLink" value="#{configurationMB.logoLink}" readonly="true"/>
<input type="hidden" id="logoImg" value="#{configurationMB.logoImg}" readonly="true"/>
<p:remoteCommand name="_actualizeParams" actionListener="#{mapMB.actualizeParams}"/> <p:remoteCommand name="_actualizeParams" actionListener="#{mapMB.actualizeParams}"/>
<h:inputHidden id="centerCoordinateX" value="#{mapMB.topModelMapData.centerCoordinateX}"/> <h:inputHidden id="centerCoordinateX" value="#{mapMB.topModelMapData.centerCoordinateX}"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment