<?php
class dormatic_Scripts {

	public function __construct() {
		 add_action( 'wp_enqueue_scripts', array( $this, 'dormatic_enqueue_scripts' ) );
	}
	public function dormatic_enqueue_scripts() {
		 wp_enqueue_script( 'popper', DORMATIC_JS_URL . 'popper.min.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'bootstrap', DORMATIC_JS_URL . 'bootstrap.min.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'owl', DORMATIC_JS_URL . 'owl.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'wow', DORMATIC_JS_URL . 'wow.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'jquery-fancybox', DORMATIC_JS_URL . 'jquery.fancybox.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'jquery-nice-select', DORMATIC_JS_URL . 'jquery.nice-select.min.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'isotope', DORMATIC_JS_URL . 'isotope.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'appear', DORMATIC_JS_URL . 'appear.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'scrollbar', DORMATIC_JS_URL . 'scrollbar.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'pagenav.js', DORMATIC_JS_URL . 'pagenav.js', array( 'jquery' ), time(), true );
		wp_enqueue_script( 'dormatic-scripts', DORMATIC_JS_URL . 'script.js', array( 'jquery' ), time(), true );

		wp_localize_script(
			'dormatic-scripts',
			'ajax_object',
			array(
				'ajax_url'               => esc_url( admin_url( 'admin-ajax.php' ) ),
				'loader_img'             => DORMATIC_IMG_URL . 'ajax-loader.gif',
			)
		);

		if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
			wp_enqueue_script( 'comment-reply' );
		}
	}
}
$dormatic_scripts = new dormatic_Scripts();
