[Libreoffice-commits] online.git: loleaflet/html

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 7 09:06:10 UTC 2020


 loleaflet/html/loleaflet.html.m4 |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit f3ac1bf297febcfbe8c2e9330bbdab6728b9478a
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Apr 7 10:24:39 2020 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Apr 7 11:05:52 2020 +0200

    mobile: Load a device-form-specific branding-*.css too.
    
    Change-Id: Iac94c6993d036a10b3f4764e79f38721482acc87
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91800
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index a2c1a45cf..8f8890209 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -108,6 +108,8 @@ m4_ifelse(IOSAPP,[true],
   [<link rel="stylesheet" href="Branding/branding.css">])
 m4_ifelse(ANDROIDAPP,[true],
   [<link rel="stylesheet" href="branding.css">])
+
+m4_dnl Handle localization
 m4_ifelse(MOBILEAPP,[true],
   [
    m4_ifelse(IOSAPP,[true],
@@ -252,17 +254,25 @@ m4_ifelse(MOBILEAPP,[true],
       window.tileSize = 256;])
 m4_syscmd([cat ]GLOBAL_JS)m4_dnl
 
-<!-- Dynamically load the appropriate device-mobile.css, device-tablet.css or device-desktop.css -->
+<!-- Dynamically load the appropriate *-mobile.css, *-tablet.css or *-desktop.css -->
 var link = document.createElement('link');
 link.setAttribute("rel", "stylesheet");
 link.setAttribute("type", "text/css");
-if (window.mode.isMobile())
+var brandingLink = document.createElement('link');
+brandingLink.setAttribute("rel", "stylesheet");
+brandingLink.setAttribute("type", "text/css");
+if (window.mode.isMobile()) {
     [link.setAttribute("href", ']m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/loleaflet/%VERSION%/])[device-mobile.css');]
-else if (window.mode.isTablet())
+    [brandingLink.setAttribute("href", ']m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/loleaflet/%VERSION%/])[branding-mobile.css');]
+} else if (window.mode.isTablet()) {
     [link.setAttribute("href", ']m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/loleaflet/%VERSION%/])[device-tablet.css');]
-else
+    [brandingLink.setAttribute("href", ']m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/loleaflet/%VERSION%/])[branding-tablet.css');]
+} else {
     [link.setAttribute("href", ']m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/loleaflet/%VERSION%/])[device-desktop.css');]
+    [brandingLink.setAttribute("href", ']m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/loleaflet/%VERSION%/])[branding-desktop.css');]
+}
 document.getElementsByTagName("head")[[0]].appendChild(link);
+document.getElementsByTagName("head")[[0]].appendChild(brandingLink);
 </script>
 
 m4_ifelse(MOBILEAPP,[true],


More information about the Libreoffice-commits mailing list