->''[=TVTropes=]: design patterns for fiction.''¬
¬
To do: insert witty and concise self-description here.¬
----¬
!Spoiler Toggle Bookmarklet¬
I've written a bookmarklet that allows you to reveal all the spoilers on a page. The code is based on {{Anemotaxis}}'s iPhone/iPod spoiler fix bookmarklet.¬
¬
To use the bookmarklet, first bookmark [[http://tvtropes.org/javascript:(function(textColor,linkColor)%7bvar%20s=document.getElementsByTagName(%22span%22);for(var%20i=0;i%3cs.length;i++)%7bif(s%5bi%5d.className==%22spoiler%22%7c%7cs%5bi%5d.className==%22supersecret%22)%7bs%5bi%5d.style.color=(s%5bi%5d.style.color==%22%22)?textColor:%22%22;var%20t=s%5bi%5d.getElementsByTagName(%22a%22);for(var%20j=0;j%3ct.length;j++)t%5bj%5d.style.color=(t%5bj%5d.style.color==%22%22)?linkColor:%22%22;%7d%7d%7d)(%22inherit%22,%22navy%22) this link]]. Then edit it and remove the [="http://tvtropes.org/"=] bit from the front of the URL. Finally, open up a page with lots of spoilers (like BetterThanItSoundsAnime), and open the bookmark to test it out. Opening the bookmark a second time hides the spoilers again.¬
¬
You can customize the colors used by changing the "black" (normal text color) and "navy" (link color) at the end of the URL.¬
¬
I've tested it on Firefox 3.0 and Internet Explorer 6.¬
¬
!!Changelog¬
:'''2009-08-01''':Now works in DarthWiki. [[http://tvtropes.org/javascript:(function(textColor,linkColor)%7bvar%20s=document.getElementsByTagName(%22span%22);for(var%20i=0;i%3cs.length;i++)%7bif(s%5bi%5d.className==%22spoiler%22%7c%7cs%5bi%5d.className==%22supersecret%22)%7bs%5bi%5d.style.color=(s%5bi%5d.style.color==%22%22)?textColor:%22%22;var%20t=s%5bi%5d.getElementsByTagName(%22a%22);for(var%20j=0;j%3ct.length;j++)t%5bj%5d.style.color=(t%5bj%5d.style.color==%22%22)?linkColor:%22%22;%7d%7d%7d)(%22inherit%22,%22navy%22)]]¬
:'''2009-07-12''':Now also reveals super-secret spoilers. [[http://tvtropes.org/javascript:(function(textColor,linkColor)%7bvar%20s=document.getElementsByTagName(%22span%22);for(var%20i=0;i%3cs.length;i++)%7bif(s%5bi%5d.className==%22spoiler%22%7c%7cs%5bi%5d.className==%22supersecret%22)%7bs%5bi%5d.style.color=(s%5bi%5d.style.color==%22%22)?textColor:%22%22;var%20t=s%5bi%5d.getElementsByTagName(%22a%22);for(var%20j=0;j%3ct.length;j++)t%5bj%5d.style.color=(t%5bj%5d.style.color==%22%22)?linkColor:%22%22;%7d%7d%7d)(%22black%22,%22navy%22)]]¬
:'''2009-07-11''':Original version. [[http://tvtropes.org/javascript:(function(textColor,linkColor)%7bvar%20s=document.getElementsByTagName(%22span%22);for(var%20i=0;i%3cs.length;i++)%7bif(s%5bi%5d.className==%22spoiler%22)%7bs%5bi%5d.style.color=(s%5bi%5d.style.color==%22%22)?textColor:%22%22;var%20t=s%5bi%5d.getElementsByTagName(%22a%22);for(var%20j=0;j%3ct.length;j++)t%5bj%5d.style.color=(t%5bj%5d.style.color==%22%22)?linkColor:%22%22;%7d%7d%7d)(%22black%22,%22navy%22)]]¬
----¬
<<|TheContributors|>>¬