HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpdehaus/wp-content/plugins/salient-portfolio/includes/admin/third-party/js/yoast.js
/**
 * Salient Yoast SEO Portfolio Analysis
 *
 * @author ThemeNectar
 */
 
(function( $ ) {
  
  "use strict";
  
  function SalientPortfolioYoast() {
    
   // Ensure YoastSEO.js is present and can access the necessary features.
   if ( typeof YoastSEO === "undefined" || typeof YoastSEO.analysis === "undefined" || typeof YoastSEO.analysis.worker === "undefined" ) {
        return;
    }
    
    YoastSEO.app.registerPlugin( "SalientPortfolioPostTypePlugin", { status: "ready" } );
    
    this.relevantData = {};
    this.registerModifications();
    this.vcEvents();
    
  }
  
  SalientPortfolioYoast.prototype.vcEvents = function() {
    
    var that = this;

    // Initial.
    if( vc && vc.shortcodes.models ) {
      
      $.each(vc.shortcodes.models, function(i, el) {
        
        // Text.
        if( el.attributes.shortcode === 'vc_column_text' || 
            el.attributes.shortcode === 'nectar_highlighted_text' ||
            el.attributes.shortcode === 'fancy_box' ||
            el.attributes.shortcode === 'nectar_flip_box' ) {
              
            that.relevantData[el.attributes.id] = {
              text: el.attributes.params.content
            }
        }
      });
    }
    
    // Updating.
    if( vc && vc.events ) {
      vc.events.on( 'shortcodes:vc_column_text shortcodes:nectar_highlighted_text shortcodes:fancy_box shortcodes:nectar_flip_box', function ( model, event ) {
        
        var params = model.get( 'params' );
        params = _.extend( {}, vc.getDefaults( model.get( 'shortcode' ) ), params );
    
        if ( 'destroy' === event ) {
    			delete that.relevantData[ model.get( 'id' ) ];
    		} 
        else {
            that.relevantData[model.get( 'id' )] = {
              text: model.get( 'params' ).content
          }
        
        }
        
      });
    }
    
  }
  
  
  SalientPortfolioYoast.prototype.registerModifications = function() {
    
    const callback = this.addContent.bind( this );
    YoastSEO.app.registerModification( "content", callback, "SalientPortfolioPostTypePlugin", 10 );
    
  };
  
  
  SalientPortfolioYoast.prototype.addContent = function ( data ) {
    
    $.each(this.relevantData, function(i,obj) {
      if( obj.text ) {
        data += obj.text;
      }
    });

		return data;
	} 
  
/**
 * Adds eventlistener to load the plugin.
 */
if ( typeof YoastSEO !== "undefined" && typeof YoastSEO.app !== "undefined" ) {
  new SalientPortfolioYoast();
} else {
  jQuery( window ).on(
    "YoastSEO:ready",
    function() {
      new SalientPortfolioYoast();
    }
  );
}

}( jQuery ));