Post by Schubaltz on Jul 3, 2007 15:51:32 GMT -5
Description: As the name suggestions, this code numbers each line in the table.
Source: Open
Cross-browser: Yes
Global Footer
<script type="text/javascript">
<!--
// Code Tag Modification (Numbered Lines)
if(location.href.match(/action=((pm|calendar)view|display)/))
for(var l = document.links, k = 4; k < l.length; k ++) if(l[k].className == "nav") {
for(var i = l[k].parentNode.getElementsByTagName("table")[1].rows, x = 1; x < i.length; x ++)
if(i[x].cells[0].className.match(/windowbg2?/) && i[x].cells[1].innerHTML.match(/quote><b>code:/i)) {
var e = i[x].cells[1].firstChild.rows[1].cells[0].getElementsByTagName("blockquote");
for(var f = 0; f < e.length; f ++) {
var s = e[f].getElementsByTagName("table")[1];
if(s && s.className && s.className == "code") {
var t = [], r = s.rows[0].cells[0].firstChild;
for(var v = 0; v < r.innerHTML.split(/<br>/i).length; v ++)
t.push("<tr><td class='code'>" + (v + 1) + ": </td><td class='code'>" + r.innerHTML.split(/<br>/i)[v]);
r.innerHTML = "<table>" + t.join("</td></tr>") + "</table>";
s.rows[0].cells[0].appendChild(document.createComment(r.innerHTML));
var u = document.createElement("a");
u.appendChild(e[f].getElementsByTagName("b")[0].cloneNode(true));
u.href = "#";
u.onclick = function() {
var s = this.nextSibling.rows[0].cells[0].firstChild.rows[0].cells[0];
if(s.firstChild.firstChild.rows[0].cells.length > 1)
s.firstChild.innerHTML = s.firstChild.innerHTML.replace(/<td class="?code"?>\d+: <\/td>/ig, "");
else
s.firstChild.innerHTML = s.lastChild.data;
return false;
}
e[f].replaceChild(u, e[f].getElementsByTagName("b")[0]);
}
}
}
break;
}
//-->
</script>
Source: Open
Cross-browser: Yes
Global Footer
<script type="text/javascript">
<!--
// Code Tag Modification (Numbered Lines)
if(location.href.match(/action=((pm|calendar)view|display)/))
for(var l = document.links, k = 4; k < l.length; k ++) if(l[k].className == "nav") {
for(var i = l[k].parentNode.getElementsByTagName("table")[1].rows, x = 1; x < i.length; x ++)
if(i[x].cells[0].className.match(/windowbg2?/) && i[x].cells[1].innerHTML.match(/quote><b>code:/i)) {
var e = i[x].cells[1].firstChild.rows[1].cells[0].getElementsByTagName("blockquote");
for(var f = 0; f < e.length; f ++) {
var s = e[f].getElementsByTagName("table")[1];
if(s && s.className && s.className == "code") {
var t = [], r = s.rows[0].cells[0].firstChild;
for(var v = 0; v < r.innerHTML.split(/<br>/i).length; v ++)
t.push("<tr><td class='code'>" + (v + 1) + ": </td><td class='code'>" + r.innerHTML.split(/<br>/i)[v]);
r.innerHTML = "<table>" + t.join("</td></tr>") + "</table>";
s.rows[0].cells[0].appendChild(document.createComment(r.innerHTML));
var u = document.createElement("a");
u.appendChild(e[f].getElementsByTagName("b")[0].cloneNode(true));
u.href = "#";
u.onclick = function() {
var s = this.nextSibling.rows[0].cells[0].firstChild.rows[0].cells[0];
if(s.firstChild.firstChild.rows[0].cells.length > 1)
s.firstChild.innerHTML = s.firstChild.innerHTML.replace(/<td class="?code"?>\d+: <\/td>/ig, "");
else
s.firstChild.innerHTML = s.lastChild.data;
return false;
}
e[f].replaceChild(u, e[f].getElementsByTagName("b")[0]);
}
}
}
break;
}
//-->
</script>