mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-27 17:20:01 +00:00
Fix linting paths and resulting errors
Change-Id: Ib415d306124df53be085e358e7b868aa1ced9fd1
This commit is contained in:
parent
2ea0e0e475
commit
ce3ce51558
|
@ -21,8 +21,8 @@ module.exports = function ( grunt ) {
|
|||
jshintrc: true
|
||||
},
|
||||
all: [
|
||||
'modules/*.js',
|
||||
'tests/*.js'
|
||||
'modules/**/*.js',
|
||||
'tests/**/*.js'
|
||||
]
|
||||
},
|
||||
jscs: {
|
||||
|
|
|
@ -24,8 +24,8 @@ mw.TemplateData.Model = function mwTemplateDataModel( config ) {
|
|||
this.sourceCodeParameters = [];
|
||||
};
|
||||
|
||||
/* Setup */
|
||||
OO.initClass( mw.TemplateData.Model );
|
||||
/* Inheritance */
|
||||
|
||||
OO.mixinClass( mw.TemplateData.Model, OO.EventEmitter );
|
||||
|
||||
/* Events */
|
||||
|
|
|
@ -29,8 +29,8 @@ mw.TemplateData.SourceHandler = function MWTemplateDataSourceHander( config ) {
|
|||
this.setFullPageName( config.fullPageName );
|
||||
};
|
||||
|
||||
/* Setup */
|
||||
OO.initClass( mw.TemplateData.SourceHandler );
|
||||
/* Inheritance */
|
||||
|
||||
OO.mixinClass( mw.TemplateData.SourceHandler, OO.EventEmitter );
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
mw.TemplateData.Dialog = function mwTemplateDataDialog( config ) {
|
||||
// Parent constructor
|
||||
mw.TemplateData.Dialog.super.call( this, config );
|
||||
mw.TemplateData.Dialog.parent.call( this, config );
|
||||
|
||||
this.model = null;
|
||||
this.modified = false;
|
||||
|
@ -23,6 +23,8 @@ mw.TemplateData.Dialog = function mwTemplateDataDialog( config ) {
|
|||
this.$element.addClass( 'tdg-templateDataDialog' );
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
||||
OO.inheritClass( mw.TemplateData.Dialog, OO.ui.ProcessDialog );
|
||||
|
||||
/* Static properties */
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* @mixins OO.ui.mixin.DraggableElement
|
||||
*
|
||||
* @constructor
|
||||
* @param {Mixed} data Option data
|
||||
* @param {Object} [config] Configuration options
|
||||
*/
|
||||
mw.TemplateData.DragDropItemWidget = function mwTemplateDataDragDropItemWidget( config ) {
|
||||
|
@ -14,7 +13,7 @@ mw.TemplateData.DragDropItemWidget = function mwTemplateDataDragDropItemWidget(
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.TemplateData.DragDropItemWidget.super.call( this, $.extend( {}, { icon: 'parameter' }, config ) );
|
||||
mw.TemplateData.DragDropItemWidget.parent.call( this, $.extend( {}, { icon: 'parameter' }, config ) );
|
||||
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.DraggableElement.call( this, config );
|
||||
|
@ -24,7 +23,8 @@ mw.TemplateData.DragDropItemWidget = function mwTemplateDataDragDropItemWidget(
|
|||
.addClass( 'tdg-templateDataDragDropItemWidget' );
|
||||
};
|
||||
|
||||
/* Setup */
|
||||
/* Inheritance */
|
||||
|
||||
OO.inheritClass( mw.TemplateData.DragDropItemWidget, OO.ui.DecoratedOptionWidget );
|
||||
|
||||
OO.mixinClass( mw.TemplateData.DragDropItemWidget, OO.ui.mixin.DraggableElement );
|
||||
|
|
|
@ -16,7 +16,7 @@ mw.TemplateData.DragDropWidget = function mwTemplateDataDragDropWidget( config )
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.TemplateData.DragDropWidget.super.call( this, config );
|
||||
mw.TemplateData.DragDropWidget.parent.call( this, config );
|
||||
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.DraggableGroupElement.call( this, $.extend( {}, config, { $group: this.$element } ) );
|
||||
|
@ -32,6 +32,7 @@ OO.mixinClass( mw.TemplateData.DragDropWidget, OO.ui.mixin.DraggableGroupElement
|
|||
|
||||
/**
|
||||
* Get an array of keys based on the current items, in order
|
||||
*
|
||||
* @return {string[]} Array of keys
|
||||
*/
|
||||
mw.TemplateData.DragDropWidget.prototype.getKeyArray = function () {
|
||||
|
@ -39,7 +40,7 @@ mw.TemplateData.DragDropWidget.prototype.getKeyArray = function () {
|
|||
arr = [];
|
||||
|
||||
for ( i = 0, len = this.items.length; i < len; i++ ) {
|
||||
arr.push( this.items[i].getData() );
|
||||
arr.push( this.items[ i ].getData() );
|
||||
}
|
||||
|
||||
return arr;
|
||||
|
@ -48,6 +49,7 @@ mw.TemplateData.DragDropWidget.prototype.getKeyArray = function () {
|
|||
/**
|
||||
* Reorder the key into its new index. Find the item first, then add
|
||||
* it back in its new place.
|
||||
*
|
||||
* @param {string} key Unique key
|
||||
* @param {number} newIndex New index
|
||||
*/
|
||||
|
@ -56,8 +58,8 @@ mw.TemplateData.DragDropWidget.prototype.reorderKey = function ( key, newIndex )
|
|||
|
||||
// Get the item that belongs to this key
|
||||
for ( i = 0, len = this.items.length; i < len; i++ ) {
|
||||
if ( this.items[i].getData() === key ) {
|
||||
item = this.items[i];
|
||||
if ( this.items[ i ].getData() === key ) {
|
||||
item = this.items[ i ];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* TemplateData Option Import Widget
|
||||
*
|
||||
* @extends {OO.ui.DecoratedOptionWidget}
|
||||
* @param {Object} config Dialog configuration object
|
||||
*/
|
||||
|
@ -7,7 +8,7 @@ mw.TemplateData.OptionImportWidget = function mwTemplateDataOptionImportWidget(
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.TemplateData.OptionImportWidget.super.call( this, $.extend( {}, config, { icon: 'parameter-set' } ) );
|
||||
mw.TemplateData.OptionImportWidget.parent.call( this, $.extend( {}, config, { icon: 'parameter-set' } ) );
|
||||
|
||||
this.params = config.params;
|
||||
|
||||
|
@ -16,12 +17,12 @@ mw.TemplateData.OptionImportWidget = function mwTemplateDataOptionImportWidget(
|
|||
this.buildParamLabel();
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
||||
OO.inheritClass( mw.TemplateData.OptionImportWidget, OO.ui.DecoratedOptionWidget );
|
||||
|
||||
/**
|
||||
* Build the parameter label in the parameter select widget
|
||||
* @param {Object} paramData Parameter data
|
||||
* @return {jQuery} Label element
|
||||
*/
|
||||
mw.TemplateData.OptionImportWidget.prototype.buildParamLabel = function () {
|
||||
var paramNames = this.params.slice( 0, 9 ).join( mw.msg( 'comma-separator' ) ),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* TemplateData Option Widget
|
||||
*
|
||||
* @extends {OO.ui.DecoratedOptionWidget}
|
||||
* @param {Object} config Dialog configuration object
|
||||
*/
|
||||
|
@ -8,8 +9,9 @@ mw.TemplateData.OptionWidget = function mwTemplateDataOptionWidget( config ) {
|
|||
|
||||
config = config || {};
|
||||
data = config.data || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.TemplateData.OptionWidget.super.call( this, $.extend( {}, config, { data: data.key, icon: 'parameter' } ) );
|
||||
mw.TemplateData.OptionWidget.parent.call( this, $.extend( {}, config, { data: data.key, icon: 'parameter' } ) );
|
||||
|
||||
this.key = data.key;
|
||||
this.name = data.name;
|
||||
|
@ -21,12 +23,12 @@ mw.TemplateData.OptionWidget = function mwTemplateDataOptionWidget( config ) {
|
|||
this.buildParamLabel();
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
||||
OO.inheritClass( mw.TemplateData.OptionWidget, OO.ui.DecoratedOptionWidget );
|
||||
|
||||
/**
|
||||
* Build the parameter label in the parameter select widget
|
||||
* @param {Object} paramData Parameter data
|
||||
* @return {jQuery} Label element
|
||||
*/
|
||||
mw.TemplateData.OptionWidget.prototype.buildParamLabel = function () {
|
||||
var i, len,
|
||||
|
@ -45,7 +47,7 @@ mw.TemplateData.OptionWidget.prototype.buildParamLabel = function () {
|
|||
$aliases.append(
|
||||
$( '<span>' )
|
||||
.addClass( 'tdg-templateDataOptionWidget-param-alias' )
|
||||
.text( this.aliases[i] )
|
||||
.text( this.aliases[ i ] )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue