<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Discussion on Wikipedia Table of Contents | Userscripts.org</title>
    <link>http://userscripts.org/scripts/show/31240</link>
    <description>Recent comments on userscript: Wikipedia Table of Contents</description>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>Pls fix the bug of extra long TOC, replied by benchen</title>
      <description>&lt;p&gt;it may not happen often in en.wikipedia, but at least some highly visited pages always have extra long TOC, for example, the village pump or the Article for Deletion. Please fix it.&lt;/p&gt;</description>
      <pubDate>Mon, 27 Apr 2009 15:06:37 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25659:115274</guid>
      <author>benchen</author>
      <link>http://userscripts.org/posts/115274</link>
    </item>
    <item>
      <title>Archived Comments, replied by Arun R</title>
      <description>&lt;p&gt;Thanks. The whole heading is now a collapse button.&lt;/p&gt;</description>
      <pubDate>Thu, 07 Aug 2008 14:32:01 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:17562:77089</guid>
      <author>Arun R</author>
      <link>http://userscripts.org/posts/77089</link>
    </item>
    <item>
      <title>Archived Comments, replied by Softyx</title>
      <description>&lt;p&gt;hi,&lt;/p&gt;

&lt;p&gt;really nice script ;)&lt;/p&gt;

&lt;p&gt;Softyx&lt;/p&gt;</description>
      <pubDate>Thu, 07 Aug 2008 08:28:37 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:17562:77090</guid>
      <author>Softyx</author>
      <link>http://userscripts.org/posts/77090</link>
    </item>
    <item>
      <title>Archived Comments, replied by nickmcclendon</title>
      <description>&lt;p&gt;Nice script! I tweaked it up a bit to my liking, and this is the result I got (in case you care at all).
&lt;br /&gt;It's a bit more wiki-esqe, and the whole heading is now the collapse button (I found the small square to difficult to manage).
&lt;br /&gt;&lt;pre&gt;// ==UserScript==
// @name        Wikipedia Table of Contents
// @description You can see the page overview from the table of contents and go to the 
//              desired section without losing sight of the table of contents. The TOC scrolls with the 
//              page and can be minimized or maximized at will.
// @include     http://*.wikipedia.org*
// @namespace   arunr.org
// ==/UserScript==

function buildTOC() {
	var myTOC = createTOC();
	populateTOC(myTOC);
	styleTOC(myTOC);
	appendYUILibs();
}

function styleTOC(myTOC) {
	myTOC.style.position = &quot;fixed&quot;;
	myTOC.style.top = &quot;20px&quot;;
	myTOC.style.right=&quot;10px&quot;;
	myTOC.style.width=&quot;250px&quot;;
	myTOC.style.backgroundColor = &quot;white&quot;;
	//myTOC.style.opacity = 0.7;
	myTOC.style.color=&quot;black&quot;;
	myTOC.style.fontFamily=&quot;Arial, serif&quot;;
	myTOC.style.padding=&quot;3px&quot;;
	myTOC.style.fontSize=&quot;11px&quot;;
	myTOC.style.zIndex = 1000000;

	var mySTYLE = document.createElement(&quot;style&quot;);
	mySTYLE.type=&quot;text/css&quot;;
	var newStyle1 = document.createTextNode(&quot;#toc {border:none;}&quot;);
	var newStyle2 = document.createTextNode('#wikiTOC ul li a {color: #002BB8;}');
	mySTYLE.appendChild(newStyle1);
	mySTYLE.appendChild(newStyle2);

	var pageHEAD = document.getElementsByTagName(&quot;head&quot;)[0];
	pageHEAD.appendChild(mySTYLE);
}

function appendYUILibs() {
	var mySCRIPT = document.createElement(&quot;script&quot;);
	mySCRIPT.src=&quot;http://yui.yahooapis.com/2.5.0/build/yahoo-dom-event/yahoo-dom-event.js&quot;;
	var mySCRIPT1 = document.createElement(&quot;script&quot;);
	mySCRIPT1.src=&quot;http://yui.yahooapis.com/2.5.0/build/dragdrop/dragdrop-min.js&quot;;

	var myHEAD = document.getElementsByTagName(&quot;head&quot;)[0];
	myHEAD.appendChild(mySCRIPT);
	myHEAD.appendChild(mySCRIPT1);
	enableDD();
}

function enableDD() {
	//YAHOO = unsafeWindow.YAHOO || null;
	var myDD = YAHOO.util.DD(&quot;wikiTOC&quot;);
}

function populateTOC() {
	var tocBODY = document.getElementById(&quot;wikiTOCBODY&quot;);
	tocBODY.style.overflow = &quot;auto&quot;;
	var maxh = window.innerHeight - 75;
	tocBODY.style.maxHeight = (maxh) + &quot;px&quot;;
	tocBODY.style.padding = &quot;0 5px&quot;;
	var tocTable = document.getElementById(&quot;toc&quot;);
	var tocUL = tocTable.getElementsByTagName(&quot;td&quot;)[0].getElementsByTagName(&quot;ul&quot;)[0];
	var mytocBODY = &quot;&lt;ul&gt;&quot;+tocUL.innerHTML+&quot;&lt;/ul&gt;&quot;;
	tocBODY.innerHTML = mytocBODY;
	tocTable.innerHTML = &quot;&quot;;
}

function createTOC() {
	var myTOC = document.createElement(&quot;div&quot;);
	myTOC.id = &quot;toc&quot;; //&quot;wikiTOC&quot;;
	
	var myHEAD = document.createElement(&quot;div&quot;);
	myHEAD.id = &quot;wikiTOCHEAD&quot;;
	var myHEADING = document.createElement(&quot;p&quot;);
	myHEADING.innerHTML = &quot;Table of contents&quot;;
	myHEADING.style.border=&quot;1px solid #aaaaaa&quot;;
	myHEADING.style.padding = &quot;2px&quot;;
	myHEADING.addEventListener(&quot;click&quot;, toggleTOCBODY, false);
	myHEAD.appendChild(myHEADING);
	
	var myBODY = document.createElement(&quot;div&quot;);
	myBODY.id = &quot;wikiTOCBODY&quot;;
	myBODY.style.border=&quot;1px solid #aaaaaa&quot;;
	
	myTOC.appendChild(myHEAD);
	myTOC.appendChild(myBODY);
	var wikiBody = document.getElementsByTagName(&quot;body&quot;)[0].appendChild(myTOC);
	return myTOC;
}

function toggleTOCBODY(){
	var tocBODY = document.getElementById(&quot;wikiTOCBODY&quot;);
	var tocICON = document.getElementById(&quot;tocICON&quot;);
	if (tocBODY.style.display==&quot;none&quot;){
		tocBODY.style.display=&quot;block&quot;;
	} else {
		tocBODY.style.display=&quot;none&quot;;
	}
}

window.addEventListener(&quot;load&quot;, buildTOC, false);&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 07 Aug 2008 05:19:13 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:17562:77091</guid>
      <author>nickmcclendon</author>
      <link>http://userscripts.org/posts/77091</link>
    </item>
    <item>
      <title>Archived Comments, replied by Jesse Andrews</title>
      <description>&lt;p&gt;The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)&lt;/p&gt;</description>
      <pubDate>Wed, 17 Nov 2004 01:05:51 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:17562:77088</guid>
      <author>Jesse Andrews</author>
      <link>http://userscripts.org/posts/77088</link>
    </item>
  </channel>
</rss>
