Make WordPress Core

Ticket #25912: commmon.all.diff

File commmon.all.diff, 4.2 KB (added by jorbin, 13 years ago)
  • .jshintrc

     
    11{
    22        "boss": true,
    3         "curly": true,
    4         "eqeqeq": true,
     3        "curly": false,
     4        "eqeqeq": false,
    55        "eqnull": true,
    66        "es3": true,
    77        "expr": true,
  • src/wp-admin/js/common.js

     
     1/* global setUserSetting:true, ajaxurl:true, commonL10n:true, alert:true, confirm:true, toggleWithKeyboard:true, pagenow:true */
    12var showNotice, adminMenu, columns, validateForm, screenMeta;
    23(function($){
    34// Removed in 3.3.
     
    6566                n = parseInt( $t.attr('colspan'), 10 ) + diff;
    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 ).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();
     75};
    7576
    7677// stub for doing better warnings
    7778showNotice = {
     
    161162
    162163$(document).ready( function() {
    163164        var lastClicked = false, checks, first, last, checked, sliced, menu = $('#adminmenu'), mobileEvent,
    164                 pageInput = $('input.current-page'), currentPage = pageInput.val();
     165                pageInput = $('input.current-page'), currentPage = pageInput.val(),
     166                transitionTimeout, focusedRowActions;
    165167
    166168        // when the menu is folded, make the fly-out submenu header clickable
    167169        menu.on('click.wp-submenu-head', '.wp-submenu-head', function(e){
    168170                $(e.target).parent().siblings('a').get(0).click();
    169171        });
    170172
    171         $('#collapse-menu').on('click.collapse-menu', function(e){
     173        $('#collapse-menu').on('click.collapse-menu', function(){
    172174                var body = $( document.body ), respWidth;
    173175
    174176                // reset any compensation for submenus near the bottom of the screen
     
    226228        }
    227229
    228230        menu.find('li.wp-has-submenu').hoverIntent({
    229                 over: function(e){
     231                over: function(){
    230232                        var b, h, o, f, m = $(this).find('.wp-submenu'), menutop, wintop, maxtop, top = parseInt( m.css('top'), 10 );
    231233
    232234                        if ( isNaN(top) || top > -5 ) // meaning the submenu is visible
     
    300302                // toggle "check all" checkboxes
    301303                var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible').not(':checked');
    302304                $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() {
    303                         return ( 0 == unchecked.length );
     305                        return ( 0 === unchecked.length );
    304306                });
    305307
    306308                return true;
     
    335337        });
    336338
    337339        // Show row actions on keyboard focus of its parent container element or any other elements contained within
    338         var transitionTimeout, focusedRowActions;
    339340        $( 'td.post-title, td.title, td.comment, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap' ).focusin(function(){
    340341                clearTimeout( transitionTimeout );
    341342                focusedRowActions = $(this).find( '.row-actions' );
     
    396397                        e.preventDefault();
    397398        });
    398399
    399         $('#newcontent').bind('blur.wpevent_InsertTab', function(e) {
     400        $('#newcontent').bind('blur.wpevent_InsertTab', function() {
    400401                if ( this.lastKey && 9 == this.lastKey )
    401402                        this.focus();
    402403        });
    403404
    404405        if ( pageInput.length ) {
    405                 pageInput.closest('form').submit( function(e){
     406                pageInput.closest('form').submit( function(){
    406407
    407408                        // Reset paging var for new filters/searches but not for bulk actions. See #17685.
    408409                        if ( $('select[name="action"]').val() == -1 && $('select[name="action2"]').val() == -1 && pageInput.val() == currentPage )
  • src/wp-includes/js/zxcvbn-async.js

     
     1/* global _zxcvbnSettings:true */
    12(function() {
    23  var async_load = function() {
    34    var first, s;