Post by Ross on Jul 3, 2007 11:50:05 GMT -8
Global Footer
This code will change the Nav-Tree back into the style used in v3 of the software and which is still used by some other forum providers where each level is on a seperate line and is indented slightly further than the previous line. Hopefully this one will be fully cross browser
If you want to, you can download and reupload the spacer images to your own host or you can change them to your own custom images if you'd prefer. The image URLs are all on the first few lines
<script type='text/javascript'>
<!--
/* PBv3 Style Nav Tree - Ross of PBS */
var folder_url = 'http://img505.imageshack.us/img505/4463/navfoldermh1.gif';
var indents = new Array(
new Array('http://img515.imageshack.us/img515/945/tlinemn8.gif','|-'),
new Array('http://img505.imageshack.us/img505/4479/tline2zk7.gif','| |-'),
new Array('http://img505.imageshack.us/img505/5259/tline3wv7.gif','| | |-')
);
var td = document.getElementsByTagName('td');
var nav = document.createElement('div');
for(i=0; i<td.length; i++) {
if(td.item(i).vAlign == 'top' && td.item(i).width == '100%') {
var count = 0;
var folder = document.createElement('img');
folder.src = folder_url;
folder.alt = '*';
while(td.item(i).firstChild && !td.item(i).firstChild.nodeName.toString().match(/^(script|table)$/i)) {
if(td.item(i).firstChild.nodeName == 'A' || (td.item(i).firstChild.nodeName == '#text' && td.item(i).firstChild.nextSibling.nodeName == 'BR' && count > 0)) {
if(td.item(i).firstChild.nodeName == '#text')
td.item(i).firstChild.nodeValue = td.item(i).firstChild.nodeValue.substr(3, td.item(i).firstChild.nodeValue.length);
if(count > 0) {
nav.appendChild(document.createElement('br'));
var img = document.createElement('img');
img.src = indents[count-1][0];
img.alt = indents[count-1][1];
nav.appendChild(img);
}
nav.appendChild(folder.cloneNode(true));
if(count < 3)
nav.appendChild(document.createTextNode(' '));
count++;
}
if(td.item(i).firstChild.nodeName != '#text' || td.item(i).firstChild.nodeValue != ' :: ')
nav.appendChild(td.item(i).firstChild);
else
td.item(i).removeChild(td.item(i).firstChild);
}
td.item(i).insertBefore(nav, td.item(i).firstChild);
break;
}
}
//-->
</script>
This code will change the Nav-Tree back into the style used in v3 of the software and which is still used by some other forum providers where each level is on a seperate line and is indented slightly further than the previous line. Hopefully this one will be fully cross browser
If you want to, you can download and reupload the spacer images to your own host or you can change them to your own custom images if you'd prefer. The image URLs are all on the first few lines
<script type='text/javascript'>
<!--
/* PBv3 Style Nav Tree - Ross of PBS */
var folder_url = 'http://img505.imageshack.us/img505/4463/navfoldermh1.gif';
var indents = new Array(
new Array('http://img515.imageshack.us/img515/945/tlinemn8.gif','|-'),
new Array('http://img505.imageshack.us/img505/4479/tline2zk7.gif','| |-'),
new Array('http://img505.imageshack.us/img505/5259/tline3wv7.gif','| | |-')
);
var td = document.getElementsByTagName('td');
var nav = document.createElement('div');
for(i=0; i<td.length; i++) {
if(td.item(i).vAlign == 'top' && td.item(i).width == '100%') {
var count = 0;
var folder = document.createElement('img');
folder.src = folder_url;
folder.alt = '*';
while(td.item(i).firstChild && !td.item(i).firstChild.nodeName.toString().match(/^(script|table)$/i)) {
if(td.item(i).firstChild.nodeName == 'A' || (td.item(i).firstChild.nodeName == '#text' && td.item(i).firstChild.nextSibling.nodeName == 'BR' && count > 0)) {
if(td.item(i).firstChild.nodeName == '#text')
td.item(i).firstChild.nodeValue = td.item(i).firstChild.nodeValue.substr(3, td.item(i).firstChild.nodeValue.length);
if(count > 0) {
nav.appendChild(document.createElement('br'));
var img = document.createElement('img');
img.src = indents[count-1][0];
img.alt = indents[count-1][1];
nav.appendChild(img);
}
nav.appendChild(folder.cloneNode(true));
if(count < 3)
nav.appendChild(document.createTextNode(' '));
count++;
}
if(td.item(i).firstChild.nodeName != '#text' || td.item(i).firstChild.nodeValue != ' :: ')
nav.appendChild(td.item(i).firstChild);
else
td.item(i).removeChild(td.item(i).firstChild);
}
td.item(i).insertBefore(nav, td.item(i).firstChild);
break;
}
}
//-->
</script>