| 1 |
/* global jQuery, ClipboardJS */ |
| 2 |
|
| 3 |
jQuery( document ).ready( function ( $ ) { |
| 4 |
const clipboard = new ClipboardJS( '#beyondwords__inspect--copy' ); |
| 5 |
|
| 6 |
clipboard.on( 'success', function () { |
| 7 |
$( '#beyondwords__inspect--copy-confirm' ).show(); |
| 8 |
} ); |
| 9 |
|
| 10 |
$( 'body' ).on( 'click', '#beyondwords__inspect--remove', function () { |
| 11 |
/* eslint-disable-next-line no-alert */ |
| 12 |
const confirm = window.confirm( |
| 13 |
wp.i18n.__( |
| 14 |
'Remove all BeyondWords data when the post is saved?', |
| 15 |
'speechkit' |
| 16 |
) |
| 17 |
); |
| 18 |
|
| 19 |
if ( confirm ) { |
| 20 |
$( '#beyondwords_delete_content' ).removeAttr( 'disabled' ); |
| 21 |
$( '[data-beyondwords-metavalue]' ).val( '' ); |
| 22 |
} |
| 23 |
} ); |
| 24 |
} ); |
| 25 |
|