| Server IP : 60.247.133.247 / Your IP : 216.73.217.108 Web Server : Apache System : Linux ebs-119054 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 User : goodwill ( 65985) PHP Version : 8.2.20 Disable Function : link,symlink,passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server,pcntl_fork,pcntl_rfork MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/wwwroot/goodwill/wwwroot/wp-content/plugins/Ultimate_VC_Addons/lib/notices/ |
Upload File : |
/**
* Customizer controls toggles
*
* @package
*/
( function ( $ ) {
/**
* Helper class for the main Customizer interface.
*
* @since 1.0.0
* @class ASTCustomizer
*/
AstraNotices = {
/**
* Initializes our custom logic for the Customizer.
*
* @since 1.0.0
* @function init
*/
init() {
this._bind();
},
/**
* Binds events for the Astra Portfolio.
*
* @since 1.0.0
* @access private
* @function _bind
*/
_bind() {
$( document ).on(
'click',
'.astra-notice-close',
AstraNotices._dismissNoticeNew
);
$( document ).on(
'click',
'.astra-notice .notice-dismiss',
AstraNotices._dismissNotice
);
},
_dismissNotice( event ) {
event.preventDefault();
const repeat_notice_after =
$( this )
.parents( '.astra-notice' )
.data( 'repeat-notice-after' ) || '';
const notice_id =
$( this ).parents( '.astra-notice' ).attr( 'id' ) || '';
AstraNotices._ajax( notice_id, repeat_notice_after );
},
_dismissNoticeNew( event ) {
event.preventDefault();
const repeat_notice_after =
$( this ).attr( 'data-repeat-notice-after' ) || '';
const notice_id =
$( this ).parents( '.astra-notice' ).attr( 'id' ) || '';
const $el = $( this ).parents( '.astra-notice' );
$el.fadeTo( 100, 0, function () {
$el.slideUp( 100, function () {
$el.remove();
} );
} );
AstraNotices._ajax( notice_id, repeat_notice_after );
const link = $( this ).attr( 'href' ) || '';
const target = $( this ).attr( 'target' ) || '';
if ( '' !== link && '_blank' === target ) {
window.open( link, '_blank' );
}
},
_ajax( notice_id, repeat_notice_after ) {
if ( '' === notice_id ) {
return;
}
$.ajax( {
url: ajaxurl,
type: 'POST',
data: {
action: 'astra-notice-dismiss',
nonce: astraNotices._notice_nonce,
notice_id,
repeat_notice_after: parseInt( repeat_notice_after ),
},
} );
},
};
$( function () {
AstraNotices.init();
} );
} )( jQuery );