From 63cb47247baa55f91bdac92dc34ea829755fc42a Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 15 Aug 2017 15:15:26 -0400 Subject: [PATCH] Serve the taskbar css as separated file. For firefox, the file encoding must be specified in the first 1024 bytes. If it is not, firefox will reload the page when it founds it. By inserting the taskbar's css directly in the html, we are "moving" down the encoding of the page, and the encoding is not inside the first 1024 bytes. This also improve a bit the performance as the browser can cache the css file and it's avoid us to send the css in earch html file. --- src/server/kiwix-serve.cpp | 14 +++++--------- static/server/include.html.part | 1 + 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index ddfbba3..9aa5498 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -129,15 +129,11 @@ void introduceTaskbar(string& content, const string& humanReadableBookId) content, "", replaceRegex( - RESOURCE::include_html_part, humanReadableBookId, "__CONTENT__")); - content = appendToFirstOccurence( - content, - "", - ""); + RESOURCE::include_html_part, humanReadableBookId, "__CONTENT__") + + (noLibraryButtonFlag + ? "" + : "") + ); if ( humanReadableBookId.empty() ) { content = appendToFirstOccurence( content, diff --git a/static/server/include.html.part b/static/server/include.html.part index 79a6ddc..4836dce 100644 --- a/static/server/include.html.part +++ b/static/server/include.html.part @@ -1,5 +1,6 @@ +