Fixing bugs and modernising mediawiki.action.watch.ajax.js a little bit
authorKrinkle <krinkle@users.mediawiki.org>
Thu, 9 Dec 2010 22:45:49 +0000 (22:45 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Thu, 9 Dec 2010 22:45:49 +0000 (22:45 +0000)
commiteb0ecfb5371496d472f95c8a5e8ca6606dc1f460
tree85e8bdc55970948061f0f4ece2e771bfe488467e
parente71cb1628dfc814c22d76df94a691d5f02e04e58
Fixing bugs and modernising mediawiki.action.watch.ajax.js a little bit

* add() takes the selector directly. Passing a jQuery object either doesn't work or is an undocumented feature.
* using the mw.util functions instead of a less than perfect regex.
* closest() instead of parents() is faster and should be used whenever possible
* The this in processResult() didn't refer to the jQuery object of the anchor tag. It was probably never noticed since it's only used in the else{}-fallback (hard to mis). Fixed now by passing the link in the function
* The this in .bind('mw-ajaxwatch') didn't refer to this either, fixed also by passing  into the function
* Replace() function in .bind('mw-ajaxwatch') didn't work, the slashes causes nothing to be matched at all. Before this the href stayed the same and didn't change accordingly.
resources/Resources.php
resources/mediawiki.action/mediawiki.action.watch.ajax.js