mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
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:
parent
558a0375b0
commit
ea088b21a4
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user