[Libreoffice-commits] dev-tools.git: help3/html

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 7 17:19:48 UTC 2019


 help3/html/ed_transform.xsl |    3 +--
 help3/html/xhp2html.js      |   25 ++++++++++++++++---------
 2 files changed, 17 insertions(+), 11 deletions(-)

New commits:
commit c1f33b3d2b36ee920e41d01dddb865050166d30a
Author:     Olivier Hallot <olivier.hallot at libreoffice.org>
AuthorDate: Mon Jan 7 12:30:18 2019 -0200
Commit:     Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Mon Jan 7 18:19:28 2019 +0100

    More work in Help editor
    
    Change-Id: I73b84e4b3edddac90c576cab911d136867665aa6
    Reviewed-on: https://gerrit.libreoffice.org/65936
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
    Tested-by: Olivier Hallot <olivier.hallot at libreoffice.org>

diff --git a/help3/html/ed_transform.xsl b/help3/html/ed_transform.xsl
index 8e045cb..f3d4f85 100644
--- a/help3/html/ed_transform.xsl
+++ b/help3/html/ed_transform.xsl
@@ -21,7 +21,6 @@
 
 <xsl:output indent="yes" method="html" doctype-system= "about:legacy-compat"/>
 
-<xsl:include href="hc2/help3xsl/localized.xsl"/>
 <xsl:include href="hc2/help3xsl/links.txt.xsl"/>
 <!--
 ############################
@@ -1064,7 +1063,7 @@
                         </xsl:otherwise>
                     </xsl:choose>
                 </xsl:variable>
-                <xsl:value-of select="concat($target,'media/icon-themes/',$aux00)"/>
+                <xsl:value-of select="concat($img_url_prefix,$aux00)"/>
             </xsl:when>
             <xsl:otherwise>
                 <xsl:value-of select="concat($target, at src)"/>
diff --git a/help3/html/xhp2html.js b/help3/html/xhp2html.js
index 46e7e0a..6d21dff 100644
--- a/help3/html/xhp2html.js
+++ b/help3/html/xhp2html.js
@@ -7,6 +7,9 @@
  *
  */
 
+/* change these parameters to fit your installation */
+
+var prefixURL="http://localhost/ed/"
 var helpcontent2 = "/hc2/";
 var productname = "LibreOffice";
 var productversion = "6.3";
@@ -32,11 +35,13 @@ function loadDoc(filename, isXML)
 //         }
 //     };
 
-    xhttp.open("GET", filename, false);
+    xhttp.open("GET", prefixURL + filename, false);
     try {xhttp.responseType = "msxml-document"} catch(err) {} // Helping IE11
 //     if isXML=true return XML otherwise return a text string
     xhttp.send(null);
-    return (isXML) ? xhttp.responseXML : xhttp.responseText;
+    var response =  (isXML) ? xhttp.responseXML : xhttp.responseText;
+    delete xhttp;
+    return response
 }
 
 function displayResult()
@@ -49,8 +54,10 @@ function displayResult()
     var oParser = new DOMParser();
     // Parse XML contents
     var xml = oParser.parseFromString( editor.doc.getValue(), "application/xml");
-    // Load XSLT
-    var xsl = loadDoc("/ed/ed_transform.xsl", true);
+    // Load XSLT as TXT because XML it has issues
+    var xsl1 = loadDoc("ed_transform.xsl", false);
+    var oParser2 = new DOMParser();
+    var xsl = oParser2.parseFromString( xsl1, "application/xml");
     // Process transformation & display in 'renderedpage'
     // code for IE
     if (window.ActiveXObject || xhttp.responseType == "msxml-document")
@@ -63,11 +70,11 @@ function displayResult()
     {
         var xsltProcessor = new XSLTProcessor();
         xsltProcessor.importStylesheet(xsl);
-        xsltProcessor.setParameter("", "root", root)
-        xsltProcessor.setParameter("", "local", local)
-        xsltProcessor.setParameter("", "language", language)
-        xsltProcessor.setParameter("", "productname", productname)
-        xsltProcessor.setParameter("", "productversion", productversion)
+        xsltProcessor.setParameter("", "root", root);
+        xsltProcessor.setParameter("", "local", local);
+        xsltProcessor.setParameter("", "language", language);
+        xsltProcessor.setParameter("", "productname", productname);
+        xsltProcessor.setParameter("", "productversion", productversion);
         var resultDocument = xsltProcessor.transformToFragment(xml, document);
         document.getElementById("renderedpage").appendChild(resultDocument.getElementById("DisplayArea"));
     }


More information about the Libreoffice-commits mailing list