|
Post by eveready on Aug 14, 2010 23:16:51 GMT -8
I'm trying to remove the space between the buttons on the posting page (Quote-Modify-Delete), and I've come up with this...
<script> var aTD = document.getElementsByTagName("TD");
for(a=0;a<aTD.length;a++){ if(pb_action=='display'){ if(aTD[a].width=="40%" && aTD[a].align=="right"){ var sp = new RegExp('&nb'+'sp;','gi') aTD[a].innerHTML = aTD[a].innerHTML.replace(sp,''); } } } </script>
Doesn't work though and I'm wondering if you could tell me why.
|
|
|
Post by Wormopolis on Aug 15, 2010 1:32:48 GMT -8
|
|
|
Post by eveready on Aug 15, 2010 2:09:39 GMT -8
<script> var aTD = document.getElementsByTagName("TD"); if(pb_action=='display'){ for(a=0;a<aTD.length;a++){ if(aTD[a].width=="40%" && aTD[a].align=="right"){ aTD[a].innerHTML = aTD[a].innerHTML.replace(/\s/,''); }}} </script>
It's doing something.... it seems to move one of the buttons over about one pixel.
But it's not removing the spaces. Any other ideas?
|
|
|
Post by Wormopolis on Aug 15, 2010 2:12:53 GMT -8
ugh.. Im dumb..
/\s/g
the g makes it find more then the first one.
|
|
|
Post by eveready on Aug 15, 2010 2:13:56 GMT -8
Yeah, I tried that too, but it removes all of the buttons completely.
|
|
|
Post by Wormopolis on Aug 15, 2010 2:21:56 GMT -8
alright then...
/>\s</g
|
|
|
Post by eveready on Aug 15, 2010 2:26:49 GMT -8
Works, thanks.
If you get a minute can you explain to me the >\s< part? How does that equal a space?
|
|
|
Post by Wormopolis on Aug 15, 2010 2:30:52 GMT -8
The > and < are the end pieces of the surrounding tags. when we removed ALL the spaces before, it made all the tags look like: <ahref='/index.cgi?board=whatever'><imgsrc='imgsrc.jpg'border=0>
so in essence destroying the html.. I dont know why I thought that would work.
by having it look for spaces (\s) BEWTEEN the > and < ONLY then it was able to ignore all other spaces in the HTML.
|
|
|
Post by eveready on Aug 15, 2010 2:33:22 GMT -8
Ah...got it. Thanks.
Give a man a fish, yada yada...
|
|