User "Krinkle" posted a comment on MediaWiki.r92112. Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/92112#c19576 Commit summary:
Rewrite ajaxCategories for ResourceLoader. Add some missing functionality (edit categories and more). Move styles from shared.css into own stylesheet. Fix regex bugs Comment: Nice work on bringing that back! I know it's just a start, but a few things: <pre> + $(document).ready( function() {_setup()}); </pre> No need to create an anonymous function to call a function, pass the function by reference directly. <pre> + var _catElements = {}; + var _otherElements = {}; </pre> This closure is local (private) entirely, none of them are public, why are only these underscored / why underscored at all ? <pre> -var ajaxCategories = { - fetchSuggestions : function( query ) { + function _fetchSuggestions ( query ) { </pre> same thing, going from a public method to a local one is a choise, but why underscore it ? If its public but supposed to be private, it could make sense to underscore it if one is unable to make it private, but these really are private. <pre> wgScriptPath + '/api.php' <pre> Legacy global + hardcoded ".php", use <code>mw.util.wikiScript( 'api' )</code> instead. _______________________________________________ MediaWiki-CodeReview mailing list mediawiki-coderev...@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview