diff --git a/browser/html/cool.html.m4 b/browser/html/cool.html.m4 index 4ab070585d2f2..824b3a2171a4b 100644 --- a/browser/html/cool.html.m4 +++ b/browser/html/cool.html.m4 @@ -47,6 +47,9 @@ m4_ifelse(MOBILEAPP, [true], ] ) + + + diff --git a/browser/js/global.js b/browser/js/global.js index e759eb86f67f7..5e3c85a6d2e25 100644 --- a/browser/js/global.js +++ b/browser/js/global.js @@ -281,6 +281,9 @@ class InitializerBase { document.getElementById('content-keeper').remove(); }, false); + window.brandProductName = document.getElementById("init-product-branding-name").value; + window.brandProductURL = document.getElementById("init-product-branding-url").value; + this.initiateCoolParams(); } diff --git a/browser/src/control/Control.AboutDialog.ts b/browser/src/control/Control.AboutDialog.ts index 3e5d35cfe1cf6..b92477b971181 100644 --- a/browser/src/control/Control.AboutDialog.ts +++ b/browser/src/control/Control.AboutDialog.ts @@ -87,12 +87,12 @@ class AboutDialog { productName = windowAny.MobileAppName; } else { productName = - typeof brandProductName !== 'undefined' + typeof brandProductName === 'string' && brandProductName.length > 0 ? brandProductName : 'Collabora Online Development Edition (unbranded)'; } var productURL = - typeof brandProductURL !== 'undefined' + typeof brandProductURL === 'string' && brandProductURL.length > 0 ? brandProductURL : 'https://collaboraonline.github.io/'; diff --git a/common/ConfigUtil.cpp b/common/ConfigUtil.cpp index e68581c7835d9..8185a8c7ea090 100644 --- a/common/ConfigUtil.cpp +++ b/common/ConfigUtil.cpp @@ -287,6 +287,8 @@ static const std::map DefAppConfig = { { "user_interface.mode", "default" }, { "user_interface.statusbar_save_indicator", "true" }, { "user_interface.use_integration_theme", "true" }, + { "user_interface.brandProductName", "" }, + { "user_interface.brandProductURL", "" }, { "wasm.enable", "false" }, { "wasm.force", "false" }, { "watermark.opacity", "0.2" }, diff --git a/configure.ac b/configure.ac index 0b0d267727a74..5e1904f1316ad 100644 --- a/configure.ac +++ b/configure.ac @@ -989,6 +989,7 @@ WELCOME_CONFIG_FRAGMENT= HOME_MODE_CONFIGURATION= ENABLE_WELCOME_MESSAGE=0 WELCOME_URL= +CONFIG_INTERFACE_FRAGMENT= if test -n "$with_welcome_url"; then WELCOME_URL=$with_welcome_url ENABLE_WELCOME_MESSAGE=1 @@ -999,12 +1000,16 @@ else WELCOME_CONFIG_FRAGMENT=" false " + CONFIG_INTERFACE_FRAGMENT=" + https://www.collaboraonline.com" fi AC_SUBST([WELCOME_CONFIG_FRAGMENT]) AM_SUBST_NOTMAKE(WELCOME_CONFIG_FRAGMENT) AC_SUBST([HOME_MODE_CONFIGURATION]) AM_SUBST_NOTMAKE(HOME_MODE_CONFIGURATION) +AC_SUBST([CONFIG_INTERFACE_FRAGMENT]) +AM_SUBST_NOTMAKE(CONFIG_INTERFACE_FRAGMENT) AC_DEFINE_UNQUOTED([ENABLE_WELCOME_MESSAGE],$ENABLE_WELCOME_MESSAGE,[Should the Release notes message be shown on upgrade]) AM_CONDITIONAL([ENABLE_WELCOME_MESSAGE], [test "$ENABLE_WELCOME_MESSAGE" = "1"]) AC_DEFINE_UNQUOTED([WELCOME_URL],["$WELCOME_URL"],[The welcome url of the build.]) diff --git a/coolwsd.xml.in b/coolwsd.xml.in index 238500e622fc8..95842fbbf5475 100644 --- a/coolwsd.xml.in +++ b/coolwsd.xml.in @@ -259,6 +259,9 @@ default true true + + @CONFIG_INTERFACE_FRAGMENT@ + diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index c75c35cff1f6b..c7043504caf77 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -1718,6 +1718,11 @@ FileServerRequestHandler::ResourceAccessDetails FileServerRequestHandler::prepro #else // configurable std::string enableWelcomeMessage = stringifyBoolFromConfig(config, "welcome.enable", false); std::string autoShowWelcome = stringifyBoolFromConfig(config, "welcome.enable", false); + + std::string brandProductURL = ConfigUtil::getConfigValue(config, "user_interface.brandProductURL", ""); + std::string brandProductName = ConfigUtil::getConfigValue(config, "user_interface.brandProductName", ""); + Poco::replaceInPlace(preprocess, std::string("%PRODUCT_BRANDING_NAME%"), brandProductName); + Poco::replaceInPlace(preprocess, std::string("%PRODUCT_BRANDING_URL%"), brandProductURL); #endif Poco::replaceInPlace(preprocess, std::string("%ENABLE_WELCOME_MSG%"), enableWelcomeMessage);