File: /medikors/www/wp-content/plugins/happy-elementor-addons-pro/classes/class.marvin.php
<?php
namespace Happy_Addons_Pro;
defined( 'ABSPATH' ) || die();
class Marvin {
public static function init() {
if ( hapro_is_elementor_version( '>=', '2.8.0' ) ) {
add_action( 'elementor/editor/before_enqueue_scripts', [ __CLASS__, 'enqueue' ] );
} else {
add_action( 'elementor/preview/enqueue_scripts', [ __CLASS__, 'enqueue' ] );
}
}
public static function enqueue() {
if ( apply_filters( 'happyaddons_marvin_active', true ) && hapro_has_valid_license() ) {
wp_enqueue_script(
'marvin-ls',
HAPPY_ADDONS_PRO_ASSETS . 'admin/js/marvin-ls.min.js',
null,
HAPPY_ADDONS_PRO_VERSION,
true
);
if ( hapro_is_elementor_version( '>=', '2.8.0' ) ) {
$src = HAPPY_ADDONS_PRO_ASSETS . 'admin/js/marvin-new.min.js';
$dependencies = [ 'marvin-ls', 'elementor-editor' ];
} else {
$src = HAPPY_ADDONS_PRO_ASSETS . 'admin/js/marvin.min.js';
$dependencies = [ 'marvin-ls' ];
}
wp_enqueue_script(
'marvin',
$src,
$dependencies,
HAPPY_ADDONS_PRO_VERSION,
true
);
wp_localize_script(
'marvin',
'marvin',
[
'storagekey' => md5( 'LICENSE KEY' ),
'identifier' => wp_create_nonce( 'ha-retainer' ),
'serviceEndpoint' => admin_url( 'admin-ajax.php' )
]
);
}
}
}
Marvin::init();