Changeset 26156
- Timestamp:
- 11/14/2013 05:09:46 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/js/edit-comments.js (modified) (19 diffs)
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 */ 2 var setCommentsList, theList, theExtraList, 3 toggleWithKeyboard = false; 2 4 3 5 (function($) { 4 var getCount, updateCount, updatePending, dashboardTotals;6 var commentReply, getCount, updateCount, updatePending, dashboardTotals; 5 7 6 8 setCommentsList = 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; 8 11 9 12 totalInput = $('input[name="_total"]', '#comments-form'); … … 12 15 13 16 dimAfter = function( r, settings ) { 14 var c = $('#' + settings.element), editRow, replyID, replyButton; 17 var editRow, replyID, replyButton, 18 c = $( '#' + settings.element ); 15 19 16 20 editRow = $('#replyrow'); … … 30 34 } 31 35 32 vardiff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;36 diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1; 33 37 updatePending( diff ); 34 38 }; … … 36 40 // Send current total, page, per_page and url 37 41 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' ); 39 45 40 46 settings.data._total = totalInput.val() || 0; … … 81 87 $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){ 82 88 $(this).remove(); 83 $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show() });89 $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show(); }); 84 90 }); 85 91 return false; … … 102 108 103 109 dashboardTotals = function(n) { 104 var dash = $('#dashboard_right_now'), total, appr, totalN, apprN; 110 var total, appr, totalN, apprN, 111 dash = $('#dashboard_right_now'); 105 112 106 113 n = n || 0; … … 145 152 if ( n < 1 ) 146 153 n = 0; 147 a.closest('.awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');154 a.closest('.awaiting-mod')[ 0 === n ? 'addClass' : 'removeClass' ]('count-0'); 148 155 updateCount( a, n ); 149 156 }); … … 154 161 // In admin-ajax.php, we send back the unix time stamp instead of 1 on success 155 162 delAfter = function( r, settings ) { 156 var total , N, spam, trash, pending,163 var total_items_i18n, total, N, spam, trash, pending, 157 164 untrash = $(settings.target).parent().is('span.untrash'), 158 165 unspam = $(settings.target).parent().is('span.unspam'), … … 226 233 } 227 234 228 if ( ! theExtraList || theExtraList.size() == 0 || theExtraList.children().size()== 0 || untrash || unspam ) {235 if ( ! theExtraList || theExtraList.size() === 0 || theExtraList.children().size() === 0 || untrash || unspam ) { 229 236 return; 230 237 } … … 284 291 285 292 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(); }); 287 294 }); 288 295 }; … … 310 317 }); 311 318 312 $('#doaction, #doaction2, #post-query-submit').click(function( e){319 $('#doaction, #doaction2, #post-query-submit').click(function(){ 313 320 if ( $('#the-comment-list #replyrow').length > 0 ) 314 321 commentReply.close(); … … 356 363 if ( this.cid && this.act == 'edit-comment' ) { 357 364 c = $('#comment-' + this.cid); 358 c.fadeIn(300, function(){ c.show() }).css('backgroundColor', '');365 c.fadeIn(300, function(){ c.show(); }).css('backgroundColor', ''); 359 366 } 360 367 … … 404 411 405 412 c.after( editRow ).fadeOut('fast', function(){ 406 $('#replyrow').fadeIn(300, function(){ $(this).show() });413 $('#replyrow').fadeIn(300, function(){ $(this).show(); }); 407 414 }); 408 415 } else if ( action == 'add' ) { … … 411 418 $('#the-comment-list').prepend(editRow); 412 419 $('#replyrow').fadeIn(300); 413 } else {414 replyButton = $('#replybtn', editRow);420 } else { 421 replyButton = $('#replybtn', editRow); 415 422 $('#edithead, #savebtn, #addhead, #addbtn', editRow).hide(); 416 423 $('#replyhead, #replybtn', editRow).show(); … … 423 430 } 424 431 425 $('#replyrow').fadeIn(300, function(){ $(this).show() });432 $('#replyrow').fadeIn(300, function(){ $(this).show(); }); 426 433 } 427 434 … … 432 439 rbottom = rtop + $('#replyrow').height(); 433 440 scrollTop = window.pageYOffset || document.documentElement.scrollTop; 434 vp = document.documentElement.clientHeight || self.innerHeight || 0;441 vp = document.documentElement.clientHeight || window.innerHeight || 0; 435 442 scrollBottom = scrollTop + vp; 436 443 … … 514 521 515 522 c = $.trim(r.data); // Trim leading whitespaces 516 $(c).hide() 523 $(c).hide(); 517 524 $('#replyrow').after(c); 518 525 … … 573 580 if (l.length) 574 581 window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1'; 575 } 582 }; 576 583 }; 577 584 … … 591 598 $('option[value="' + value + '"]', scope).prop('selected', true); 592 599 $('#doaction').click(); 593 } 600 }; 594 601 }; 595 602
Note: See TracChangeset
for help on using the changeset viewer.