Make WordPress Core

Changeset 26112


Ignore:
Timestamp:
11/12/2013 11:55:23 PM (13 years ago)
Author:
nacin
Message:

Free common.js of JSHint errors.

props jorbin.
fixes #25912.

File:
1 edited

Legend:

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

    r25677 r26112  
     1/* global setUserSetting, ajaxurl, commonL10n, alert, confirm, toggleWithKeyboard, pagenow */
    12var showNotice, adminMenu, columns, validateForm, screenMeta;
    23(function($){
    … …  
    6667                $t.attr('colspan', n.toString());
    6768        }
    68 }
     69};
    6970
    7071$(document).ready(function(){columns.init();});
    7172
    7273validateForm = function( form ) {
    73         return !$( form ).find('.form-required').filter( function() { return $('input:visible', this).val() == ''; } ).addClass( 'form-invalid' ).find('input:visible').change( function() { $(this).closest('.form-invalid').removeClass( 'form-invalid' ); } ).size();
    74 }
     74        return !$( form )
     75                .find( '.form-required' )
     76                .filter( function() { return $( 'input:visible', this ).val() === ''; } )
     77                .addClass( 'form-invalid' )
     78                .find( 'input:visible' )
     79                .change( function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } )
     80                .size();
     81};
    7582
    7683// stub for doing better warnings
    … …  
    161168
    162169$(document).ready( function() {
    163         var lastClicked = false, checks, first, last, checked, sliced, menu = $('#adminmenu'), mobileEvent,
    164                 pageInput = $('input.current-page'), currentPage = pageInput.val();
     170        var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions,
     171                lastClicked = false,
     172                menu = $('#adminmenu'),
     173                pageInput = $('input.current-page'),
     174                currentPage = pageInput.val();
    165175
    166176        // when the menu is folded, make the fly-out submenu header clickable
    … …  
    169179        });
    170180
    171         $('#collapse-menu').on('click.collapse-menu', function(e){
     181        $('#collapse-menu').on('click.collapse-menu', function() {
    172182                var body = $( document.body ), respWidth;
    173183
    … …  
    227237
    228238        menu.find('li.wp-has-submenu').hoverIntent({
    229                 over: function(e){
     239                over: function() {
    230240                        var b, h, o, f, m = $(this).find('.wp-submenu'), menutop, wintop, maxtop, top = parseInt( m.css('top'), 10 );
    231241
    … …  
    301311                var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible').not(':checked');
    302312                $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() {
    303                         return ( 0 == unchecked.length );
     313                        return ( 0 === unchecked.length );
    304314                });
    305315
    … …  
    336346
    337347        // Show row actions on keyboard focus of its parent container element or any other elements contained within
    338         var transitionTimeout, focusedRowActions;
    339348        $( 'td.post-title, td.title, td.comment, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap' ).focusin(function(){
    340349                clearTimeout( transitionTimeout );
    … …  
    397406        });
    398407
    399         $('#newcontent').bind('blur.wpevent_InsertTab', function(e) {
     408        $('#newcontent').bind('blur.wpevent_InsertTab', function() {
    400409                if ( this.lastKey && 9 == this.lastKey )
    401410                        this.focus();
    … …  
    403412
    404413        if ( pageInput.length ) {
    405                 pageInput.closest('form').submit( function(e){
     414                pageInput.closest('form').submit( function() {
    406415
    407416                        // Reset paging var for new filters/searches but not for bulk actions. See #17685.
Note: See TracChangeset for help on using the changeset viewer.