diff options
author | andi <andi@splitbrain.org> | 2005-06-24 15:41:14 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-06-24 15:41:14 +0200 |
commit | 90f3a5b141fc1e54922aa4fffcf026cfa542f2a8 (patch) | |
tree | a6fe481beca28b8327d37b79ae0fa2bb1f7c5f59 | |
parent | 90db23d71d75b2d863812238d45064285332ff85 (diff) | |
download | rpg-90f3a5b141fc1e54922aa4fffcf026cfa542f2a8.tar.gz rpg-90f3a5b141fc1e54922aa4fffcf026cfa542f2a8.tar.bz2 |
fixed problem with TOC toggle and W3C validator
darcs-hash:20050624134114-9977f-4d08d9644dbc6836b55ec5c83aa6b10980a545be.gz
-rw-r--r-- | inc/parser/xhtml.php | 7 | ||||
-rw-r--r-- | 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>' |