seems working
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portal/liferay62-plugins/social-dockbar-hook@124430 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a1db63718d
commit
9faaf71e3a
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
<artifactId>social-dockbar-hook</artifactId>
|
<artifactId>social-dockbar-hook</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<name>social-dockbar-hook Hook</name>
|
<name>social-dockbar-hook Hook</name>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>6.3.0-SNAPSHOT</version>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
@ -1,15 +1,95 @@
|
||||||
|
|
||||||
|
<%
|
||||||
|
//themeDisplay.getUser().getScreenName();
|
||||||
|
String currentVirtualHost = request.getServerName();
|
||||||
|
String groupName = currentVirtualHost.split("\\.")[0];
|
||||||
|
|
||||||
|
String mySiteURL = "/"+groupName;
|
||||||
|
%>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
//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");
|
||||||
|
if (window.location.href.indexOf("<%=mySiteURL%>") >= 0) {
|
||||||
|
window.location.href = "/group<%=mySiteURL%>?"+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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var base64hashtag = btoa($('#searchbox').val());
|
||||||
|
var base64attr = btoa("elasticSearchIdentificationParameter");
|
||||||
|
if (window.location.href.indexOf("<%=mySiteURL%>") >= 0) {
|
||||||
|
window.location.href = "/group<%=mySiteURL%>?"+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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#searchbox').keyup(function(e){
|
||||||
|
if(e.keyCode == 13)
|
||||||
|
{
|
||||||
|
$(this).trigger("enterKey");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<ul class="nav nav-add-controls">
|
<ul class="nav nav-add-controls">
|
||||||
<li class="dockbar-item"><a class="" href="javascript:;"
|
<li class="dockbar-item"><a class=""
|
||||||
id="homeIcon" title="To be decided"> <i class="icon-home"
|
href="<%="/group/" + groupName%>" id="homeIcon" title="To be decided">
|
||||||
style="font-size: 24px;"></i>
|
<i class="icon-home" style="font-size: 24px;"></i>
|
||||||
</a></li>
|
</a></li>
|
||||||
<li class="dockbar-item"><a class="" href="javascript:;"
|
<li class="dockbar-item"><a class=""
|
||||||
id="wsIcon" alt='Workspace' title='Virtual Workspace'> <i
|
href="<%="/group/" + groupName + "/workspace"%>" id="wsIcon"
|
||||||
|
alt='Workspace' title='Virtual Workspace'> <i
|
||||||
class="icon-folder-open" style="font-size: 24px;"></i>
|
class="icon-folder-open" style="font-size: 24px;"></i>
|
||||||
</a></li>
|
</a></li>
|
||||||
<li class="dockbar-item"><a class="" href="javascript:;"
|
<li class="dockbar-item"><a class=""
|
||||||
id="messagesIcon" alt='See Messages' title='Messages'> <i
|
href="<%="/group/" + groupName + "/messages"%>" id="messagesIcon"
|
||||||
class="icon-envelope" style="font-size: 24px;"></i>
|
alt='See Messages' title='Messages'> <i class="icon-envelope"
|
||||||
|
style="font-size: 24px;"></i>
|
||||||
</a></li>
|
</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<ul class="nav nav-add-controls">
|
||||||
|
<li class="dockbar-item">
|
||||||
|
<input id="searchbox" type="text" placeholder="Search in News Feed">
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
Loading…
Reference in New Issue