Skip to content

Commit

Permalink
Item13030: add topbar overlay for PatternSkin
Browse files Browse the repository at this point in the history
... replacing the standard search boxes with a solrized one.
  • Loading branch information
MichaelDaum committed Dec 16, 2014
1 parent 5f33772 commit c3552ec
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions templates/viewtopbar.solr.tmpl
@@ -0,0 +1,40 @@
%TMPL:INCLUDE{"viewtopbar"}%
%TMPL:DEF{"topbar"}%<div id="patternTopBar"><div id="patternTopBarContentsWrapper"><div id="patternTopBarContents">
<table border="0" cellpadding="0" cellspacing="0" style="width:100%" summary="">
<tr><td valign="middle"><span id="foswikiLogo" class="foswikiImage"><a href="%WEBLOGOURL%"><img src="%WEBLOGOIMG%" border="0" alt="%WEBLOGOALT%" style="border:none;" /></a></span></td>
<td align="right" valign="top" class="patternMetaMenu">
<div class="natSearchBox foswikiHideOnPrint solrSearchBox jqUITooltip" data-theme="info" data-arrow="on" data-position="left">
<form name="searchbox" id="searchbox" class="natSearchForm" action="%SCRIPTURLPATH{"view"}%/%BASEWEB%/WebSearch" >
<input type="hidden" name="origtopic" value="%BASEWEB%.%BASETOPIC%" />
<input type="text" class="foswikiInputField" placeholder="%TMPL:P{"searchbox::placeholder"}%" size="20" title="%MAKETEXT{"Enter topic name or a search string"}%" name="search" value="%TMPL:P{"searchbox::value"}%" accesskey="f" />
</form>
</div>
</td></tr></table>
%JQREQUIRE{"autosuggest"}%<!-- -->
%TMPL:P{"searchbox::javascript"}%<!-- -->
%TMPL:P{"searchbox::css"}%<!-- -->
</div></div></div>%TMPL:END%

%TMPL:DEF{"searchbox::placeholder"}%%MAKETEXT{"search"}%%TMPL:END%
%TMPL:DEF{"searchbox::value"}%%URLPARAM{"search" encode="entity"}%%TMPL:END%

%TMPL:DEF{"searchbox::javascript"}%<literal><script>
jQuery(function($) {
$("#searchbox").each(function() {
var $form = $(this),
$input = $form.find("input[type=text]");

if (typeof($.fn.autosuggest) === 'function') { // make sure autosuggest realy is present
$input.autosuggest({
menuClass: 'natSearchBoxMenu'
});
}
});
});
</script></literal>%TMPL:END%

%TMPL:DEF{"searchbox::css"}%<literal><style>
.natSearchBox .foswikiInputField {
width:260px;
}
</style></literal>%TMPL:END%

0 comments on commit c3552ec

Please sign in to comment.