You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2020/08/01 16:41:50 UTC

[freemarker-docgen] 01/04: Show old browser warning for MSIE 10-11 too.

This is an automated email from the ASF dual-hosted git repository.

ddekany pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/freemarker-docgen.git

commit 6f6899d4964ca2cb04e65c6cbeaf3a24fdaf48d5
Author: ddekany <dd...@apache.org>
AuthorDate: Fri Jul 31 23:07:27 2020 +0200

    Show old browser warning for MSIE 10-11 too.
---
 .../org/freemarker/docgen/core/less/lib/layout/header.less  | 13 +++++++++++++
 .../org/freemarker/docgen/core/templates/page.ftlh          | 12 +++++++++---
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/layout/header.less b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/layout/header.less
index 6bfc89c..2a7cecd 100644
--- a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/layout/header.less
+++ b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/layout/header.less
@@ -105,3 +105,16 @@
     align-items: flex-end;
   }
 }
+
+.oldBrowserWarning {
+  display: none;
+  background-color: #C00;
+  color: #fff;
+  font-weight: bold;
+  padding: 12px 24px;
+
+  /* IE10-IE11 css: */
+  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
+     display: block;
+  }
+}
diff --git a/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/page.ftlh b/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/page.ftlh
index 217ec54..60c7a84 100644
--- a/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/page.ftlh
+++ b/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/page.ftlh
@@ -34,7 +34,7 @@
     <meta itemprop="url" content="${deployUrl}">
     <meta itemprop="name" content="${siteTitle}">
 
-    <@browserWarning />
+    <@oldBrowserWarning />
     <@header.header />
     <div class="main-content site-width">
       <div class="content-wrapper<#if disableJavaScript> no-toc</#if>">
@@ -103,12 +103,18 @@
 </#macro>
 
 
-<#macro browserWarning>
+<#macro oldBrowserWarning>
   <!--[if lte IE 9]>
-  <div style="background-color: #C00; color: #fff; padding: 12px 24px;">Please use a modern browser to view this website.</div>
+  <@oldBrowserWarning_inner forceDisplay=true />
   <![endif]--><#rt>
+  <@oldBrowserWarning_inner forceDisplay=false />
 </#macro>
 
+<#macro oldBrowserWarning_inner forceDisplay>
+  <div class="oldBrowserWarning"<#if forceDisplay> style="display: block"</#if>>
+    Unsupported web browser - Use a modern browser to view this website!
+  </div>
+</#macro>
 
 <#macro page>
   <!doctype html><#lt>