| 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/assets/js/vendors/ |
Upload File : |
/* global vc, YoastSEO, _, jQuery */
( function ( $ ) {
'use strict';
// vcYoast is used below in the code
// eslint-disable-next-line no-unused-vars
var imageEventString, vcYoast, relevantData, eventsList;
relevantData = {};
eventsList = [
'sync',
'add',
'update'
];
var contentModification = _.memoize( function ( data ) {
data = _.reduce( relevantData, function ( memo, value ) {
if ( value.html ) {
memo = memo.replace( '"' + value.text + '"', value.html );
}
if ( value.image && value.param ) {
var i, imagesString = '', attachment;
for ( i = 0; value.image.length > i; i ++ ) {
attachment = window.wp.media.model.Attachment.get( value.image[ i ]);
if ( attachment.get( 'url' ) ) {
imagesString += '<img src=\'' + attachment.get( 'url' ) + '\' alt=\'' + ( attachment.get( 'alt' ) || attachment.get( 'caption' ) || attachment.get( 'title' ) ) + '\'>';
}
}
memo += imagesString;
}
return memo;
}, data );
return data;
});
function getImageEventString ( e ) {
return ' shortcodes:' + e + ':param:type:attach_image' + ' shortcodes:' + e + ':param:type:attach_images';
}
// add relevant data for images
imageEventString = _.reduce( eventsList, function ( memo, e ) {
return memo + getImageEventString( e );
}, '' );
vc.events.on( imageEventString, function ( model, param, settings ) {
if ( param && param.length > 0 ) {
var ids = param.split( /\s*,\s*/ );
_.each( ids, function ( id ) {
var attachment = window.wp.media.model.Attachment.get( id );
if ( !attachment.get( 'url' ) ) {
attachment.once( 'sync', function () {
if ( window.YoastSEO ) {
YoastSEO.app.pluginReloaded( 'wpbVendorYoast' );
}
});
attachment.fetch();
}
});
relevantData[ model.get( 'id' ) + settings.param_name ] = {
image: ids,
paramName: settings.param_name,
param: param
};
}
});
vc.events.on( getImageEventString( 'destroy' ), function ( model, param, settings ) {
delete relevantData[ model.get( 'id' ) + settings.param_name ];
});
// Add relevant data to headings
vc.events.on( 'shortcodes:vc_custom_heading', function ( model, event ) {
var params, tagSearch;
params = model.get( 'params' );
params = _.extend({}, vc.getDefaults( model.get( 'shortcode' ) ), params );
if ( 'destroy' === event ) {
delete relevantData[ model.get( 'id' ) ];
} else if ( params.text && params.font_container ) {
tagSearch = params.font_container.match( /tag:([^\|]+)/ );
if ( tagSearch[ 1 ]) {
relevantData[ model.get( 'id' ) ] = {
html: '<' + tagSearch[ 1 ] + '>' + params.text + '</' + tagSearch[ 1 ] + '>',
text: params.text
};
}
}
});
$( window ).on( 'YoastSEO:ready', function () {
var VcVendorYoast = function () {
// init
YoastSEO.app.registerPlugin( 'wpbVendorYoast', { status: 'ready' });
YoastSEO.app.pluginReady( 'wpbVendorYoast' );
YoastSEO.app.registerModification( 'content', contentModification, 'wpbVendorYoast', 5 );
};
vcYoast = new VcVendorYoast();
});
$( document ).ready( function () {
if ( window.wp && wp.hooks && wp.hooks.addFilter ) {
wp.hooks.addFilter( 'rank_math_content', 'wpbRankMath', contentModification );
}
});
})( window.jQuery );