mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-24 07:53:37 +00:00
Merge "Trim aliases on save"
This commit is contained in:
commit
6d9b97fdf8
|
@ -136,7 +136,7 @@
|
|||
},
|
||||
aliases: {
|
||||
type: 'array',
|
||||
delimiter: ','
|
||||
delimiter: mw.msg( 'comma-separator' )
|
||||
},
|
||||
label: {
|
||||
type: 'string',
|
||||
|
@ -210,7 +210,7 @@
|
|||
*/
|
||||
TemplateDataModel.static.splitAndTrimArray = function ( str, delim ) {
|
||||
var arr = [];
|
||||
delim = delim || ',';
|
||||
delim = delim || mw.msg( 'comma-separator' );
|
||||
|
||||
$.each( str.split( delim ), function () {
|
||||
var trimmed = $.trim( this );
|
||||
|
@ -231,9 +231,9 @@
|
|||
TemplateDataModel.static.arrayUnionWithoutEmpty = function () {
|
||||
var result = OO.simpleArrayUnion.apply( this, arguments );
|
||||
|
||||
// Filter empty strings
|
||||
// Trim and filter empty strings
|
||||
return result.filter( function ( i ) {
|
||||
return i;
|
||||
return $.trim( i );
|
||||
} );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue