jenkins-bot has submitted this change and it was merged.

Change subject: Add npm entry point
......................................................................


Add npm entry point

Change-Id: I7d9b627fdeed5a9e6191175954a0e39a2aec2d5a
---
A .jshintignore
A .jshintrc
A Gruntfile.js
M modules/ext.fundraiserstatistics.js
A package.json
5 files changed, 84 insertions(+), 18 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..04c3a97
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,23 @@
+{
+       // Enforcing
+       "bitwise": true,
+       "eqeqeq": true,
+       "freeze": true,
+       "latedef": "nofunc",
+       "noarg": true,
+       "nonew": true,
+       "undef": true,
+       "unused": true,
+       "strict": false,
+
+       // Relaxing
+       "es5": false,
+
+       // Environment
+       "browser": true,
+       "jquery": true,
+
+       "globals": {
+               "mediaWiki": false
+       }
+}
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..36b6671
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,30 @@
+/*jshint node:true */
+module.exports = function ( grunt ) {
+       grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+       grunt.loadNpmTasks( 'grunt-jsonlint' );
+       grunt.loadNpmTasks( 'grunt-banana-checker' );
+
+       grunt.initConfig( {
+               jshint: {
+                       options: {
+                               jshintrc: true
+                       },
+                       all: [
+                               '**/*.js',
+                               '!node_modules/**'
+                       ]
+               },
+               banana: {
+                       all: 'i18n/'
+               },
+               jsonlint: {
+                       all: [
+                               '**/*.json',
+                               '!node_modules/**'
+                       ]
+               }
+       } );
+
+       grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
+       grunt.registerTask( 'default', 'test' );
+};
diff --git a/modules/ext.fundraiserstatistics.js 
b/modules/ext.fundraiserstatistics.js
index e101424..2fc9fc6 100644
--- a/modules/ext.fundraiserstatistics.js
+++ b/modules/ext.fundraiserstatistics.js
@@ -1,6 +1,6 @@
 /* JavaScript */
 
-$j( document ).ready( function() {
+jQuery( document ).ready( function( $ ) {
        'use strict';
 
        var currentViewID = 'fundraiserstats-view-box-0';
@@ -25,34 +25,34 @@
                currentChartID = newLayerID;
        }
 
-       $j( '.fundraiserstats-bar' ).hover( function() {
-               replaceView( $j(this).attr( 'rel' ) );
+       $( '.fundraiserstats-bar' ).hover( function() {
+               replaceView( $(this).attr( 'rel' ) );
        } );
-       $j( '.fundraiserstats-chart-tab' ).click( function() {
-               replaceChart( $j(this).attr( 'rel' ) );
+       $( '.fundraiserstats-chart-tab' ).click( function() {
+               replaceChart( $(this).attr( 'rel' ) );
        } );
-       $j( '.fundraiserstats-current' ).each( function() {
-               replaceView( $j(this).attr( 'rel' ) );
+       $( '.fundraiserstats-current' ).each( function() {
+               replaceView( $(this).attr( 'rel' ) );
        } );
        // When someone clicks on a year, hide or show that year in the charts
-       $j( '#configholder .yeartoggle' ).click( function() {
-               var checked = $j(this).is( ':checked' );
-               $j( '.fundraiserstats-' + $j(this).attr( 'id' ) ).each( 
function() {
+       $( '#configholder .yeartoggle' ).click( function() {
+               var checked = $(this).is( ':checked' );
+               $( '.fundraiserstats-' + $(this).attr( 'id' ) ).each( 
function() {
                        if ( checked ) {
-                               $j(this).css( 'display', 'block' );
+                               $(this).css( 'display', 'block' );
                        } else {
-                               $j(this).css( 'display', 'none' );
+                               $(this).css( 'display', 'none' );
                        }
                } );
        } );
        // When someone clicks on Customize, display pop-up menu and change 
arrow icon.
-       $j( '#configtoggle' ).click( function() {
-               $j( '#configholder' ).toggle();
-               if ($j( '#configtoggle a' ).css( 'background-position' ) === 
'0px -18px') {
-                       $j( '#configtoggle a' ).css( 'background-position', 
'0px -3px' );
+       $( '#configtoggle' ).click( function() {
+               $( '#configholder' ).toggle();
+               if ($( '#configtoggle a' ).css( 'background-position' ) === 
'0px -18px') {
+                       $( '#configtoggle a' ).css( 'background-position', '0px 
-3px' );
                } else {
-                       $j( '#configtoggle a' ).css( 'background-position','0px 
-18px' );
+                       $( '#configtoggle a' ).css( 'background-position','0px 
-18px' );
                }
        } );
 
-} );
+}( jQuery ) );
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..ec97d7b
--- /dev/null
+++ b/package.json
@@ -0,0 +1,12 @@
+{
+  "scripts": {
+    "test": "grunt test"
+  },
+  "devDependencies": {
+    "grunt": "0.4.5",
+    "grunt-cli": "0.1.13",
+    "grunt-banana-checker": "0.4.0",
+    "grunt-contrib-jshint": "1.0.0",
+    "grunt-jsonlint": "1.0.7"
+  }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/275576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d9b627fdeed5a9e6191175954a0e39a2aec2d5a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContributionReporting
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to