@Devourer (post 1): Well, I'll code the JS anyway, and attach it when I'm done. (I'm also attaching a preview to this post.) If you still don't like it, feel free to not use it. If you want to use it after seeing it, go ahead.
@Doodle: I only ever use ternarys for short conditions. The prototyping comment was related to the AJAX criticism, though I now see that multiple object instances (and hence inheritance) are not required at all. I didn't see a function named
toggle, but I did see two functions named
show and
hide -- neither of which was necessary. One should not pollute the global namespace just to save on typing.
@Dev (2): It's not necessarily that I mind the JS here. It's more that it can be done better. If improvement is possible, why not improve? (Especially in this case -- I'd be doing all the JS. All you'd have to do, should you change your mind, is upload a few files and change some SCRIPT tags. I do understand your refusal, though -- you're following the "if it ain't broke, don't fix it" principle.)
For anyone who's curious, I have a draft here. It's a 60-80% complete, 50-minute rewrite of this site's
global.js. Those who decide to view the code draft may wonder why I made a large and (IMO) flexible "Modal" object... I made it both to display large images and to replace all the alerts. Having to go through ten prompts to enter a trigger is rather annoying... A neat, JS-powered modal form would be so much neater.
Besides that, the draft also changes AJAX up a bit... The site's AJAX system (on the client side) is a little tricky to describe... Essentially, every time a request is sent, a request object (XMLHttpRequest) is created for it, and another object (based on what's being done -- a shoutbox post, etc.) is created. I found that instead of having multiple classes for each AJAX task, I could simply have immutable objects... Yeah, it's tricky for me to describe. The draft is untested; when I get to testing it, I should be able to wrap my head around the site's AJAX a little better.
Attachments:
None.