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
bb88002a
Commit
bb88002a
authored
Feb 03, 2017
by
Piotr Gawron
Browse files
comments checkbox moved from customMap
parent
4fe8d1d9
Changes
6
Show whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/map/CustomMap.js
View file @
bb88002a
...
...
@@ -291,43 +291,8 @@ CustomMap.prototype.createMapMenu = function() {
var
rightHeaderMenu
=
document
.
createElement
(
'
div
'
);
rightHeaderMenu
.
className
=
"
rightHeaderMenu
"
;
var
submenuDiv
=
document
.
createElement
(
'
div
'
);
submenuDiv
.
className
=
"
div4checkboxes
"
;
var
commentCheckbox
=
document
.
createElement
(
'
input
'
);
commentCheckbox
.
type
=
"
checkbox
"
;
commentCheckbox
.
name
=
"
Comments
"
;
commentCheckbox
.
id
=
ControlType
.
COMMENT_CHECKBOX
;
commentCheckbox
.
onclick
=
function
()
{
ServerConnector
.
getSessionData
(
selfMap
.
getProject
()).
setShowComments
(
commentCheckbox
.
checked
);
if
(
commentCheckbox
.
checked
)
{
document
.
getElementById
(
'
refresh_comments_button
'
).
style
.
display
=
'
inline
'
;
}
else
{
document
.
getElementById
(
'
refresh_comments_button
'
).
style
.
display
=
'
none
'
;
}
return
selfMap
.
refreshComments
();
};
this
.
addControl
(
commentCheckbox
);
var
element
=
document
.
createElement
(
'
label
'
);
element
.
innerHTML
=
"
COMMENTS
"
;
element
.
setAttribute
(
"
for
"
,
ControlType
.
COMMENT_CHECKBOX
);
submenuDiv
.
appendChild
(
commentCheckbox
);
submenuDiv
.
appendChild
(
element
);
var
submenuButtonDiv
=
document
.
createElement
(
'
button
'
);
submenuButtonDiv
.
id
=
"
refresh_comments_button
"
;
submenuButtonDiv
.
innerHTML
=
"
<i class='fa fa-refresh' style='font-size:21px; font-weight:400;'></i>
"
;
submenuButtonDiv
.
className
=
"
overview_button
"
;
submenuButtonDiv
.
style
.
display
=
'
none
'
;
submenuButtonDiv
.
onclick
=
(
function
()
{
return
function
()
{
selfMap
.
refreshComments
();
return
false
;
};
})();
submenuDiv
.
appendChild
(
submenuButtonDiv
);
rightHeaderMenu
.
appendChild
(
submenuDiv
);
submenuButtonDiv
=
document
.
createElement
(
'
button
'
);
submenuButtonDiv
.
id
=
"
clear_button
"
;
submenuButtonDiv
.
className
=
"
overview_button
"
;
submenuButtonDiv
.
innerHTML
=
"
<i class='fa fa-times' style='font-size:18px; font-weight:300; padding-right:10px;'></i> CLEAR
"
;
...
...
frontend-js/src/main/js/minerva.js
View file @
bb88002a
...
...
@@ -266,6 +266,24 @@ function create(params) {
}
document
.
getElementsByName
(
"
versionDiv
"
)[
0
].
innerHTML
=
project
.
getVersion
();
var
commentCheckbox
=
document
.
getElementsByName
(
"
commentCheckbox
"
)[
0
];
var
refreshCommentButton
=
document
.
getElementsByName
(
"
refreshCommentButton
"
)[
0
];
commentCheckbox
.
onclick
=
function
()
{
ServerConnector
.
getSessionData
(
project
).
setShowComments
(
commentCheckbox
.
checked
);
if
(
commentCheckbox
.
checked
)
{
refreshCommentButton
.
style
.
display
=
'
inline
'
;
}
else
{
refreshCommentButton
.
style
.
display
=
'
none
'
;
}
return
result
.
refreshComments
();
};
refreshCommentButton
.
onclick
=
(
function
()
{
return
function
()
{
result
.
refreshComments
();
return
false
;
};
})();
if
(
ServerConnector
.
getSessionData
().
getShowComments
())
{
result
.
getControl
(
ControlType
.
COMMENT_CHECKBOX
).
checked
=
true
;
return
result
.
refreshComments
();
...
...
frontend-js/src/test/js/helper.js
View file @
bb88002a
...
...
@@ -35,7 +35,7 @@ Helper.prototype.createMenuDiv = function() {
result
.
appendChild
(
hideDiv
);
var
versionDiv
=
document
.
createElement
(
"
div
"
);
result
.
setAttribute
(
"
name
"
,
"
versionDiv
"
);
versionDiv
.
setAttribute
(
"
name
"
,
"
versionDiv
"
);
result
.
appendChild
(
versionDiv
);
var
button
=
document
.
createElement
(
"
button
"
);
...
...
@@ -52,6 +52,15 @@ Helper.prototype.createMenuDiv = function() {
legendCheckbox
.
setAttribute
(
"
name
"
,
"
legendCheckbox
"
);
result
.
appendChild
(
legendCheckbox
);
var
commentCheckbox
=
document
.
createElement
(
"
input
"
);
commentCheckbox
.
setAttribute
(
"
type
"
,
"
checkbox
"
);
commentCheckbox
.
setAttribute
(
"
name
"
,
"
commentCheckbox
"
);
result
.
appendChild
(
commentCheckbox
);
var
refreshCommentButton
=
document
.
createElement
(
"
button
"
);
refreshCommentButton
.
setAttribute
(
"
name
"
,
"
refreshCommentButton
"
);
result
.
appendChild
(
refreshCommentButton
);
return
result
;
};
...
...
frontend-js/src/test/js/map/CustomMap-test.js
View file @
bb88002a
...
...
@@ -524,12 +524,6 @@ describe('CustomMap', function() {
});
});
it
(
"
showComments
"
,
function
()
{
var
map
=
helper
.
createCustomMap
();
map
.
getControl
(
ControlType
.
COMMENT_CHECKBOX
).
click
();
assert
.
ok
(
ServerConnector
.
getSessionData
(
map
.
getProject
()).
getShowComments
());
});
it
(
"
changed coords in map
"
,
function
()
{
var
map
=
helper
.
createCustomMap
();
var
oldCenter
=
map
.
getGoogleMap
().
getCenter
();
...
...
frontend-js/src/test/js/minerva-test.js
View file @
bb88002a
...
...
@@ -39,6 +39,14 @@ describe('minerva global', function() {
});
});
it
(
"
showComments
"
,
function
()
{
var
options
=
helper
.
createCustomMapOptions
();
return
minerva
.
create
(
options
).
then
(
function
()
{
document
.
getElementsByName
(
"
commentCheckbox
"
)[
0
].
click
();
assert
.
ok
(
ServerConnector
.
getSessionData
(
options
.
getProject
()).
getShowComments
());
});
});
it
(
"
contructor with GET zoom param
"
,
function
()
{
var
options
=
helper
.
createCustomMapOptions
();
GuiConnector
.
getParams
[
"
zoom
"
]
=
"
5
"
;
...
...
web/src/main/webapp/index.xhtml
View file @
bb88002a
...
...
@@ -121,12 +121,25 @@ function initMap(){
<i
name=
"hideButtonIcon"
class=
'fa fa-chevron-left'
/>
</button>
</div>
<div
name=
"versionDiv"
class=
"headerTextBold"
/>
<div
class=
"rightHeaderMenu"
>
<div
class=
"div4checkboxes"
>
<input
type=
"checkbox"
name =
"legendCheckbox"
/>
<label
for =
"legendCheckbox"
>
LEGEND
</label>
<input
type=
"checkbox"
name=
"commentCheckbox"
/>
<label
for =
"commentCheckbox"
>
COMMENTS
</label>
<button
class=
"overview_button"
name=
"refreshCommentButton"
style=
"display:none"
>
<i
class=
'fa fa-refresh'
style=
'font-size:21px; font-weight:400;'
></i>
</button>
</div>
</div>
</div>
<div
id=
"mapElement"
class=
"mapClass"
/>
<div
id=
"legend"
class=
"carousel slide legendBox"
style=
"display:none"
>
<div
class=
"legendBox"
>
<div
id=
"legend"
class=
"carousel slide"
style=
"display:none"
>
<ol
name=
"indicators"
class=
"carousel-indicators"
>
</ol>
...
...
@@ -142,6 +155,7 @@ function initMap(){
<span
class=
"glyphicon glyphicon-chevron-right"
aria-hidden=
"true"
></span>
<span
class=
"sr-only"
>
Next
</span>
</a>
</div>
</div>
</div>
...
...
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