mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 03:52:35 -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 }"
|
? " #kiwix_serve_taskbar_library_button { display: none }"
|
||||||
: "")
|
: "")
|
||||||
+ "</style>");
|
+ "</style>");
|
||||||
content = appendToFirstOccurence(
|
if ( humanReadableBookId.empty() ) {
|
||||||
content,
|
content = appendToFirstOccurence(
|
||||||
"<body[^>]*>",
|
content,
|
||||||
replaceRegex(
|
"<body[^>]*>",
|
||||||
RESOURCE::taskbar_html_part, humanReadableBookId, "__CONTENT__"));
|
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
|
welcomeHTML
|
||||||
= replaceRegex(RESOURCE::home_html_tmpl, welcomeBooksHtml, "__BOOKS__");
|
= replaceRegex(RESOURCE::home_html_tmpl, welcomeBooksHtml, "__BOOKS__");
|
||||||
|
|
||||||
|
introduceTaskbar(welcomeHTML, "");
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
/* Fork if necessary */
|
/* Fork if necessary */
|
||||||
if (daemonFlag) {
|
if (daemonFlag) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user