Page MenuHomePhabricator

Implement standalone JavaScript version of mw.widgets.NamespaceInputWidget
Closed, ResolvedPublic

Description

Implement standalone JavaScript version of mw.widgets.NamespaceInputWidget. Currently, mw.widgets.NamespaceInputWidget is only usable if created by infusion of the PHP NamespaceInputWidget (added in 2ac9e2a4327af2102c20df5d186fc62858f0f9ca); the big problem is that in JavaScript, we have no way to build the list of namespaces. This would have to be implemented.

Details

Related Gerrit Patches:
mediawiki/core : masterRefactor NamespaceInputWidget

Event Timeline

matmarex created this task.Jul 17 2015, 1:38 PM
matmarex raised the priority of this task from to Low.
matmarex updated the task description. (Show Details)
matmarex added a subscriber: matmarex.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 17 2015, 1:38 PM
Anomie added a subscriber: Anomie.Jul 17 2015, 3:03 PM

Building the list of namespaces seems easy enough:

items = $.map( mw.config.get( 'wgFormattedNamespaces' ), function ( name, ns ) {
    if ( ns === '0' ) {
        name = mw.message( 'blanknamespace' ).text();
    }
    return new OO.ui.MenuOptionWidget( { data: ns, label: name } );
} ).sort( function ( a, b ) {
    return a.data - b.data;
} );
matmarex claimed this task.Aug 11 2015, 4:46 PM

Change 230821 had a related patch set uploaded (by Bartosz Dziewoński):
Refactor NamespaceInputWidget

https://gerrit.wikimedia.org/r/230821

Change 230821 merged by jenkins-bot:
Refactor NamespaceInputWidget

https://gerrit.wikimedia.org/r/230821

matmarex closed this task as Resolved.Aug 21 2015, 4:03 PM