/home/crealab/pueblito.brainware.com.co/wp-content/plugins/scroll_magic/index.php
<?php
/*
Plugin Name: ScrollMagic
Description: A WordPress Builder for Animated Content.
Author: DocoDev
Version: 5.0.3
Author URI: https://codecanyon.net/user/docodev/portfolio
Text Domain: bestbug
Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
defined( 'WPSG_URL' ) or define('WPSG_URL', plugins_url( '/', __FILE__ ));
defined( 'WPSG_PATH' ) or define('WPSG_PATH', basename( dirname( __FILE__ )));
defined( 'WPSG_FULLPATH' ) or define('WPSG_FULLPATH', plugins_url( '/', __FILE__ ));
defined( 'WPSG_TEXTDOMAIN' ) or define('WPSG_TEXTDOMAIN', plugins_url( '/', __FILE__ ));
defined( 'WPSG_PREFIX' ) or define('WPSG_PREFIX', 'docodev_');
defined( 'WPSG_VERSION' ) or define('WPSG_VERSION', '5.0.3');
// POSTTYPES
defined( 'WPSG_POSTTYPE' ) or define('WPSG_POSTTYPE', 'docodev_scrollmagic');
defined( 'WPSG_MEGAMENU_POSTTYPE' ) or define('WPSG_MEGAMENU_POSTTYPE', 'wpsg_megamenu');
defined( 'WPSG_OPTION' ) or define('WPSG_OPTION', 'scrollmagic_opt_');
// PAGE SLUG
defined( 'WPSG_SLUG' ) or define('WPSG_SLUG', 'scrollmagic');
defined( 'WPSG_SLUG_SETTINGS' ) or define('WPSG_SLUG_SETTINGS', 'wpsg_settings');
defined( 'WPSG_ALL_SCROLL_SLUG' ) or define('WPSG_ALL_SCROLL_SLUG', 'wpsg_all_scrollmagics');
defined( 'WPSG_ADD_SCROLL_SLUG' ) or define('WPSG_ADD_SCROLL_SLUG', 'wpsg_add_scrollmagic');
defined( 'WPSG_SETTINGS_SCROLL_SLUG' ) or define('WPSG_SETTINGS_SCROLL_SLUG', 'wpsg_settings_scrollmagic');
// SHORTCODES
defined( 'WPSG_SHORTCODE' ) or define('WPSG_SHORTCODE', 'docodev_scrollmagic');
// METABOXES
defined( 'WPSG_METABOX_SCROLL' ) or define('WPSG_METABOX_SCROLL', '_docodev_scrollmagic') ;
// AJAX
defined( 'WPSG_SAVE_SETTINS' ) or define('WPSG_SAVE_SETTINS', 'bbscrollmagic_save_settings');
include_once 'includes/functions.php';
if ( ! class_exists( 'Wpsg_Class' ) ) {
/**
* Wpsg_Class Class
*
* @since 1.0
*/
class Wpsg_Class {
/**
* Constructor
*
* @return void
* @since 1.0
*/
function __construct() {
// Load core
if(!class_exists('BestBug_Core_Class')) {
include_once 'bestbugcore/index.php';
}
BestBug_Core_Class::support('options');
BestBug_Core_Class::support('posttypes');
include_once 'includes/index.php';
if(is_admin()) {
include_once 'includes/admin/index.php';
}
include_once 'includes/shortcodes/index.php';
add_action( 'init', array( $this, 'init' ), 20 );
add_action( 'wp_footer', array( $this, 'wpsg_css'), 11 );
}
public function init() {
// Load enqueueScripts
add_action('wp_enqueue_scripts', array($this, 'loadEnqueueScripts'));
add_action( 'admin_enqueue_scripts', array( $this, 'adminEnqueueScripts' ) );
}
public function adminEnqueueScripts2() {
wp_enqueue_style( 'scrolly-support', WPSG_URL . 'assets/admin/css/support.css' );
}
public function adminEnqueueScripts() {
BestBug_Core_Class::adminEnqueueScripts();
// wp_enqueue_style( 'contextMenu', WPSG_URL . 'assets/vender/contextMenu/jquery.contextMenu.min.css' );
// wp_enqueue_script( 'jquery' );
// // wp_enqueue_script( 'contextMenu', WPSG_URL . 'assets/vender/contextMenu/jquery.contextMenu.min.js',array( 'jquery' ), WPSG_VERSION, true );
wp_enqueue_script( 'sweetalert', BESTBUG_CORE_URL . 'assets/admin/js/sweetalert.min.js', array( 'jquery' ), null, true );
wp_enqueue_style( 'wpsg-admin', WPSG_URL . 'assets/admin/css/style.css' );
wp_enqueue_script( 'wpsg-admin', WPSG_URL . 'assets/admin/js/script.js', array( 'jquery' ), WPSG_VERSION, true );
wp_localize_script( "wpsg-admin", "settings_slug", array(admin_url('/admin.php?page='.WPSG_SETTINGS_SCROLL_SLUG)));
}
public function loadEnqueueScripts(){
self::enqueueScripts();
}
public static function enqueueScripts() {
// Fix Divi theme
if ( defined( 'ET_BUILDER_DIVI_LIBRARY_URL' ) ) {
wp_register_script('mediaelement', plugins_url('wp-mediaelement.min.js', __FILE__), array('jquery'), '4.8.2', true);
wp_enqueue_script('mediaelement');
}
if(bb_option(WPSG_OPTION.'smooth_scroll','yes') == 'yes') {
wp_enqueue_script( 'smoothscroll', WPSG_URL . 'assets/js/smoothscroll.js', array( 'jquery' ), WPSG_VERSION, true );
}
wp_enqueue_style( 'animate', WPSG_URL . 'assets/vender/animate/animate.min.css');
wp_enqueue_style( 'magnific-popup', WPSG_URL . 'assets/vender/magnific-popup/magnific-popup.css');
wp_enqueue_style( 'font-awesome', WPSG_URL . 'assets/vender/font-awesome/css/font-awesome.min.css', null, '5.15.4' );
wp_enqueue_style( 'docodev-scrollmagic', WPSG_URL . 'assets/css/style.css' );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'ScrollMagic', WPSG_URL . 'assets/vender/scroll-magic/ScrollMagic.min.js', null, WPSG_VERSION, true );
wp_enqueue_script( 'drawsvg', WPSG_URL . 'assets/vender/jquery.drawsvg.min.js', null, WPSG_VERSION, true );
wp_enqueue_script( 'magnific-popup', WPSG_URL . 'assets/vender/magnific-popup/jquery.magnific-popup.min.js', null, WPSG_VERSION, true );
wp_enqueue_script( 'animejs', WPSG_URL . 'assets/vender/animejs/anime.min.js', null, WPSG_VERSION, true );
wp_enqueue_script( 'docodev-scrollmagic', WPSG_URL . 'assets/js/docodev.scrollmagic.js', array( 'jquery', 'animejs', 'ScrollMagic' ), WPSG_VERSION, true );
wp_localize_script( "docodev-scrollmagic", "SCROLLMAGIC_OPTIONS", array(
'SMOOTH' => bb_option(WPSG_OPTION.'smooth'),
'SPEED' => bb_option(WPSG_OPTION.'speed'),
));
}
public function loadTextDomain() {
load_plugin_textdomain( WPSG_TEXTDOMAIN, false, WPSG_PATH . '/languages/' );
}
public function wpsg_css() {
global $scrollmagic_anime;
?>
<script type="text/javascript">
SCROLLMAGIC_ANIME = <?php echo json_encode($scrollmagic_anime); ?>;
</script>
<?php
}
}
new Wpsg_Class();
}