Introduce a global taskbar on the welcomeHTML page to allow global search.

Global search is a search on all zims.
This commit is contained in:
Matthieu Gautier 2017-07-17 18:24:27 +02:00
parent 558a0375b0
commit ea088b21a4

View File

@ -138,11 +138,20 @@ void introduceTaskbar(string& content, const string& humanReadableBookId)
? " #kiwix_serve_taskbar_library_button { display: none }"
: "")
+ "</style>");
content = appendToFirstOccurence(
content,
"<body[^>]*>",
replaceRegex(
RESOURCE::taskbar_html_part, humanReadableBookId, "__CONTENT__"));
if ( humanReadableBookId.empty() ) {
content = appendToFirstOccurence(
content,
"<body[^>]*>",
RESOURCE::global_taskbar_html_part);
} else {
content = appendToFirstOccurence(
content,
"<body[^>]*>",
replaceRegex(
RESOURCE::taskbar_html_part,
humanReadableBookId,
"__CONTENT__"));
}
}
}
@ -982,6 +991,8 @@ int main(int argc, char** argv)
welcomeHTML
= replaceRegex(RESOURCE::home_html_tmpl, welcomeBooksHtml, "__BOOKS__");
introduceTaskbar(welcomeHTML, "");
#ifndef _WIN32
/* Fork if necessary */
if (daemonFlag) {