<?php

/** --------------------------------------
*** REGISTERING THEME ASSETS
*** ------------------------------------*/

/**
 * Enqueue scripts.
 */
function xs_scripts() {

	if (!is_admin()) {
	    // wp_enqueue_script() syntax, $handle, $src, $deps, $version, $in_footer(boolean)
		// load Modernizr
		wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/theme-assets/js/modernizr-1.0.min.js', '', null , true );    

		// load wordpress jquery
	    wp_enqueue_script( 'jquery' );

		//Google Map js
		wp_enqueue_script( 'gmap', 'https://maps.google.com/maps/api/js?sensor=false', array('jquery'), null , true );    
//		wp_enqueue_script( 'gmap', get_template_directory_uri() . '/theme-assets/js/sensor.js', array('jquery'), null , true );    

		//Get Direction js
		wp_enqueue_script( 'get-direction', get_template_directory_uri() . '/theme-assets/js/directions.js', array('gmap'), null , true );    

		// Load Bootstrap js
		wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/theme-assets/js/bootstrap.min.js', array('jquery'), '3.2.0', true );    

		//Placeholder js
		wp_enqueue_script( 'placeholders', get_template_directory_uri() . '/theme-assets/js/placeholders.js', array('jquery'), null , true );    

		//Backstretch js
		wp_enqueue_script( 'backstretch', get_template_directory_uri() . '/theme-assets/js/jquery.backstretch.min.js', array('jquery'), null , true );    

		//Hoverdir js
		wp_enqueue_script( 'hoverdir', get_template_directory_uri() . '/theme-assets/js/jquery.hoverdir.js', array('jquery'), null , true );    

		//PrettyPhoto js
		wp_enqueue_script( 'prettyPhoto', get_template_directory_uri() . '/theme-assets/js/jquery.prettyPhoto.js', array('jquery'), null , true );    

		//onEvent js
		wp_enqueue_script( 'onevent', get_template_directory_uri() . '/theme-assets/js/onevent.js', array('jquery'), null, true );    

		//Countdown js
		wp_enqueue_script( 'countdown', get_template_directory_uri() . '/theme-assets/js/jquery.countdown.js', array('jquery'), null , true );    

		//Fitvids js
		wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/theme-assets/js/jquery.fitvids.js', array('jquery'), null , true );    

		//onEvent custom js
		wp_enqueue_script( 'onevent-custom', get_template_directory_uri() . '/theme-assets/js/custom.js', array('jquery'), null , true );    



		// Load Wordpress Comment js
		if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
			wp_enqueue_script( 'comment-reply' );
		}
	}
}
add_action( 'wp_enqueue_scripts', 'xs_scripts' );

//<link href='http://fonts.googleapis.com/css?family=Roboto:500,100,300,700,400' rel='stylesheet' type='text/css'>
/**
 * Enqueue styles.
 */
function xs_styles() {

	if (!is_admin()) {
	    // wp_enqueue_style( $handle, $src, $deps, $ver, $media )
            // Font
            wp_enqueue_style('xs',  XS_THEME_URL . '/style.css', null, '1.0');
            wp_enqueue_style('googlefont-xs', '//fonts.googleapis.com/css?family=Roboto:500,100,300,700,400', array(), false, 'all');
	    // Bootstrap
	    wp_enqueue_style( 'core-wp', get_template_directory_uri() . '/theme-assets/css/core-wp.css', array(), '3.2.0', 'all' );
	    wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/theme-assets/css/bootstrap.min.css', array(), '3.2.0', 'all' );

	    // Font Awesome
	    wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/theme-assets/fonts/font-awesome/css/font-awesome.min.css', array(), '4.0.0', 'all' );

	    // Main Style
	    if(xs_get_option('theme_options', 'main_template_style', 'color') == 'color'){
		    wp_enqueue_style( 'onevent-main', get_template_directory_uri() . '/theme-assets/css/style-1.css', array(), XS_VERSION, 'all' );
		}else{
		    wp_enqueue_style( 'onevent-main', get_template_directory_uri() . '/theme-assets/css/style-2.css', array(), XS_VERSION, 'all' );
		}

	    // Responsive
	    wp_enqueue_style( 'onevent-responsive', get_template_directory_uri() . '/theme-assets/css/responsive.css', array('onevent-main'), XS_VERSION, 'all' );

	    // PrettyPhoto
	    wp_enqueue_style( 'prettyphoto', get_template_directory_uri() . '/theme-assets/css/prettyPhoto.css', array(), null, 'all' );

	    // Override
	    wp_enqueue_style( 'onevent-override', get_template_directory_uri() . '/theme-assets/css/override.css', array('onevent-main'), null, 'all' );
	}
}
add_action( 'wp_enqueue_scripts', 'xs_styles' );


