Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/271494

Change subject: Fix jslint errors
......................................................................

Fix jslint errors

Change-Id: Ife260843eb746199dbfcff038f0279893a7eb6eb
---
M resources/ext.survey.js
M resources/ext.survey.special.survey.js
2 files changed, 14 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Survey 
refs/changes/94/271494/1

diff --git a/resources/ext.survey.js b/resources/ext.survey.js
index 6cf854b..40ec60b 100644
--- a/resources/ext.survey.js
+++ b/resources/ext.survey.js
@@ -6,6 +6,8 @@
  * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
  */
 
+/*jshint supernew:true */
+
 window.survey = new( function() {
        
        this.log = function( message ) {
@@ -21,6 +23,7 @@
        };
        
        this.msg = function() {
+               var message;
                if ( typeof mediaWiki === 'undefined' ) {
                        message = window.wgSurveyMessages[arguments[0]];
                        
@@ -35,6 +38,7 @@
        };
        
        this.htmlSelect = function( options, value, attributes, 
onChangeCallback ) {
+               var message;
                $select = $( '<select />' ).attr( attributes );
                
                for ( message in options ) {
@@ -48,7 +52,7 @@
                }
                
                if ( typeof onChangeCallback !== 'undefined' ) {
-                       $select.change( function() { onChangeCallback( $( this 
).val() ) } );
+                       $select.change( function() { onChangeCallback( $( this 
).val() ); } );
                }
                
                return $select;
@@ -56,6 +60,7 @@
        
        this.htmlRadio = function( options, value, name, attributes ) {
                var $radio = $( '<div />' ).attr( attributes );
+               var message;
                $radio.html( '' );
                
                for ( message in options ) {
@@ -90,7 +95,7 @@
                        this.RADIO = 3;
                        this.TEXTAREA = 4;
                        this.CHECK = 5;
-               } );
+               }() );
                
                this.typeHasAnswers = function( t ) {
                        return $.inArray( t, [ survey.question.type.RADIO, 
survey.question.type.SELECT ] ) !== -1;
@@ -98,6 +103,7 @@
                
                this.getTypeSelector = function( value, attributes, 
onChangeCallback ) {
                        var options = [];
+                       var msg;
                        
                        var types = {
                                'text': survey.question.type.TEXT,
@@ -118,7 +124,7 @@
                        return survey.htmlSelect( options, parseInt( value ), 
attributes, onChangeCallback );
                };
                
-       } );
+       }() );
        
 } )();
 
diff --git a/resources/ext.survey.special.survey.js 
b/resources/ext.survey.special.survey.js
index 6586917..ba6dfc2 100644
--- a/resources/ext.survey.special.survey.js
+++ b/resources/ext.survey.special.survey.js
@@ -6,6 +6,9 @@
  * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
  */
 
+/*jshint -W061 */
+/*jshint -W007 */
+
 (function( $, mw, survey ) { $( document ).ready( function() {
 
        var _this = this;
@@ -139,7 +142,7 @@
        }
        
        function removeQuestion( question ) {
-               $( '#survey-question-div-' + question.id ).closest( 'tr' 
).slideUp( 'fast', function() { $( this ).remove(); } )
+               $( '#survey-question-div-' + question.id ).closest( 'tr' 
).slideUp( 'fast', function() { $( this ).remove(); } );
        }
        
        function onAddQuestionRequest() {
@@ -183,4 +186,4 @@
        
        setup();
        
-} ); })( jQuery, window.mediaWiki, window.survey );
+} ); }( jQuery, mediaWiki, window.survey ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife260843eb746199dbfcff038f0279893a7eb6eb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Survey
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>

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

Reply via email to