Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
894a6342
Commit
894a6342
authored
Jan 05, 2017
by
Piotr Gawron
Browse files
logo link is obtained via API
parent
22f7ae61
Changes
7
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/ConfigurationType.js
View file @
894a6342
...
...
@@ -3,6 +3,7 @@
var
ConfigurationType
=
{
DEFAULT_MAP
:
"
DEFAULT_MAP
"
,
LOGO_IMG
:
"
LOGO_IMG
"
,
LOGO_LINK
:
"
LOGO_LINK
"
,
};
module
.
exports
=
ConfigurationType
;
frontend-js/src/main/js/ServerConnector.js
View file @
894a6342
...
...
@@ -49,14 +49,6 @@ ServerConnector.lastActualization = 0;
ServerConnector
.
_customMap
=
null
;
/**
* Get link to the website that should be accessed when clicking on
* {@link ServerConnector.getLogoImg}.
*/
ServerConnector
.
getLogoLink
=
function
()
{
return
document
.
getElementById
(
'
logoLink
'
).
value
;
};
/**
* Get zoom level of the {@link CustomMap} at which it was last browsed.
*/
...
...
@@ -915,7 +907,7 @@ ServerConnector.getConfigurationParam = function(paramId) {
return
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
paramId
===
undefined
)
{
reject
(
"
Invalid param identifier
"
);
}
else
if
(
self
.
_configurationParam
[
paramId
]
!==
undefined
)
{
}
else
if
(
self
.
_configurationParam
[
paramId
]
!==
undefined
)
{
resolve
(
self
.
_configurationParam
[
paramId
]);
}
else
{
return
self
.
getToken
().
then
(
function
(
token
)
{
...
...
@@ -1038,6 +1030,10 @@ ServerConnector.getLogoImg = function() {
return
this
.
getConfigurationParam
(
ConfigurationType
.
LOGO_IMG
);
};
ServerConnector
.
getLogoLink
=
function
()
{
return
this
.
getConfigurationParam
(
ConfigurationType
.
LOGO_LINK
);
};
ServerConnector
.
getOverlayById
=
function
(
layoutId
,
projectId
)
{
var
self
=
this
;
return
new
Promise
(
function
(
resolve
,
reject
)
{
...
...
frontend-js/src/main/js/map/ControlType.js
View file @
894a6342
...
...
@@ -2,6 +2,8 @@
var
ControlType
=
{
COMMENT_CHECKBOX
:
"
COMMENT_CHECKBOX
"
,
LOGO_IMG
:
"
LOGO_IMG
"
,
LOGO_2_IMG
:
"
LOGO_2_IMG
"
,
};
module
.
exports
=
ControlType
;
frontend-js/src/main/js/map/CustomMap.js
View file @
894a6342
...
...
@@ -103,7 +103,6 @@ CustomMap.prototype.createSubmaps = function() {
};
CustomMap
.
prototype
.
createLogo
=
function
()
{
var
logoControlDiv2
=
document
.
createElement
(
'
DIV
'
);
var
logo2
=
document
.
createElement
(
'
IMG
'
);
ServerConnector
.
getLogoImg
().
then
(
function
(
url
){
...
...
@@ -114,10 +113,15 @@ CustomMap.prototype.createLogo = function() {
});
logo2
.
style
.
cursor
=
'
pointer
'
;
logo2
.
style
.
width
=
"
80px
"
;
logo2
.
id
=
ControlType
.
LOGO_2_IMG
;
this
.
addControl
(
logo2
);
logoControlDiv2
.
appendChild
(
logo2
);
google
.
maps
.
event
.
addDomListener
(
logo2
,
'
click
'
,
function
()
{
var
win
=
window
.
open
(
ServerConnector
.
getLogoLink
(),
'
_blank
'
);
win
.
focus
();
return
ServerConnector
.
getLogoLink
().
then
(
function
(
url
){
var
win
=
window
.
open
(
url
,
'
_blank
'
);
win
.
focus
();
}).
catch
(
GuiConnector
.
alert
);
});
logoControlDiv2
.
index
=
0
;
// used for ordering
this
.
getGoogleMap
().
controls
[
google
.
maps
.
ControlPosition
.
LEFT_BOTTOM
].
push
(
logoControlDiv2
);
...
...
@@ -128,6 +132,9 @@ CustomMap.prototype.createLogo = function() {
var
logo
=
document
.
createElement
(
'
IMG
'
);
logo
.
src
=
GuiConnector
.
getImgPrefix
()
+
GuiConnector
.
getLcsbLogoImg
(
this
.
bigButtons
);
logo
.
style
.
cursor
=
'
pointer
'
;
logo
.
id
=
ControlType
.
LOGO_IMG
;
this
.
addControl
(
logo
);
logoControlDiv
.
appendChild
(
logo
);
google
.
maps
.
event
.
addDomListener
(
logo
,
'
click
'
,
function
()
{
var
win
=
window
.
open
(
'
http://wwwen.uni.lu/lcsb/
'
,
'
_blank
'
);
...
...
frontend-js/src/test/js/google-map-mock.js
View file @
894a6342
...
...
@@ -11,7 +11,8 @@ var google = {
fun
:
fun
});
},
addDomListener
:
function
()
{
addDomListener
:
function
(
object
,
type
,
fun
)
{
object
.
addEventListener
(
type
,
fun
);
},
trigger
:
function
(
object
,
type
,
param
)
{
for
(
var
i
=
0
;
i
<
google
.
maps
.
event
.
_data
.
length
;
i
++
)
{
...
...
frontend-js/src/test/js/map/CustomMap-test.js
View file @
894a6342
...
...
@@ -623,7 +623,7 @@ describe('CustomMap', function() {
assert
.
ok
(
details
[
0
][
0
]
instanceof
Comment
);
});
});
it
(
"
getOverlayDataForIdentifiedElement
"
,
function
()
{
var
map
=
helper
.
createCustomMap
();
var
commentOverlay
=
helper
.
createCommentDbOverlay
(
map
);
...
...
@@ -637,9 +637,8 @@ describe('CustomMap', function() {
return
map
.
getOverlayDataForIdentifiedElement
(
ie
,
{
comment
:
true
}).
then
(
function
(
details
)
{
logger
.
debug
(
details
);
assert
.
equal
(
details
.
length
,
1
);
assert
.
equal
(
details
.
length
,
1
);
var
overlayData
=
details
[
0
];
assert
.
equal
(
overlayData
.
overlay
,
commentOverlay
);
assert
.
ok
(
overlayData
.
data
);
...
...
@@ -647,7 +646,5 @@ describe('CustomMap', function() {
assert
.
ok
(
overlayData
.
data
[
0
]
instanceof
Comment
);
});
});
});
web/src/main/webapp/WEB-INF/components/map/map.xhtml
View file @
894a6342
...
...
@@ -37,8 +37,6 @@
<h:inputHidden
id=
"exportModelId"
value=
"#{exportMB.selectedModelId}"
/>
<h:inputHidden
id=
"selectedDrugPolygon"
value=
"#{drugMB.polygon}"
/>
<input
type=
"hidden"
id=
"logoLink"
value=
"#{configurationMB.logoLink}"
readonly=
"true"
/>
<p:remoteCommand
name=
"_actualizeParams"
actionListener=
"#{mapMB.actualizeParams}"
/>
<h:inputHidden
id=
"centerCoordinateX"
value=
"#{mapMB.topModelMapData.centerCoordinateX}"
/>
<h:inputHidden
id=
"centerCoordinateY"
value=
"#{mapMB.topModelMapData.centerCoordinateY}"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment