From 90f3a5b141fc1e54922aa4fffcf026cfa542f2a8 Mon Sep 17 00:00:00 2001
From: andi <andi@splitbrain.org>
Date: Fri, 24 Jun 2005 15:41:14 +0200
Subject: [PATCH] fixed problem with TOC toggle and W3C validator

darcs-hash:20050624134114-9977f-4d08d9644dbc6836b55ec5c83aa6b10980a545be.gz
---
 inc/parser/xhtml.php  | 7 +------
 lib/scripts/script.js | 5 ++++-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index dad6dfb97..aa8d90897 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -70,12 +70,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         global $lang;
         $this->doc .= '<div class="toc">'.DOKU_LF;
         $this->doc .= '<div class="tocheader">';
-/*      The (+/-) version will work too but needs some CSS tweaking to look fine */
-/*      $this->doc .= ' <script type="text/javascript">showTocToggle("+","-")';*/
-        $this->doc .=  '<script type="text/javascript">showTocToggle(';
-        $this->doc .=    '\'<img src="'.DOKU_BASE.'lib/images/arrow_down.gif">\',';
-        $this->doc .=    '\'<img src="'.DOKU_BASE.'lib/images/arrow_up.gif">\')';
-        $this->doc .=  '</script>';
+        $this->doc .= ' <script type="text/javascript">showTocToggle("+","-")</script>';
         $this->doc .= $lang['toc'];
         $this->doc .= '</div>'.DOKU_LF;
         $this->doc .= '<div id="tocinside">'.DOKU_LF;
diff --git a/lib/scripts/script.js b/lib/scripts/script.js
index 5ad930281..9d667c7af 100644
--- a/lib/scripts/script.js
+++ b/lib/scripts/script.js
@@ -289,8 +289,11 @@ function suggestWikiname(){
 /**
  * This prints the switch to toggle the Table of Contents
  */
-function showTocToggle(show,hide) {
+function showTocToggle(showtxt,hidetxt) {
   if(document.getElementById) {
+		show = '<img src="'+DOKU_BASE+'lib/images/arrow_down.gif" alt="'+showtxt+'">';
+		hide = '<img src="'+DOKU_BASE+'lib/images/arrow_up.gif" alt="'+hidetxt+'">';
+
     document.writeln('<div class=\'toctoggle\'><a href="javascript:toggleToc()" class="toc">' +
     '<span id="showlink" style="display:none;">' + show + '</span>' +
     '<span id="hidelink">' + hide + '</span>'
-- 
GitLab