Server Help

Trash Talk - Broken 'code' tags?

Samapico - Wed Jun 08, 2011 8:21 am
Post subject: Broken 'code' tags?
On Chrome, the show/hide button that appears with code tags doesn't seem to work right... You click it once, it hides the code, but it also hides the "show/hide" link, so you can't show it back.
Is it just me?

Code: Show/Hide

blah

Cheese - Wed Jun 08, 2011 4:13 pm
Post subject:
works fine on ff
CypherJF - Wed Jun 08, 2011 6:41 pm
Post subject:
Definitely broke with Chrome 12.0.742.91 w/ Win Vista.
Maverick - Thu Jun 09, 2011 11:50 am
Post subject:
Broken on Chrome 11.0.696.77 on Windows 7 aswell.

I guess you just shouldn't hide code pieces when working in Chrome (or face it that you won't be able to show it again) tongue.gif
JoWie - Thu Jun 09, 2011 2:11 pm
Post subject:
Looks like this is done on purpose. The javascript code does:
Code: Show/Hide

this.innerText = ""


"this" is the show/hide link.

Firefox does not implement this non-standard Internet Explorer attribute (it uses textContent which is in w3c DOM 3)
Cheese - Thu Jun 09, 2011 4:48 pm
Post subject:
Code: Show/Hide

<div class="genmed" style="margin-bottom:2px">
<b>Code:</b>
<span class="gensmall">
<a onclick="if (this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" style="width:45px;font-size:10px;margin:0px;padding:0px;" value="Hide" href="javascript:void(0)">Show/Hide</a>
</span>
</div>

Mine GO BOOM - Mon Jun 13, 2011 6:09 am
Post subject:
Thanks for letting me know, I'll fix it soon. I just threw in some random javascript a long time ago to add the hide/show because sometimes people would post their whole server.cfg file in their post and I liked to hide it when reading the thread.
Samapico - Mon Jun 13, 2011 5:22 pm
Post subject:
I might be confusing this with another forum, but wasn't there something like a 'codebox' tag at some point? Like a code tag, but that includes a scrollbar and has a limited vertical size.
That could be handy for these kind of things
Mine GO BOOM - Mon Jun 13, 2011 6:51 pm
Post subject:
That would be another site. If you happen to have handy javascript/css for them, I can upgrade random parts of the site however you guys would like.
Cheese - Tue Jun 14, 2011 12:21 am
Post subject:
could you install a black theme
this white one hurts my eyes icon_sad.gif
Anonymous - Sun Jun 19, 2011 5:02 pm
Post subject: Re: Broken 'code' tags?
Samapico wrote:
On Chrome, the show/hide button that appears with code tags doesn't seem to work right... You click it once, it hides the code, but it also hides the "show/hide" link, so you can't show it back.
Is it just me?

Code: Show/Hide

blah


Yup same for me.
Hakaku - Sun Jun 19, 2011 10:25 pm
Post subject:
This is what the code is doing:
Code: Show/Hide
if (this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') {
   this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';
   this.innerText = '';
   this.value = 'Hide';
} else {
   this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none';
   this.innerText = '';
   this.value = 'Show';
}

If you remove the two "this.innerText = '';", the code will work properly on Chrome (and any other WebKit derivative), as well as IE8 and probably Opera too. Firefox has no implementation of innerText, so it's simply ignored, hence why it seemingly works fine.

There's also an issue with the text editor buttons (i.e. [tag]...[/tag]), where they won't wrap tags around highlighted portions of text.
Mine GO BOOM - Mon Jun 20, 2011 1:32 am
Post subject:
Cheese wrote:
could you install a black theme

If it were even possible to switch themes with the hacks applied to the forums, I might. But it would be easier to just start fresh with brand new forums software, which sadly I don't have that much time to be able to do.

Hakaku wrote:
If you remove the two "this.innerText = '';", the code will work properly on Chrome (and any other WebKit derivative), as well as IE8 and probably Opera too. Firefox has no implementation of innerText, so it's simply ignored, hence why it seemingly works fine.

Thanks, made this modification. I assume IE6 breaks (what change won't?) but oh well.

Hakaku wrote:
There's also an issue with the text editor buttons (i.e. [tag]...[/tag]), where they won't wrap tags around highlighted portions of text.

That has been a bug for a long, long time. I never bothered to fix it, as I generally type the bbcode myself and no one else has complained before.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group