Skip to content

Commit 2ca902a

Browse files
committed
make theme specifying possible through richdocuments
Signed-off-by: Pranam Lashkari <lpranam@collabora.com> Change-Id: I3e6e837464069330975cb377ec0126c5d61477ef
1 parent d2c016e commit 2ca902a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

wsd/FileServer.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,9 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request,
674674
LOG_TRC("css_variables=" << cssVars);
675675
const std::string postMessageOrigin = form.get("postmessage_origin", "");
676676
LOG_TRC("postmessage_origin" << postMessageOrigin);
677+
const std::string theme = form.get("theme", "");
678+
LOG_TRC("theme=" << theme);
679+
677680
// Escape bad characters in access token.
678681
// This is placed directly in javascript in loleaflet.html, we need to make sure
679682
// that no one can do anything nasty with their clever inputs.
@@ -725,8 +728,9 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request,
725728
protocolDebug = "true";
726729
Poco::replaceInPlace(preprocess, std::string("%PROTOCOL_DEBUG%"), protocolDebug);
727730

728-
static const std::string linkCSS("<link rel=\"stylesheet\" href=\"%s/loleaflet/" LOOLWSD_VERSION_HASH "/%s.css\">");
729-
static const std::string scriptJS("<script src=\"%s/loleaflet/" LOOLWSD_VERSION_HASH "/%s.js\"></script>");
731+
std::string themePreFix = (theme == "") ? "" : theme + "_";
732+
static const std::string linkCSS("<link rel=\"stylesheet\" href=\"%s/loleaflet/" LOOLWSD_VERSION_HASH "/" + themePreFix + "%s.css\">");
733+
static const std::string scriptJS("<script src=\"%s/loleaflet/" LOOLWSD_VERSION_HASH "/" + themePreFix + "%s.js\"></script>");
730734

731735
std::string brandCSS(Poco::format(linkCSS, responseRoot, std::string(BRANDING)));
732736
std::string brandJS(Poco::format(scriptJS, responseRoot, std::string(BRANDING)));

0 commit comments

Comments
 (0)