Make WordPress Core

Ticket #25944: theme-preview.diff

File theme-preview.diff, 1.5 KB (added by tommcfarlin, 12 years ago)

Resolving JSHint errors regarding closing braces, missing semicolons, and undefined variables.

  • src/wp-admin/js/theme-preview.js

     
    1 
     1/* global tb_click */
    22var thickDims, tbWidth, tbHeight;
    33jQuery(document).ready(function($) {
    44
     
    1212                        tbWindow.width(w).height(h);
    1313                        $('#TB_iframeContent').width(w).height(h - 27);
    1414                        tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
    15                         if ( typeof document.body.style.maxWidth != 'undefined' )
     15                        if ( typeof document.body.style.maxWidth !== 'undefined' ) {
    1616                                tbWindow.css({'top':'30px','margin-top':'0'});
     17                        }
    1718                }
    1819        };
    1920
    2021        thickDims();
    21         $(window).resize( function() { thickDims() } );
     22        $(window).resize( function() { thickDims(); } );
    2223
    2324        $('a.thickbox-preview').click( function() {
    2425                tb_click.call(this);
    2526
    2627                var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
    2728
    28                 if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
     29                if ( tbWidth = href.match(/&tbWidth=[0-9]+/) ) {
    2930                        tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
    30                 else
     31                } else {
    3132                        tbWidth = $(window).width() - 90;
     33                }
    3234
    33                 if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
     35                if ( tbHeight = href.match(/&tbHeight=[0-9]+/) ) {
    3436                        tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
    35                 else
     37                } else {
    3638                        tbHeight = $(window).height() - 60;
     39                }
    3740
    3841                if ( alink.length ) {
    3942                        url = alink.attr('href') || '';