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.
Description
Description
Details
Details
Related Changes in Gerrit:
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Refactor NamespaceInputWidget | mediawiki/core | master | +307 -142 |
Related Objects
Related Objects
Event Timeline
Comment Actions
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;
} );Comment Actions
Change 230821 had a related patch set uploaded (by Bartosz Dziewoński):
Refactor NamespaceInputWidget