| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.3/wp-content/plugins/js_composer/modules/typography/assets/js/ |
Upload File : |
jQuery( document ).ready( function ( $ ) {
$( '#vc_synchronize_google_fonts_button' ).on( 'click', function ( e ) {
if ( $( this ).attr( 'disabled' ) ) {
e.preventDefault();
return;
}
process_google_fonts_sync( e, this );
});
$( '#vc_synchronize_adobe_fonts_button' ).on( 'click', function ( e ) {
if ( $( this ).attr( 'disabled' ) ) {
e.preventDefault();
return;
}
process_adobe_fonts_sync( e, this );
});
function process_google_fonts_sync ( e, _this ) {
e.preventDefault();
add_preloader( _this );
var data = {
action: 'wpb_google_fonts',
_vcnonce: window.vcAdminNonce
};
$.ajax({
type: 'POST',
url: window.ajaxurl,
data: data
}).done( function ( response ) {
if ( response.success ) {
add_field_message( _this, window.i18nLocaleSettings.google_fonts_synced, 'success' );
} else {
add_field_message( _this, response.data );
add_field_message( _this, response.data, 'error' );
}
}).fail( function () {
add_field_message( _this, window.i18nLocaleSettings.google_fonts_sync_failed, 'error' );
});
}
function process_adobe_fonts_sync ( e, _this ) {
e.preventDefault();
add_preloader( _this );
var adobe_id_input = $( '#wpb_js_adobe_fonts_web_project_id' );
var web_project_id = adobe_id_input.val();
if ( ! web_project_id ) {
add_field_message( _this, window.i18nLocaleSettings.enter_adobe_sync_web_project_id, 'error' );
return;
}
var data = {
action: 'wpb_adobe_set_fonts',
web_project_id: web_project_id,
_vcnonce: window.vcAdminNonce
};
$.ajax({
type: 'POST',
url: window.ajaxurl,
data: data
}).done( function ( response ) {
if ( response.success ) {
var hidden_input = $( 'input[name="wpb_js_adobe_fonts_data"]' );
hidden_input.val( response.data.body );
add_field_message( _this, window.i18nLocaleSettings.adobe_fonts_synced, 'success' );
} else {
add_field_message( _this, response.data, 'error' );
}
}).fail( function () {
add_field_message( _this, window.i18nLocaleSettings.adobe_fonts_sync_failed, 'error' );
});
}
function add_field_message ( _this, message, result ) {
var all_messages = $( '.wpb_message_placeholder' );
all_messages.hide();
var message_placeholder = $( '.wpb_message_placeholder.notice.notice-' + result );
message_placeholder.show();
if ( message_placeholder.length ) {
message_placeholder.find( 'p' ).html( message );
}
remove_preloader( _this );
}
function add_preloader ( element ) {
var preloader = '<span class="vc_ui-wp-spinner vc_ui-wp-spinner-dark"></span>';
var elementObj = $( element );
elementObj.prepend( preloader );
elementObj.attr( 'disabled','disabled' );
}
function remove_preloader ( element ) {
var elementObj = $( element );
$( element ).find( '.vc_ui-wp-spinner' ).remove();
elementObj.removeAttr( 'disabled' );
}
});