/** * Define HOOKs for loading CSS and JavaScript files */ public function init_load_css_js_tpl() { // Load only at specific Page if ( wpbc_is_setup_wizard_page() ) { add_action( 'wpbc_enqueue_js_files', array( $this, 'js_load_files' ), 50 ); add_action( 'wpbc_enqueue_css_files', array( $this, 'enqueue_css_files' ), 50 ); add_action( 'wpbc_hook_settings_page_footer', array( $this, 'hook__load_templates_at_footer' ) ); } } /** JS */ public function js_load_files( $where_to_load ) { $in_footer = true; if ( wpbc_is_setup_wizard_page() ){ wp_enqueue_script( 'wpbc_all', wpbc_plugin_url( '/_dist/all/_out/wpbc_all.js' ), array( 'jquery' ), WP_BK_VERSION_NUM, array( 'in_footer' => WPBC_JS_IN_FOOTER ) ); wp_enqueue_script( 'wpbc-main-client', wpbc_plugin_url( '/js/client.js' ), array( 'wpbc-datepick' ), WP_BK_VERSION_NUM, array( 'in_footer' => WPBC_JS_IN_FOOTER ) ); wp_enqueue_script( 'wpbc-times', wpbc_plugin_url( '/js/wpbc_times.js' ), array( 'wpbc-main-client' ), WP_BK_VERSION_NUM, array( 'in_footer' => WPBC_JS_IN_FOOTER ) ); wp_enqueue_script( 'wpbc-settings_obj', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/settings_obj.js', array( 'wpbc_all' ), WP_BK_VERSION_NUM, $in_footer ); wp_enqueue_script( 'wpbc-setup_wizard_obj', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/setup_obj.js', array( 'wpbc-settings_obj' ), WP_BK_VERSION_NUM, $in_footer ); wp_enqueue_script( 'wpbc-setup_wizard_show', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/setup_show.js', array( 'wpbc-setup_wizard_obj' ), WP_BK_VERSION_NUM, $in_footer ); wp_enqueue_script( 'wpbc-setup_wizard_ajax', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/setup_ajax.js', array( 'wpbc-setup_wizard_obj' ), WP_BK_VERSION_NUM, $in_footer ); } } /** CSS */ public function enqueue_css_files( $where_to_load ) { if ( wpbc_is_setup_wizard_page() ){ wp_enqueue_style( 'wpbc-setup_wizard_page', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/setup_page.css', array(), WP_BK_VERSION_NUM ); } } // // /** * Load Templates at footer of page * * @param $page string */ public function hook__load_templates_at_footer( $page ){ // Hook from ../includes/page-setup/setup__page.php if ( 'wpbc-ajx_booking_setup_wizard' === $page ) { $this->wpbc_template__stp_wiz__main_content(); wpbc_stp_wiz__template__welcome(); wpbc_stp_wiz__template__general_info(); wpbc_stp_wiz__template__date_time_formats(); wpbc_stp_wiz__template__bookings_types(); wpbc_stp_wiz__template__form_structure(); wpbc_stp_wiz__template__cal_availability(); wpbc_stp_wiz__template__color_theme(); wpbc_stp_wiz__template__optional_other_settings(); wpbc_stp_wiz__template__wizard_publish(); wpbc_stp_wiz__template__get_started(); $this->wpbc_template__stp_wiz__left_navigation(); $this->wpbc_template__stp_wiz__left_navigation_item(); $this->wpbc_template__timeline_steps(); $this->wpbc_template__timeline_steps_icons(); $this->wpbc_template__stp_wiz__footer_buttons(); } } // ============================================================================================================= // == Templates == // ============================================================================================================= /** * Template - Page Container * * Help Tips: * * * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => 'Data' } ) ); * * @return void */ private function wpbc_template__stp_wiz__main_content() { ?>'; ?> {{{ template__main_section( data ) }}} <# if ( false !== data.steps[ data.current_step ][ 'show_section_right' ] ) { #>
test_right_widget(); ?>
<# } #> <# var wpbc_template__stp_wiz__footer_buttons = wp.template( 'wpbc_template__stp_wiz__footer_buttons' ); #> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => 'Data' } ) ); * * @return void */ private function wpbc_template__stp_wiz__left_navigation() { ?> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => 'Data' } ) ); * * @return void */ private function wpbc_template__stp_wiz__left_navigation_item() { ?>
Calendar Skin
} /** * Just for loading CSS and JavaScript files */ if ( true ) { $wpbc_setup_wizard_page_loading = new WPBC_AJX__Setup_Wizard__Templates; $wpbc_setup_wizard_page_loading->init_load_css_js_tpl(); }