update js to new file

This commit is contained in:
Django Doucet 2023-01-29 17:29:45 -07:00
parent f9c0edc681
commit 80901b5b65
2 changed files with 22 additions and 5 deletions

View file

@ -11,10 +11,27 @@ jQuery( function( $ ) {
$( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false );
}
} );
$(document).on( 'wp-plugin-install-success', function( event, response ) {
setTimeout( function() {
$( '.activate-now' ).removeClass( 'thickbox open-plugin-details-modal' );
}, 1200 );
} );
} );
//Reply Comment-edit screen
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() {
if ( recipients ){
$('#replycontent').val( recipients )
}
}, 100);
})
//Clear Mentions from content on cancel
$('.cancel.button').on('click', function(){
$('#replycontent').val('');
});
}
} );

View file

@ -235,12 +235,12 @@ class Admin {
wp_enqueue_script( 'activitypub-admin-styles', plugins_url( 'assets/js/activitypub-admin.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false );
}
if ( 'edit-comments.php' === $hook_suffix || 'tools_page_activitypub_tools' === $hook_suffix ) {
if ( 'edit-comments.php' === $hook_suffix ) {
\wp_enqueue_script(
'activitypub_actions',
\plugin_dir_url( ACTIVITYPUB_PLUGIN ) . '/assets/js/activitypub.js',
\plugin_dir_url( ACTIVITYPUB_PLUGIN ) . '/assets/js/activitypub-admin.js',
array( 'jquery' ),
\filemtime( \plugin_dir_path( ACTIVITYPUB_PLUGIN ) . 'assets/js/activitypub.js' ),
\filemtime( \plugin_dir_path( ACTIVITYPUB_PLUGIN ) . 'assets/js/activitypub-admin.js' ),
true
);
}