User "Krinkle" posted a comment on MediaWiki.r91083.
Full URL:
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/91083#c19022
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:
Yeah, checking length of the array is probably a good thing after splitting it.
There are other edgecases though, which is why mw.Title was created.
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview