public function handle() { $ajax_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'post_type' => Tribe__Events__Main::POSTTYPE); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-ajax-day.js'), true); $handle = 'tribe-events-ajax-day'; wp_enqueue_script($handle, $path, array('tribe-events-bar'), $this->filter_js_version(), true); wp_localize_script($handle, 'TribeCalendar', $ajax_data); }
public function handle() { $deps = array_merge($this->deps, array('jquery')); $path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'jquery-placeholder/jquery.placeholder.js', true); $placeholder_handle = Tribe__Events__Template_Factory::get_placeholder_handle(); wp_enqueue_script($placeholder_handle, $path, $deps, '2.0.7', false); Tribe__Events__Template_Factory::add_vendor_script($placeholder_handle); }
public function handle() { $path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'jquery-resize/jquery.ba-resize.js', true); $deps = array_merge($this->deps, array('jquery')); $handle = $this->prefix . '-jquery-resize'; wp_enqueue_script($handle, $path, $deps, '1.1', false); Tribe__Events__Template_Factory::add_vendor_script($handle); }
public function handle() { $deps = array_merge($this->deps, array('jquery'), Tribe__Events__Template_Factory::get_vendor_scripts()); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events.js'), true); $handle = $this->prefix . '-calendar-script'; wp_enqueue_script($handle, $path, $deps, $this->filter_js_version()); $js_config_array = array('permalink_settings' => get_option('permalink_structure'), 'events_post_type' => Tribe__Events__Main::POSTTYPE, 'events_base' => tribe_get_events_link()); wp_localize_script($handle, 'tribe_js_config', $js_config_array); }
public function handle() { $ajax_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'post_type' => Tribe__Events__Main::POSTTYPE); $path1 = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'nanoscroller/jquery.nanoscroller.js', true); wp_enqueue_script('tribe-events-pro-slimscroll', $path1, array('tribe-events-pro', 'jquery-ui-draggable'), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION), true); $path2 = Tribe__Events__Template_Factory::getMinFile(tribe_events_pro_resource_url('tribe-events-week.js'), true); wp_enqueue_script('tribe-events-pro-week', $path2, array('tribe-events-pro-slimscroll'), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION), true); wp_localize_script('tribe-events-pro-week', 'TribeWeek', $ajax_data); }
public function handle() { $deps = array_merge($this->deps, array('jquery', $this->prefix . '-bootstrap-datepicker', $this->prefix . '-calendar-script')); $ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http')); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-ajax-calendar.js'), true); $handle = 'tribe-events-calendar'; wp_enqueue_script($handle, $path, $deps, $this->filter_js_version(), true); wp_localize_script($handle, 'TribeCalendar', $ajax_data); }
public function handle() { $css_path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'select2/select2.css', true); $path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'select2/select2.js', true); wp_enqueue_style($this->prefix . '-select2-css', $css_path); $script_handle = $this->prefix . '-select2'; wp_enqueue_script($script_handle, $path, 'jquery', '3.2'); Tribe__Events__Template_Factory::add_vendor_script($script_handle); }
public function handle() { $tribe_paged = !empty($_REQUEST['tribe_paged']) ? $_REQUEST['tribe_paged'] : 0; $ajax_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'tribe_paged' => $tribe_paged); $path1 = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'isotope/jquery.isotope.js', true); $path2 = Tribe__Events__Template_Factory::getMinFile(tribe_events_pro_resource_url('tribe-events-photo-view.js'), true); wp_enqueue_script('tribe-events-pro-isotope', $path1, array('tribe-events-pro'), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION), true); wp_enqueue_script('tribe-events-pro-photo', $path2, array('tribe-events-pro-isotope'), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION), true); wp_localize_script('tribe-events-pro-photo', 'TribePhoto', $ajax_data); }
public function handle() { $deps = array_merge($this->deps, array('jquery', $this->prefix . '-calendar-script')); $tribe_paged = !empty($_REQUEST['tribe_paged']) ? $_REQUEST['tribe_paged'] : 0; $ajax_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'tribe_paged' => $tribe_paged); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-ajax-list.js'), true); $handle = 'tribe-events-list'; wp_enqueue_script($handle, $path, $deps, $this->filter_js_version(), true); wp_localize_script($handle, 'TribeList', $ajax_data); }
public function handle() { $deps = array_merge($this->deps, array('jquery')); $css_path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'chosen/public/chosen.css', true); $path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'chosen/public/chosen.jquery.js', true); wp_enqueue_style($this->prefix . '-chosen-style', $css_path); $handle = $this->prefix . '-chosen-jquery'; wp_enqueue_script($handle, $path, $deps, '0.9.5', false); Tribe__Events__Template_Factory::add_vendor_script($handle); }
/** * Adds content to the embed head tag * * The embed header DOES NOT have wp_head() executed inside of it. Instead, any scripts/styles * are explicitly output */ public function embed_head() { $css_path = Tribe__Events__Template_Factory::getMinFile(Tribe__Events__Main::instance()->plugin_url . 'src/resources/css/tribe-events-embed.css', true); $css_path = add_query_arg('ver', Tribe__Events__Main::VERSION, $css_path); ?> <link rel="stylesheet" id="tribe-events-embed-css" href="<?php echo esc_url($css_path); ?> " type="text/css" media="all"> <?php }
public function handle() { $css_path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'bootstrap-datepicker/css/datepicker.css', true); $path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'bootstrap-datepicker/js/bootstrap-datepicker.min.js', true); wp_enqueue_style($this->prefix . '-bootstrap-datepicker-css', $css_path); $handle = $this->prefix . '-bootstrap-datepicker'; wp_enqueue_script($handle, $path, 'jquery', '3.2'); Tribe__Events__Template_Factory::add_vendor_script($handle); $localized_datepicker_array = array('days' => array_merge($this->tec->daysOfWeek, array($this->tec->daysOfWeek[0])), 'daysShort' => array_merge($this->tec->daysOfWeekShort, array($this->tec->daysOfWeekShort[0])), 'daysMin' => array_merge($this->tec->daysOfWeekMin, array($this->tec->daysOfWeekMin[0])), 'months' => array_values($this->tec->monthsFull), 'monthsShort' => array_values($this->tec->monthsShort), 'clear' => __('Clear', 'the-events-calendar'), 'today' => __('Today', 'the-events-calendar')); wp_localize_script($handle, 'tribe_bootstrap_datepicker_strings', array('dates' => $localized_datepicker_array)); }
public function handle() { $http = is_ssl() ? 'https' : 'http'; $url = apply_filters('tribe_events_pro_google_maps_api', $http . '://maps.google.com/maps/api/js'); wp_register_script('tribe-gmaps', $url, array('tribe-events-pro')); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_pro_resource_url('tribe-events-ajax-maps.js'), true); wp_register_script('tribe-events-pro-geoloc', $path, array('tribe-gmaps', Tribe__Events__Template_Factory::get_placeholder_handle()), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION)); wp_enqueue_script('tribe-events-pro-geoloc'); $geoloc = Tribe__Events__Pro__Geo_Loc::instance(); $data = array('ajaxurl' => admin_url('admin-ajax.php', $http), 'nonce' => wp_create_nonce('tribe_geosearch'), 'map_view' => 'map' == Tribe__Events__Main::instance()->displaying ? true : false); wp_localize_script('tribe-events-pro-geoloc', 'GeoLoc', $data); }
public function handle() { $css_path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'select2/select2.css', true); $path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'select2/select2.js', true); wp_enqueue_style($this->prefix . '-select2-css', $css_path); // we know of other plugins loading a version of select2 compatible with our needs // let's not queue the script twice. if (!$this->has_script_alias('select2')) { $script_handle = $this->prefix . '-select2'; wp_enqueue_script($script_handle, $path, 'jquery', '3.2'); Tribe__Events__Template_Factory::add_vendor_script($script_handle); } }
public function handle() { // check if responsive should be killed if (apply_filters('tribe_events_kill_responsive', false)) { add_filter('tribe_events_mobile_breakpoint', '__return_zero'); } $stylesheets = array(); $mobile_break = tribe_get_mobile_breakpoint(); // Get the selected style option $style_option = tribe_get_option('stylesheetOption', 'tribe'); // from `some-style-option` // to `Tribe__Events__Asset__Events_Css_Some_Style_Option` $child_class_name = $this->get_child_class_name($style_option); /** * @var Tribe__Events__Asset__Abstract_Events_Css */ $child_class_instance = new $child_class_name(); // `$stylesheets` passed by reference $child_class_instance->handle($stylesheets, $mobile_break); // put override css at the end of the array $stylesheets['tribe-events-calendar-override-style'] = 'tribe-events/tribe-events.css'; // do the enqueues foreach ($stylesheets as $name => $css_file) { if ($name == 'tribe-events-calendar-override-style') { $user_stylesheet_url = Tribe__Events__Templates::locate_stylesheet('tribe-events/tribe-events.css'); if ($user_stylesheet_url) { wp_enqueue_style($name, $user_stylesheet_url); } } else { // get full URL $url = tribe_events_resource_url($css_file); // get the minified file $url = Tribe__Events__Template_Factory::getMinFile($url, true); // apply filters $url = apply_filters('tribe_events_stylesheet_url', $url, $name); // set the $media attribute if ($name == 'tribe-events-calendar-mobile-style' || $name == 'tribe-events-calendar-full-mobile-style') { $media = "only screen and (max-width: {$mobile_break}px)"; wp_enqueue_style($name, $url, array('tribe-events-calendar-style'), Tribe__Events__Main::VERSION, $media); } else { wp_register_style($name, $url, array(), Tribe__Events__Main::VERSION); wp_enqueue_style($name); } } } }
/** * This Week Widget - Style and Scripts * */ public static function styles_and_scripts() { wp_enqueue_script('tribe-this-week', tribe_events_pro_resource_url('widget-this-week.min.js'), array('jquery'), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION)); // Tribe Events CSS filename $event_file = 'widget-this-week.css'; $stylesheet_option = tribe_get_option('stylesheetOption', 'tribe'); // What Option was selected switch ($stylesheet_option) { case 'skeleton': $event_file_option = 'widget-this-week-' . $stylesheet_option . '.css'; break; case 'full': $event_file_option = 'widget-this-week-' . $stylesheet_option . '.css'; break; default: $event_file_option = 'widget-this-week-theme.css'; break; } $style_url = tribe_events_pro_resource_url($event_file_option); // get the minified file $style_url = Tribe__Events__Template_Factory::getMinFile($style_url, true); //filter stylesheet $style_url = apply_filters('tribe_events_pro_widget_calendar_stylesheet_url', $style_url); //Check for Override $style_override_url = Tribe__Events__Templates::locate_stylesheet('tribe-events/pro/' . $event_file, $style_url); // Load up stylesheet from theme or plugin if ($style_url && $stylesheet_option == 'tribe') { wp_enqueue_style('widget-this-week-pro-style', tribe_events_pro_resource_url('widget-this-week-full.css'), array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION)); wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '-widget-this-week-pro-style', $style_url, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION)); } else { wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '-widget-this-week-pro-style', $style_url, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION)); } if ($style_override_url && $style_override_url != $style_url) { wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '--widget-this-week-pro-override-style', $style_override_url, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION)); } $widget_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http')); wp_localize_script('tribe-this-week', 'tribe_this_week', $widget_data); }
/** * Enqueue the plugin stylesheet(s). * * @author PaulHughes01 * @since 3.4 * @return void */ public function enqueueStylesAndScripts() { if (tribe_is_event_query() || tribe_is_event_organizer() || tribe_is_event_venue()) { $show_filter = apply_filters('tribe_events_filters_should_show', in_array(get_post_type(), array(Tribe__Events__Main::VENUE_POST_TYPE, Tribe__Events__Main::ORGANIZER_POST_TYPE)) ? false : true); if ($show_filter) { //Only display filters before template if the layout is horizontal if (tribe_get_option('events_filters_layout', 'vertical') == 'vertical') { add_action('tribe_events_bar_after_template', array($this, 'displaySidebar'), 25); } else { if (tribe_get_option('tribeDisableTribeBar', false) == true) { add_action('tribe_events_before_template', array($this, 'displaySidebar'), 25); } else { add_action('tribe_events_bar_after_template', array($this, 'displaySidebar'), 25); } } } // enqueue chosen for tag multi-select Tribe__Events__Template_Factory::asset_package('chosen'); Tribe__Events__Template_Factory::asset_package('calendar-script', array('jquery-ui-slider')); wp_enqueue_style('custom-jquery-styles'); wp_enqueue_style('Tribe__Events__Filterbar__View-css', Tribe__Events__Template_Factory::getMinFile($this->pluginUrl . 'src/resources/css/filter-view.css', true), array(), apply_filters('tribe_events_filters_css_version', self::VERSION)); wp_enqueue_script('jquery-ui-slider'); wp_enqueue_script('Tribe__Events__Filterbar__View-scripts', Tribe__Events__Template_Factory::getMinFile($this->pluginUrl . 'src/resources/js/filter-scripts.js', true), array(), apply_filters('tribe_events_filters_js_version', self::VERSION)); //Check for override stylesheet $user_stylesheet_url = Tribe__Events__Templates::locate_stylesheet('tribe-events/filterbar/filter-view.css'); $user_stylesheet_url = apply_filters('tribe_events_filterbar_stylesheet_url', $user_stylesheet_url); //If override stylesheet exists, then enqueue it if ($user_stylesheet_url) { wp_enqueue_style('tribe-events-filterbar-override-style', $user_stylesheet_url); } } }
protected function enqueue_map_scripts() { // Setup Google Maps API $url = apply_filters('tribe_events_google_maps_api', '//maps.googleapis.com/maps/api/js'); wp_enqueue_script('tribe_events_google_maps_api', $url, array(), false, true); // Setup our own script used to initialize each map $url = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('embedded-map.js'), true); wp_enqueue_script(self::MAP_HANDLE, $url, array('tribe_events_google_maps_api'), false, true); $this->map_script_enqueued = true; }
/** * Enqueue the plugin stylesheet(s). * * @author caseypicker * @since 3.9 * @return void */ public function enqueue_styles() { //Only enqueue wootickets styles on singular event page if (is_singular(Tribe__Events__Main::POSTTYPE)) { $stylesheet_url = $this->pluginUrl . 'src/resources/css/wootickets.css'; // Get minified CSS if it exists $stylesheet_url = Tribe__Events__Template_Factory::getMinFile($stylesheet_url, true); // apply filters $stylesheet_url = apply_filters('tribe_wootickets_stylesheet_url', $stylesheet_url); wp_enqueue_style('TribeEventsWooTickets', $stylesheet_url, array(), apply_filters('tribe_events_wootickets_css_version', self::VERSION)); //Check for override stylesheet $user_stylesheet_url = Tribe__Events__Templates::locate_stylesheet('tribe-events/wootickets/wootickets.css'); $user_stylesheet_url = apply_filters('tribe_events_wootickets_stylesheet_url', $user_stylesheet_url); //If override stylesheet exists, then enqueue it if ($user_stylesheet_url) { wp_enqueue_style('tribe-events-wootickets-override-style', $user_stylesheet_url); } } }
public function handle() { $deps = array_merge($this->deps, array('jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'tribe-bumpdown', 'wp-util')); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('events-admin.js'), true); wp_enqueue_script($this->prefix . '-admin', $path, $deps, $this->filter_js_version(), true); }
public function handle() { $deps = array_merge($this->deps, array('jquery', $this->prefix . '-calendar-script', $this->prefix . '-bootstrap-datepicker', $this->prefix . '-jquery-resize', Tribe__Events__Template_Factory::get_placeholder_handle())); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-bar.js'), true); wp_enqueue_script($this->prefix . '-bar', $path, $deps, $this->filter_js_version()); }
public function handle() { $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('events-admin.css'), true); wp_enqueue_style($this->prefix . '-admin-ui', $path, array(), Tribe__Events__Main::VERSION); }
/** * Enquues a script to handle live refresh of the date previews. */ public function live_refresh_script() { $url = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('events-admin-date-preview.js'), true); wp_enqueue_script('tribe-date-live-refresh', $url, array('jquery'), false, true); }
public function handle() { $path = Tribe__Events__Template_Factory::getMinFile($this->vendor_url . 'jquery/smoothness/jquery-ui-1.8.23.custom.css', true); wp_enqueue_style($this->prefix . '-custom-jquery-styles', $path); }
public function handle() { $deps = array_merge($this->deps, array('jquery')); $path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('jquery-ecp-plugins.js'), true); wp_enqueue_script($this->prefix . '-ecp-plugins', $path, $deps, $this->filter_js_version()); }