Moving IP-check to mw.util & some enhancements to and applying code conventions to...
authorKrinkle <krinkle@users.mediawiki.org>
Fri, 4 Mar 2011 01:48:24 +0000 (01:48 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Fri, 4 Mar 2011 01:48:24 +0000 (01:48 +0000)
commit730eeb8e26c5adbef90a597a67b8cb092c6b01fb
tree1d57b50f01ddab65a3ba08292e5abaa3d14db4eb
parent801ce47efd7e55bf8b0d4477d1a1b5678c77a0a4
Moving IP-check to mw.util & some enhancements to and applying code conventions to mw.special.block.js
* This commit addresses the @TODOs that were in mediawiki.legacy.block before it was migrated to /resources in r83183 ("@TODO: find some better JS file for [is IP functions]")
* JSHint warning fixed: Using ==== when comparing to '' (safer and faster than ==)
* Instead of checking the initial onload state by faking a onkeyup/onchange event, seperate the two functions and use those
** --> This fixes issue where it falsely triggers other bindings on-load that are globally bound to input elements via $('input').live() or $('[type="text"]').delegate() because of the .keyup()/.change() call )
* Caching selectors (var $wpBlockExpiry = $(..) etc.) instead of re-creating a dozen jQuery objects again and getting the document element by id – on *every* onkeyup/onchange
** --> Notable speed improvement in Safari 3 and IE6 with the caching, these had a little bit of a lag when typing fast, mw.legacy.block.js had the lag as well. Fixed now.
* Adding instantToggle-argument to switch between fade or hiding/showing right away. When setting the initial state they're called with instant=true so that there's no fading, the page loads and stuff hides that shouldn't be visible. Any later interaction will still have the fade.
** Calling a function like foo(true) sucks, adding a local DO_INSTANT = true.
* Making behaviour the same as the legacy.block was (if isEmpty, do bring the element back to view ( show() / fadeIn) instead of doing nothing)
resources/Resources.php
resources/mediawiki.special/mediawiki.special.block.js
resources/mediawiki.util/mediawiki.util.js