| Index: trunk/phase3/includes/Skin.php |
| — | — | @@ -1694,7 +1694,9 @@ |
| 1695 | 1695 | return |
| 1696 | 1696 | "<table border=\"0\" bgcolor=\"#8888aa\" cellpadding=\"0\" cellspacing=\"1\"><tr><td>\n" . |
| 1697 | 1697 | "<table border=\"0\" bgcolor=\"#f3f3ff\" CELLPADDING=5><tr><td>\n". |
| 1698 | | - "<b>".wfMsg("toc")."</b><p>\n". |
| | 1698 | + "<b>".wfMsg("toc")."</b>" . |
| | 1699 | + " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>" . |
| | 1700 | + "</td></tr><tr id='tocinside'><td>\n". |
| 1699 | 1701 | $toc."</td></tr></table></td></tr></table><P>\n"; |
| 1700 | 1702 | } |
| 1701 | 1703 | |
| Index: trunk/phase3/stylesheets/wikibits.js |
| — | — | @@ -34,6 +34,7 @@ |
| 35 | 35 | // in [-][H]H format... |
| 36 | 36 | // won't yet work with non-even tzs |
| 37 | 37 | function fetchTimezone() { |
| | 38 | + // FIXME: work around Safari bug |
| 38 | 39 | var localclock = new Date(); |
| 39 | 40 | // returns negative offset from GMT in minutes |
| 40 | 41 | var tzRaw = localclock.getTimezoneOffset(); |
| — | — | @@ -45,3 +46,27 @@ |
| 46 | 47 | function guessTimezone(box) { |
| 47 | 48 | document.preferences.wpHourDiff.value = fetchTimezone(); |
| 48 | 49 | } |
| | 50 | + |
| | 51 | +var tocShow, tocHide; |
| | 52 | +function showTocToggle(show,hide) { |
| | 53 | + if(document.getElementById) { |
| | 54 | + document.writeln('<small>[<a href="javascript:toggleToc()" id="toctoggle">' + |
| | 55 | + hide + '/' + show + '</a>]</small>'); |
| | 56 | + tocShow = show; |
| | 57 | + tocHide = hide; |
| | 58 | + } |
| | 59 | +} |
| | 60 | + |
| | 61 | +function toggleToc() { |
| | 62 | + var toc = document.getElementById('tocinside'); |
| | 63 | + var tog = document.getElementById('toctoggle'); |
| | 64 | + if(toc.style.display == 'none') { |
| | 65 | + toc.style.display = tocWas; |
| | 66 | + // tog.innerHtml = tocHide; |
| | 67 | + } else { |
| | 68 | + tocWas = toc.style.display; |
| | 69 | + toc.style.display = 'none'; |
| | 70 | + // tog.innerHtml = tocShow; |
| | 71 | + } |
| | 72 | +} |
| | 73 | + |