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