[Libreoffice-commits] help.git: help3xsl/help.html help3xsl/index2.html help3xsl/index.html help3xsl/online_transform.xsl

Olivier Hallot olivier.hallot at libreoffice.org
Wed Jan 10 00:15:24 UTC 2018


 help3xsl/help.html            |    1 
 help3xsl/index.html           |    1 
 help3xsl/index2.html          |   83 +++++++++++++++++++++---------------------
 help3xsl/online_transform.xsl |    1 
 4 files changed, 45 insertions(+), 41 deletions(-)

New commits:
commit 2c7cfc527a05ef757ab3ecfd6ab5a2582a104680
Author: Olivier Hallot <olivier.hallot at libreoffice.org>
Date:   Tue Jan 9 12:44:59 2018 -0200

    Add Content-Security-Policies in new Help pages
    
    Change-Id: I115fc16fbf4b8284bfedc735761434bb586f0355
    Reviewed-on: https://gerrit.libreoffice.org/47660
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
    Tested-by: Olivier Hallot <olivier.hallot at libreoffice.org>

diff --git a/help3xsl/help.html b/help3xsl/help.html
index 8dc4e67c2..015f75357 100644
--- a/help3xsl/help.html
+++ b/help3xsl/help.html
@@ -9,6 +9,7 @@
 <html>
 <head>
     <script type="text/javascript" src="latest/help.js"></script>
+    <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org *.google.com *.googleapis.com"/>
 </head>
 <body>
 <script type="text/javascript">
diff --git a/help3xsl/index.html b/help3xsl/index.html
index 9300f1b86..fcaa9bdda 100644
--- a/help3xsl/index.html
+++ b/help3xsl/index.html
@@ -8,6 +8,7 @@
 -->
 <html>
 <head>
+    <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org *.google.com *.googleapis.com"/>
 </head>
 <body>
 <script type="text/javascript">
diff --git a/help3xsl/index2.html b/help3xsl/index2.html
index adc2010e8..6f4fc7f39 100644
--- a/help3xsl/index2.html
+++ b/help3xsl/index2.html
@@ -7,46 +7,47 @@
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 -->
 <html>
-	<head>
-	<script type="text/javascript" src="help.js"></script>
-	<script type="text/javascript" src="hid2file.js"></script>
-	</head>
-	<body>
-        <script type="text/javascript">
-        var url = window.location.href;
-        var n = url.indexOf('index.html?');
-        if (n != -1){
-        // the URL came from LibreOffice help (F1)
-            var version = getParameterByName("Version",url);
-            var lang = getParameterByName("Language",url);
-            var system  = getParameterByName("System",url);
-            var rest= url.substr(n+11,url.lenght);
-            var module;
-            var defaultFile;
-            var smodule = rest.substr(0, rest.indexOf('/'));
-            switch (smodule) {
-            case "swriter":   {defaultFile='text/swriter/main0000.html';module="WRITER";break;}
-            case "scalc":     {defaultFile='text/scalc/main0000.html';module="CALC";break;}
-            case "simpress":  {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;}
-            case "sdraw":     {defaultFile='text/sdraw/main0000.html';module="DRAW";break;}
-            case "smath":     {defaultFile='text/smath/main0000.html';module="MATH";break;}
-            case "sdatabase": {defaultFile='text/shared/explorer/database/main.html';module="BASE";break;}
-            case "sbasic":    {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;}
-            default:          {defaultFile='text/shared/main0000.html';module="WRITER";break;}
-            }
-            var bookmark = rest.slice(rest.indexOf('/')+1, rest.indexOf('?'));
-            var file = map[bookmark];
-            // rebuild URL
-            if (file=='undefined'){
-                file = defaultFile;
-            }
-            var newURL = lang+'/'+file+'?System='+system+'&DbPAR='+module;
-            window.open(newURL,'_self');
-        }else{
-        // URL came from elsewhere, direct access to webroot, we redirect to main Help page
-            window.open('en-US/text/shared/main0108.html?&DbPAR=WRITER&System=WIN','_self');
-        }
-    </script>
-	</body>
+<head>
+    <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org *.google.com *.googleapis.com"/>
+    <script type="text/javascript" src="help.js"></script>
+    <script type="text/javascript" src="hid2file.js"></script>
+</head>
+<body>
+<script type="text/javascript">
+    var url = window.location.href;
+    var n = url.indexOf('index.html?');
+    if (n != -1){
+    // the URL came from LibreOffice help (F1)
+    var version = getParameterByName("Version",url);
+    var lang = getParameterByName("Language",url);
+    var system  = getParameterByName("System",url);
+    var rest= url.substr(n+11,url.lenght);
+    var module;
+    var defaultFile;
+    var smodule = rest.substr(0, rest.indexOf('/'));
+    switch (smodule) {
+    case "swriter":   {defaultFile='text/swriter/main0000.html';module="WRITER";break;}
+    case "scalc":     {defaultFile='text/scalc/main0000.html';module="CALC";break;}
+    case "simpress":  {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;}
+    case "sdraw":     {defaultFile='text/sdraw/main0000.html';module="DRAW";break;}
+    case "smath":     {defaultFile='text/smath/main0000.html';module="MATH";break;}
+    case "sdatabase": {defaultFile='text/shared/explorer/database/main.html';module="BASE";break;}
+    case "sbasic":    {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;}
+    default:          {defaultFile='text/shared/main0000.html';module="WRITER";break;}
+    }
+    var bookmark = rest.slice(rest.indexOf('/')+1, rest.indexOf('?'));
+    var file = map[bookmark];
+    // rebuild URL
+    if (file=='undefined'){
+    file = defaultFile;
+    }
+    var newURL = lang+'/'+file+'?System='+system+'&DbPAR='+module;
+    window.open(newURL,'_self');
+    }else{
+    // URL came from elsewhere, direct access to webroot, we redirect to main Help page
+    window.open('en-US/text/shared/main0108.html?&DbPAR=WRITER&System=WIN','_self');
+    }
+</script>
+</body>
 </html>
 
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index ab787411c..31295b51d 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -120,6 +120,7 @@
     <head>
         <base href="{$install}"/>
         <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
+        <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org *.google.com *.googleapis.com"/>
         <title><xsl:value-of select="$titleL10N"/></title>
         <link rel="shortcut icon" href="{$productversion}/media/navigation/favicon.ico" />
         <link  type="text/css" href="{$productversion}/normalize.css" rel="Stylesheet" />


More information about the Libreoffice-commits mailing list