|
Post by Wormopolis on Jul 23, 2011 7:35:03 GMT -8
well the first try didnt work and crashed my test board...
|
|
|
Post by Streamstrider on Jul 24, 2011 15:52:58 GMT -8
Sorry 'bout that. . . .
|
|
|
Post by Wormopolis on Jul 24, 2011 16:19:22 GMT -8
i just havent figured out a way to do it. you cant just sort the rows.
|
|
|
Post by Wormopolis on Jul 25, 2011 20:55:39 GMT -8
This working for you?
|
|
|
Post by Wormopolis on Jul 26, 2011 17:57:26 GMT -8
alright... give this one a shot:
<script type="text/javascript"> <!-- // Thread Title color based on First Letter // by Wormo - concept by streamstrider
var alsoAlphabetizeThreads=true;
var titleColorArray=new Array(); titleColorArray['A']='F09E47'; titleColorArray['B']='D72F20'; titleColorArray['C']='AFB70B'; titleColorArray['D']='A84505'; titleColorArray['E']='6C77B7'; titleColorArray['F']='6B809D'; titleColorArray['G']='765968'; titleColorArray['H']='A07688'; titleColorArray['I']='DC4314'; titleColorArray['C']='E3DAF3'; titleColorArray['K']='CBE813'; titleColorArray['L']='1FC3DC'; titleColorArray['M']='FA54C9'; titleColorArray['N']='CBEEF5'; titleColorArray['O']='20F102'; titleColorArray['P']='5118D9'; titleColorArray['Q']='E5E0D1'; titleColorArray['R']='8F0409'; titleColorArray['S']='AAB873'; titleColorArray['T']='F5DF18'; titleColorArray['U']='F63643'; titleColorArray['V']='1111DD'; titleColorArray['W']='0D6D59'; titleColorArray['X']='F5DF18'; titleColorArray['Y']='D36E02'; titleColorArray['Z']='F61825';
for (tds=document.getElementsByTagName('td'), tt=0; tt<tds.length; tt++) { if (tds[tt].width.match(/4(3|8)%/) && tds[tt].className.match(/windowbg/) && tds[tt].getElementsByTagName('font')[0]) { var fkeep=tds[tt].getElementsByTagName('font')[0]; var lkeep=(fkeep.innerText ? fkeep.innerText : fkeep.textContent).substr(0,1).toUpperCase(); if (titleColorArray[lkeep] && fkeep.firstChild && fkeep.firstChild.firstChild) fkeep.firstChild.firstChild.innerHTML='<font color="'+ titleColorArray[lkeep] +'">'+fkeep.firstChild.firstChild.innerHTML+'</font>'; } } // alphabetize part if (alsoAlphabetizeThreads) { var threadTable=fkeep.parentNode.parentNode.parentNode.parentNode; var postRows=threadTable.rows; var nwList=new Array(), ll=0, aa=2; advmodchk=postRows[1].cells[0].getElementsByTagName('input')[0]; while (aa<threadTable.rows.length-1) { if (!postRows[aa].innerHTML.match(/sticky(lock)?\.(gif|png)/) && postRows[aa].cells.length>1) { nwList[ll]=new Array(); var btitle=postRows[aa].cells[advmodchk ? 3 : 2].getElementsByTagName('b')[0]; nwList[ll][0]=(btitle.textContent ? btitle.textContent : btitle.innerText).toLowerCase(); nwList[ll][1]=threadTable.rows[aa].cloneNode(true); threadTable.deleteRow(aa); ll++; aa--; } aa++; } nwList.sort(); var backinRow=threadTable.rows[threadTable.rows.length-1]; if (advmodchk) backinRow=backinRow.previousSibling;
for (bb=0; bb<nwList.length; bb++) { backinRow.parentNode.insertBefore(nwList[bb][1], backinRow); } } // --> </script>
|
|
|
Post by Streamstrider on Aug 4, 2011 11:42:31 GMT -8
Awesome! It works! Thank you so much! Now I just have to change those colors. XD
|
|
|
Post by Wormopolis on Aug 4, 2011 19:58:20 GMT -8
if you already had colors from the previous version just move the old array into this version. uses same variable name.
|
|
|
Post by Wormopolis on Aug 6, 2011 19:20:40 GMT -8
I suppose I can submit this... and turn it off for the requests board...
|
|
|
Post by Streamstrider on Aug 20, 2011 20:35:03 GMT -8
Well, the colors just didn't work well with the skin, so I changed 'em to be readable. Again, thanks so much!
|
|
|
Post by Streamstrider on Nov 10, 2011 16:16:30 GMT -8
Found a problem. XD Took me forever to notice, surprisingly. In any board I use this code, I cannot utilize the advanced moderation tools. They're present, but when I click a button to say, move a topic, or even lock a topic, it just reloads the page. XD
|
|
|
Post by Wormopolis on Nov 10, 2011 20:24:13 GMT -8
that was the same problem the orginal alphabetize code had too...
|
|
|
Post by Streamstrider on Nov 11, 2011 16:10:44 GMT -8
Well, that's frustrating. . . . XD
|
|
|
Post by Wormopolis on Nov 11, 2011 22:51:38 GMT -8
try this
<script type="text/javascript"> <!-- // Thread Title color based on First Letter // with optional thread list alphabetize // by Wormo - concept by streamstrider
var titleColorArray=new Array(); titleColorArray['A']='F09E47'; titleColorArray['B']='D72F20'; titleColorArray['C']='AFB70B'; titleColorArray['D']='A84505'; titleColorArray['E']='6C77B7'; titleColorArray['F']='6B809D'; titleColorArray['G']='765968'; titleColorArray['H']='A07688'; titleColorArray['I']='DC4314'; titleColorArray['C']='E3DAF3'; titleColorArray['K']='CBE813'; titleColorArray['L']='1FC3DC'; titleColorArray['M']='FA54C9'; titleColorArray['N']='CBEEF5'; titleColorArray['O']='20F102'; titleColorArray['P']='5118D9'; titleColorArray['Q']='E5E0D1'; titleColorArray['R']='8F0409'; titleColorArray['S']='AAB873'; titleColorArray['T']='F5DF18'; titleColorArray['U']='F63643'; titleColorArray['V']='1111DD'; titleColorArray['W']='0D6D59'; titleColorArray['X']='F5DF18'; titleColorArray['Y']='D36E02'; titleColorArray['Z']='F61825';
var alsoAlphabetizeThreads=true;
for (tds=document.getElementsByTagName('td'), tt=0; tt<tds.length; tt++) { if (tds[tt].width.match(/4(3|8)%/) && tds[tt].className.match(/windowbg/) && tds[tt].getElementsByTagName('font')[0]) { var fkeep=tds[tt].getElementsByTagName('font')[0]; var lkeep=(fkeep.innerText ? fkeep.innerText : fkeep.textContent).substr(0,1).toUpperCase(); if (titleColorArray[lkeep] && fkeep.firstChild && fkeep.firstChild.firstChild) fkeep.firstChild.firstChild.innerHTML='<font color="'+ titleColorArray[lkeep] +'">'+fkeep.firstChild.firstChild.innerHTML+'</font>'; } } // alphabetize part if (alsoAlphabetizeThreads) { var threadTable=fkeep.parentNode.parentNode.parentNode.parentNode; var postRows=threadTable.rows; var nwList=new Array(), ll=0, aa=2; advmodchk=postRows[1].cells[0].getElementsByTagName('input')[0]; for (r1=2; r1<postRows.length-(advmodchk ? 3: 2); r1++) { if (!postRows[r1].innerHTML.match(/sticky(lock)?\.(gif|png)/) && postRows[r1].cells.length>1) { var btitle1=postRows[r1].cells[advmodchk ? 3 : 2].getElementsByTagName('b')[0]; btitle1=(btitle1.textContent ? btitle1.textContent : btitle1.innerText).toLowerCase(); for (r2=r1+1; r2<postRows.length-(advmodchk ? 2: 1); r2++) { var btitle2=postRows[r2].cells[advmodchk ? 3 : 2].getElementsByTagName('b')[0]; btitle2=(btitle2.textContent ? btitle2.textContent : btitle2.innerText).toLowerCase(); if (btitle2 < btitle1) { postRows[r1].parentNode.insertBefore(postRows[r2], postRows[r1]); btitle1=btitle2; } } } } } // --> </script>
|
|
|
Post by Streamstrider on Nov 12, 2011 16:27:36 GMT -8
It moved one out of four selected, and now it won't do it at all again.
|
|
|
Post by Wormopolis on Nov 12, 2011 17:34:17 GMT -8
what about the other functions? like bump or lock?
|
|