diff options
author | André Malo <nd@apache.org> | 2012-05-08 23:18:40 +0200 |
---|---|---|
committer | André Malo <nd@apache.org> | 2012-05-08 23:18:40 +0200 |
commit | 86d35f0f0a74c8931dcf2592c6829710b32bf531 (patch) | |
tree | 4eb0a53c8eaad7c41c258ee9a6e60b4597b44058 /docs | |
parent | Make server variables (like %{REMOTE_ADDR}) stand out more. (diff) | |
download | apache2-86d35f0f0a74c8931dcf2592c6829710b32bf531.tar.xz apache2-86d35f0f0a74c8931dcf2592c6829710b32bf531.zip |
- simplify and cleanup comment integration script
- make comment version tag configurable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1335773 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs')
-rw-r--r-- | docs/manual/style/version.ent | 3 | ||||
-rw-r--r-- | docs/manual/style/xsl/common.xsl | 41 |
2 files changed, 25 insertions, 19 deletions
diff --git a/docs/manual/style/version.ent b/docs/manual/style/version.ent index 3894511b0a..4e6c06cdba 100644 --- a/docs/manual/style/version.ent +++ b/docs/manual/style/version.ent @@ -22,3 +22,6 @@ <!ENTITY httpd.patch "0"> <!ENTITY httpd.docs "trunk"> + +<!-- Version tag for disqus comments --> +<!ENTITY httpd.disqus "2.4"> diff --git a/docs/manual/style/xsl/common.xsl b/docs/manual/style/xsl/common.xsl index 70f4500211..cb63f659d1 100644 --- a/docs/manual/style/xsl/common.xsl +++ b/docs/manual/style/xsl/common.xsl @@ -20,6 +20,8 @@ <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp SYSTEM "util/nbsp.xml"> <!ENTITY lf SYSTEM "util/lf.xml"> + <!ENTITY % HTTPD-VERSION SYSTEM "../version.ent"> + %HTTPD-VERSION; ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -169,7 +171,7 @@ rel="stylesheet" href="{$path}/style/css/manual-print.css"/> <link href="{$path}/style/css/prettify.css" type="text/css" rel="stylesheet" />&lf; - <script type="text/javascript" src="{$path}/style/scripts/prettify.js">&lf; </script> &lf; + <script type="text/javascript" src="{$path}/style/scripts/prettify.js">&lf;</script>&lf; <!-- chm files do not need a favicon --> <xsl:if test="not($is-chm or $is-zip)">&lf; <link rel="shortcut icon" href="{$path}/images/favicon.ico" /> @@ -294,23 +296,24 @@ <h2><a name="comments_section" id="comments_section"><xsl:value-of select="$message[@id='comments']" /></a></h2> <div class="warning"><strong>This section is experimental!</strong><br/>Comments placed here should not be expected to last beyond the testing phase of this system, nor do we in any way guarantee that we'll read them.</div>&lf; -<div id="disqus_thread">&lf;</div> <script type="text/javascript"> -<xsl:text disable-output-escaping="yes"><![CDATA[<!--//--><![CDATA[//><!--]]></xsl:text> -var lang = '<xsl:value-of select="$doclang"/>';<![CDATA[ +<xsl:text disable-output-escaping="yes"><![CDATA[<!--//--><![CDATA[//><!-- var disqus_shortname = 'httpd'; -var disqus_identifier = window.location.href.replace(/(current|trunk)/, "2.4").replace(/\/[a-z]{2}\//, "/").replace(window.location.protocol, "http:") + '.' + lang; -if (disqus_identifier.indexOf("httpd.apache.org") != -1) { - (function() { - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = window.location.protocol + '//' + disqus_shortname + '.disqus.com/embed.js'; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); - })(); -} else { - var text = document.createTextNode("Comments have been disabled for offline viewing."); - document.getElementById('disqus_thread').appendChild(text); -} -]]><xsl:text disable-output-escaping="yes"><![CDATA[//--><!]]]]>></xsl:text></script> +var disqus_identifier = 'http://httpd.apache.org/docs/]]></xsl:text>&httpd.disqus;<xsl:value-of select="concat($metafile/path, $metafile/basename, '.html.', $doclang)" disable-output-escaping="yes" /><xsl:text disable-output-escaping="yes"><![CDATA['; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="disqus_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'http' + '://' + disqus_shortname + '.disqus.com/embed.js'; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="disqus_thread">Comments have been disabled for offline viewing.<\/div>'); + } +})(window, document); +//--><!]]]]>></xsl:text></script> </div> </xsl:when> </xsl:choose> @@ -340,11 +343,11 @@ if (disqus_identifier.indexOf("httpd.apache.org") != -1) { </div> <!-- /footer --> <script type="text/javascript"> -<xsl:text disable-output-escaping="yes"><![CDATA[<!--//--><![CDATA[//><!--]]></xsl:text><![CDATA[ -if (typeof(prettyPrint) !== undefined) { +<xsl:text disable-output-escaping="yes"><![CDATA[<!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); } -]]><xsl:text disable-output-escaping="yes"><![CDATA[//--><!]]]]>></xsl:text></script> +//--><!]]]]>></xsl:text></script> </xsl:template> <!-- /bottom --> |