PluginProbe ʕ •ᴥ•ʔ
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress / 5.6.8
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress v5.6.8
5.6.8 5.6.7 5.6.6 5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.2 5.5.1 5.5.0 5.4.2 trunk 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.1.91 5.1.92 5.1.93 5.1.94 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1
latepoint / lib / kit / astra-notices / notices.js
latepoint / lib / kit / astra-notices Last commit date
class-bsf-admin-notices.php 2 weeks ago notices.css 4 months ago notices.js 2 weeks ago
notices.js
95 lines
1 /**
2 * Customizer controls toggles
3 *
4 * @package Astra
5 */
6
7 ( function( $ ) {
8
9 /**
10 * Helper class for the main Customizer interface.
11 *
12 * @since 1.0.0
13 * @class ASTCustomizer
14 */
15 var AstraNotices = {
16
17 /**
18 * Initializes our custom logic for the Customizer.
19 *
20 * @since 1.0.0
21 * @method init
22 */
23 init: function()
24 {
25 this._bind();
26 },
27
28 /**
29 * Binds events for the Astra Portfolio.
30 *
31 * @since 1.0.0
32 * @access private
33 * @method _bind
34 */
35 _bind: function()
36 {
37 $( document ).on('click', '.astra-notice-close', AstraNotices._dismissNoticeNew );
38 $( document ).on('click', '.astra-notice .notice-dismiss', AstraNotices._dismissNotice );
39 },
40
41 _dismissNotice: function( event ) {
42 event.preventDefault();
43
44 var repeat_notice_after = $( this ).parents('.astra-notice').data( 'repeat-notice-after' ) || '';
45 var notice_id = $( this ).parents('.astra-notice').attr( 'id' ) || '';
46
47 AstraNotices._ajax( notice_id, repeat_notice_after );
48 },
49
50 _dismissNoticeNew: function( event ) {
51 event.preventDefault();
52
53 var repeat_notice_after = $( this ).attr( 'data-repeat-notice-after' ) || '';
54 var notice_id = $( this ).parents('.astra-notice').attr( 'id' ) || '';
55
56 var $el = $( this ).parents('.astra-notice');
57 $el.fadeTo( 100, 0, function() {
58 $el.slideUp( 100, function() {
59 $el.remove();
60 });
61 });
62
63 AstraNotices._ajax( notice_id, repeat_notice_after );
64
65 var link = $( this ).attr( 'href' ) || '';
66 var target = $( this ).attr( 'target' ) || '';
67 if( '' !== link && '_blank' === target ) {
68 window.open(link , '_blank');
69 }
70 },
71
72 _ajax: function( notice_id, repeat_notice_after ) {
73
74 if( '' === notice_id ) {
75 return;
76 }
77
78 $.ajax({
79 url: ajaxurl,
80 type: 'POST',
81 data: {
82 action : 'astra-notice-dismiss',
83 nonce : bsfAstraNotices._notice_nonce,
84 notice_id : notice_id,
85 repeat_notice_after : parseInt( repeat_notice_after, 10 ),
86 },
87 });
88
89 }
90 };
91
92 $( function() {
93 AstraNotices.init();
94 } );
95 } )( jQuery );