File Not Found
Guest
- Author
- File Not Found
- Contributors
- N/A
- Quickbar Entry
-
javascript: function getElementsByClass(searchClass, node, tag)
{var classElements = new Array();
if (node == null) node = document;
if (tag == null) tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)" + searchClass + "(\\s|$)");
for (i = 0, j = 0;i < elsLen;i++)
{if (pattern.test(els[i].className))
{classElements[j] = els[i];
j++;
}
}
return classElements;
}
divs = getElementsByClass("igmline small");
posters = [];
for(i=0; i < divs.length; i++)
{posters[i] = divs[i].getElementsByTagName("a")[0].firstChild.nodeValue;
divs[i].getElementsByTagName("span")[0].innerHTML += ' <a href="javascript: hideVar_'+i+' = divs['+i+'].parentNode.getElementsByTagName(\'div\')[1]; if(hideVar_'+i+'.style.display == \'inherit\'){hideVar_'+i+'.style.display = \'none\';} else {hideVar_'+i+'.style.display = \'inherit\';} void(0);"> Show / Hide this post</a>';
divs[i].getElementsByTagName("span")[0].innerHTML += ' ';
divs[i].getElementsByTagName("span")[0].innerHTML += '<a href="javascript: butt_pirate = \''+posters[i]+'\'; for(i=0; i < divs.length; i++){if(posters[i] == butt_pirate){hideVar = divs[i].parentNode.getElementsByTagName(\'div\')[1]; if(hideVar.style.display == \'inherit\'){hideVar.style.display = \'none\';} else {hideVar.style.display = \'inherit\';}}} void(0);">Show / Hide All posts by '+posters[i]+'</a>';
}
void(0);
- Public?
- Public
Given the recent request from players for a skype smiley script for the tribe forums, I've of late been doing quite a number of forum related scripts. The below is one such script.
Right, in it's current stage, you will need to use the "open forum in new window button", and as such, this script will need to be used as a browser bookmark, however, I will fix that, once I get over my irritation with iframes.
The below script, when run, will add two button to the header bar for posts on your tribe forum.
Those button are... Show/Hide post, and, Show/Hide all posts by USER_X
The script has been approved, so feel free to try it out, and let me know what you think, or if you can think of any improvements, or additional features of a similar nature you'd like.
[spoil]
[/spoil]
Right, in it's current stage, you will need to use the "open forum in new window button", and as such, this script will need to be used as a browser bookmark, however, I will fix that, once I get over my irritation with iframes.
The below script, when run, will add two button to the header bar for posts on your tribe forum.
Those button are... Show/Hide post, and, Show/Hide all posts by USER_X
The script has been approved, so feel free to try it out, and let me know what you think, or if you can think of any improvements, or additional features of a similar nature you'd like.
[spoil]
Code:
javascript: function getElementsByClass(searchClass, node, tag)
{var classElements = new Array();
if (node == null) node = document;
if (tag == null) tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)" + searchClass + "(\\s|$)");
for (i = 0, j = 0;i < elsLen;i++)
{if (pattern.test(els[i].className))
{classElements[j] = els[i];
j++;
}
}
return classElements;
}
divs = getElementsByClass("igmline small");
posters = [];
for(i=0; i < divs.length; i++)
{posters[i] = divs[i].getElementsByTagName("a")[0].firstChild.nodeValue;
divs[i].getElementsByTagName("span")[0].innerHTML += ' <a href="javascript: hideVar_'+i+' = divs['+i+'].parentNode.getElementsByTagName(\'div\')[1]; if(hideVar_'+i+'.style.display == \'inherit\'){hideVar_'+i+'.style.display = \'none\';} else {hideVar_'+i+'.style.display = \'inherit\';} void(0);"> Show / Hide this post</a>';
divs[i].getElementsByTagName("span")[0].innerHTML += ' ';
divs[i].getElementsByTagName("span")[0].innerHTML += '<a href="javascript: butt_pirate = \''+posters[i]+'\'; for(i=0; i < divs.length; i++){if(posters[i] == butt_pirate){hideVar = divs[i].parentNode.getElementsByTagName(\'div\')[1]; if(hideVar.style.display == \'inherit\'){hideVar.style.display = \'none\';} else {hideVar.style.display = \'inherit\';}}} void(0);">Show / Hide All posts by '+posters[i]+'</a>';
}
void(0);
Upvote
0