Make WordPress Core

Changeset 26156


Ignore:
Timestamp:
11/14/2013 05:09:46 AM (12 years ago)
Author:
nacin
Message:

Avoid jshint errors in edit-comment.js.

props adamsilverstein.
fixes #25979.

File:
1 edited

Legend:

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

    r25546 r26156  
    1 var theList, theExtraList, toggleWithKeyboard = false;
     1/* global adminCommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */
     2var setCommentsList, theList, theExtraList,
     3    toggleWithKeyboard = false;
    24
    35(function($) {
    4 var getCount, updateCount, updatePending, dashboardTotals;
     6var commentReply, getCount, updateCount, updatePending, dashboardTotals;
    57
    68setCommentsList = function() {
    7     var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList;
     9    var totalInput, perPageInput, pageInput, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList, diff,
     10        lastConfidentTime = 0;
    811
    912    totalInput = $('input[name="_total"]', '#comments-form');
     
    1215
    1316    dimAfter = function( r, settings ) {
    14         var c = $('#' + settings.element), editRow, replyID, replyButton;
     17        var editRow, replyID, replyButton,
     18            c = $( '#' + settings.element );
    1519
    1620        editRow = $('#replyrow');
     
    3034        }
    3135
    32         var diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
     36        diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
    3337        updatePending( diff );
    3438    };
     
    3640    // Send current total, page, per_page and url
    3741    delBefore = function( settings, list ) {
    38         var wpListsData = $(settings.target).attr('data-wp-lists'), id, el, n, h, a, author, action = false;
     42        var note, id, el, n, h, a, author,
     43            action = false,
     44            wpListsData = $( settings.target ).attr( 'data-wp-lists' );
    3945
    4046        settings.data._total = totalInput.val() || 0;
     
    8187                $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
    8288                    $(this).remove();
    83                     $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show() });
     89                    $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show(); });
    8490                });
    8591                return false;
     
    102108
    103109    dashboardTotals = function(n) {
    104         var dash = $('#dashboard_right_now'), total, appr, totalN, apprN;
     110        var total, appr, totalN, apprN,
     111            dash = $('#dashboard_right_now');
    105112
    106113        n = n || 0;
     
    145152            if ( n < 1 )
    146153                n = 0;
    147             a.closest('.awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
     154            a.closest('.awaiting-mod')[ 0 === n ? 'addClass' : 'removeClass' ]('count-0');
    148155            updateCount( a, n );
    149156        });
     
    154161    // In admin-ajax.php, we send back the unix time stamp instead of 1 on success
    155162    delAfter = function( r, settings ) {
    156         var total, N, spam, trash, pending,
     163        var total_items_i18n, total, N, spam, trash, pending,
    157164            untrash = $(settings.target).parent().is('span.untrash'),
    158165            unspam = $(settings.target).parent().is('span.unspam'),
     
    226233        }
    227234
    228         if ( ! theExtraList || theExtraList.size() == 0 || theExtraList.children().size() == 0 || untrash || unspam ) {
     235        if ( ! theExtraList || theExtraList.size() === 0 || theExtraList.children().size() === 0 || untrash || unspam ) {
    229236            return;
    230237        }
     
    284291
    285292            if ( wpListsData.indexOf(':trash=1') != -1 || wpListsData.indexOf(':spam=1') != -1 )
    286                 $('#undo-' + id).fadeIn(300, function(){ $(this).show() });
     293                $('#undo-' + id).fadeIn(300, function(){ $(this).show(); });
    287294        });
    288295};
     
    310317        });
    311318
    312         $('#doaction, #doaction2, #post-query-submit').click(function(e){
     319        $('#doaction, #doaction2, #post-query-submit').click(function(){
    313320            if ( $('#the-comment-list #replyrow').length > 0 )
    314321                commentReply.close();
     
    356363        if ( this.cid && this.act == 'edit-comment' ) {
    357364            c = $('#comment-' + this.cid);
    358             c.fadeIn(300, function(){ c.show() }).css('backgroundColor', '');
     365            c.fadeIn(300, function(){ c.show(); }).css('backgroundColor', '');
    359366        }
    360367
     
    404411
    405412            c.after( editRow ).fadeOut('fast', function(){
    406                 $('#replyrow').fadeIn(300, function(){ $(this).show() });
     413                $('#replyrow').fadeIn(300, function(){ $(this).show(); });
    407414            });
    408415        } else if ( action == 'add' ) {
     
    411418            $('#the-comment-list').prepend(editRow);
    412419            $('#replyrow').fadeIn(300);
    413         } else {
    414             replyButton = $('#replybtn', editRow);
     420        } else {
     421            replyButton = $('#replybtn', editRow);
    415422            $('#edithead, #savebtn, #addhead, #addbtn', editRow).hide();
    416423            $('#replyhead, #replybtn', editRow).show();
     
    423430            }
    424431
    425             $('#replyrow').fadeIn(300, function(){ $(this).show() });
     432            $('#replyrow').fadeIn(300, function(){ $(this).show(); });
    426433        }
    427434
     
    432439            rbottom = rtop + $('#replyrow').height();
    433440            scrollTop = window.pageYOffset || document.documentElement.scrollTop;
    434             vp = document.documentElement.clientHeight || self.innerHeight || 0;
     441            vp = document.documentElement.clientHeight || window.innerHeight || 0;
    435442            scrollBottom = scrollTop + vp;
    436443
     
    514521
    515522        c = $.trim(r.data); // Trim leading whitespaces
    516         $(c).hide()
     523        $(c).hide();
    517524        $('#replyrow').after(c);
    518525
     
    573580                if (l.length)
    574581                    window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1';
    575             }
     582            };
    576583        };
    577584
     
    591598                $('option[value="' + value + '"]', scope).prop('selected', true);
    592599                $('#doaction').click();
    593             }
     600            };
    594601        };
    595602
Note: See TracChangeset for help on using the changeset viewer.