Change-Id: I43972b6a4236c87772ed50a7787c43edb795bed8
"apisandbox-continue-clear": "Clear",
"apisandbox-continue-help": "{{int:apisandbox-continue}} will [https://www.mediawiki.org/wiki/API:Query#Continuing_queries continue] the last request; {{int:apisandbox-continue-clear}} will clear continuation-related parameters.",
"apisandbox-param-limit": "Enter <kbd>max</kbd> to use the maximum limit.",
"apisandbox-continue-clear": "Clear",
"apisandbox-continue-help": "{{int:apisandbox-continue}} will [https://www.mediawiki.org/wiki/API:Query#Continuing_queries continue] the last request; {{int:apisandbox-continue-clear}} will clear continuation-related parameters.",
"apisandbox-param-limit": "Enter <kbd>max</kbd> to use the maximum limit.",
+ "apisandbox-multivalue-all-namespaces": "$1 (All namespaces)",
+ "apisandbox-multivalue-all-values": "$1 (All values)",
"booksources": "Book sources",
"booksources-summary": "",
"booksources-search-legend": "Search for book sources",
"booksources": "Book sources",
"booksources-summary": "",
"booksources-search-legend": "Search for book sources",
"apisandbox-continue-clear": "Button text for clearing query continuation parameters.\n{{Identical|Clear}}",
"apisandbox-continue-help": "Help text for the continue and clear buttons.",
"apisandbox-param-limit": "Additional documentation text for 'limit'-type parameters.",
"apisandbox-continue-clear": "Button text for clearing query continuation parameters.\n{{Identical|Clear}}",
"apisandbox-continue-help": "Help text for the continue and clear buttons.",
"apisandbox-param-limit": "Additional documentation text for 'limit'-type parameters.",
+ "apisandbox-multivalue-all-namespaces": "Used as an entry in a multiple-namespace widget to select all available namespaces. Parameters:\n* $1 - API input value meaning \"all namespaces\".",
+ "apisandbox-multivalue-all-values": "Used as an entry in a multiple-value widget to select all available values. Parameters:\n* $1 - API input value meaning \"all values\".",
"booksources": "{{doc-special|BookSources}}\n\n'''This message shouldn't be changed unless it has serious mistakes.'''\n\nIt's used as the page name of the configuration page of [[Special:BookSources]]. Changing it breaks existing sites using the default version of this message.\n\nSee also:\n* {{msg-mw|Booksources|title}}\n* {{msg-mw|Booksources-text|text}}",
"booksources-summary": "{{doc-specialpagesummary|booksources}}",
"booksources-search-legend": "Box heading on [[Special:BookSources|book sources]] special page. The box is for searching for places where a particular book can be bought or viewed.",
"booksources": "{{doc-special|BookSources}}\n\n'''This message shouldn't be changed unless it has serious mistakes.'''\n\nIt's used as the page name of the configuration page of [[Special:BookSources]]. Changing it breaks existing sites using the default version of this message.\n\nSee also:\n* {{msg-mw|Booksources|title}}\n* {{msg-mw|Booksources-text|text}}",
"booksources-summary": "{{doc-specialpagesummary|booksources}}",
"booksources-search-legend": "Box heading on [[Special:BookSources|book sources]] special page. The box is for searching for places where a particular book can be bought or viewed.",
'apisandbox-continue-clear',
'apisandbox-continue-help',
'apisandbox-param-limit',
'apisandbox-continue-clear',
'apisandbox-continue-help',
'apisandbox-param-limit',
+ 'apisandbox-multivalue-all-namespaces',
+ 'apisandbox-multivalue-all-values',
'api-format-prettyprint-status',
'blanknamespace',
],
'api-format-prettyprint-status',
'blanknamespace',
],
}
},
apiCheckValid: function () {
}
},
apiCheckValid: function () {
- var ok = this.getApiValue() !== undefined || suppressErrors;
+ var ok = true,
+ pi = this.paramInfo;
+
+ if ( !suppressErrors ) {
+ ok = this.getApiValue() !== undefined && !(
+ pi.allspecifier !== undefined &&
+ this.getItemsData().length > 1 &&
+ this.getItemsData().indexOf( pi.allspecifier ) !== -1
+ );
+ }
+
this.setIcon( ok ? null : 'alert' );
this.setIconTitle( ok ? '' : mw.message( 'apisandbox-alert-field' ).plain() );
return $.Deferred().resolve( ok ).promise();
this.setIcon( ok ? null : 'alert' );
this.setIconTitle( ok ? '' : mw.message( 'apisandbox-alert-field' ).plain() );
return $.Deferred().resolve( ok ).promise();
return a.data - b.data;
} );
if ( Util.apiBool( pi.multi ) ) {
return a.data - b.data;
} );
if ( Util.apiBool( pi.multi ) ) {
+ if ( pi.allspecifier !== undefined ) {
+ items.unshift( new OO.ui.MenuOptionWidget( {
+ data: pi.allspecifier,
+ label: mw.message( 'apisandbox-multivalue-all-namespaces', pi.allspecifier ).text()
+ } ) );
+ }
+
widget = new OO.ui.CapsuleMultiselectWidget( {
menu: { items: items }
} );
widget = new OO.ui.CapsuleMultiselectWidget( {
menu: { items: items }
} );
return new OO.ui.MenuOptionWidget( { data: String( v ), label: String( v ) } );
} );
if ( Util.apiBool( pi.multi ) ) {
return new OO.ui.MenuOptionWidget( { data: String( v ), label: String( v ) } );
} );
if ( Util.apiBool( pi.multi ) ) {
+ if ( pi.allspecifier !== undefined ) {
+ items.unshift( new OO.ui.MenuOptionWidget( {
+ data: pi.allspecifier,
+ label: mw.message( 'apisandbox-multivalue-all-values', pi.allspecifier ).text()
+ } ) );
+ }
+
widget = new OO.ui.CapsuleMultiselectWidget( {
menu: { items: items }
} );
widget = new OO.ui.CapsuleMultiselectWidget( {
menu: { items: items }
} );