(7 files, 16kb)
- Removed selectRadioByName, which is barely ever used in the Wedge codebase, and replaced it with shorter inline jQuery replacements. Fixed a couple of minor bugs in the process. (ManageBans.template.php, ManageSearch.template.php, Profile.template.php, script.js)
- Removed onBeforeUpdate callback from auto-suggest code. onfocus() does just as well, you know! (ManageBans.template.php, suggest.js)
- Removed the 'temporary fix' on Opera when using code tags. It's a very old fix now, and this bug doesn't show up in current versions, no need to bother users with that... (install.sql)
! Fixed search method layout. (admin.css)
* A massive overall rewrite of the main script file, resulting in a 4999-byte gzipped/minified script.js, a 10% improvement. And that 10% share is also the size of Wedge's script file compared with a stock copy of SMF's on a server with mod_deflate off. (script.js)
- 'vers' is useless, just use $.browser.version directly. And it compresses better to just repeat that...
* It's cleaner to have one is_* browser declaration per line, instead of several.
- Removed removeEntities prototype -- only used in one place, and I doubt any plugin would use it. Well, if they do... They can always reproduce it.
- Removed we_itemPos -- as indicated, it wasn't used anywhere. Plugin authors should use $(item).offset() instead.
- Removed Thought.getText prototype, only used once in the code, moved it there directly.
- Removed the "Safari 1.3 Beta" bug fix. Seriously, it was released back in 2005, when work on SMF 2.0 wasn't even started...
* Replaced every single for () loop with an $.each() call. Saves an awful lot.
* Replaced most 'something in container' tests, replaced with 'container.something' or something else depending on the context. While the 'in' solution is important in some specific cases, it isn't here. (Not sure about document.cookie, but apparently it's always there.)
- Removed bIgnoreDisabled flag from invertAll. Only used once in Wedge -- and it's going away since it's in the Package code.
- Removed bActOnElement flag from weSelectText. I couldn't find it used anywhere in Wedge (and probably in SMF, either.)
- Used regular show_ajax/hide_ajax on ajaxRating, rather than the custom loader. Although it can be seen as a regression...
- There's no need to declare a local variable if you're assigning directly to "new images().src". I know -- it's awkward!
@ Good to know for later: sometimes, there's a chance that declaring local variables as fake parameters will save space. (See weSaveEntities and Thought.edit)
* Replaced JumpTo's big object with a simple array. I just added the equivalent variable names in comments.
* Converted weCookie, weToggle and Thought classes to use this.method in constructor, rather than prototypes. Since they're not usually called thousands of times per page, there's virtually no drawback to this, and it allows declaring local variables for everything instead of using the this keyword.