PluginProbe
BeyondWords – AI audio for publishers / 6.0.3
BeyondWords – AI audio for publishers v6.0.3
7.1.0 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.7.0 All 43 releases
speechkit / src / Component / Settings / Notices / index.js

index.js in BeyondWords – AI audio for publishers 6.0.3, at src/Component/Settings/Notices/index.js

48 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global beyondwordsData, jQuery */
2
3 ( function ( $ ) {
4 'use strict';
5
6 $( document ).ready( function () {
7 $( '#beyondwords_notice_review' ).on(
8 'click',
9 '.notice-dismiss',
10 function ( event ) {
11 event.preventDefault();
12
13 // eslint-disable-next-line max-len
14 const endpoint = `${ beyondwordsData.root }beyondwords/v1/settings/notices/review/dismiss`;
15
16 $.ajax( {
17 url: endpoint,
18 method: 'POST',
19 // eslint-disable-next-line object-shorthand
20 beforeSend: function ( xhr ) {
21 xhr.setRequestHeader(
22 'X-WP-Nonce',
23 beyondwordsData.nonce
24 );
25 },
26 // eslint-disable-next-line object-shorthand
27 success: function ( response ) {
28 if ( response.success ) {
29 $( '#beyondwords_notice_review' ).hide();
30 } else {
31 // eslint-disable-next-line no-console
32 console.error(
33 '🔊 REST API Error dismissing notice',
34 response
35 );
36 }
37 },
38 // eslint-disable-next-line object-shorthand
39 error: function ( error ) {
40 // eslint-disable-next-line no-console
41 console.error( '🔊 Error dismissing notice', error );
42 },
43 } );
44 }
45 );
46 } );
47 } )( jQuery );
48