<?php
 /**
 * Enqueue scripts and styles.
 */
function storex_scripts() {
	
	// Styles	
	wp_enqueue_style('bootstrap-min',get_template_directory_uri().'/assets/css/bootstrap.min.css', array(), wp_get_theme()->get('Version'));
	
	wp_enqueue_style('owl-carousel-min',get_template_directory_uri().'/assets/css/owl.carousel.min.css', array(), wp_get_theme()->get('Version'));
	
	wp_enqueue_style('font-awesome',get_template_directory_uri().'/assets/css/fonts/font-awesome/css/font-awesome.min.css', array(), wp_get_theme()->get('Version'));
	
	wp_enqueue_style('animate',get_template_directory_uri().'/assets/css/animate.min.css', array(), wp_get_theme()->get('Version'));
	
	wp_enqueue_style('storex-elpath', get_template_directory_uri() . '/assets/css/elpath.css', array(), wp_get_theme()->get('Version'));

	wp_enqueue_style('storex-main', get_template_directory_uri() . '/assets/css/main.css', array(), wp_get_theme()->get('Version'));

	wp_enqueue_style('nice-select', get_template_directory_uri() . '/assets/css/nice-select.css', array(), wp_get_theme()->get('Version'));
	
	wp_enqueue_style('storex-media-query', get_template_directory_uri() . '/assets/css/responsive.css', array(), wp_get_theme()->get('Version'));
	
	wp_enqueue_style( 'storex-style', get_stylesheet_uri(), array(), wp_get_theme()->get('Version') );
	
	// Scripts
	wp_enqueue_script( 'jquery' );
	
	wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery'), wp_get_theme()->get('Version'), true);

	wp_enqueue_script('owl-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array('jquery'), wp_get_theme()->get('Version'), true);
	
	wp_enqueue_script('jquery-fancybox', get_template_directory_uri() . '/assets/js/jquery.fancybox.js', array('jquery'), wp_get_theme()->get('Version'), true);
	
	wp_enqueue_script('wow-min', get_template_directory_uri() . '/assets/js/wow.min.js', array('jquery'), wp_get_theme()->get('Version'), true);

	wp_enqueue_script('storex-custom-js', get_template_directory_uri() . '/assets/js/custom.js', array('jquery'), wp_get_theme()->get('Version'), true);

	wp_enqueue_script('storex-scrolltop-js', get_template_directory_uri() . '/assets/js/scrolltop.min.js', array('jquery'), wp_get_theme()->get('Version'), true);
	
	wp_enqueue_script('nice-select-js', get_template_directory_uri() . '/assets/js/jquery.nice-select.min.js', array('jquery'), wp_get_theme()->get('Version'), true);

	wp_enqueue_script('jquery-ui-js', get_template_directory_uri() . '/assets/js/jquery-ui.js', array('jquery'), wp_get_theme()->get('Version'), true);

	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'storex_scripts' );

//Admin Enqueue for Admin
function storex_admin_enqueue_scripts(){
	wp_enqueue_style('storex-admin-style', get_template_directory_uri() . '/inc/customizer/assets/css/admin.css', array(), wp_get_theme()->get('Version'));
	wp_enqueue_script( 'storex-admin-script', get_template_directory_uri() . '/inc/customizer/assets/js/storex-admin-script.js', array( 'jquery' ), wp_get_theme()->get('Version'), true );
    wp_localize_script( 'storex-admin-script', 'storex_ajax_object',
        array(
            'ajax_url'             => admin_url( 'admin-ajax.php' ),
            'dismiss_notice_nonce' => wp_create_nonce( 'storex_dismissed_notice' ),
        )
    );
}
add_action( 'admin_enqueue_scripts', 'storex_admin_enqueue_scripts' );