Ticket #11260: 11260-first-run.diff
File 11260-first-run.diff, 7.4 KB (added by , 14 years ago) |
---|
-
wp-admin/admin-ajax.php
220 220 if ( 'spam' == $status ) 221 221 die( (string) time() ); 222 222 $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); 223 } elseif ( isset($_POST['unspam']) && ( 0 == $_POST['unspam'] || 1 == $_POST['unspam'] ) ) { 224 if ( 'spam' != $status ) 225 die( (string) time() ); 226 $r = wp_set_comment_status( $comment->comment_ID, $_POST['unspam'] ); 223 227 } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) { 224 228 $r = wp_delete_comment( $comment->comment_ID ); 225 229 } else { -
wp-admin/includes/template.php
2371 2371 */ 2372 2372 function wp_comment_trashnotice() { 2373 2373 ?> 2374 <div class="hidden" id=" undo-holder">2375 <div class="trash-undo-inside"><?php _e('Comment by'); ?> <strong></strong> <?php _e('moved to the trash.'); ?> <span class="untrash"><a class="undo-trash"href="#"><?php _e('Undo'); ?></a></span></div>2374 <div class="hidden" id="trash-undo-holder"> 2375 <div class="trash-undo-inside"><?php printf(__('Comment by %s moved to the trash.'), '<strong></strong>'); ?> <span class="undo untrash"><a href="#"><?php _e('Undo'); ?></a></span></div> 2376 2376 </div> 2377 <div class="hidden" id="spam-undo-holder"> 2378 <div class="spam-undo-inside"><?php printf(__('Comment by %s marked as spam.'), '<strong></strong>'); ?> <span class="undo unspam"><a href="#"><?php _e('Undo'); ?></a></span></div> 2379 </div> 2377 2380 <?php 2378 2381 } 2379 2382 -
wp-admin/js/edit-comments.dev.js
38 38 settings.data._per_page = perPageInput.val() || 0; 39 39 settings.data._page = pageInput.val() || 0; 40 40 settings.data._url = document.location.href; 41 42 var action; 43 if ( cl.indexOf(':trash=1') != -1 ) 44 action = 'trash'; 45 else if ( cl.indexOf(':spam=1') != -1 ) 46 action = 'spam'; 41 47 42 if ( cl.indexOf(':trash=1') != -1) {48 if ( action == 'trash' || action == 'spam' ) { 43 49 id = cl.replace(/.*?comment-([0-9]+).*/, '$1'); 44 50 el = $('#comment-' + id); 45 note = $('# undo-holder').html();51 note = $('#'+action+'-undo-holder').html(); 46 52 47 53 if ( el.siblings('#replyrow').length && commentReply.cid == id ) 48 54 commentReply.close(); … … 50 56 if ( el.is('tr') ) { 51 57 n = el.children(':visible').length; 52 58 author = $('.author strong', el).text(); 53 h = $('<tr id=" trashundo-' + id + '" class="trash-undo" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>');59 h = $('<tr id="undo-' + id + '" class="undo un' + action + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>'); 54 60 } else { 55 61 author = $('.comment-author', el).text(); 56 h = $('<div id=" trashundo-' + id + '" style="display:none;" class="trash-undo">' + note + '</div>');62 h = $('<div id="undo-' + id + '" style="display:none;" class="undo un' + action + '">' + note + '</div>'); 57 63 } 58 64 59 65 el.before(h); 60 66 61 $('strong', '#trashundo-' + id).text(author + ' '); 62 a = $('a.undo-trash', '#trashundo-' + id); 63 a.attr('href', 'comment.php?action=untrashcomment&c=' + id + '&_ajax_nonce=' + settings.data._ajax_nonce); 64 a.attr('className', 'delete:the-comment-list:comment-' + id + '::untrash=1 vim-z vim-destructive'); 65 $('.avatar', el).clone().prependTo('#trashundo-' + id + ' .trash-undo-inside'); 67 $('strong', '#undo-' + id).text(author + ' '); 68 a = $('.undo a', '#undo-' + id); 69 if ( action == 'trash' ) { 70 a.attr('href', 'comment.php?action=untrashcomment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce); 71 a.attr('className', 'delete:the-comment-list:comment-' + id + '::untrash=1 vim-z vim-destructive'); 72 } 73 else if ( action == 'spam' ) { 74 a.attr('href', 'comment.php?action=deletecomment&dt=unspam&s=' + ($(el).is('.approved') ? '1' : '0') + '&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce); 75 a.attr('className', 'delete:the-comment-list:comment-' + id + '::unspam=' + ($(el).is('.approved') ? '1' : '0') + ' vim-z vim-destructive'); 76 /* 77 if ( $(el).is('.approved') ) { 78 a.attr('href', $('.approve a', el).attr('href')); 79 a.attr('className', $('.approve a', el).attr('className')); 80 } 81 else { 82 a.attr('href', $('.unapprove a', el).attr('href')); 83 a.attr('className', $('.unapprove a', el).attr('className')); 84 } 85 */ 86 } 87 $('.avatar', el).clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside'); 66 88 67 89 a.click(function(){ 68 90 list.wpList.del(this); 69 $('# trashundo-' + id).fadeOut(300, function(){91 $('#undo-' + id).fadeOut(300, function(){ 70 92 $(this).remove(); 71 93 $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show() }); 72 94 }); … … 135 157 136 158 // In admin-ajax.php, we send back the unix time stamp instead of 1 on success 137 159 delAfter = function( r, settings ) { 138 var total, pageLinks, N, untrash = $(settings.target).parent().is('span.untrash'), spam, trash;160 var total, pageLinks, N, untrash = $(settings.target).parent().is('span.untrash'), unspam = $(settings.target).parent().is('span.unspam'), spam, trash; 139 161 140 162 function getUpdate(s) { 141 163 if ( $(settings.target).parent().is('span.' + s) ) … … 150 172 151 173 if ( untrash ) 152 174 trash = -1; 175 if ( unspam ) 176 spam = -1; 153 177 154 178 $('span.pending-count').each( function() { 155 179 var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved'); 156 180 157 if ( $(settings.target).parent().is('span.unapprove') || ( untrash&& unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"181 if ( $(settings.target).parent().is('span.unapprove') || ( (untrash||unspam) && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" 158 182 n = n + 1; 159 183 } else if ( unapproved ) { // we deleted a formerly unapproved comment 160 184 n = n - 1; … … 212 236 .bind('wpListDelEnd', function(e, s){ 213 237 var id = s.element.replace(/[^0-9]+/g, ''); 214 238 215 if ( s.target.className.indexOf(':trash=1') != -1 )216 $('# trashundo-' + id).fadeIn(300, function(){ $(this).show() });239 if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1 ) 240 $('#undo-' + id).fadeIn(300, function(){ $(this).show() }); 217 241 }); 218 242 }; 219 243 -
wp-admin/comment.php
153 153 154 154 if ( 'spam' == $_REQUEST['dt'] ) 155 155 wp_set_comment_status( $comment->comment_ID, 'spam' ); 156 elseif ( 'unspam' == $_REQUEST['dt'] && isset($_REQUEST['s']) ) 157 wp_set_comment_status( $comment->comment_ID, $_REQUEST['s'] ); 156 158 else 157 159 wp_delete_comment( $comment->comment_ID ); 158 160 -
wp-admin/wp-admin.dev.css
3524 3524 font-size: 11px; 3525 3525 } 3526 3526 3527 .trash-undo-inside { 3527 .trash-undo-inside, 3528 .spam-undo-inside { 3528 3529 margin: 1px 8px 1px 0; 3529 3530 line-height: 16px; 3530 3531 } 3531 3532 3533 .spam-undo-inside .avatar, 3532 3534 .trash-undo-inside .avatar { 3533 3535 height: 20px; 3534 3536 width: 20px;