From 4d6b5e5f74c50cc440a46fada8fa89ad2f946749 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Tue, 28 Apr 2020 15:51:38 -0300 Subject: Apply module brand color to Help page Change page header and headings to module colors Module colors from branding wiki page https://wiki.documentfoundation.org/Marketing/Branding#Colors Based on ideas of Beatriz Fonseca (@beatorizu) betrizaf@gmail.com Change-Id: Ia855872185a9c5ff6bcf3c351cc78e57e5a7901c Reviewed-on: https://gerrit.libreoffice.org/c/help/+/93100 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- help3xsl/help2.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'help3xsl/help2.js') diff --git a/help3xsl/help2.js b/help3xsl/help2.js index 8c2b60d725..9eb35c003c 100644 --- a/help3xsl/help2.js +++ b/help3xsl/help2.js @@ -66,6 +66,32 @@ function setSystemSpan(spanZ) { } } +// paint headers and headings with appl color + +function moduleColor (module) { + switch (module){ + case "WRITER" : {color="#0369A3"; break;} + case "CALC" : {color="#43C330"; break;} + case "CHART" : {color="darkcyan"; break;} + case "DRAW" : {color="#A33E03"; break;} + case "IMPRESS": {color="#C99C00"; break;} + case "BASE" : {color="#8E03A3"; break;} + case "BASIC" : {color="black"; break;} + case "MATH" : {color="darkslategray"; break;} + case "SHARED" : {color="gray"; break;} + default : {color="#18A303"; break;} + } + document.getElementById("TopLeftHeader").style.background = color; + document.getElementById("SearchFrame").style.background = color; + document.getElementById("DonationFrame").style.background = color; + var cols = document.getElementsByClassName('tableheadcell'); + for(i = 0; i < cols.length; i++) {cols[i].style.backgroundColor = color;}; + for (j of [1,2,3,4,5,6]) { + var hh = document.getElementsByTagName("H" + j); + for(i = 0; i < hh.length; i++) {hh[i].style.color = color;} + } +} + // Find spans that need the switch treatment and give it to them var spans = document.querySelectorAll("[class^=switch]"); var n = spans.length; @@ -205,6 +231,7 @@ if (document.body.getElementsByTagName('meta')) { var module = getParameterByName("DbPAR"); var helpID = getParameterByName("HID"); fixURL(module,system); +moduleColor(module); function debugInfo(dbg) { if (dbg == null) return; -- cgit