2016-04-06 17:46:23 +02:00
|
|
|
<%@ page import="org.gcube.common.portal.GCubePortalConstants" %>
|
2016-07-14 12:17:26 +02:00
|
|
|
<%@ page import="org.gcube.common.portal.PortalContext" %>
|
2016-02-21 20:37:54 +01:00
|
|
|
|
2016-02-22 16:35:25 +01:00
|
|
|
<%
|
2016-07-14 12:17:26 +02:00
|
|
|
PortalContext context = PortalContext.getConfiguration();
|
|
|
|
String groupName = context.getGatewayName(request);
|
|
|
|
String mySiteURL = context.getSiteLandingPagePath(request);
|
2016-02-22 16:35:25 +01:00
|
|
|
%>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
jQuery(document).ready(function() {
|
2016-04-01 18:11:14 +02:00
|
|
|
|
|
|
|
//check for notifications on load after 3 seconds
|
|
|
|
var username = "<%=themeDisplay.getUser().getScreenName()%>";
|
|
|
|
|
2016-04-05 15:40:03 +02:00
|
|
|
// current location to extract the vre and the user profiles within it
|
|
|
|
var location = window.location.href;
|
|
|
|
|
2016-04-01 18:11:14 +02:00
|
|
|
$.get('/notificationchecker/notificationchecker', {
|
2016-04-05 15:40:03 +02:00
|
|
|
userid : username, location : location
|
2016-04-01 18:11:14 +02:00
|
|
|
}, function(responseText) {
|
|
|
|
});
|
|
|
|
|
2016-07-25 18:13:44 +02:00
|
|
|
//then repeat every 3 minutes
|
2016-04-01 18:11:14 +02:00
|
|
|
setInterval(function() {
|
|
|
|
var username = "<%=themeDisplay.getUser().getScreenName()%>";
|
2016-04-05 15:40:03 +02:00
|
|
|
var location = window.location.href;
|
|
|
|
$.get('/notificationchecker/notificationchecker',{
|
|
|
|
userid : username, location : location
|
2016-04-01 18:11:14 +02:00
|
|
|
}, function(responseText) {
|
|
|
|
});
|
2016-07-25 18:13:44 +02:00
|
|
|
}, 240000);
|
2016-04-01 18:11:14 +02:00
|
|
|
|
2016-02-22 16:35:25 +01:00
|
|
|
//search box keyboard handlers
|
|
|
|
$('#searchbox').bind("enterKey",function(e){
|
|
|
|
if ($('#searchbox').val() != "") {
|
|
|
|
if ($('#searchbox').val().indexOf("#") == 0) {
|
|
|
|
if ($('#searchbox').val().indexOf(" ") >= 0) {
|
|
|
|
alert('Sorry, spaces not allowed when searching for topics!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var base64hashtag = btoa($('#searchbox').val());
|
|
|
|
var base64attr = btoa("hashtagIdentificationParameter");
|
2016-04-06 17:46:23 +02:00
|
|
|
|
2016-02-22 16:35:25 +01:00
|
|
|
if (window.location.href.indexOf("<%=mySiteURL%>") >= 0) {
|
2016-04-06 17:46:23 +02:00
|
|
|
window.location.href = "<%=mySiteURL%>?"+base64attr+"="+ base64hashtag;
|
2016-02-22 16:35:25 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
//this is when you are in a VRE and you want to search in that VRE, count the slashes to get where to point
|
|
|
|
//you always want to point to /group/vrename
|
|
|
|
var newhref = window.location.href;
|
|
|
|
if (window.location.href.indexOf("?") >= 0) {
|
|
|
|
newhref = window.location.href.split("?")[0];
|
|
|
|
}
|
|
|
|
var count = newhref.split("/").length-1;
|
|
|
|
if (count > 4)
|
|
|
|
window.location.href = newhref + "/../?"+base64attr+"="+ base64hashtag;
|
|
|
|
else
|
|
|
|
window.location.href = newhref + "?"+base64attr+"="+ base64hashtag;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
var base64hashtag = btoa($('#searchbox').val());
|
|
|
|
var base64attr = btoa("elasticSearchIdentificationParameter");
|
|
|
|
if (window.location.href.indexOf("<%=mySiteURL%>") >= 0) {
|
2016-04-06 17:46:23 +02:00
|
|
|
window.location.href = "<%=mySiteURL%>?"+base64attr+"="+ base64hashtag;
|
2016-02-22 16:35:25 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
//this is when you are in a VRE and you want to search in that VRE, count the slashes to get where to point
|
|
|
|
//you always want to point to /group/vrename
|
|
|
|
var newhref = window.location.href;
|
|
|
|
if (window.location.href.indexOf("?") >= 0) {
|
|
|
|
newhref = window.location.href.split("?")[0];
|
|
|
|
}
|
|
|
|
var count = newhref.split("/").length-1;
|
|
|
|
if (count > 4)
|
|
|
|
window.location.href = newhref + "/../?"+base64attr+"="+ base64hashtag;
|
|
|
|
else
|
|
|
|
window.location.href = newhref + "?"+base64attr+"="+ base64hashtag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#searchbox').keyup(function(e){
|
|
|
|
if(e.keyCode == 13)
|
|
|
|
{
|
|
|
|
$(this).trigger("enterKey");
|
|
|
|
}
|
|
|
|
});
|
2016-03-28 12:25:44 +02:00
|
|
|
//remove placeholder text on click
|
|
|
|
$('#searchbox').click(function() {
|
|
|
|
$('#searchbox').attr("placeholder", "");
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#searchbox-phone').keyup(function(e){
|
|
|
|
if(e.keyCode == 13)
|
|
|
|
{
|
|
|
|
$(this).trigger("enterKey");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
//remove placeholder text on click
|
|
|
|
$('#searchbox-phone').click(function() {
|
|
|
|
$('#searchbox-phone').attr("placeholder", "");
|
|
|
|
});
|
|
|
|
|
|
|
|
//search box keyboard handlers
|
|
|
|
$('#searchbox-phone').bind("enterKey",function(e){
|
|
|
|
if ($('#searchbox-phone').val() != "") {
|
|
|
|
if ($('#searchbox-phone').val().indexOf("#") == 0) {
|
|
|
|
if ($('#searchbox-phone').val().indexOf(" ") >= 0) {
|
|
|
|
alert('Sorry, spaces not allowed when searching for topics!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var base64hashtag = btoa($('#searchbox-phone').val());
|
|
|
|
var base64attr = btoa("hashtagIdentificationParameter");
|
|
|
|
if (window.location.href.indexOf("<%=mySiteURL%>") >= 0) {
|
2016-04-06 17:46:23 +02:00
|
|
|
window.location.href = "<%=mySiteURL%>?"+base64attr+"="+ base64hashtag;
|
2016-03-28 12:25:44 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
//this is when you are in a VRE and you want to search in that VRE, count the slashes to get where to point
|
|
|
|
//you always want to point to /group/vrename
|
|
|
|
var newhref = window.location.href;
|
|
|
|
if (window.location.href.indexOf("?") >= 0) {
|
|
|
|
newhref = window.location.href.split("?")[0];
|
|
|
|
}
|
|
|
|
var count = newhref.split("/").length-1;
|
|
|
|
if (count > 4)
|
|
|
|
window.location.href = newhref + "/../?"+base64attr+"="+ base64hashtag;
|
|
|
|
else
|
|
|
|
window.location.href = newhref + "?"+base64attr+"="+ base64hashtag;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
var base64hashtag = btoa($('#searchbox-phone').val());
|
|
|
|
var base64attr = btoa("elasticSearchIdentificationParameter");
|
|
|
|
if (window.location.href.indexOf("<%=mySiteURL%>") >= 0) {
|
2016-04-06 17:46:23 +02:00
|
|
|
window.location.href = "<%=mySiteURL%>?"
|
2016-04-01 18:11:14 +02:00
|
|
|
+ base64attr
|
|
|
|
+ "="
|
|
|
|
+ base64hashtag;
|
|
|
|
} else {
|
|
|
|
//this is when you are in a VRE and you want to search in that VRE, count the slashes to get where to point
|
|
|
|
//you always want to point to /group/vrename
|
|
|
|
var newhref = window.location.href;
|
|
|
|
if (window.location.href
|
|
|
|
.indexOf("?") >= 0) {
|
|
|
|
newhref = window.location.href
|
|
|
|
.split("?")[0];
|
|
|
|
}
|
|
|
|
var count = newhref
|
|
|
|
.split("/").length - 1;
|
|
|
|
if (count > 4)
|
|
|
|
window.location.href = newhref
|
|
|
|
+ "/../?"
|
|
|
|
+ base64attr
|
|
|
|
+ "="
|
|
|
|
+ base64hashtag;
|
|
|
|
else
|
|
|
|
window.location.href = newhref
|
|
|
|
+ "?"
|
|
|
|
+ base64attr
|
|
|
|
+ "="
|
|
|
|
+ base64hashtag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2016-02-22 16:35:25 +01:00
|
|
|
</script>
|
2016-03-27 17:30:30 +02:00
|
|
|
<!-- When desktop -->
|
|
|
|
<div class="collapse nav-collapse">
|
2016-04-01 18:11:14 +02:00
|
|
|
<ul class="nav nav-add-controls">
|
|
|
|
<li class="dockbar-item"><a class=""
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL%>" id="homeIcon"
|
|
|
|
title="<%=groupName%> Home"> <i
|
2016-04-01 18:11:14 +02:00
|
|
|
class="icon-home" style="font-size: 24px;"></i>
|
|
|
|
</a></li>
|
|
|
|
<li class="dockbar-item"><a class=""
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL+ GCubePortalConstants.USER_WORKSPACE_FRIENDLY_URL%>" id="wsIcon"
|
2016-04-01 18:11:14 +02:00
|
|
|
alt='Workspace' title='Virtual Workspace'> <i
|
|
|
|
class="icon-folder-open" style="font-size: 24px;"></i>
|
|
|
|
</a></li>
|
2016-06-30 17:55:55 +02:00
|
|
|
<li class="dockbar-item"><a class=""
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL + GCubePortalConstants.CATALOGUE_FRIENDLY_URL%>" id="catalougueIcon"
|
2016-06-30 17:55:55 +02:00
|
|
|
alt='See Data Catalogue' title='Data Catalogue'> <i
|
|
|
|
class="icon-book" style="font-size: 24px;"></i>
|
|
|
|
</a></li>
|
2016-04-01 18:11:14 +02:00
|
|
|
<li class="dockbar-item"><a class=""
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL + GCubePortalConstants.USER_MESSAGES_FRIENDLY_URL%>" id="messagesIcon"
|
2016-04-01 18:11:14 +02:00
|
|
|
alt='See Messages' title='Messages'> <i class="icon-envelope"
|
|
|
|
style="font-size: 24px;"></i>
|
|
|
|
</a></li>
|
|
|
|
</ul>
|
2016-03-27 17:30:30 +02:00
|
|
|
</div>
|
|
|
|
<div class="collapse nav-collapse">
|
2016-04-01 18:11:14 +02:00
|
|
|
<ul class="nav nav-add-controls">
|
|
|
|
<li class="dockbar-item"><input id="searchbox" type="text"
|
|
|
|
placeholder="Search News Feed"></li>
|
|
|
|
</ul>
|
2016-03-27 17:30:30 +02:00
|
|
|
</div>
|
|
|
|
<!-- When phone or tablet -->
|
2016-07-11 10:15:20 +02:00
|
|
|
<span><a class="btn btn-navbar"
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL%>" id="homeIcon"
|
2016-07-11 10:15:20 +02:00
|
|
|
title="<%=groupName%> Infrastructure Gateway Home"> <i
|
|
|
|
class="icon-home" style="font-size: 24px;"></i>
|
|
|
|
</a>
|
|
|
|
</span>
|
2016-04-01 18:11:14 +02:00
|
|
|
<span> <a class="btn btn-navbar"
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL + GCubePortalConstants.USER_WORKSPACE_FRIENDLY_URL%>" id="wsIcon"
|
2016-04-01 18:11:14 +02:00
|
|
|
alt='Workspace' title='Virtual Workspace'> <i
|
|
|
|
class="icon-folder-open" style="font-size: 24px;"></i>
|
|
|
|
</a>
|
2016-03-27 17:30:30 +02:00
|
|
|
</span>
|
2016-06-30 17:55:55 +02:00
|
|
|
<span> <a class="btn btn-navbar"
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL + GCubePortalConstants.CATALOGUE_FRIENDLY_URL%>" id="catalougueIcon"
|
2016-06-30 17:55:55 +02:00
|
|
|
alt='See Data Catalogue' title='Data Catalogue'> <i class="icon-book"
|
|
|
|
style="font-size: 24px;"></i>
|
|
|
|
</a>
|
2016-04-01 18:11:14 +02:00
|
|
|
<span> <a class="btn btn-navbar"
|
2016-07-14 12:17:26 +02:00
|
|
|
href="<%=mySiteURL + GCubePortalConstants.USER_MESSAGES_FRIENDLY_URL%>" id="messagesIcon"
|
2016-04-01 18:11:14 +02:00
|
|
|
alt='See Messages' title='Messages'> <i class="icon-envelope"
|
|
|
|
style="font-size: 24px;"></i>
|
|
|
|
</a>
|
2016-03-27 17:30:30 +02:00
|
|
|
</span>
|
2016-03-27 22:22:48 +02:00
|
|
|
<c:choose>
|
2016-04-01 18:11:14 +02:00
|
|
|
<c:when test="<%=themeDisplay.isShowControlPanelIcon()%>">
|
|
|
|
<span class="btn btn-navbar"> <input id="searchbox-phone"
|
|
|
|
type="text" style="width: 70px;" placeholder="Search ...">
|
|
|
|
</span>
|
|
|
|
</c:when>
|
2016-03-27 22:22:48 +02:00
|
|
|
<c:otherwise>
|
2016-04-01 18:11:14 +02:00
|
|
|
<span class="btn btn-navbar"> <input id="searchbox-phone"
|
|
|
|
type="text" placeholder="Search News Feed">
|
|
|
|
</span>
|
|
|
|
</c:otherwise>
|
2016-03-27 22:22:48 +02:00
|
|
|
</c:choose>
|
2016-03-27 17:30:30 +02:00
|
|
|
<!-- End When phone or tablet -->
|