Apply coding conventions for whitespaces
authorFomafix <fomafix@googlemail.com>
Sun, 13 Apr 2014 18:03:20 +0000 (18:03 +0000)
committerKrinkle <krinklemail@gmail.com>
Fri, 18 Apr 2014 04:30:46 +0000 (04:30 +0000)
Change-Id: Ibd32177ac1f608fbb480d74a573c20b6487d28c4

resources/src/jquery/jquery.autoEllipsis.js
resources/src/jquery/jquery.localize.js
resources/src/jquery/jquery.mw-jump.js
resources/src/jquery/jquery.mwExtension.js
resources/src/jquery/jquery.spinner.js
resources/src/jquery/jquery.suggestions.js
resources/src/jquery/jquery.tablesorter.js
resources/src/jquery/jquery.textSelection.js
resources/src/mediawiki.action/mediawiki.action.edit.js
resources/src/mediawiki/mediawiki.debug.profile.js
resources/src/mediawiki/mediawiki.feedback.js

index 57d8f94..061f5d6 100644 (file)
@@ -39,7 +39,7 @@ $.fn.autoEllipsis = function ( options ) {
                        text, trimmableText, w, pw,
                        l, r, i, side, m,
                        // container element - used for measuring against
-                       $container = $(this);
+                       $container = $( this );
 
                if ( options.restoreText ) {
                        if ( !$container.data( 'autoEllipsis.originalText' ) ) {
index f499e10..0b42354 100644 (file)
@@ -123,7 +123,7 @@ $.fn.localize = function ( options ) {
        // for 'html:msg' turns up the 'html:msg', but searching for 'msg' doesn't. So searching for
        // both 'msg' and 'html:msg' seems to get the job done. This feels pretty icky, though.
        $target.find( 'msg,html\\:msg' ).each( function () {
-               var $el = $(this);
+               var $el = $( this );
                // Escape by default
                if ( $el.attr( 'raw' ) ) {
                        $el.html( msg( options, $el.attr( 'key' ) ) );
@@ -140,7 +140,7 @@ $.fn.localize = function ( options ) {
        $.each( attributes, function ( i, attr ) {
                var msgAttr = attr + '-msg';
                $target.find( '[' + msgAttr + ']' ).each( function () {
-                       var $el = $(this);
+                       var $el = $( this );
                        $el.attr( attr, msg( options, $el.attr( msgAttr ) ) ).removeAttr( msgAttr );
                } );
        } );
index e286834..5eae0be 100644 (file)
@@ -6,9 +6,9 @@ jQuery( function ( $ ) {
        $( '.mw-jump' ).on( 'focus blur', 'a', function ( e ) {
                // Confusingly jQuery leaves e.type as focusout for delegated blur events
                if ( e.type === 'blur' || e.type === 'focusout' ) {
-                       $( this ).closest( '.mw-jump' ).css({ height: 0 });
+                       $( this ).closest( '.mw-jump' ).css( { height: 0 } );
                } else {
-                       $( this ).closest( '.mw-jump' ).css({ height: 'auto' });
+                       $( this ).closest( '.mw-jump' ).css( { height: 'auto' } );
                }
        } );
 
index 03c1c85..cdcb8fb 100644 (file)
@@ -3,7 +3,7 @@
  */
 ( function ( $ ) {
 
-       $.extend({
+       $.extend( {
                trimLeft: function ( str ) {
                        return str === null ? '' : str.toString().replace( /^\s+/, '' );
                },
                        }
                        return true;
                }
-       });
+       } );
 
 }( jQuery ) );
index 073fb3d..361d3e0 100644 (file)
@@ -15,7 +15,7 @@
                type: 'inline'
        };
 
-       $.extend({
+       $.extend( {
                /**
                 * Create a spinner element
                 *
                 * Example:
                 *
                 *     // Create a large spinner reserving all available horizontal space.
-                *     var $spinner = $.createSpinner({ size: 'large', type: 'block' });
+                *     var $spinner = $.createSpinner( { size: 'large', type: 'block' } );
                 *     // Insert above page content.
                 *     $( '#mw-content-text' ).prepend( $spinner );
                 *
                 *     // Place a small inline spinner next to the "Save" button
-                *     var $spinner = $.createSpinner({ size: 'small', type: 'inline' });
+                *     var $spinner = $.createSpinner( { size: 'small', type: 'inline' } );
                 *     // Alternatively, just `$.createSpinner();` as these are the default options.
                 *     $( '#wpSave' ).after( $spinner );
                 *
                 *     // The following two are equivalent:
                 *     $.createSpinner( 'magic' );
-                *     $.createSpinner({ id: 'magic' });
+                *     $.createSpinner( { id: 'magic' } );
                 *
                 * @static
                 * @inheritable
@@ -89,7 +89,7 @@
                removeSpinner: function ( id ) {
                        return $( '#mw-spinner-' + id ).remove();
                }
-       });
+       } );
 
        /**
         * Inject a spinner after each element in the collection
index 28c4731..ed3d862 100644 (file)
@@ -24,7 +24,7 @@
  * result: Set of callbacks for rendering and selecting
  *             Type: Object of Functions 'render' and 'select'
  * $region: jQuery selection of element to place the suggestions below and match width of
- *             Type: jQuery Object, Default: $(this)
+ *             Type: jQuery Object, Default: $( this )
  * suggestions: Suggestions to display
  *             Type: Array of strings
  * maxRows: Maximum number of suggestions to display at one time
@@ -250,7 +250,7 @@ $.suggestions = {
                                                                        context.data.selectedWithMouse = true;
                                                                        $.suggestions.highlight(
                                                                                context,
-                                                                               $(this).closest( '.suggestions-results .suggestions-result' ),
+                                                                               $( this ).closest( '.suggestions-results .suggestions-result' ),
                                                                                false
                                                                        );
                                                                } )
@@ -309,13 +309,13 @@ $.suggestions = {
                var selected = context.data.$container.find( '.suggestions-result-current' );
                if ( !result.get || selected.get( 0 ) !== result.get( 0 ) ) {
                        if ( result === 'prev' ) {
-                               if( selected.hasClass( 'suggestions-special' ) ) {
+                               if ( selected.hasClass( 'suggestions-special' ) ) {
                                        result = context.data.$container.find( '.suggestions-result:last' );
                                } else {
                                        result = selected.prev();
                                        if ( !( result.length && result.hasClass( 'suggestions-result' ) ) ) {
                                                // there is something in the DOM between selected element and the wrapper, bypass it
-                                               result = selected.parents( '.suggestions-results > *' ).prev().find( '.suggestions-result' ).eq(0);
+                                               result = selected.parents( '.suggestions-results > *' ).prev().find( '.suggestions-result' ).eq( 0 );
                                        }
 
                                        if ( selected.length === 0 ) {
@@ -339,7 +339,7 @@ $.suggestions = {
                                        result = selected.next();
                                        if ( !( result.length && result.hasClass( 'suggestions-result' ) ) ) {
                                                // there is something in the DOM between selected element and the wrapper, bypass it
-                                               result = selected.parents( '.suggestions-results > *' ).next().find( '.suggestions-result' ).eq(0);
+                                               result = selected.parents( '.suggestions-results > *' ).next().find( '.suggestions-result' ).eq( 0 );
                                        }
 
                                        if ( selected.hasClass( 'suggestions-special' ) ) {
@@ -450,12 +450,12 @@ $.fn.suggestions = function () {
        var returnValue,
                args = arguments;
 
-       $(this).each( function () {
+       $( this ).each( function () {
                var context, key;
 
                /* Construction / Loading */
 
-               context = $(this).data( 'suggestions-context' );
+               context = $( this ).data( 'suggestions-context' );
                if ( context === undefined || context === null ) {
                        context = {
                                config: {
@@ -463,7 +463,7 @@ $.fn.suggestions = function () {
                                        cancel: function () {},
                                        special: {},
                                        result: {},
-                                       $region: $(this),
+                                       $region: $( this ),
                                        suggestions: [],
                                        maxRows: 7,
                                        delay: 120,
@@ -510,7 +510,7 @@ $.fn.suggestions = function () {
 
                                // Suggestion the last mousedown event occurred on
                                mouseDownOn: $( [] ),
-                               $textbox: $(this),
+                               $textbox: $( this ),
                                selectedWithMouse: false
                        };
 
@@ -580,9 +580,9 @@ $.fn.suggestions = function () {
                                )
                                .appendTo( $( 'body' ) );
 
-                       $(this)
+                       $( this )
                                // Stop browser autocomplete from interfering
-                               .attr( 'autocomplete', 'off')
+                               .attr( 'autocomplete', 'off' )
                                .keydown( function ( e ) {
                                        // Store key pressed to handle later
                                        context.data.keypressed = e.which;
@@ -611,9 +611,9 @@ $.fn.suggestions = function () {
                }
 
                // Store the context for next time
-               $(this).data( 'suggestions-context', context );
+               $( this ).data( 'suggestions-context', context );
        } );
-       return returnValue !== undefined ? returnValue : $(this);
+       return returnValue !== undefined ? returnValue : $( this );
 };
 
 }( jQuery ) );
index af0d897..405a0e4 100644 (file)
                        } else if ( node.tagName.toLowerCase() === 'img' ) {
                                return $node.attr( 'alt' ) || ''; // handle undefined alt
                        } else {
-                               return $.map( $.makeArray( node.childNodes ), function( elem ) {
+                               return $.map( $.makeArray( node.childNodes ), function ( elem ) {
                                        // 1 is for document.ELEMENT_NODE (the constant is undefined on old browsers)
                                        if ( elem.nodeType === 1 ) {
                                                return getElementSortKey( elem );
                                nodeValue = '';
                        }
 
-                       if ( nodeValue !== '') {
+                       if ( nodeValue !== '' ) {
                                if ( parsers[i].is( nodeValue, table ) ) {
                                        concurrent++;
                                        rowIndex++;
        function emulateTHeadAndFoot( $table ) {
                var $thead, $tfoot, i, len,
                        $rows = $table.find( '> tbody > tr' );
-               if ( !$table.get(0).tHead ) {
+               if ( !$table.get( 0 ).tHead ) {
                        $thead = $( '<thead>' );
                        $rows.each( function () {
-                               if ( $(this).children( 'td' ).length ) {
+                               if ( $( this ).children( 'td' ).length ) {
                                        // This row contains a <td>, so it's not a header row
                                        // Stop here
                                        return false;
                                }
                                $thead.append( this );
                        } );
-                       $table.find(' > tbody:first').before( $thead );
+                       $table.find( ' > tbody:first' ).before( $thead );
                }
-               if ( !$table.get(0).tFoot ) {
+               if ( !$table.get( 0 ).tFoot ) {
                        $tfoot = $( '<tfoot>' );
                        len = $rows.length;
                        for ( i = len - 1; i >= 0; i-- ) {
-                               if ( $( $rows[i] ).children( 'td' ).length ){
+                               if ( $( $rows[i] ).children( 'td' ).length ) {
                                        break;
                                }
-                               $tfoot.prepend( $( $rows[i] ));
+                               $tfoot.prepend( $( $rows[i] ) );
                        }
                        $table.append( $tfoot );
                }
 
                        // Loop through all the dom cells of the thead
                        $tableRows.each( function ( rowIndex, row ) {
-                               $.each( row.cells, function( columnIndex, cell ) {
+                               $.each( row.cells, function ( columnIndex, cell ) {
                                        rowspan = Number( cell.rowSpan );
                                        colspan = Number( cell.colSpan );
 
                        } );
                        // We want to find the row that has the most columns (ignoring colspan)
                        $.each( exploded, function ( index, cellArray ) {
-                               headerCount = $.unique( $(cellArray) ).length;
+                               headerCount = $.unique( $( cellArray ) ).length;
                                if ( headerCount >= maxSeen ) {
                                        maxSeen = headerCount;
                                        longestTR = index;
         */
        function setHeadersOrder( $headers, sortList, headerToColumns ) {
                // Loop through all headers to retrieve the indices of the columns the header spans across:
-               $.each( headerToColumns, function( headerIndex, columns ) {
+               $.each( headerToColumns, function ( headerIndex, columns ) {
 
-                       $.each( columns, function( i, columnIndex ) {
+                       $.each( columns, function ( i, columnIndex ) {
                                var header = $headers[headerIndex];
 
                                if ( !isValueInArray( columnIndex, sortList ) ) {
                                        header.count = 0;
                                } else {
                                        // Column shall be sorted: Apply designated count and order.
-                                       $.each( sortList, function( j, sortColumn ) {
+                                       $.each( sortList, function ( j, sortColumn ) {
                                                if ( sortColumn[0] === i ) {
                                                        header.order = sortColumn[1];
                                                        header.count = sortColumn[1] + 1;
 
        function uniqueElements( array ) {
                var uniques = [];
-               $.each( array, function( index, elem ) {
+               $.each( array, function ( index, elem ) {
                        if ( elem !== undefined && $.inArray( elem, uniques ) === -1 ) {
                                uniques.push( elem );
                        }
        }
 
        function sortText( a, b ) {
-               return ( (a < b) ? -1 : ((a > b) ? 1 : 0) );
+               return ( ( a < b ) ? -1 : ( ( a > b ) ? 1 : 0 ) );
        }
 
        function sortTextDesc( a, b ) {
-               return ( (b < a) ? -1 : ((b > a) ? 1 : 0) );
+               return ( ( b < a ) ? -1 : ( ( b > a ) ? 1 : 0 ) );
        }
 
        function multisort( table, sortList, cache ) {
 
                // We allow a trailing percent sign, which we just strip. This works fine
                // if percents and regular numbers aren't being mixed.
-               ts.numberRegex = new RegExp('^(' + '[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?' + // Fortran-style scientific
+               ts.numberRegex = new RegExp( '^(' + '[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?' + // Fortran-style scientific
                '|' + '[-+\u2212]?' + digitClass + '+[\\s\\xa0]*%?' + // Generic localised
-               ')$', 'i');
+               ')$', 'i' );
        }
 
        function buildDateTable() {
 
                // Build RegEx
                // Any date formated with . , ' - or /
-               ts.dateRegex[0] = new RegExp( /^\s*(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{2,4})\s*?/i);
+               ts.dateRegex[0] = new RegExp( /^\s*(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{2,4})\s*?/i );
 
                // Written Month name, dmy
                ts.dateRegex[1] = new RegExp( '^\\s*(\\d{1,2})[\\,\\.\\-\\/\'\\s]+(' + regex + ')' + '[\\,\\.\\-\\/\'\\s]+(\\d{2,4})\\s*$', 'i' );
                        // Build array of key names
                        for ( key in ts.collationTable ) {
                                // Check hasOwn to be safe
-                               if ( ts.collationTable.hasOwnProperty(key) ) {
-                                       keys.push(key);
+                               if ( ts.collationTable.hasOwnProperty( key ) ) {
+                                       keys.push( key );
                                }
                        }
                        if ( keys.length ) {
                }
                ts.rgx = {
                        IPAddress: [
-                               new RegExp( /^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/)
+                               new RegExp( /^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/ )
                        ],
                        currency: [
-                               new RegExp( /(^[£$€¥]|[£$€¥]$)/),
-                               new RegExp( /[£$€¥]/g)
+                               new RegExp( /(^[£$€¥]|[£$€¥]$)/ ),
+                               new RegExp( /[£$€¥]/g )
                        ],
                        url: [
-                               new RegExp( /^(https?|ftp|file):\/\/$/),
-                               new RegExp( /(https?|ftp|file):\/\//)
+                               new RegExp( /^(https?|ftp|file):\/\/$/ ),
+                               new RegExp( /(https?|ftp|file):\/\// )
                        ],
                        isoDate: [
-                               new RegExp( /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/)
+                               new RegExp( /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/ )
                        ],
                        usLongDate: [
-                               new RegExp( /^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/)
+                               new RegExp( /^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/ )
                        ],
                        time: [
-                               new RegExp( /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/)
+                               new RegExp( /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/ )
                        ]
                };
        }
 
        function convertSortList( sortObjects ) {
                var sortList = [];
-               $.each( sortObjects, function( i, sortObject ) {
-                       $.each ( sortObject, function( columnIndex, order ) {
+               $.each( sortObjects, function ( i, sortObject ) {
+                       $.each( sortObject, function ( columnIndex, order ) {
                                var orderIndex = ( order === 'desc' ) ? 1 : 0;
                                sortList.push( [parseInt( columnIndex, 10 ), orderIndex] );
                        } );
                                                if ( $sortbottoms.length ) {
                                                        var $tfoot = $table.children( 'tfoot' );
                                                        if ( $tfoot.length ) {
-                                                               $tfoot.eq(0).prepend( $sortbottoms );
+                                                               $tfoot.eq( 0 ).prepend( $sortbottoms );
                                                        } else {
                                                                $table.append( $( '<tfoot>' ).append( $sortbottoms ) );
                                                        }
                                                        newSortList = $.map( columns, function ( c ) {
                                                                // jQuery "helpfully" flattens the arrays...
                                                                return [[c, cell.order]];
-                                                       });
+                                                       } );
                                                        // Index of first column belonging to this header
                                                        i = columns[0];
 
                                if ( ts.transformTable !== false ) {
                                        out = '';
                                        for ( p = 0; p < s.length; p++ ) {
-                                               c = s.charAt(p);
+                                               c = s.charAt( p );
                                                if ( c in ts.transformTable ) {
                                                        out += ts.transformTable[c];
                                                } else {
                        },
 
                        formatFloat: function ( s ) {
-                               var i = parseFloat(s);
+                               var i = parseFloat( s );
                                return isNaN( i ) ? 0 : i;
                        },
 
        ts.addParser( {
                id: 'IPAddress',
                is: function ( s ) {
-                       return ts.rgx.IPAddress[0].test(s);
+                       return ts.rgx.IPAddress[0].test( s );
                },
                format: function ( s ) {
                        var a = s.split( '.' ),
                                        r += item;
                                }
                        }
-                       return $.tablesorter.formatFloat(r);
+                       return $.tablesorter.formatFloat( r );
                },
                type: 'numeric'
        } );
        ts.addParser( {
                id: 'currency',
                is: function ( s ) {
-                       return ts.rgx.currency[0].test(s);
+                       return ts.rgx.currency[0].test( s );
                },
                format: function ( s ) {
                        return $.tablesorter.formatDigit( s.replace( ts.rgx.currency[1], '' ) );
        ts.addParser( {
                id: 'url',
                is: function ( s ) {
-                       return ts.rgx.url[0].test(s);
+                       return ts.rgx.url[0].test( s );
                },
                format: function ( s ) {
                        return $.trim( s.replace( ts.rgx.url[1], '' ) );
        ts.addParser( {
                id: 'isoDate',
                is: function ( s ) {
-                       return ts.rgx.isoDate[0].test(s);
+                       return ts.rgx.isoDate[0].test( s );
                },
                format: function ( s ) {
-                       return $.tablesorter.formatFloat((s !== '') ? new Date(s.replace(
-                       new RegExp( /-/g), '/')).getTime() : '0' );
+                       return $.tablesorter.formatFloat( ( s !== '' ) ? new Date( s.replace(
+                       new RegExp( /-/g ), '/' ) ).getTime() : '0' );
                },
                type: 'numeric'
        } );
        ts.addParser( {
                id: 'usLongDate',
                is: function ( s ) {
-                       return ts.rgx.usLongDate[0].test(s);
+                       return ts.rgx.usLongDate[0].test( s );
                },
                format: function ( s ) {
-                       return $.tablesorter.formatFloat( new Date(s).getTime() );
+                       return $.tablesorter.formatFloat( new Date( s ).getTime() );
                },
                type: 'numeric'
        } );
        ts.addParser( {
                id: 'date',
                is: function ( s ) {
-                       return ( ts.dateRegex[0].test(s) || ts.dateRegex[1].test(s) || ts.dateRegex[2].test(s ));
+                       return ( ts.dateRegex[0].test( s ) || ts.dateRegex[1].test( s ) || ts.dateRegex[2].test( s ) );
                },
                format: function ( s ) {
                        var match;
                        }
 
                        var y;
-                       if ( ( y = parseInt( s[0], 10) ) < 100 ) {
+                       if ( ( y = parseInt( s[0], 10 ) ) < 100 ) {
                                // Guestimate years without centuries
                                if ( y < 30 ) {
                                        s[0] = 2000 + y;
        ts.addParser( {
                id: 'time',
                is: function ( s ) {
-                       return ts.rgx.time[0].test(s);
+                       return ts.rgx.time[0].test( s );
                },
                format: function ( s ) {
                        return $.tablesorter.formatFloat( new Date( '2000/01/01 ' + s ).getTime() );
        ts.addParser( {
                id: 'number',
                is: function ( s ) {
-                       return $.tablesorter.numberRegex.test( $.trim( s ));
+                       return $.tablesorter.numberRegex.test( $.trim( s ) );
                },
                format: function ( s ) {
-                       return $.tablesorter.formatDigit(s);
+                       return $.tablesorter.formatDigit( s );
                },
                type: 'numeric'
        } );
index 7262fe6..156b314 100644 (file)
@@ -5,7 +5,7 @@
        if ( document.selection && document.selection.createRange ) {
                // On IE, patch the focus() method to restore the windows' scroll position
                // (bug 32241)
-               $.fn.extend({
+               $.fn.extend( {
                        focus: ( function ( jqFocus ) {
                                return function () {
                                        var $w, state, result;
@@ -19,7 +19,7 @@
                                        return jqFocus.apply( this, arguments );
                                };
                        }( $.fn.focus ) )
-               });
+               } );
        }
 
        $.fn.textSelection = function ( command, options ) {
@@ -70,7 +70,7 @@
                                var retval, range,
                                        el = this.get( 0 );
 
-                               if ( $(el).is( ':hidden' ) ) {
+                               if ( $( el ).is( ':hidden' ) ) {
                                        retval = '';
                                } else if ( document.selection && document.selection.createRange ) {
                                        activateElementOnIE( el );
                                                                context.fn.restoreCursorAndScrollTop();
                                                        }
                                                        if ( options.selectionStart !== undefined ) {
-                                                               $(this).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } );
+                                                               $( this ).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } );
                                                        }
 
-                                                       selText = $(this).textSelection( 'getSelection' );
+                                                       selText = $( this ).textSelection( 'getSelection' );
                                                        scrollTop = this.scrollTop;
                                                        range = document.selection.createRange();
 
                                                } else if ( this.selectionStart || this.selectionStart === 0 ) {
                                                        // Mozilla/Opera
 
-                                                       $(this).focus();
+                                                       $( this ).focus();
                                                        if ( options.selectionStart !== undefined ) {
-                                                               $(this).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } );
+                                                               $( this ).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } );
                                                        }
 
-                                                       selText = $(this).textSelection( 'getSelection' );
+                                                       selText = $( this ).textSelection( 'getSelection' );
                                                        startPos = this.selectionStart;
                                                        endPos = this.selectionEnd;
                                                        scrollTop = this.scrollTop;
                                                        }
                                                }
                                        }
-                                       $(this).trigger( 'encapsulateSelection', [ options.pre, options.peri, options.post, options.ownline,
+                                       $( this ).trigger( 'encapsulateSelection', [ options.pre, options.peri, options.post, options.ownline,
                                                options.replace, options.spitlines ] );
-                               });
+                               } );
                        },
                        /**
                         * Ported from Wikia's LinkSuggest extension
                                return this.each( function () {
                                        var selection, length, newLines;
                                        // Do nothing if hidden
-                                       if ( !$(this).is( ':hidden' ) ) {
+                                       if ( !$( this ).is( ':hidden' ) ) {
                                                if ( this.selectionStart || this.selectionStart === 0 ) {
                                                        // Opera 9.0 doesn't allow setting selectionStart past
                                                        // selectionEnd; any attempts to do that will be ignored
                                                        } catch ( e ) { }
                                                }
                                        }
-                               });
+                               } );
                        },
                        /**
                         * Ported from Wikia's LinkSuggest extension
                                        }
                                        return ( $.client.profile().platform === 'mac' ? 13 : ( $.client.profile().platform === 'linux' ? 15 : 16 ) ) * row;
                                }
-                               return this.each(function () {
+                               return this.each( function () {
                                        var scroll, range, savedRange, pos, oldScrollTop;
                                        // Do nothing if hidden
-                                       if ( !$(this).is( ':hidden' ) ) {
+                                       if ( !$( this ).is( ':hidden' ) ) {
                                                if ( this.selectionStart || this.selectionStart === 0 ) {
                                                        // Mozilla
                                                        scroll = getCaretScrollPosition( this );
-                                                       if ( options.force || scroll < $(this).scrollTop() ||
-                                                                       scroll > $(this).scrollTop() + $(this).height() ) {
-                                                               $(this).scrollTop( scroll );
+                                                       if ( options.force || scroll < $( this ).scrollTop() ||
+                                                                       scroll > $( this ).scrollTop() + $( this ).height() ) {
+                                                               $( this ).scrollTop( scroll );
                                                        }
                                                } else if ( document.selection && document.selection.createRange ) {
                                                        // IE / Opera
                                                         */
                                                        range = document.body.createTextRange();
                                                        savedRange = document.selection.createRange();
-                                                       pos = $(this).textSelection( 'getCaretPosition' );
+                                                       pos = $( this ).textSelection( 'getCaretPosition' );
                                                        oldScrollTop = this.scrollTop;
                                                        range.moveToElementText( this );
                                                        range.collapse();
-                                                       range.move( 'character', pos + 1);
+                                                       range.move( 'character', pos + 1 );
                                                        range.select();
                                                        if ( this.scrollTop !== oldScrollTop ) {
                                                                this.scrollTop += range.offsetTop;
                                                        savedRange.select();
                                                }
                                        }
-                                       $(this).trigger( 'scrollToPosition' );
+                                       $( this ).trigger( 'scrollToPosition' );
                                } );
                        }
                };
                                break;
                }
 
-               context = $(this).data( 'wikiEditor-context' );
+               context = $( this ).data( 'wikiEditor-context' );
                hasIframe = context !== undefined && context && context.$iframe !== undefined;
 
                // IE selection restore voodoo
index a575844..0481b6a 100644 (file)
                        }
                        $editForm.submit( function () {
                                scrollTop.value = editBox.scrollTop;
-                       });
+                       } );
                }
 
                // Apply to dynamically created textboxes as well as normal ones
                $( document ).on( 'focus', 'textarea, input:text', function () {
                        $currentFocused = $( this );
                } );
-       });
+       } );
 
 }( mediaWiki, jQuery ) );
index 2b8f881..49c88c3 100644 (file)
                                result[result.length - 1].contained.push( period );
                        } else {
                                // period is next result
-                               result.push({
+                               result.push( {
                                        start: period.start,
                                        end: period.end,
                                        contained: [period]
-                               });
+                               } );
                        }
                        return result;
                };
index 90a6425..e160579 100644 (file)
                                        color: '#0645ad'
                                } );
 
-                               this.$dialog.dialog({
+                               this.$dialog.dialog( {
                                        width: 500,
                                        autoOpen: false,
                                        title: mw.msg( this.dialogTitleMessageKey ),
                                        modal: true,
                                        buttons: fb.buttons
-                               });
+                               } );
 
-                       this.subjectInput = this.$dialog.find( 'input.feedback-subject' ).get(0);
-                       this.messageInput = this.$dialog.find( 'textarea.feedback-message' ).get(0);
+                       this.subjectInput = this.$dialog.find( 'input.feedback-subject' ).get( 0 );
+                       this.messageInput = this.$dialog.find( 'textarea.feedback-message' ).get( 0 );
 
                },