Jatin has uploaded a new change for review.

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

Change subject: Making SF pass JSHint test
......................................................................

Making SF pass JSHint test

Bug: 61630
Change-Id: I40e5d3b7588f176909f152a4602f9423cf63d286
---
A .jshintrc
M libs/SF_autoedit.js
M libs/SF_autogrow.js
M libs/SF_checkboxes.js
M libs/SF_collapsible.js
M libs/SF_imagePreview.js
M libs/SF_popupform.js
M libs/SF_preview.js
M libs/SF_submit.js
M libs/SF_wikieditor.js
M libs/SemanticForms.js
M libs/ext.dynatree.js
M libs/ext.sf.select2.base.js
M libs/ext.sf.select2.combobox.js
M libs/ext.sf.select2.tokens.js
M libs/jquery.browser.js
M libs/jquery.dynatree.js
M libs/jquery.fancybox.js
18 files changed, 231 insertions(+), 211 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/70/151970/1

diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..a07cb6f
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,40 @@
+{
+       "predef": [
+               "mediaWiki",
+               "jQuery",
+               "semanticforms"
+               "mw",
+               "$",
+               "sf",
+               "ext"
+       ],
+
+       "bitwise": true,
+       "camelcase": false,
+       "curly": true,
+       "eqeqeq": true,
+       "forin": false,
+       "immed": true,
+       "latedef": true,
+       "newcap": true,
+       "noarg": false,
+       "noempty": true,
+       "nonew": true,
+       "quotmark": false,
+       "regexp": false,
+       "undef": true,
+       "unused": false,
+       "strict": false,
+       "trailing": true,
+
+       "laxbreak": true,
+       "smarttabs": true,
+       "multistr": true,
+
+       "browser": true,
+
+       "nomen": false,
+       "onevar": false,
+
+       "scripturl":false
+}
diff --git a/libs/SF_autoedit.js b/libs/SF_autoedit.js
index a41e50d..904251c 100644
--- a/libs/SF_autoedit.js
+++ b/libs/SF_autoedit.js
@@ -4,7 +4,6 @@
  * @author Stephan Gambke
  */
 
-/*global jQuery, mediaWiki */
 /*global confirm */
 
 ( function ( $, mw ) {
diff --git a/libs/SF_autogrow.js b/libs/SF_autogrow.js
index c566a90..a807764 100644
--- a/libs/SF_autogrow.js
+++ b/libs/SF_autogrow.js
@@ -24,7 +24,7 @@
 function autoGrowBindEvents(textArea) {
        textArea.onkeyup = function() {
                autoGrow(textArea);
-       }
+       };
 }
 
 function autoGrow(textArea) {
diff --git a/libs/SF_checkboxes.js b/libs/SF_checkboxes.js
index f49f0b8..019e502 100644
--- a/libs/SF_checkboxes.js
+++ b/libs/SF_checkboxes.js
@@ -4,8 +4,6 @@
  * @author Stephan Gambke
  */
 
-/*global jQuery, mediaWiki */
-
 ( function ( $, mw ) {
 
        'use strict';
@@ -50,7 +48,7 @@
                } );
 
                return this;
-       }
+       };
 
        $().ready( function ( $ ) {
                $( '.checkboxesSpan.select-all' ).appendSelectionSwitches();
diff --git a/libs/SF_collapsible.js b/libs/SF_collapsible.js
index 330f61d..c945f40 100644
--- a/libs/SF_collapsible.js
+++ b/libs/SF_collapsible.js
@@ -26,7 +26,7 @@
        this.each(function(){
                var fieldset = jQuery(this);
                var legend = fieldset.children('legend');
-               if ( setting.collapsed == true ) {
+               if ( setting.collapsed === true ) {
                        legend.toggle(
                                function(){
                                        sfShowFieldsetContent(fieldset, 
setting);
@@ -45,7 +45,7 @@
                                function(){
                                        sfShowFieldsetContent(fieldset, 
setting);
                                }
-                       )
+                       );
                }
        });
 };
diff --git a/libs/SF_imagePreview.js b/libs/SF_imagePreview.js
index 842e5a2..c1f3aff 100644
--- a/libs/SF_imagePreview.js
+++ b/libs/SF_imagePreview.js
@@ -23,9 +23,9 @@
                                if ( data.query && data.query.pages ) {
                                        var pages = data.query.pages;
 
-                                       for ( p in pages ) {
+                                       for ( var p = 0; p < pages.length; p++ 
) {
                                                var info = pages[p].imageinfo;
-                                               for ( i in info ) {
+                                               for ( var i = 0; i < 
info.length; i++ ) {
                                                        callback( 
info[i].thumburl );
                                                        return;
                                                }
diff --git a/libs/SF_popupform.js b/libs/SF_popupform.js
index c7a8222..732ab80 100644
--- a/libs/SF_popupform.js
+++ b/libs/SF_popupform.js
@@ -4,6 +4,7 @@
  * @author Stephan Gambke
  *
  */
+/*global escape*/
 
 // initialise
 jQuery( function() {
@@ -33,7 +34,7 @@
        window.ext = {};
 }
 
-window.ext.popupform = new function() {
+
        var wrapper;
        var background;
        var container;
@@ -198,7 +199,7 @@
                closeBtn.click( handleCloseFrame );
        }
 
-       function handleLoadFrame(){
+       function handleLoadFrame() {
                var iframecontents = iframe.contents();
 
                var containerAlreadyVisible = container.is( ':visible' );
@@ -215,16 +216,16 @@
                content = iframecontents.find("#gumax-content-body");
 
                // normal skins use #content (e.g. Vector, Monobook)
-               if ( content.length == 0 ) content = 
iframecontents.find("#content");
+               if ( content.length === 0 ) content = 
iframecontents.find("#content");
 
                // some skins use #mw_content (e.g. Modern)
-               if ( content.length == 0 ) content = 
iframecontents.find("#mw_content");
+               if ( content.length === 0 ) content = 
iframecontents.find("#mw_content");
 
                var iframebody = content.closest("body");
                var iframedoc = iframebody.parent();
 
                // this is not a normal MW page (or it uses an unknown skin)
-               if ( content.length == 0 ) content = iframebody;
+               if ( content.length === 0 ) content = iframebody;
 
                // the huge left margin looks ugly in Vector, reduce it
                // (How does this look for other skins?)
@@ -269,9 +270,7 @@
                                var elem = jQuery(this);
 
                                // TODO: Does this really help?
-                               if ( getStyle(this, "display") != "none"
-//                                     && ( getStyle( this, "width") != "0px" 
|| getStyle( this, "height") != "0px" )
-                                       && ! (
+                               if ( getStyle(this, "display") != "none" && ! (
                                                ( this.offsetLeft + 
elem.outerWidth(true) < 0 ) ||              // left of document
                                                ( this.offsetTop + 
elem.outerHeight(true) < 0 )  || // above document
                                                ( this.offsetLeft > 100000 ) || 
        // right of document
@@ -400,8 +399,8 @@
                .not('a[href^="#"]')           // local links
                .not('a.sfFancyBox')           // link to file upload
                .click(function(event){
-                       if ( event.result != false ) {  // if not already 
caught by somebody else
-                               closeFrameAndFollowLink( 
event.target.getAttribute('href') )
+                       if ( event.result !== false ) {  // if not already 
caught by somebody else
+                               closeFrameAndFollowLink( 
event.target.getAttribute('href') );
                        }
                        return false;
                });
@@ -438,7 +437,7 @@
                        var innerform = jQuery("<div>" + returnedData + 
"</div>").find("form");
 
                        // check if we got an error page
-                       if ( innerform.length == 0 ) {
+                       if ( innerform.length === 0 ) {
 
                                form.unbind( event );
 
@@ -475,7 +474,7 @@
 
                        }
 
-                       var form = jQuery('<form action="' + url + '" 
method="POST"><input type="hidden" name="action" value="purge"></form>')
+                       form = jQuery('<form action="' + url + '" 
method="POST"><input type="hidden" name="action" value="purge"></form>')
                        .appendTo('body');
 
                        form
@@ -496,11 +495,11 @@
                var oldContW = content.width();
                var oldContH = content.height();
 
-               var availW = Math.floor( jQuery(window).width() * .8 );
-               var availH = Math.floor( jQuery(window).height() * .8 );
+               var availW = Math.floor( jQuery(window).width() * 0.8 );
+               var availH = Math.floor( jQuery(window).height() * 0.8 );
 
-               var emergencyW = Math.floor( jQuery(window).width() * .85 );
-               var emergencyH = Math.floor( jQuery(window).height() * .85 );
+               var emergencyW = Math.floor( jQuery(window).width() * 0.85 );
+               var emergencyH = Math.floor( jQuery(window).height() * 0.85 );
 
                // FIXME: these might not be the true values
                var scrollW = 25;
@@ -657,10 +656,9 @@
                                .width( frameW )
                                .height ( frameH );
 
-                               with ( container[0].style ) {
-                                       top = (Math.floor(( - frameH ) / 2)) + 
"px";
-                                       left = (Math.floor(( - frameW ) / 2)) + 
"px";
-                               }
+                               container[0].style.top = (Math.floor(( - frameH 
) / 2)) + "px";
+                               container[0].style.left = (Math.floor(( - 
frameW ) / 2)) + "px";
+
 
                                setTimeout(function(){
 
@@ -708,7 +706,7 @@
 
                if ( jQuery.browser.mozilla ) {
                        body
-                       .css('overflow', 'auto')
+                       .css('overflow', 'auto');
                }
 
                return true;
@@ -794,4 +792,3 @@
        this.handlePopupFormInput = handlePopupFormInput;
        this.handlePopupFormLink = handlePopupFormLink;
        this.adjustFrameSize = adjustFrameSize;
-};
diff --git a/libs/SF_preview.js b/libs/SF_preview.js
index 424fd86..0d4f93b 100644
--- a/libs/SF_preview.js
+++ b/libs/SF_preview.js
@@ -4,7 +4,6 @@
  * @author Stephan Gambke
  */
 
-/*global jQuery, mediaWiki */
 /*global validateAll */
 
 ( function ( $, mw ) {
diff --git a/libs/SF_submit.js b/libs/SF_submit.js
index 484939b..9a3dcdb 100644
--- a/libs/SF_submit.js
+++ b/libs/SF_submit.js
@@ -4,7 +4,6 @@
  * @author Stephan Gambke
 */
 
-/*global jQuery, mediaWiki */
 /*global validateAll */
 
 ( function ( $, mw ) {
diff --git a/libs/SF_wikieditor.js b/libs/SF_wikieditor.js
index 0dae2fe..4931847 100644
--- a/libs/SF_wikieditor.js
+++ b/libs/SF_wikieditor.js
@@ -1,4 +1,5 @@
 // create ext if it does not exist yet
+/*global wgWikiEditorEnabledModules*/
 if ( typeof( window.ext ) === "undefined" ) {
        window.ext = {};
 }
@@ -16,7 +17,7 @@
                                                input.wikiEditor( 'addModule', 
jQuery.wikiEditor.modules.toolbar.config.getDefaultConfig() );
 
                                                // hide sig if required
-                                               if ( wgWikiEditorEnabledModules 
&& wgWikiEditorEnabledModules['hidesig'] == true ) {
+                                               if ( wgWikiEditorEnabledModules 
&& wgWikiEditorEnabledModules.hidesig === true ) {
                                                        input.wikiEditor( 
'removeFromToolbar', {
                                                                'section': 
'main',
                                                                'group': 
'insert',
diff --git a/libs/SemanticForms.js b/libs/SemanticForms.js
index 30d569f..c37ffc7 100644
--- a/libs/SemanticForms.js
+++ b/libs/SemanticForms.js
@@ -10,6 +10,7 @@
  * @author Harold Solbrig
  * @author Eugene Mednikov
  */
+ /*global sfgShowOnSelect, sfgFieldProperties, validateAll*/
 
 // Activate autocomplete functionality for the specified field
 (function(jQuery) {
@@ -18,17 +19,19 @@
        jQuery.ui.autocomplete.prototype._renderItem = function( ul, item) {
 
                var delim = this.element.context.delimiter;
-               if ( delim == null ) {
+    var term;
+               if ( delim === null ) {
                        term = this.term;
                } else {
                        term = this.term.split( delim ).pop();
                }
                var re = new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + 
term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + 
")(?![^<>]*>)(?![^&;]+;)", "gi");
                var loc = item.label.search(re);
+    var t;
                if (loc >= 0) {
-                       var t = item.label.substr(0, loc) + '<strong>' + 
item.label.substr(loc, term.length) + '</strong>' + item.label.substr(loc + 
term.length);
+                       t = item.label.substr(0, loc) + '<strong>' + 
item.label.substr(loc, term.length) + '</strong>' + item.label.substr(loc + 
term.length);
                } else {
-                       var t = item.label;
+                       t = item.label;
                }
                return jQuery( "<li></li>" )
                        .data( "item.autocomplete", item )
@@ -52,7 +55,7 @@
        var data_source = field_values[0];
        if (field_values[1] == 'list') {
                delimiter = ",";
-               if (field_values[2] != null) {
+               if (field_values[2] !== null) {
                        delimiter = field_values[2];
                }
        }
@@ -62,7 +65,7 @@
        // This doesn't cover the case of a delimiter that's a newline
        // plus something else, like ".\n" or "\n\n", but as far as we
        // know no one has yet needed that.
-       if ( delimiter != null ) {
+       if ( delimiter !== null ) {
                if ( delimiter == "\\n" ) {
                        delimiter = "\n";
                } else {
@@ -77,10 +80,11 @@
        jQuery.extend( jQuery.ui.autocomplete, {
            filter: function(array, term) {
                var sfgAutocompleteOnAllChars = mw.config.get( 
'sfgAutocompleteOnAllChars' );
-               if ( sfgAutocompleteOnAllChars ) {
-                       var matcher = new 
RegExp(jQuery.ui.autocomplete.escapeRegex(term), "i" );
+               var matcher;
+    if ( sfgAutocompleteOnAllChars ) {
+                       matcher = new 
RegExp(jQuery.ui.autocomplete.escapeRegex(term), "i" );
                } else {
-                       var matcher = new RegExp("\\b" + 
jQuery.ui.autocomplete.escapeRegex(term), "i" );
+                       matcher = new RegExp("\\b" + 
jQuery.ui.autocomplete.escapeRegex(term), "i" );
                }
                return jQuery.grep( array, function(value) {
                        return matcher.test( value.label || value.value || 
value );
@@ -88,23 +92,22 @@
            }
        });
 
-    values = jQuery(this).data('autocompletevalues');
+   var values = jQuery(this).data('autocompletevalues');
     if ( !values ) {
        var sfgAutocompleteValues = mw.config.get( 'sfgAutocompleteValues' );
        values = sfgAutocompleteValues[field_string];
     }
-    if (values != null) {
+    var split = function (val) {
+               return val.split(delimiter);
+       };
+       var extractLast = function (term) {
+               return split(term).pop();
+       };
+    if (values !== null) {
        // Local autocompletion
 
-       if (delimiter != null) {
+       if (delimiter !== null) {
                // Autocomplete for multiple values
-
-               function split(val) {
-                       return val.split(delimiter);
-               }
-               function extractLast(term) {
-                       return split(term).pop();
-               }
 
                var thisInput = jQuery(this);
 
@@ -148,13 +151,7 @@
        var data_type = jQuery(this).attr("autocompletedatatype");
        myServer += "?action=sfautocomplete&format=json&" + data_type + "=" + 
data_source;
 
-       if (delimiter != null) {
-               function split(val) {
-                       return val.split(delimiter);
-               }
-               function extractLast(term) {
-                       return split(term).pop();
-               }
+       if (delimiter !== null) {
                jQuery(this).autocomplete({
                        source: function(request, response) {
                                jQuery.getJSON(myServer, {
@@ -163,8 +160,8 @@
                                        
response(jQuery.map(data.sfautocomplete, function(item) {
                                                return {
                                                        value: item.title
-                                               }
-                                       }))
+                                               };
+                                       }));
                                });
                        },
                        search: function() {
@@ -204,8 +201,8 @@
                                                
response(jQuery.map(data.sfautocomplete, function(item) {
                                                        return {
                                                                value: 
item.title
-                                                       }
-                                               }))
+                                                       };
+                                               }));
                                        }
                                });
                        },
@@ -288,7 +285,7 @@
        // if no initialization function for this input was registered yet,
        // create entry
        if ( ! 
jQuery("#sfForm").data("SemanticForms").initFunctions[this.attr("id")] ) {
-               
jQuery("#sfForm").data("SemanticForms").initFunctions[this.attr("id")] = new 
Array();
+               
jQuery("#sfForm").data("SemanticForms").initFunctions[this.attr("id")] = [];
        }
 
        // record initialization function
@@ -299,10 +296,10 @@
 
        // execute initialization if input is not part of 
multipleTemplateStarter
        // and if not forbidden
-       if ( this.closest(".multipleTemplateStarter").length == 0 && 
!noexecute) {
+       if ( this.closest(".multipleTemplateStarter").length === 0 && 
!noexecute) {
                var input = this;
                // ensure initFunction is only exectued after doc structure is 
complete
-               jQuery(function() {initFunction ( input.attr("id"), param )});
+               jQuery(function() {initFunction ( input.attr("id"), param );});
        }
 
        return this;
@@ -415,7 +412,7 @@
        var showOnSelectVals = sfgShowOnSelect[this.attr("id")];
 
        var instanceWrapperDiv = this.closest('.multipleTemplateInstance');
-       if ( instanceWrapperDiv.length == 0 ) {
+       if ( instanceWrapperDiv.length === 0 ) {
                instanceWrapperDiv = null;
        }
 
@@ -451,7 +448,7 @@
        var showOnSelectVals = sfgShowOnSelect[this.attr("id")];
 
        var instanceWrapperDiv = this.closest('.multipleTemplateInstance');
-       if ( instanceWrapperDiv.length == 0 ) {
+       if ( instanceWrapperDiv.length === 0 ) {
                instanceWrapperDiv = null;
        }
 
@@ -472,7 +469,7 @@
        var div_id = sfgShowOnSelect[this.attr("id")];
 
        var instanceWrapperDiv = this.closest('.multipleTemplateInstance');
-       if ( instanceWrapperDiv.length == 0 ) {
+       if ( instanceWrapperDiv.length === 0 ) {
                instanceWrapperDiv = null;
        }
 
@@ -507,16 +504,17 @@
        } else {
                return true;
        }
-}
+};
 
 jQuery.fn.validateMandatoryField = function() {
        var fieldVal = this.find(".mandatoryField").val();
-       if (fieldVal == null) {
-               var isEmpty = true;
+  var isEmpty;
+       if (fieldVal === null) {
+               isEmpty = true;
        } else if (jQuery.isArray(fieldVal)) {
-               var isEmpty = (fieldVal.length == 0);
+               isEmpty = (fieldVal.length === 0);
        } else {
-               var isEmpty = (fieldVal.replace(/\s+/, '') == '');
+               isEmpty = (fieldVal.replace(/\s+/, '') === '');
        }
        if (isEmpty) {
                this.addErrorMessage( 'sf_blank_error' );
@@ -528,7 +526,7 @@
 
 jQuery.fn.validateMandatoryComboBox = function() {
        var combobox = this.find( "input.sfComboBox" );
-       if (combobox.val() == '') {
+       if (combobox.val() === '') {
                this.addErrorMessage( 'sf_blank_error' );
                return false;
        } else {
@@ -537,9 +535,9 @@
 };
 
 jQuery.fn.validateMandatoryDateField = function() {
-       if (this.find(".dayInput").val() == '' ||
-           this.find(".monthInput").val() == '' ||
-           this.find(".yearInput").val() == '') {
+       if (this.find(".dayInput").val() === '' ||
+           this.find(".monthInput").val() === '' ||
+           this.find(".yearInput").val() === '') {
                this.addErrorMessage( 'sf_blank_error' );
                return false;
        } else {
@@ -562,7 +560,7 @@
        // Get the number of checked checkboxes within this span - must
        // be at least one.
        var numChecked = this.find("input:checked").size();
-       if (numChecked == 0) {
+       if (numChecked === 0) {
                this.addErrorMessage( 'sf_blank_error' );
                return false;
        } else {
@@ -578,7 +576,7 @@
        var fieldVal = this.find("input").val();
        // code borrowed from http://snippets.dzone.com/posts/show/452
        var url_regexp = 
/(ftp|http|https|rtsp|news):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
-       if (fieldVal == "" || url_regexp.test(fieldVal)) {
+       if (fieldVal === "" || url_regexp.test(fieldVal)) {
                return true;
        } else {
                this.addErrorMessage( 'sf_bad_url_error' );
@@ -590,7 +588,7 @@
        var fieldVal = this.find("input").val();
        // code borrowed from 
http://javascript.internet.com/forms/email-validation---basic.html
        var email_regexp = 
/^\s*\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+\s*$/;
-       if (fieldVal == '' || email_regexp.test(fieldVal)) {
+       if (fieldVal === '' || email_regexp.test(fieldVal)) {
                return true;
        } else {
                this.addErrorMessage( 'sf_bad_email_error' );
@@ -602,7 +600,7 @@
        var fieldVal = this.find("input").val();
        // Handle "E notation"/scientific notation ("1.2e-3") in addition
        // to regular numbers
-       if (fieldVal == '' ||
+       if (fieldVal === '' ||
        
fieldVal.match(/^\s*[\-+]?((\d+[\.,]?\d*)|(\d*[\.,]?\d+))([eE]?[\-\+]?\d+)?\s*$/))
 {
                return true;
        } else {
@@ -615,7 +613,7 @@
        // validate only if day and year fields are both filled in
        var dayVal = this.find(".dayInput").val();
        var yearVal = this.find(".yearInput").val();
-       if (dayVal == '' || yearVal == '') {
+       if (dayVal === '' || yearVal === '') {
                return true;
        } else if (dayVal.match(/^\d+$/) && dayVal <= 31) {
                // no year validation, since it can also include
@@ -679,8 +677,8 @@
 
                        // if input is not part of multipleTemplateStarter
                        if ( typeof sfdata.validationFunctions[i] !== 
'undefined' &&
-                               jQuery("#" + 
sfdata.validationFunctions[i].input).closest(".multipleTemplateStarter").length 
== 0 &&
-                               jQuery("#" + 
sfdata.validationFunctions[i].input).closest(".hiddenBySF").length == 0 ) {
+                               jQuery("#" + 
sfdata.validationFunctions[i].input).closest(".multipleTemplateStarter").length 
=== 0 &&
+                               jQuery("#" + 
sfdata.validationFunctions[i].input).closest(".hiddenBySF").length === 0 ) {
 
                                if (! sfdata.validationFunctions[i].valfunction(
                                                
sfdata.validationFunctions[i].input,
@@ -693,7 +691,7 @@
 
        if (num_errors > 0) {
                // add error header, if it's not there already
-               if (jQuery("#form_error_header").size() == 0) {
+               if (jQuery("#form_error_header").size() === 0) {
                        jQuery("#contentSub").append('<div 
id="form_error_header" class="errorbox" style="font-size: medium"><img src="' + 
mw.config.get( 'sfgScriptPath' ) + '/skins/MW-Icon-AlertMark.png" />&nbsp;' + 
mw.message( 'sf_formerrors_header' ).escaped() + '</div><br clear="both" />');
                }
                scroll(0, 0);
@@ -708,7 +706,7 @@
                //remove error box if it exists because there are no errors in 
the form now
                jQuery("#contentSub").find(".errorbox").remove();
        }
-       return (num_errors == 0);
+       return (num_errors === 0);
 };
 
 /**
@@ -767,12 +765,13 @@
 
                                var sfdata = 
jQuery("#sfForm").data('SemanticForms');
                                if ( sfdata ) { // found data object?
+          var i;
                                        if ( sfdata.initFunctions[old_id] ) {
 
                                                // For every initialization 
method for
                                                // input with id old_id, 
register the
                                                // method for the new input.
-                                               for ( var i = 0; i < 
sfdata.initFunctions[old_id].length; i++ ) {
+                                               for ( i = 0; i < 
sfdata.initFunctions[old_id].length; i++ ) {
 
                                                        
jQuery(this).SemanticForms_registerInputInit(
                                                                
sfdata.initFunctions[old_id][i].initFunction,
@@ -785,7 +784,7 @@
                                        // For every validation method for the
                                        // input with ID old_id, register it
                                        // for the new input.
-                                       for ( var i = 0; i < 
sfdata.validationFunctions.length; i++ ) {
+                                       for ( i = 0; i < 
sfdata.validationFunctions.length; i++ ) {
 
                                                if ( typeof 
sfdata.validationFunctions[i] !== 'undefined' &&
                                                        
sfdata.validationFunctions[i].input == old_id ) {
@@ -840,7 +839,7 @@
                                                        
thatData[i].initFunction(
                                                                this.id,
                                                                
thatData[i].parameters
-                                                               )
+                                                               );
                                                }
                                        }
                                }
@@ -855,8 +854,8 @@
 // regular inputs, and the 'origName' attribute for inputs in multiple-instance
 // templates.
 jQuery.fn.setDependentAutocompletion = function( dependentField, baseField, 
baseValue ) {
-       propName = sfgFieldProperties[dependentField];
-       baseProp = sfgFieldProperties[baseField];
+       var propName = sfgFieldProperties[dependentField];
+       var baseProp = sfgFieldProperties[baseField];
        var myServer = mw.config.get( 'wgScriptPath' ) + "/api.php";
        myServer += "?action=sfautocomplete&format=json&property=" + propName + 
"&baseprop=" + baseProp + "&basevalue=" + baseValue;
        var dependentValues = [];
@@ -879,7 +878,7 @@
                dataType: 'json',
                async: false,
                success: function(data) {
-                       realData = data.sfautocomplete;
+                       var realData = data.sfautocomplete;
                        jQuery.each(realData, function(key, val) {
                                dependentValues.push(val.title);
                        });
@@ -894,13 +893,13 @@
  * for its 'dependent' field (e.g., for a city).
  */
 jQuery.fn.setAutocompleteForDependentField = function( partOfMultiple ) {
-       curValue = jQuery(this).val();
-       if ( curValue == null ) { return this; }
+       var curValue = jQuery(this).val();
+       if ( curValue === null ) { return this; }
 
-       nameAttr = partOfMultiple ? 'origName' : 'name';
-       name = jQuery(this).attr(nameAttr);
+       var nameAttr = partOfMultiple ? 'origName' : 'name';
+       var name = jQuery(this).attr(nameAttr);
        var sfgDependentFields = mw.config.get( 'sfgDependentFields' );
-       dependent_on_me = [];
+       var dependent_on_me = [];
        for ( var i = 0; i < sfgDependentFields.length; i++ ) {
                var dependentFieldPair = sfgDependentFields[i];
                if ( dependentFieldPair[0] == name ) {
@@ -911,12 +910,13 @@
 
        var self = this;
        jQuery.each( dependent_on_me, function() {
-               dependentField = this;
+               var dependentField = this;
+    var dependent_field_element;
                if ( partOfMultiple ) {
-                       var dependent_field_element = 
jQuery(self).closest(".multipleTemplateInstance")
+                       dependent_field_element = 
jQuery(self).closest(".multipleTemplateInstance")
                                .find('[origName="' + dependentField + '"]');
                } else {
-                       var dependent_field_element = jQuery('[name="' + 
dependentField + '"]');
+                       dependent_field_element = jQuery('[name="' + 
dependentField + '"]');
                }
                var class_name = $(dependent_field_element).attr( 'class' );
                if ( class_name.indexOf( 'sfComboBox' ) != -1 ) {
diff --git a/libs/ext.dynatree.js b/libs/ext.dynatree.js
index f53acb9..116b04d 100644
--- a/libs/ext.dynatree.js
+++ b/libs/ext.dynatree.js
@@ -1,7 +1,7 @@
 $(function () {
-       // Attach the dynatree widget to an existing <div id="tree"> element
-       // and pass the tree options as an argument to the dynatree() function:
-       var nodeSelection = $("div[id*=treeinput]");
+    // Attach the dynatree widget to an existing <div id="tree"> element
+    // and pass the tree options as an argument to the dynatree() function:
+    var nodeSelection = $("div[id*=treeinput]");
     nodeSelection.each (function (index) {
         var node = nodeSelection.eq(index);
         var selectMode = 2;
@@ -12,42 +12,41 @@
         }
 
         node.dynatree({
-               checkbox: true,
-               minExpandLevel: 1,
+            checkbox: true,
+            minExpandLevel: 1,
             classNames: checkboxClass,
-               selectMode: selectMode,
-               onClick: function (node, event) {
-                       var targetType = node.getEventTargetType(event);
-                           if ( targetType == "expander" ) {
-                                   node.toggleExpand();
-                           } else if ( targetType == "checkbox" ||
-                                  targetType == "title" ) {
-                                   node.toggleSelect();
-                           }
+            selectMode: selectMode,
+            onClick: function (node, event) {
+                var targetType = node.getEventTargetType(event);
+                if ( targetType == "expander" ) {
+                    node.toggleExpand();
+                } else if ( targetType == "checkbox" ||
+                       targetType == "title" ) {
+                    node.toggleSelect();
+                }
 
-                       return false;
-                   },
-               //Un/check real checkboxes recursively after selection
-               onSelect: function (select, dtnode) {
-                       var inputkey = "chb-" + dtnode.data.key;
-                           $("[id='" + inputkey + "']").attr("checked", 
select);
-               },
-               //Prevent reappearing of checkbox when node is collapse
-                   onExpand: function (select, dtnode) {
-                           $("#chb-" + dtnode.data.key).attr("checked",
-                                   dtnode.isSelected()).addClass("hidden");
-               }
-           });
-           //Update real checkboxes according to selections
-               $.map(node.dynatree("getTree").getSelectedNodes(),
-                       function (dtnode) {
-                               $("#chb-" + dtnode.data.key).attr("checked", 
true);
-                               dtnode.activate();
-                       });
-               var activeNode = node.dynatree("getTree").getActiveNode();
-               if (activeNode !== null) {
-                       activeNode.deactivate()
-               }
-       });
+                return false;
+            },
+            //Un/check real checkboxes recursively after selection
+            onSelect: function (select, dtnode) {
+                var inputkey = "chb-" + dtnode.data.key;
+                $("[id='" + inputkey + "']").attr("checked", select);
+            },
+            //Prevent reappearing of checkbox when node is collapse
+            onExpand: function (select, dtnode) {
+                $("#chb-" + dtnode.data.key).attr("checked",
+                    dtnode.isSelected()).addClass("hidden");
+            }
+        });
+        //Update real checkboxes according to selections
+        $.map(node.dynatree("getTree").getSelectedNodes(),
+            function (dtnode) {
+                $("#chb-" + dtnode.data.key).attr("checked", true);
+                dtnode.activate();
+            });
+        var activeNode = node.dynatree("getTree").getActiveNode();
+        if (activeNode !== null) {
+            activeNode.deactivate();
+        }
+    });
 });
-
diff --git a/libs/ext.sf.select2.base.js b/libs/ext.sf.select2.base.js
index f2143d2..a5e18ca 100644
--- a/libs/ext.sf.select2.base.js
+++ b/libs/ext.sf.select2.base.js
@@ -76,15 +76,15 @@
                        var markup = "";
 
                        var text_highlight = 
sf.select2.base.prototype.textHighlight;
-                       if ( text != undefined && image != undefined && 
description != undefined ) {
+                       if ( text !== undefined && image !== undefined && 
description !== undefined ) {
                                markup += "<table class='sf-select2-result'> 
<tr>";
                                markup += "<td class='sf-result-thumbnail'><img 
src='" + image + "'/></td>";
                                markup += "<td class='sf-result-info'><div 
class='sf-result-title'>" + text_highlight(text, term) + "</div>";
                                markup += "<div class='sf-result-description'>" 
+ description + "</div>";
                                markup += "</td></tr></table>";
-                       } else if ( text != undefined && image != undefined ) {
+                       } else if ( text !== undefined && image !== undefined ) 
{
                                markup += "<img class='sf-icon' src='"+ image 
+"'/>" + text_highlight(text, term);
-                       } else if ( text != undefined && description != 
undefined ) {
+                       } else if ( text !== undefined && description !== 
undefined ) {
                                markup += "<table class='sf-select2-result'> 
<tr>";
                                markup += "<td class='sf-result-info'><div 
class='sf-result-title'>" + text_highlight(text, term) + "</div>";
                                markup += "<div class='sf-result-description'>" 
+ description + "</div>";
@@ -118,7 +118,6 @@
                        var input_id = "#" + this.id;
                        var name_attr = this.nameAttr( $(input_id) );
                        var name = $(input_id).attr( name_attr );
-                       var dependent_on_me = [];
 
                        var sfgDependentFields = mw.config.get( 
'sfgDependentFields' );
                        for ( var i = 0; i < sfgDependentFields.length; i++ ) {
@@ -174,7 +173,7 @@
                 *
                 */
                partOfMultiple: function( element ) {
-                       return element.attr( "origname" ) != undefined ? true : 
false;
+                       return element.attr( "origname" ) !== undefined ? true 
: false;
                },
                /*
                 * Gives dependent field options which include
@@ -188,11 +187,12 @@
                getDependentFieldOpts: function( dep_on ) {
                        var input_id = "#" + this.id;
                        var dep_field_opts = {};
+      var base_element;
                        if ( this.partOfMultiple($(input_id)) ) {
-                               var base_element = $(input_id).closest( 
".multipleTemplateInstance" )
+                               base_element = $(input_id).closest( 
".multipleTemplateInstance" )
                                                                .find( 
'[origname ="' + dep_on + '" ]' );
                        } else {
-                               var base_element = $('[name ="' + dep_on + '" 
]');
+                               base_element = $('[name ="' + dep_on + '" ]');
                        }
                        dep_field_opts.base_value = base_element.val();
                        dep_field_opts.base_prop = base_element.attr( 
"autocompletesettings" );
@@ -249,7 +249,7 @@
                        var remove_diacritics = 
sf.select2.base.prototype.removeDiacritics;
                        var no_diac_text = remove_diacritics(text);
                        var start = 
no_diac_text.toUpperCase().indexOf(term.toUpperCase());
-                       if (start != 0 && !mw.config.get( 
'sfgAutocompleteOnAllChars' )) {
+                       if (start !== 0 && !mw.config.get( 
'sfgAutocompleteOnAllChars' )) {
                                start = no_diac_text.toUpperCase().indexOf(" " 
+ term.toUpperCase());
                                if ( start != -1 ) {
                                        start = start + 1;
diff --git a/libs/ext.sf.select2.combobox.js b/libs/ext.sf.select2.combobox.js
index 79a4169..9e60d72 100644
--- a/libs/ext.sf.select2.combobox.js
+++ b/libs/ext.sf.select2.combobox.js
@@ -43,11 +43,11 @@
        combobox_proto.setOptions = function() {
                var input_id = this.id;
                var opts = {};
-               var input_id = "#" + input_id;
+               input_id = "#" + input_id;
                var input_tagname = $(input_id).prop( "tagName" );
                var autocomplete_opts = this.getAutocompleteOpts();
 
-               if ( autocomplete_opts.autocompletedatatype != undefined ) {
+               if ( autocomplete_opts.autocompletedatatype !== undefined ) {
                        opts.ajax = this.getAjaxOpts();
                        opts.minimumInputLength = 1;
                        opts.formatInputTooShort = mw.msg( 
"sf-select2-input-too-short", opts.minimumInputLength );
@@ -62,7 +62,7 @@
                                var no_diac_text = 
sf.select2.base.prototype.removeDiacritics( text );
                                var position = 
no_diac_text.toUpperCase().indexOf(term.toUpperCase());
                                var position_with_space = 
no_diac_text.toUpperCase().indexOf(" " + term.toUpperCase());
-                               if ( (position != -1 && position == 0 ) ||  
position_with_space != -1 )
+                               if ( (position != -1 && position === 0 ) ||  
position_with_space != -1 )
                                        return true;
                                else
                                        return false;
@@ -75,12 +75,12 @@
                if ( $(input_id).attr( "existingvaluesonly" ) !== "true" && 
input_tagname == "INPUT" ) {
                        opts.createSearchChoice = function( term, data ) { if ( 
$(data).filter(function() { return this.text.localeCompare( term )===0; 
}).length===0 ) {return { id:term, text:term };} };
                }
-               if ( $(input_id).val() != "" && input_tagname == "INPUT" ) {
+               if ( $(input_id).val() !== "" && input_tagname == "INPUT" ) {
                        opts.initSelection = function ( element, callback ) { 
var data = {id: element.val(), text: element.val()}; callback(data); };
                }
                opts.allowClear = true;
                var size = $(input_id).attr("size");
-               if ( size == undefined ) {
+               if ( size === undefined ) {
                        size = 35; //default value
                }
                opts.containerCss = { 'min-width': size * 6 };
@@ -100,17 +100,17 @@
                var input_id = "#" + this.id;
                var values = [{id: 0, text: ""}];
                var dep_on = this.dependentOn();
-               var i;
-               if ( dep_on == null ) {
+               var i, data;
+               if ( dep_on === null ) {
                        if ( autocompletesettings == 'external data' ) {
                                var name = 
$(input_id).attr(this.nameAttr($(input_id)));
                                var sfgEDSettings = mw.config.get( 
'sfgEDSettings' );
                                var edgValues = mw.config.get( 'edgValues' );
-                               var data = {};
-                               if ( sfgEDSettings[name].title != undefined && 
sfgEDSettings[name].title != "" ) {
+                               data = {};
+                               if ( sfgEDSettings[name].title !== undefined && 
sfgEDSettings[name].title !== "" ) {
                                        data.title = 
edgValues[sfgEDSettings[name].title];
                                        i = 0;
-                                       if ( data.title != undefined ) {
+                                       if ( data.title !== undefined ) {
                                                data.title.forEach(function() {
                                                        values.push({
                                                        id: i + 1, text: 
data.title[i]
@@ -118,20 +118,20 @@
                                                    i++;
                                                });
                                        }
-                                       if ( sfgEDSettings[name].image != 
undefined && sfgEDSettings[name].image != "" ) {
+                                       if ( sfgEDSettings[name].image !== 
undefined && sfgEDSettings[name].image !== "" ) {
                                                data.image = 
edgValues[sfgEDSettings[name].image];
                                                i = 0;
-                                               if ( data.image != undefined ) {
+                                               if ( data.image !== undefined ) 
{
                                                        
data.image.forEach(function() {
                                                                
values[i+1].image = data.image[i];
                                                                i++;
                                                        });
                                                }
                                        }
-                                       if ( sfgEDSettings[name].description != 
undefined && sfgEDSettings[name].description != "" ) {
+                                       if ( sfgEDSettings[name].description 
!== undefined && sfgEDSettings[name].description !== "" ) {
                                                data.description = 
edgValues[sfgEDSettings[name].description];
                                                i = 0;
-                                               if ( data.description != 
undefined ) {
+                                               if ( data.description !== 
undefined ) {
                                                        
data.description.forEach(function() {
                                                                
values[i+1].description = data.description[i];
                                                                i++;
@@ -142,10 +142,10 @@
 
                        } else {
                                var sfgAutocompleteValues = mw.config.get( 
'sfgAutocompleteValues' );
-                               var data = 
sfgAutocompleteValues[autocompletesettings];
+                               data = 
sfgAutocompleteValues[autocompletesettings];
                                i = 0;
                                //Convert data into the format accepted by 
Select2
-                               if (data != undefined) {
+                               if (data !== undefined) {
                                        data.forEach(function()
                                        {
                                            values.push({
@@ -186,7 +186,6 @@
         *
         */
        combobox_proto.getAjaxOpts = function() {
-               var input_id = "#" + this.id;
                var autocomplete_opts = this.getAutocompleteOpts();
                var my_server = mw.util.wikiScript( 'api' );
                my_server += "?action=sfautocomplete&format=json&" + 
autocomplete_opts.autocompletedatatype + "=" + 
autocomplete_opts.autocompletesettings;
@@ -219,7 +218,7 @@
        combobox_proto.onChange = function() {
                var self = this;
                var data = $(this).select2( "data" );
-               if (data != null) {
+               if (data !== null) {
                        $(this).val( data.text );
                } else {
                        $(this).val( '' );
@@ -230,11 +229,12 @@
                var cmbox = new sf.select2.combobox();
                var dep_on_me = $.unique(cmbox.dependentOnMe( $(this) ));
                dep_on_me.forEach( function( dependent_field_name ) {
+      var dependent_field;
                        if ( cmbox.partOfMultiple( $(self) ) ) {
-                               var dependent_field = $(self).closest( 
".multipleTemplateInstance" )
+                               dependent_field = $(self).closest( 
".multipleTemplateInstance" )
                                        .find( '[origname ="' + 
dependent_field_name + '" ]' );
                        } else {
-                               var dependent_field = $('[name ="' + 
dependent_field_name + '" ]');
+                               dependent_field = $('[name ="' + 
dependent_field_name + '" ]');
                        }
                        cmbox.dependentFieldAutocompleteHandler( 
dependent_field, self );
                });
diff --git a/libs/ext.sf.select2.tokens.js b/libs/ext.sf.select2.tokens.js
index 793fff8..7dbbcc0 100644
--- a/libs/ext.sf.select2.tokens.js
+++ b/libs/ext.sf.select2.tokens.js
@@ -59,11 +59,11 @@
                var self = this;
                var input_id = this.id;
                var opts = {};
-               var input_id = "#" + input_id;
+               input_id = "#" + input_id;
                var input_tagname = $(input_id).prop( "tagName" );
                var autocomplete_opts = this.getAutocompleteOpts();
 
-               if ( autocomplete_opts.autocompletedatatype != undefined ) {
+               if ( autocomplete_opts.autocompletedatatype !== undefined ) {
                        opts.ajax = this.getAjaxOpts();
                        opts.minimumInputLength = 1;
                        opts.formatInputTooShort = "";
@@ -78,7 +78,7 @@
                                var no_diac_text = 
sf.select2.base.prototype.removeDiacritics( text );
                                var position = 
no_diac_text.toUpperCase().indexOf(term.toUpperCase());
                                var position_with_space = 
no_diac_text.toUpperCase().indexOf(" " + term.toUpperCase());
-                               if ( (position != -1 && position == 0 ) ||  
position_with_space != -1 )
+                               if ( (position != -1 && position === 0 ) ||  
position_with_space != -1 )
                                        return true;
                                else
                                        return false;
@@ -91,13 +91,13 @@
                if ( $(input_id).attr( "existingvaluesonly" ) !== "true" && 
input_tagname == "INPUT" ) {
                        opts.createSearchChoice = function( term, data ) { if ( 
$(data).filter(function() { return this.text.localeCompare( term )===0; 
}).length===0 ) {return { id:term, text:term };} };
                }
-               if ( $(input_id).val() != "" && input_tagname == "INPUT" ) {
+               if ( $(input_id).val() !== "" && input_tagname == "INPUT" ) {
                        opts.initSelection = function ( element, callback ) {
                                var data = [];
                                var delim = self.getDelimiter($(input_id));
                                var i = 0;
                                
$(element.val().trim().split(delim)).each(function () {
-                                       if ( this != "" ) {
+                                       if ( this !== "" ) {
                                                data.push({id: i, text: this});
                                                i += 1;
                                        }
@@ -107,7 +107,7 @@
                        };
                }
                var size = $(input_id).attr("size");
-               if ( size == undefined ) {
+               if ( size === undefined ) {
                        size = 100; //default value
                }
                opts.containerCss = { 'min-width': size * 6 };
@@ -118,7 +118,7 @@
                opts.tokenSeparators = this.getDelimiter($(input_id));
                opts.openOnEnter = true;
                var maxvalues = $(input_id).attr( "maxvalues" );
-               if ( maxvalues != undefined ) {
+               if ( maxvalues !== undefined ) {
                        opts.maximumSelectionSize = maxvalues;
                        opts.formatSelectionTooBig = mw.msg( 
"sf-select2-selection-too-big", maxvalues );
                }
@@ -136,17 +136,18 @@
        tokens_proto.getData = function( autocompletesettings ) {
                var input_id = "#" + this.id;
                var values = [];
+    var data;
                var dep_on = this.dependentOn();
-               if ( dep_on == null ) {
+               if ( dep_on === null ) {
                        if ( autocompletesettings == 'external data' ) {
                                var name = 
$(input_id).attr(this.nameAttr($(input_id)));
                                var sfgEDSettings = mw.config.get( 
'sfgEDSettings' );
                                var edgValues = mw.config.get( 'edgValues' );
-                               var data = {};
-                               if ( sfgEDSettings[name].title != undefined && 
sfgEDSettings[name].title != "" ) {
+                               data = {};
+                               if ( sfgEDSettings[name].title !== undefined && 
sfgEDSettings[name].title !== "" ) {
                                        data.title = 
edgValues[sfgEDSettings[name].title];
                                        i = 0;
-                                       if ( data.title != undefined ) {
+                                       if ( data.title !== undefined ) {
                                                data.title.forEach(function() {
                                                        values.push({
                                                        id: i + 1, text: 
data.title[i]
@@ -154,20 +155,20 @@
                                                    i++;
                                                });
                                        }
-                                       if ( sfgEDSettings[name].image != 
undefined && sfgEDSettings[name].image != "" ) {
+                                       if ( sfgEDSettings[name].image !== 
undefined && sfgEDSettings[name].image !== "" ) {
                                                data.image = 
edgValues[sfgEDSettings[name].image];
                                                i = 0;
-                                               if ( data.image != undefined ) {
+                                               if ( data.image !== undefined ) 
{
                                                        
data.image.forEach(function() {
                                                                values[i].image 
= data.image[i];
                                                                i++;
                                                        });
                                                }
                                        }
-                                       if ( sfgEDSettings[name].description != 
undefined && sfgEDSettings[name].description != "" ) {
+                                       if ( sfgEDSettings[name].description 
!== undefined && sfgEDSettings[name].description !== "" ) {
                                                data.description = 
edgValues[sfgEDSettings[name].description];
                                                i = 0;
-                                               if ( data.description != 
undefined ) {
+                                               if ( data.description !== 
undefined ) {
                                                        
data.description.forEach(function() {
                                                                
values[i].description = data.description[i];
                                                                i++;
@@ -178,10 +179,10 @@
 
                        } else {
                                var sfgAutocompleteValues = mw.config.get( 
'sfgAutocompleteValues' );
-                               var data = 
sfgAutocompleteValues[autocompletesettings];
+                               data = 
sfgAutocompleteValues[autocompletesettings];
                                var i = 0;
                                //Convert data into the format accepted by 
Select2
-                               if (data != undefined) {
+                               if (data !== undefined) {
                                        data.forEach(function()
                                        {
                                            values.push({
@@ -222,7 +223,6 @@
         *
         */
        tokens_proto.getAjaxOpts = function() {
-               var input_id = "#" + this.id;
                var autocomplete_opts = this.getAutocompleteOpts();
                var data_source = 
autocomplete_opts.autocompletesettings.split(',')[0];
                var my_server = mw.util.wikiScript( 'api' );
@@ -259,7 +259,7 @@
                var tokens = new sf.select2.tokens();
                var delim = tokens.getDelimiter( $(this) );
 
-               if (data != null) {
+               if (data !== null) {
                        var tokens_value = "";
                        data.forEach( function( token ) {
                                tokens_value += token.text.trim() + delim + " ";
@@ -278,7 +278,7 @@
        tokens_proto.getDelimiter = function ( element ) {
                var field_values = element.attr('autocompletesettings').split( 
',' );
                var delimiter = ",";
-               if (field_values[1] == 'list' && field_values[2] != null) {
+               if (field_values[1] == 'list' && field_values[2] !== null) {
                                delimiter = field_values[2];
                }
 
diff --git a/libs/jquery.browser.js b/libs/jquery.browser.js
index ab190f6..53df749 100644
--- a/libs/jquery.browser.js
+++ b/libs/jquery.browser.js
@@ -26,8 +26,8 @@
 
 // Don't clobber any existing jQuery.browser in case it's different
        if (!jQuery.browser) {
-               matched = uaMatch(navigator.userAgent);
-               browser = {};
+               var matched = uaMatch(navigator.userAgent);
+               var browser = {};
 
                if (matched.browser) {
                        browser[ matched.browser ] = true;
diff --git a/libs/jquery.dynatree.js b/libs/jquery.dynatree.js
index 606f3dd..308ad00 100644
--- a/libs/jquery.dynatree.js
+++ b/libs/jquery.dynatree.js
@@ -430,15 +430,8 @@
                        }
                        // IE6 doesn't correctly evaluate multiple class names,
                        // so we create combined class names that can be used 
in the CSS
-                       cnList.push(cn.combinedExpanderPrefix
-                                       + (this.bExpanded ? "e" : "c")
-                                       + (data.isLazy && this.childList === 
null ? "d" : "")
-                                       + (isLastSib ? "l" : "")
-                                       );
-                       cnList.push(cn.combinedIconPrefix
-                                       + (this.bExpanded ? "e" : "c")
-                                       + (data.isFolder ? "f" : "")
-                                       );
+                       cnList.push(cn.combinedExpanderPrefix   + 
(this.bExpanded ? "e" : "c") + (data.isLazy && this.childList === null ? "d" : 
"") + (isLastSib ? "l" : ""));
+                       cnList.push(cn.combinedIconPrefix       + 
(this.bExpanded ? "e" : "c") + (data.isFolder ? "f" : ""));
                        this.span.className = cnList.join(" ");
 
                        // TODO: we should not set this in the <span> tag also, 
if we set it here:
@@ -1136,9 +1129,7 @@
                        }
                }
                // Do not apply animations in init phase, or before lazy-loading
-               var allowEffects = !(this.data.isLazy && this.childList === 
null)
-                       && !this._isLoading
-                       && !forceSync;
+               var allowEffects = !(this.data.isLazy && this.childList === 
null) && !this._isLoading && !forceSync;
                this.render(allowEffects);
 
                // Auto-collapse mode: collapse all siblings
@@ -1519,8 +1510,7 @@
                // We listen to this, if a callback was passed to reloadChildren
                if(callback){
                        var self = this;
-                       var eventType = "nodeLoaded.dynatree." + 
this.tree.$tree.attr("id")
-                               + "." + this.data.key;
+                       var eventType = "nodeLoaded.dynatree." + 
this.tree.$tree.attr("id") + "." + this.data.key;
                        this.tree.$tree.bind(eventType, function(e, node, isOk){
                                self.tree.$tree.unbind(eventType);
                                self.tree.logDebug("loaded %o, %o, %o", e, 
node, isOk);
@@ -2851,8 +2841,7 @@
                                        }else if(hitMode === "after" && 
otherNode && node === otherNode.getPrevSibling()){
 //                                             this.logDebug("    drop before 
source node prevented");
                                                hitMode = null;
-                                       }else if(hitMode === "over" && otherNode
-                                                       && otherNode.parent === 
node && otherNode.isLastSibling() ){
+                                       }else if(hitMode === "over" && 
otherNode && otherNode.parent === node && otherNode.isLastSibling() ){
 //                                             this.logDebug("    drop last 
child over own parent prevented");
                                                hitMode = null;
                                        }
@@ -2861,8 +2850,7 @@
                                ui.helper.data("hitMode", hitMode);
                        }
                        // Auto-expand node (only when 'over' the node, not 
'before', or 'after')
-                       if(hitMode === "over"
-                               && dnd.autoExpandMS && node.hasChildren() !== 
false && !node.bExpanded) {
+                       if(hitMode === "over" && dnd.autoExpandMS && 
node.hasChildren() !== false && !node.bExpanded) {
                                node.scheduleAction("expand", dnd.autoExpandMS);
                        }
                        if(hitMode && dnd.onDragOver){
diff --git a/libs/jquery.fancybox.js b/libs/jquery.fancybox.js
index bcf92be..68d2865 100644
--- a/libs/jquery.fancybox.js
+++ b/libs/jquery.fancybox.js
@@ -373,7 +373,7 @@
                        if (wrap.is(":visible")) {
                                $( close.add( nav_left ).add( nav_right ) 
).hide();
 
-                               pos = wrap.position(),
+                               pos = wrap.position();
 
                                start_pos = {
                                        top      : pos.top,
@@ -808,7 +808,7 @@
 
                                var rel = $(this).attr('rel') || '';
 
-                               if (!rel || rel == '' || rel === 'nofollow') {
+                               if (!rel || rel === '' || rel === 'nofollow') {
                                        selectedArray.push(this);
 
                                } else {
@@ -1071,7 +1071,7 @@
                                if (busy) {
                                        e.preventDefault();
 
-                               } else if ($(e.target).get(0).clientHeight == 0 
|| $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
+                               } else if ($(e.target).get(0).clientHeight === 
0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
                                        e.preventDefault();
                                        $.fancybox[ delta > 0 ? 'prev' : 
'next']();
                                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40e5d3b7588f176909f152a4602f9423cf63d286
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Jatin <mehtajati...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to