Permalink
Browse files

Fix for HTML output when using server side search and the the new men…

…u bar
  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Jul 31, 2016
1 parent 646302c commit 0faf45600c6c640bfaf11b017d43a4b9de193ebf
Showing with 24 additions and 4 deletions.
  1. +17 −1 src/htmlgen.cpp
  2. +6 −2 templates/html/menu.js
  3. +1 −1 templates/html/search.css
View
@@ -52,6 +52,8 @@ static QCString g_footer;
static QCString g_mathjax_code;
// note: this is only active if DISABLE_INDEX=YES, if DISABLE_INDEX is disabled, this
// part will be rendered inside menu.js
static void writeClientSearchBox(FTextStream &t,const char *relPath)
{
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
@@ -72,6 +74,8 @@ static void writeClientSearchBox(FTextStream &t,const char *relPath)
t << " </div>\n";
}
// note: this is only active if DISABLE_INDEX=YES. if DISABLE_INDEX is disabled, this
// part will be rendered inside menu.js
static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlightSearch)
{
static bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
@@ -2094,16 +2098,28 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
{
static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
static bool searchEngine = Config_getBool(SEARCHENGINE);
static bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
LayoutNavEntry *root = LayoutDocManager::instance().rootNavEntry();
if (compact)
{
QCString searchPage;
if (externalSearch)
{
searchPage = "search" + Doxygen::htmlFileExtension;
}
else
{
searchPage = "search.php";
}
t << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>" << endl;
t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>" << endl;
t << "<script type=\"text/javascript\">" << endl;
t << "$(function() {" << endl;
t << " initMenu('" << relPath << "',"
<< (searchEngine?"true":"false") << ",'"
<< (searchEngine?"true":"false") << ","
<< (serverBasedSearch?"true":"false") << ",'"
<< searchPage << "','"
<< theTranslator->trSearch() << "');" << endl;
if (Config_getBool(SEARCHENGINE))
{
View
@@ -1,4 +1,4 @@
function initMenu(relPath,searchEnabled,search) {
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
function makeTree(data,relPath) {
var result='';
if ('children' in data) {
@@ -16,7 +16,11 @@ function initMenu(relPath,searchEnabled,search) {
$('#main-nav').append(makeTree(menudata,relPath));
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
if (searchEnabled) {
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.png" alt=""/></a></span></div></li>');
if (serverSide) {
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.png" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>');
} else {
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.png" alt=""/></a></span></div></li>');
}
}
$('#main-menu').smartmenus();
}
@@ -46,7 +46,7 @@
height:19px;
background:url('search_m.png') repeat-x;
border:none;
width:111px;
width:115px;
margin-left:20px;
padding-left:4px;
color: #909090;

0 comments on commit 0faf456

Please sign in to comment.