
Code:
- <script type="text/javascript">
- <!--
- //Spoiler Script
- //Written by Dranew
- //Do not rip or claim as your own.
-
- if(location.href.match(/view_topic/)) {
- var post = get('td','tag');
- var sid = 0;
- for(a=0;a<post.length;a++) {
- if(post[a].className == "post") {
- post[a].innerHTML = post[a].innerHTML.replace(/\[spoiler\]/g, "<div id='spoiler'>").replace(/\[\/spoiler\]/g, "</div>");
- }
- }
- for(b=0;b<post.length;b++) {
- if(post[b].className == "post") {
- var div = post[b].getElementsByTagName('div')
- for(c=0;c<div.length;c++) {
- if(div[c].id == "spoiler") {
- var spoil = div[c].innerHTML
- div[c].innerHTML = "<center><span class='header' style='width: 498px; height: 20px;'></span><span class='head' style='width: 496px;'><center><a href='javascript:dispSpoil("+sid+")' id='sl"+sid+"'>Open Spoiler</a></center></span><span class=' window1 text' style='display: none; width: 496px;' id='s"+sid+"'>"+spoil+"</span><span class='base' style='width: 498px; height: 20px;'></span></center>";
- sid++
- }
- }
- }
- }
- function dispSpoil(ID) {
- var spoilText = document.getElementById("s"+ID)
- var spoilLabel = document.getElementById("sl"+ID)
- spoilLabel.innerHTML = (spoilLabel.innerHTML == "Open Spoiler")? 'Close Spoiler' : 'Open Spoiler';
- spoilText.style.display = (spoilText.style.display == "none")? '' : 'none';
- }
- }
- var icon = 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/spoiltag.png'
- var testid = 'Spoiler'
-
- function qrbuild(){
- _a = document.createElement('a');
- _a.href = testid;
- _a.onclick = function(){add_ubbc('[spoiler]','[/spoiler]');};
- _a.style.cssText = "cursor: pointer;";
- _a.appendChild(_i);
- }
- function build(){
- var _i = document.createElement('img');
- _i.src = icon;
- _i.style.border='0';
- _a = document.createElement('a');
- _a.onclick = function(){add_ubbc('[spoiler]','[/spoiler]');};
- _a.style.cssText = "cursor: pointer;";
- _a.appendChild(_i);
- }
-
- if(get('ubbc_buttons','id')){
- build();
- get('ubbc_buttons','id').firstChild.insertBefore(_a, get('ubbc_buttons','id').firstChild.lastChild);
- }
- if(get('quick_reply_ubbc','id')){
- qrbuild();
- get('quick_reply_ubbc','id').childNodes[1].appendChild(_a);
- }
- //-->
- </script>

Code:
- var icon = 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/spoiltag.png'
- var testid = 'Spoiler'
-
- function qrbuild(){
- _a = document.createElement('a');
- _a.href = testid;
- _a.onclick = function(){add_ubbc('[spoiler]','[/spoiler]');};
- _a.style.cssText = "cursor: pointer;";
- _a.appendChild(_i);
- }
- function build(){
- var _i = document.createElement('img');
- _i.src = icon;
- _i.style.border='0';
- _a = document.createElement('a');
- _a.onclick = function(){add_ubbc('[spoiler]','[/spoiler]');};
- _a.style.cssText = "cursor: pointer;";
- _a.appendChild(_i);
- }
-
- if(get('ubbc_buttons','id')){
- build();
- get('ubbc_buttons','id').firstChild.insertBefore(_a, get('ubbc_buttons','id').firstChild.lastChild);
- }
- if(get('quick_reply_ubbc','id')){
- qrbuild();
- get('quick_reply_ubbc','id').childNodes[1].appendChild(_a);
- }