2021-02-18 07:12:32 +01:00
|
|
|
(function($) {
|
|
|
|
/**
|
|
|
|
* Reply Comment-edit screen
|
|
|
|
*/
|
2022-10-07 23:41:46 +02:00
|
|
|
if ( $('body').hasClass('edit-comments-php') ) {
|
|
|
|
//Insert Mentions into comment content on reply
|
|
|
|
$( '.comment-inline.button-link' ).on( 'click', function( event ) {
|
|
|
|
var recipients = $(this).attr('data-recipients') ? $(this).attr('data-recipients') + ' ' : '';
|
|
|
|
setTimeout(function() {
|
2022-10-31 21:43:14 +01:00
|
|
|
if ( recipients ){
|
|
|
|
$('#replycontent').val( recipients )
|
2022-10-07 23:41:46 +02:00
|
|
|
}
|
|
|
|
}, 100);
|
|
|
|
})
|
|
|
|
//Clear Mentions from content on cancel
|
|
|
|
$('.cancel.button').on('click', function(){
|
|
|
|
$('#replycontent').val('');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tools screen
|
|
|
|
*/
|
|
|
|
if ( $('body').hasClass('tools_page_activitypub_tools') ) {
|
|
|
|
|
|
|
|
$('.delete_annouce' ).on('click', function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
var row = $(this).parents('tr') ? $(this).parents('tr') : '';
|
|
|
|
var nonce = $(this).attr('data-nonce') ? $(this).attr('data-nonce') : '';
|
|
|
|
var post_url = $(this).attr('data-post_url') ? $(this).attr('data-post_url') : '';
|
|
|
|
var post_author = $(this).attr('data-post_author') ? $(this).attr('data-post_author') : '';
|
|
|
|
var data = {
|
|
|
|
'action': 'migrate_post',
|
|
|
|
'nonce': nonce,
|
|
|
|
'post_url': post_url,
|
|
|
|
'post_author': post_author
|
2021-02-18 07:12:32 +01:00
|
|
|
}
|
2022-10-07 23:41:46 +02:00
|
|
|
$.ajax({
|
|
|
|
url: ajaxurl,
|
|
|
|
type: 'POST',
|
|
|
|
data: data,
|
|
|
|
success: function () {
|
|
|
|
row.remove()
|
|
|
|
},
|
|
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
|
|
console.log(textStatus + errorThrown);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
2021-02-18 07:12:32 +01:00
|
|
|
|
2022-10-07 23:41:46 +02:00
|
|
|
})( jQuery );
|