Summary: Create enhanced version of mw.util.getParamValue to
                    get an object with all parameters (in one only call)
           Product: MediaWiki
           Version: 1.18-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Javascript

With the current implementation of mw.util.getParamValue, if a script needs to
use N url parameters it will need to do N calls to the function, and this means
there will be created N RegExp objects, one for each requested parameter.

It would be better to have a way of requesting all url paramenters at once. The
function could return an object, giving us something similar to
var p = {
    'parameter' : 'value',
    'foo' : 'bar',
    'etc' : '...'

which could be used as in

if ( p['parameter'] === 'value' ) {
    //Do something
} else if ( p['foo'] === 'bar' ) {
    //Do something else

One way to implement the feature would be to split the url after the first "?"
and then break it in parts separated by "&", getting an array of "param=value"
(PS: This is what was made e.g. in the following script:

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to