From ce3ce51558bde4c5e7032366da11d3fa66fad303 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Fri, 19 Feb 2016 13:19:00 +0000 Subject: [PATCH] Fix linting paths and resulting errors Change-Id: Ib415d306124df53be085e358e7b868aa1ced9fd1 --- Gruntfile.js | 4 ++-- modules/ext.templateDataGenerator.data.js | 4 ++-- modules/ext.templateDataGenerator.sourceHandler.js | 4 ++-- modules/ext.templateDataGenerator.ui.tdDialog.js | 4 +++- .../ext.templateDataGenerator.dragDropItemWidget.js | 6 +++--- .../ext.templateDataGenerator.dragDropWidget.js | 10 ++++++---- .../ext.templateDataGenerator.optionImportWidget.js | 7 ++++--- .../widgets/ext.templateDataGenerator.optionWidget.js | 10 ++++++---- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9338fc7d..43b49a9c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -21,8 +21,8 @@ module.exports = function ( grunt ) { jshintrc: true }, all: [ - 'modules/*.js', - 'tests/*.js' + 'modules/**/*.js', + 'tests/**/*.js' ] }, jscs: { diff --git a/modules/ext.templateDataGenerator.data.js b/modules/ext.templateDataGenerator.data.js index 81d9cd11..ffbe2434 100644 --- a/modules/ext.templateDataGenerator.data.js +++ b/modules/ext.templateDataGenerator.data.js @@ -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 */ diff --git a/modules/ext.templateDataGenerator.sourceHandler.js b/modules/ext.templateDataGenerator.sourceHandler.js index 0f10149c..65a2ecb8 100644 --- a/modules/ext.templateDataGenerator.sourceHandler.js +++ b/modules/ext.templateDataGenerator.sourceHandler.js @@ -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 ); /** diff --git a/modules/ext.templateDataGenerator.ui.tdDialog.js b/modules/ext.templateDataGenerator.ui.tdDialog.js index 2bf8948f..ae058a6a 100644 --- a/modules/ext.templateDataGenerator.ui.tdDialog.js +++ b/modules/ext.templateDataGenerator.ui.tdDialog.js @@ -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 */ diff --git a/modules/widgets/ext.templateDataGenerator.dragDropItemWidget.js b/modules/widgets/ext.templateDataGenerator.dragDropItemWidget.js index 0e4ba4a8..00f68d88 100644 --- a/modules/widgets/ext.templateDataGenerator.dragDropItemWidget.js +++ b/modules/widgets/ext.templateDataGenerator.dragDropItemWidget.js @@ -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 ); diff --git a/modules/widgets/ext.templateDataGenerator.dragDropWidget.js b/modules/widgets/ext.templateDataGenerator.dragDropWidget.js index ffd1c431..c605fff1 100644 --- a/modules/widgets/ext.templateDataGenerator.dragDropWidget.js +++ b/modules/widgets/ext.templateDataGenerator.dragDropWidget.js @@ -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 ]; } } diff --git a/modules/widgets/ext.templateDataGenerator.optionImportWidget.js b/modules/widgets/ext.templateDataGenerator.optionImportWidget.js index 1ea517ed..93bb5931 100644 --- a/modules/widgets/ext.templateDataGenerator.optionImportWidget.js +++ b/modules/widgets/ext.templateDataGenerator.optionImportWidget.js @@ -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' ) ), diff --git a/modules/widgets/ext.templateDataGenerator.optionWidget.js b/modules/widgets/ext.templateDataGenerator.optionWidget.js index 6f493fb7..a7b79586 100644 --- a/modules/widgets/ext.templateDataGenerator.optionWidget.js +++ b/modules/widgets/ext.templateDataGenerator.optionWidget.js @@ -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( $( '' ) .addClass( 'tdg-templateDataOptionWidget-param-alias' ) - .text( this.aliases[i] ) + .text( this.aliases[ i ] ) ); } }