From: Erik Moeller Date: Sun, 20 Jul 2003 13:13:06 +0000 (+0000) Subject: 1) moved some toc layout elements to stylesheet X-Git-Tag: 1.1.0~382 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=4e98711e3c5c00c426e4a52ac2bdaf51e10c04b6;p=lhc%2Fweb%2Fwiklou.git 1) moved some toc layout elements to stylesheet 2) fixed edit section bug (would not trigger on elements 3) show/hide javascript toggle text changes when clicked 4) toc centered, smaller font --- diff --git a/includes/Article.php b/includes/Article.php index aedebdb0be..c7dfdce5f1 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -79,7 +79,7 @@ class Article { if($action=="edit") { if($section!="") { - $secs=preg_split("/(^=+.*?=+)/m", + $secs=preg_split("/(^=+.*?=+|^.*?<\/h[1-6].*?>)/mi", $this->mContent, -1, PREG_SPLIT_DELIM_CAPTURE); if($section==0) { @@ -656,7 +656,7 @@ name=\"wpSummary\" maxlength=200 size=60>
// of the article if ($section != "") { $oldtext=$this->getContent(); - $secs=preg_split("/(^=+.*?=+)/m",$oldtext,-1,PREG_SPLIT_DELIM_CAPTURE); + $secs=preg_split("/(^=+.*?=+|^.*?<\/h[1-6].*?>)/mi",$oldtext,-1,PREG_SPLIT_DELIM_CAPTURE); $secs[$section*2]=$text."\n\n"; // replace with edited if($section) { $secs[$section*2-1]=""; } // erase old headline $text=join("",$secs); diff --git a/includes/Skin.php b/includes/Skin.php index fc52a2e0f3..cf4a49206c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1721,20 +1721,13 @@ class Skin { } function tocTable($toc) { - -/* does not auto-expand, use table for now - return " -
- ".wfMsg("toc")."

- $toc

"; -*/ + // note to CSS fanatics: putting this in a div does not works -- div won't auto-expand return - "
\n" . - "
\n". + "
\n". "".wfMsg("toc")."" . " " . - "
\n". - $toc."

\n"; + "

\n". + $toc."

\n"; } function editSectionLink($section) { diff --git a/stylesheets/wikibits.js b/stylesheets/wikibits.js index d57d5b0aff..2d22bf301b 100644 --- a/stylesheets/wikibits.js +++ b/stylesheets/wikibits.js @@ -47,26 +47,30 @@ function guessTimezone(box) { document.preferences.wpHourDiff.value = fetchTimezone(); } -var tocShow, tocHide; function showTocToggle(show,hide) { if(document.getElementById) { - document.writeln('[' + - hide + '/' + show + ']'); - tocShow = show; - tocHide = hide; + document.writeln('[' + + '' + + '' + hide + '' + + ']'); } } function toggleToc() { var toc = document.getElementById('tocinside'); - var tog = document.getElementById('toctoggle'); + var showlink=document.getElementById('showlink'); + var hidelink=document.getElementById('hidelink'); if(toc.style.display == 'none') { - toc.style.display = tocWas; - // tog.innerHtml = tocHide; + toc.style.display = tocWas; + hidelink.style.display=''; + showlink.style.display='none'; + } else { tocWas = toc.style.display; toc.style.display = 'none'; - // tog.innerHtml = tocShow; + hidelink.style.display='none'; + showlink.style.display=''; + } } diff --git a/stylesheets/wikistandard.css b/stylesheets/wikistandard.css index cf63ca63cc..5b6cc04c17 100644 --- a/stylesheets/wikistandard.css +++ b/stylesheets/wikistandard.css @@ -7,6 +7,7 @@ } #quickbar { width: 140px; padding: 4px; visibility: visible; z-index: 99; } #topbar { padding: 4px; } +#toc { border:1px solid #8888aa; background-color:#f3f3ff;padding:5px;font-size:90%; } .bodytext { } a.interwiki, a.external { color: #3366BB; } a.printable { text-decoration: underline; }