[mediawiki.Uri] Add overrideKeys option
authorKrinkle <krinkle@users.mediawiki.org>
Thu, 10 Nov 2011 02:08:47 +0000 (02:08 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Thu, 10 Nov 2011 02:08:47 +0000 (02:08 +0000)
commit0867987577a386a0e0d47ed48bc496c2a11daaef
treeb7e198c0d3998d537b79989b3d0b24dcf459c2a4
parent25c3a4aedad74fc53153c3ed0536a4423c135145
[mediawiki.Uri] Add overrideKeys option
* The behavior of turning foo=bar&foo=quux&lorem=ipsum into "{ lorem: 'ipsum', foo: ['bar', 'quux'] }", has annoyed me several times. As it is in contrary with the way PHP works (PHP only makes numeral arrays if the key ends in '[]'). Adding in an option to make mw.Uri behave like that.
* We may wanna make that the default at some point, leaving default behavior unchanged for now.
* Converted 'strictMode' into 'options', kept backwards compatibility
* Fixed documentation comment for example (q1=0 -> "{ q1: '0'")
* Updated unit tests to account for this option.
resources/mediawiki/mediawiki.Uri.js
tests/jasmine/spec/mediawiki.Uri.spec.js