Make WordPress Core

Ticket #26011: 26011.diff

File 26011.diff, 1.7 KB (added by mdbitz, 13 years ago)

JSHint Cleanup of wp-auth-check.js

  • src/wp-includes/js/wp-auth-check.js

     
     1/* global adminpage:false */
    12// Interim login dialog
    23(function($){
    3         var wrap, check, next;
     4        var wrap, next;
    45
    56        function show() {
    67                var parent = $('#wp-auth-check'), form = $('#wp-auth-check-form'), noframe = wrap.find('.wp-auth-fallback-expired'), frame, loaded = false;
     
    1213                        });
    1314
    1415                        frame = $('<iframe id="wp-auth-check-frame" frameborder="0">').attr( 'title', noframe.text() );
    15                         frame.load( function(e) {
     16                        frame.load( function() {
    1617                                var height, body;
    1718
    1819                                loaded = true;
     
    2021                                try {
    2122                                        body = $(this).contents().find('body');
    2223                                        height = body.height();
    23                                 } catch(e) {
     24                                } catch(exc) {
    2425                                        wrap.addClass('fallback');
    2526                                        parent.css( 'max-height', '' );
    2627                                        form.remove();
     
    6768                $(window).off( 'beforeunload.wp-auth-check' );
    6869
    6970                // When on the Edit Post screen, speed up heartbeat after the user logs in to quickly refresh nonces
    70                 if ( typeof adminpage != 'undefined' && ( adminpage == 'post-php' || adminpage == 'post-new-php' )
    71                          && typeof wp != 'undefined' && wp.heartbeat ) {
     71                if ( typeof adminpage != 'undefined' && ( adminpage == 'post-php' || adminpage == 'post-new-php' ) &&
     72                        typeof wp != 'undefined' && wp.heartbeat ) {
    7273
    7374                        wp.heartbeat.interval( 'fast', 1 );
    7475                }
     
    9899        }).ready( function() {
    99100                schedule();
    100101                wrap = $('#wp-auth-check-wrap');
    101                 wrap.find('.wp-auth-check-close').on( 'click', function(e) {
     102                wrap.find('.wp-auth-check-close').on( 'click', function() {
    102103                        hide();
    103104                });
    104105        });