social-dockbar-hook/src/main/webapp/custom_jsps/html/portlet/dockbar/custom_dockbar_view.jspf

116 lines
4.0 KiB
Plaintext

<%
//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>
<!-- When desktop -->
<div class="collapse nav-collapse">
<ul class="nav nav-add-controls">
<li class="dockbar-item"><a class=""
href="<%="/group/" + groupName%>" id="homeIcon" title= "<%=groupName%> Infrastructure Gateway Home">
<i class="icon-home" style="font-size: 24px;"></i>
</a></li>
<li class="dockbar-item"><a class=""
href="<%="/group/" + groupName + "/workspace"%>" id="wsIcon"
alt='Workspace' title='Virtual Workspace'> <i
class="icon-folder-open" style="font-size: 24px;"></i>
</a></li>
<li class="dockbar-item"><a class=""
href="<%="/group/" + groupName + "/messages"%>" id="messagesIcon"
alt='See Messages' title='Messages'> <i class="icon-envelope"
style="font-size: 24px;"></i>
</a></li>
</ul>
</div>
<div class="collapse nav-collapse">
<ul class="nav nav-add-controls">
<li class="dockbar-item">
<input id="searchbox" type="text" placeholder="Search in News Feed">
</li>
</ul>
</div>
<!-- When phone or tablet -->
<span>
<a class="btn btn-navbar"href="<%="/group/" + groupName%>" id="homeIcon" title= "<%=groupName%> Infrastructure Gateway Home">
<i class="icon-home" style="font-size: 24px;"></i>
</a>
</span>
<span>
<a class="btn btn-navbar" href="<%="/group/" + groupName + "/workspace"%>" id="wsIcon"
alt='Workspace' title='Virtual Workspace'> <i class="icon-folder-open" style="font-size: 24px;"></i>
</a>
</span>
<span>
<a class="btn btn-navbar" href="<%="/group/" + groupName + "/messages"%>" id="messagesIcon"
alt='See Messages' title='Messages'> <i class="icon-envelope"
style="font-size: 24px;"></i>
</a>
</span>
<!-- End When phone or tablet -->