User "Catrope" changed the status of MediaWiki.r91083. Old Status: new New Status: fixme
User "Catrope" also posted a comment on MediaWiki.r91083. Full URL: https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/91083#c19007 Commit summary: WikiLove minor fixes: * Trailing comma's in object literals brakes IE (in rememberInputData and currentRememberData), unlike PHP. * Using fast strict comparison to undefined instead of typeof + string comparison * Whitespace (space before opening parenthesis after "if") * Fix reference to deprecated global ('skin' and 'wgFormattedNamespaces') * Fix missing case in addFilePrefix (NS_FILE has "File" and "Image" as alias, a certain localization as primary one but also a localiztion of "Image" exists as alias (a total of four)). The latter case was still missing. Fixing by using wgNamespaceIds. Also made it case- and whitespace-insensitive (like the Parser is) * Removed redundant IIFE wrapper and used the closure we already have. Local configuration BREAKING CHANGE I made an attempt to re-implement a local config that doesn't require declaring all of the options, and doesn't require the init-call to be part of the local config (which is dangerous. one syntax error and it wont init at all). Solution: - Making it into an object literal (instead of a function) - Always loading the default configuration - Moving init into init-module - Loading local config with mw.loader.using instead of a dependancy in the module definition. Result: - Local config can be a copy-paste of defaultOptions.js and it will work - But (here's the nice part) one can also just do this in MediaWiki:WikiLove.js: $.wikiLoveOptions.types.barnstar.name='Awesome Originals'; And have it work! Tested in Safari 5, Firefox 3.6 + 4, Opera 11 Comment: <pre> + var prefix = filename.split( ':' )[0] || '', + normalized = $.trim( prefix ).toLowerCase().replace( /\s/g, '_' ); + // wgNamespaceIds is missing 'file' in 1.17 on non-English wikis + if ( mw.config.get( 'wgNamespaceIds' )[normalized] !== 6 && normalized !== 'file' ) { </pre> This is broken for the (unlikely, I admit) case that <code>filename === 'File'</code> (or <code>'Image'</code> or a local alias). OK otherwise. _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
