Make WordPress Core

Changeset 26210


Ignore:
Timestamp:
11/15/2013 02:15:39 PM (10 years ago)
Author:
nacin
Message:

Fix JSHint errors in theme-install.js.

props kovshenin.
fixes #26045.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/theme-install.js

    r26141 r26210  
     1/* global ajaxurl, list_args, theme_list_args */
     2
     3var theme_viewer;
     4
    15/**
    26 * Theme Browsing
     
    2933        var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 1040 < width ) ? 1040 : width, adminbar_height = 0;
    3034
    31         if ( $('body.admin-bar').length )
     35        if ( $('body.admin-bar').length ) {
    3236            adminbar_height = 28;
     37        }
    3338
    3439        if ( tbWindow.size() ) {
     
    3641            $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
    3742            tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
    38             if ( typeof document.body.style.maxWidth != 'undefined' )
     43            if ( typeof document.body.style.maxWidth !== 'undefined' ) {
    3944                tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
    40         };
     45            }
     46        }
    4147    };
    4248
     
    5056 */
    5157jQuery( function($) {
    52     if( ! window.postMessage )
     58    if ( ! window.postMessage ) {
    5359        return;
     60    }
    5461
    5562    var preview = $('#theme-installer'),
     
    8794
    8895(function($){
    89     ThemeViewer = function( args ) {
     96    ThemeViewer = function() {
    9097
    9198        function init() {
     
    101108                    text  = $( '#filter-click' ).text();
    102109
    103                 if ( text.indexOf( '(' ) != -1 )
     110                if ( text.indexOf( '(' ) !== -1 ) {
    104111                    text = text.substr( 0, text.indexOf( '(' ) );
    105 
    106                 if ( count == 0 )
     112                }
     113
     114                if ( count === 0 ) {
    107115                    $( '#filter-click' ).text( text );
    108                 else
     116                } else {
    109117                    $( '#filter-click' ).text( text + ' (' + count + ')' );
     118                }
    110119            });
    111120
     
    131140        };
    132141
    133     return api;
    134     }
     142        return api;
     143    };
    135144})(jQuery);
    136145
    137 jQuery( document ).ready( function($) {
     146jQuery( document ).ready( function() {
    138147    theme_viewer = new ThemeViewer();
    139148    theme_viewer.init();
     
    170179            // Get out early if we don't have the required arguments.
    171180            if ( typeof ajaxurl === 'undefined' ||
    172                  typeof list_args === 'undefined' ||
    173                  typeof theme_list_args === 'undefined' ) {
    174                     $('.pagination-links').show();
     181                typeof list_args === 'undefined' ||
     182                typeof theme_list_args === 'undefined' ) {
     183
     184                $('.pagination-links').show();
    175185                    return;
    176186            }
     
    190200             * when user hits the bottom of the current page
    191201             */
    192             if ( theme_list_args.total_pages >= this.nextPage )
    193                 this.pollInterval =
    194                     setInterval( function() {
    195                         return self.poll();
    196                     }, this.scrollPollingDelay );
     202            if ( theme_list_args.total_pages >= this.nextPage ) {
     203                this.pollInterval = setInterval( function() {
     204                    return self.poll();
     205                }, this.scrollPollingDelay );
     206            }
    197207        },
    198208
     
    208218
    209219            if ( this.querying ||
    210                 ( bottom < this.$outList.height() - this.outListBottomThreshold ) )
     220                ( bottom < this.$outList.height() - this.outListBottomThreshold ) ) {
    211221                return;
     222            }
    212223
    213224            this.ajax();
     
    228239            }
    229240
    230             if ( this.nextPage > theme_list_args.total_pages )
     241            if ( this.nextPage > theme_list_args.total_pages ) {
    231242                clearInterval( this.pollInterval );
    232 
    233             if ( this.nextPage <= ( theme_list_args.total_pages + 1 ) )
     243            }
     244
     245            if ( this.nextPage <= ( theme_list_args.total_pages + 1 ) ) {
    234246                this.$outList.append( results.rows );
     247            }
    235248        },
    236249
     
    242255         */
    243256        ajax: function() {
    244             var self = this;
    245 
    246             this.querying = true;
    247 
    248             var query = {
     257            var self = this,
     258                query = {
    249259                action: 'fetch-list',
    250260                paged: this.nextPage,
     
    256266                'list_args': list_args
    257267            };
     268
     269            this.querying = true;
    258270
    259271            this.$spinner.show();
     
    271283                });
    272284        }
    273     }
    274 
    275     $(document).ready( function($) {
     285    };
     286
     287    $(document).ready( function() {
    276288        ThemeScroller.init();
    277289    });
Note: See TracChangeset for help on using the changeset viewer.