User "Aaron Schulz" changed the status of MediaWiki.r98096. Old Status: new New Status: ok
Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/98096 Commit summary: [flaggedrevs.js]: Code cleanup * Apply whitespace conventions * Apply best practices and other code conventions (strict comparison, combined var statements, local function closure) * Alias jQuery to $ locally * Use $.fn.prop() instead of $.fn.attr() to access the 'checked' property. $.fn.attr() still supports this for backwards compatibility (it reroutes to $.fn.prop if keys like 'checked' are given), but it should not be used in new code. 'title' is an attribute however. * Add function documentation where missing. Making it obvious that the context ("this") of the functions called from the mouseout/click handlers is the jQuery object. Also emphasizing that the 'e' parameter passed is an instance of jQuery.Event, which is a normalized version of the native object thrown by the browser. * Remove cross-browser compatibility check of e.relatedTarget as jQuery.Event normalizes this and sets e.relatedTarget to e.toElement in IE. * Remove bogus comment "//event bubbling" in isMouseOutBubble. Although it is called from an event handler, it is not the event handler itself. Returning true or false from isMouseOutBubble has no influence on the event handler. The function is called from an if-statement in onBoxMouseOut(). * Make use of prototype chaining instead of re-referencing the jQuery object where possible (ie. "save.val( .. ); save.attr( .. );" -> "save.val( .. ).attr( .. );") * Make a local variable definition and expose it globally later instead of declaring it into window and referring to it without "window." which makes refers to an implied global instead of to the global directly. Another way to solve that is to use "window.FlaggedRevs" everywhere, but choose to use a local variable instead to make it shorter. -- (This revision follows-up r98078) _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
