updated theme for responsive home, workspace and messages buttons and search

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portal/liferay62-plugins/social-dockbar-hook@126329 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2016-03-28 10:25:44 +00:00
parent e3bdd76be9
commit c9ac1a8faa
1 changed files with 69 additions and 2 deletions

View File

@ -67,6 +67,73 @@
$(this).trigger("enterKey");
}
});
//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) {
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-phone').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;
}
}
}
});
});
</script>
<!-- When desktop -->
@ -91,7 +158,7 @@
<div class="collapse nav-collapse">
<ul class="nav nav-add-controls">
<li class="dockbar-item">
<input id="searchbox-desktop" type="text" placeholder="Search News Feed">
<input id="searchbox" type="text" placeholder="Search News Feed">
</li>
</ul>
</div>
@ -115,7 +182,7 @@
<c:choose>
<c:when test="<%= themeDisplay.isShowControlPanelIcon() %>">
<span class="btn btn-navbar">
<input id="searchbox-phone-admin" type="text" placeholder="Search ...">
<input id="searchbox-phone" type="text" style="width: 70px;" placeholder="Search ...">
</span>
</c:when>
<c:otherwise>