AllLangPackage_html_lang.mk   |    1 -
 CustomTarget_html.mk          |   30 ------------------------------
 help3xsl/default.css          |   10 ++++++++++
 help3xsl/help.js              |    4 ++++
 help3xsl/online_transform.xsl |    6 +++++-
 5 files changed, 19 insertions(+), 32 deletions(-)

New commits:
commit 2cc2c9d5a7a9739d47b3162e0e10102b42e9cc70
Author:     Olivier Hallot <olivier.hal...@libreoffice.org>
AuthorDate: Tue Dec 31 09:43:47 2024 -0300
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Tue Dec 31 16:03:09 2024 +0100

    Warn when javascript is not enabled in browser
    
    + A big red warning displays on top of pages when JS is disabled in browser.
    + otherwise JS switch warning to display = none.
    + Fast/instantaneous in Firefox
    + Some delay (flash) experienced with Brave and Edge in Linux (Chrome 
engines).
    
    Change-Id: I2b1792e87520b3f4e0bf93a6e0430376587b4afb
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/179578
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/AllLangPackage_html_lang.mk b/AllLangPackage_html_lang.mk
index a0ae5f5a7b..4e95196970 100644
--- a/AllLangPackage_html_lang.mk
+++ b/AllLangPackage_html_lang.mk
@@ -16,7 +16,6 @@ $(eval $(call 
gb_AllLangPackage_add_files,helpcontent2_html_lang,$(LIBO_SHARE_HE
                $(lang)/bookmarks.js \
                $(lang)/contents.js \
                $(lang)/langnames.js \
-               $(lang)/noscript.html \
        ) \
 ))
 
diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index d105f119ad..e07374d0db 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -37,7 +37,6 @@ $(eval $(call 
gb_CustomTarget_register_targets,helpcontent2/help3xsl,\
                $(foreach 
module,$(html_TEXT_MODULES),filelists/html-help/$(module)/$(lang).filelist) \
                $(lang)/langnames.js \
                $(if $(HELP_OMINDEX_PAGE),$(lang)/xap_tpl) \
-               $(lang)/noscript.html \
        ) \
 ))
 
@@ -90,35 +89,6 @@ $(gb_CustomTarget_workdir)/helpcontent2/help3xsl/%/xap_tpl : 
\
 
 endif
 
-# Create noscript.html, when browser has no javascript enabled
-
-define html_gen_noscript_dep
-$(gb_CustomTarget_workdir)/helpcontent2/help3xsl/$(1)/noscript.html : \
-       $(if $(filter 
en-US,$(1)),$(SRCDIR),$(gb_HelpTranslatePartTarget_workdir)/$(1))/helpcontent2/source/text/shared/help/browserhelp.xhp
-
-endef
-
-$(eval $(foreach lang,$(gb_HELP_LANGS),$(call html_gen_noscript_dep,$(lang))))
-
-$(gb_CustomTarget_workdir)/helpcontent2/help3xsl/%/noscript.html : \
-        $(SRCDIR)/helpcontent2/help3xsl/noscript.xsl \
-        $(SRCDIR)/helpcontent2/help3xsl/brand.xsl \
-        $(SRCDIR)/helpcontent2/CustomTarget_html.mk \
-        | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
-       $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),NJS,1)
-       $(call gb_Trace_StartRange,$*/$(@F),XSL)
-       $(call gb_Helper_abbreviate_dirs,\
-               $(call gb_ExternalExecutable_get_command,xsltproc) \
-               --stringparam lang $* \
-               --stringparam productname "$(gb_PRODUCTNAME_HTML)" \
-               --stringparam productversion "$(PRODUCTVERSION)" \
-               -o $@ \
-               $(SRCDIR)/helpcontent2/help3xsl/noscript.xsl \
-               $(if $(filter 
en-US,$*),$(SRCDIR),$(gb_HelpTranslatePartTarget_workdir)/$*)/helpcontent2/source/text/shared/help/browserhelp.xhp
 \
-       )
-       $(call gb_Trace_EndRange,$*/$(@F),XSL)
-
-
 # set of installed languages - has to be language independent
 $(gb_CustomTarget_workdir)/helpcontent2/help3xsl/languages.js : \
         $(SRCDIR)/helpcontent2/CustomTarget_html.mk
diff --git a/help3xsl/default.css b/help3xsl/default.css
index dda3942ac4..cf7a4a566b 100644
--- a/help3xsl/default.css
+++ b/help3xsl/default.css
@@ -34,6 +34,16 @@ do not break anything related to layout by scaling.
   --background-color: #f7f8f7;
   --module-color: #18A303;
 }
+/* Enable disable Javascript*/
+#WarnJS {
+    margin: 20px;
+    display:block;
+}
+#WarnJS h1{
+    color: red;
+    font-weight: bold;
+    text-align: center;
+}
 
 body,
 p,
diff --git a/help3xsl/help.js b/help3xsl/help.js
index 8e0dc54206..5f8485d5b3 100644
--- a/help3xsl/help.js
+++ b/help3xsl/help.js
@@ -7,6 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+// Javascript is available? If not, display warning block
+let h = document.getElementById("WarnJS");
+h.style.display = "none";
+
 // Pagination and bookmark search
 var url = window.location.pathname;
 var moduleRegex = new RegExp('text\/(\w+)\/');
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 22c84a4f0b..72fcd5822e 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -150,7 +150,6 @@
 <html lang="{$lang}" dir="{$direction}">
     <head>
         <base href="{$install}"/>
-        <noscript><meta http-equiv="refresh" content="0; 
URL={$install}{$lang}/noscript.html"/></noscript>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
         <xsl:if test="$online">
             <meta http-equiv="Content-Security-Policy" content="script-src 
'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org"/>
@@ -230,6 +229,11 @@
         </div>
     </div>
     <div id="DisplayArea" itemprop="softwareHelp" itemscope="true" 
itemtype="http://schema.org/SoftwareApplication";>
+        <div id="WarnJS">
+            <h1 dir="auto">
+            <xsl:call-template name="brand"><xsl:with-param 
name="string"><xsl:value-of 
select="$tmp_doc_ui//variable[@id='noscriptmsg']"/></xsl:with-param></xsl:call-template>
+            </h1>
+        </div>
         <xsl:if test="$online">
             <xsl:if test="$xapian='yes'">
                 <div class="xapian-omega-search">

Reply via email to