/**
  * Show the setup wizard
  */
 public function setup_wizard()
 {
     if (empty($_GET['page']) || 'wc-setup' !== $_GET['page']) {
         return;
     }
     $this->steps = array('introduction' => array('name' => __('Introduction', 'woocommerce'), 'view' => array($this, 'wc_setup_introduction'), 'handler' => ''), 'pages' => array('name' => __('Page Setup', 'woocommerce'), 'view' => array($this, 'wc_setup_pages'), 'handler' => array($this, 'wc_setup_pages_save')), 'locale' => array('name' => __('Store Locale', 'woocommerce'), 'view' => array($this, 'wc_setup_locale'), 'handler' => array($this, 'wc_setup_locale_save')), 'shipping_taxes' => array('name' => __('Shipping & Tax', 'woocommerce'), 'view' => array($this, 'wc_setup_shipping_taxes'), 'handler' => array($this, 'wc_setup_shipping_taxes_save')), 'payments' => array('name' => __('Payments', 'woocommerce'), 'view' => array($this, 'wc_setup_payments'), 'handler' => array($this, 'wc_setup_payments_save')), 'next_steps' => array('name' => __('Ready!', 'woocommerce'), 'view' => array($this, 'wc_setup_ready'), 'handler' => ''));
     $this->step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps));
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_register_script('select2', WC()->plugin_url() . '/assets/js/select2/select2' . $suffix . '.js', array('jquery'), '3.5.2');
     wp_register_script('wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array('jquery', 'select2'), WC_VERSION);
     wp_localize_script('wc-enhanced-select', 'wc_enhanced_select_params', array('i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'woocommerce'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'woocommerce'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'woocommerce'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'woocommerce'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'woocommerce'), 'ajax_url' => admin_url('admin-ajax.php'), 'search_products_nonce' => wp_create_nonce('search-products'), 'search_customers_nonce' => wp_create_nonce('search-customers')));
     wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION);
     wp_enqueue_style('wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array('dashicons', 'install'), WC_VERSION);
     wp_register_script('wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup.min.js', array('jquery', 'wc-enhanced-select'), WC_VERSION);
     wp_localize_script('wc-setup', 'wc_setup_params', array('locale_info' => json_encode(include WC()->plugin_path() . '/i18n/locale-info.php')));
     if (!empty($_POST['save_step']) && isset($this->steps[$this->step]['handler'])) {
         call_user_func($this->steps[$this->step]['handler']);
     }
     ob_start();
     $this->setup_wizard_header();
     $this->setup_wizard_steps();
     $this->setup_wizard_content();
     $this->setup_wizard_footer();
     exit;
 }
Пример #2
0
 function boas_scripts()
 {
     global $boas_opt;
     //Bootstrap Customized
     wp_enqueue_script('bootstarp', BOAS_ASSETS_URI . '/js/bootstrap.min.js', array('jquery'), BOAS_VAR, FALSE);
     //Icon front
     wp_enqueue_style('font-awesome', BOAS_ASSETS_URI . '/css/font-awesome.min.css', array(), BOAS_VAR);
     wp_enqueue_style('animate.css', BOAS_ASSETS_URI . '/animate.min.css', array(), BOAS_VAR);
     //Page Loader
     //wp_enqueue_style('pageloader-css', BOAS_ASSETS_URI . '/page-loader/css/introLoader.css', array(), '1.6.2');
     //wp_enqueue_script('pageloader-js', BOAS_ASSETS_URI . '/page-loader/jquery.introLoader.pack.min.js', array('jquery'), '1.6.2', FALSE);
     //Mobile MEnu
     wp_enqueue_style('mmenu-style', BOAS_ASSETS_URI . '/css/jquery.mmenu.all.css', array(), BOAS_VAR);
     wp_enqueue_script('mmenu-js', BOAS_ASSETS_URI . '/js/jquery.mmenu.min.all.js', array('jquery'), BOAS_VAR, FALSE);
     // wp_enqueue_script('tubeplayer', BOAS_ASSETS_URI . '/js/jQuery.tubeplayer.min.js', array('jquery'), '5.3.0', FALSE);
     wp_enqueue_style('flexslider-style', BOAS_ASSETS_URI . '/css/flexslider.css', array(), BOAS_VAR);
     wp_enqueue_script('flexslider', BOAS_ASSETS_URI . '/js/jquery.flexslider-min.js', array('jquery'), BOAS_VAR, FALSE);
     //Slider script
     if (!empty($boas_opt['content_load_animae'])) {
         wp_enqueue_script('wow', BOAS_ASSETS_URI . '/js/wow.min.js', array('jquery'), BOAS_VAR, FALSE);
     }
     //wp_enqueue_script('yt', BOAS_ASSETS_URI . '/js/vapi.js', array(''), BOAS_VAR, FALSE);
     //jquery magnific popup
     //wp_enqueue_style('magnific-popup', BOAS_ASSETS_URI . '/css/magnific-popup.css', array(), '1.0.0');
     //wp_enqueue_script('jquery.magnific-popup', BOAS_ASSETS_URI . '/js/jquery.magnific-popup.min.js', array('jquery'), '1.0.0', FALSE);
     wp_enqueue_script('sticky', BOAS_ASSETS_URI . '/js/jquery.stickyNavbar.min.js', array('jquery'), BOAS_VAR, TRUE);
     wp_enqueue_style('boas-style', BOAS_ASSETS_URI . '/css/boas.css', array(), BOAS_VAR);
     wp_enqueue_script('boas-script', BOAS_ASSETS_URI . '/js/boas-script.js', array('jquery'), BOAS_VAR, TRUE);
     wp_localize_script('boas-script', 'boas_obj', array('site_url' => get_site_url(), 'ajaxUrl' => admin_url('ajax.php'), 'mm_theme' => $boas_opt['mobile_menu_theme'], 'mm_show_logo' => $boas_opt['show_logo_sx'] ? TRUE : FALSE, 'mm_logo' => $boas_opt['logo_url_sx']['url']));
 }
 public function enqueueJavascripts($pageHookname)
 {
     if ($pageHookname === $this->adminConsolePageHookname) {
         $jsDir = $this->config->getPluginUrl() . '/js';
         $version = $this->config->getVersion();
         $knockoutSuffix = '';
         $suffix = '.min';
         if (defined('WP_DEBUG') && WP_DEBUG) {
             $knockoutSuffix = '.debug';
             $suffix = '';
         }
         wp_register_script('knockout', $jsDir . '/deps/knockout-3.1.0' . $knockoutSuffix . '.js', array(), $version, false);
         wp_enqueue_script('knockout');
         wp_register_script('knockoutValidation', $jsDir . '/deps/knockout.validation' . $suffix . '.js', array('knockout'), $version, false);
         wp_enqueue_script('knockoutValidation');
         wp_register_script('autosize', $jsDir . '/deps/jquery.autosize' . $suffix . '.js', array('jquery'), $version, false);
         wp_enqueue_script('autosize');
         wp_register_script('chamameAdmin', $jsDir . '/admin' . $suffix . '.js', array('jquery', 'knockout', 'knockoutValidation', 'autosize'), $version, false);
         wp_enqueue_script('chamameAdmin');
         $ajaxUrl = str_replace(array('https:', 'http:'), '', admin_url('admin-ajax.php'));
         $token = wp_create_nonce('chamameLiveChat');
         $textDomain = $this->config->getTextDomain();
         wp_localize_script('chamameAdmin', 'chamameParams', array('ajaxUrl' => $ajaxUrl, 'loggedIn' => $this->session->isLoggedIn(), 'conversationId' => $this->session->getActiveConversationId(), 'token' => $token, 'text' => array('error' => __('Something went wrong. Please try again', $textDomain))));
     }
 }
Пример #4
0
function wplms_dashboard_template()
{
    if (!is_user_logged_in()) {
        wp_redirect(site_url());
    }
    $template = 'templates/dashboard';
    global $bp;
    if ($bp->current_component == 'dashboard') {
        wp_enqueue_style('wplms-dashboard-css', WPLMS_DASHBOARD_URL . '/css/wplms-dashboard.css', array(), '1.0');
        wp_enqueue_script('wplms-dashboard-js', WPLMS_DASHBOARD_URL . '/js/wplms-dashboard.js', array('jquery', 'jquery-ui-sortable'), '1.0');
        if (is_active_widget(false, false, 'wplms_instructor_dash_stats', true) || is_active_widget(false, false, 'wplms_dash_stats', true)) {
            wp_enqueue_script('wplms-sparkline', WPLMS_DASHBOARD_URL . '/js/jquery.sparkline.min.js', array('jquery'), true);
        }
        if (is_active_widget(false, false, 'wplms_instructor_stats', true) || is_active_widget(false, false, 'wplms_instructor_commission_stats', true) || is_active_widget(false, false, 'wplms_student_stats', true)) {
            wp_enqueue_script('wplms-raphael', WPLMS_DASHBOARD_URL . '/js/raphael-min.js', array('jquery'), true);
            wp_enqueue_script('wplms-morris', WPLMS_DASHBOARD_URL . '/js/morris.min.js', array('jquery'), true);
        }
        $translation_array = array('earnings' => __('Earnings', 'wplms-dashboard'), 'payout' => __('Payout', 'wplms-dashboard'), 'students' => __('# Students', 'wplms-dashboard'), 'saved' => __('SAVED', 'wplms-dashboard'), 'saving' => __('SAVING ...', 'wplms-dashboard'), 'stats_calculated' => __('Stats Calculated, reloading page ...', 'wplms-dashboard'));
        wp_localize_script('wplms-dashboard-js', 'wplms_dashboard_strings', $translation_array);
    }
    $located_template = apply_filters('bp_located_template', locate_template($template, false), $template);
    if ($located_template && $located_template != '') {
        bp_get_template_part(apply_filters('bp_load_template', $located_template));
    } else {
        bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/dashboard'));
    }
}
Пример #5
0
 /**
  * Field Render Function.
  *
  * Takes the vars and outputs the HTML for the field in the settings
  *
  * @since ReduxFramework 3.0.0
  */
 function render()
 {
     if (empty($this->field['min'])) {
         $this->field['min'] = 0;
     } else {
         $this->field['min'] = intval($this->field['min']);
     }
     if (empty($this->field['max'])) {
         $this->field['max'] = intval($this->field['min']) + 1;
     } else {
         $this->field['max'] = intval($this->field['max']);
     }
     if (empty($this->field['step']) || $this->field['step'] > $this->field['max']) {
         $this->field['step'] = 1;
     } else {
         $this->field['step'] = intval($this->field['step']);
     }
     if (empty($this->value) && !empty($this->field['default']) && intval($this->field['min']) >= 1) {
         $this->value = intval($this->field['default']);
     }
     if (empty($this->value) && intval($this->field['min']) >= 1) {
         $this->value = intval($this->field['min']);
     }
     if (empty($this->value)) {
         $this->value = 0;
     }
     // Extra Validation
     if ($this->value < $this->field['min']) {
         $this->value = intval($this->field['min']);
     } else {
         if ($this->value > $this->field['max']) {
             $this->value = intval($this->field['max']);
         }
     }
     $params = array('id' => '', 'min' => '', 'max' => '', 'step' => '', 'val' => '', 'default' => '');
     $params = wp_parse_args($this->field, $params);
     $params['val'] = $this->value;
     // Don't allow input edit if there's a step
     $readonly = "";
     if (isset($this->field['edit']) && $this->field['edit'] == false) {
         $readonly = ' readonly="readonly"';
     }
     // Use javascript globalization, better than any other method.
     global $wp_scripts;
     $data = $wp_scripts->get_data('redux-field-spinner-js', 'data');
     if (!empty($data)) {
         // Adding to the previous localize script object
         if (!is_array($data)) {
             $data = json_decode(str_replace('var reduxSpinners = ', '', substr($data, 0, -1)), true);
         }
         foreach ($data as $key => $value) {
             $localized_data[$key] = $value;
         }
         $wp_scripts->add_data('redux-field-spinner-js', 'data', '');
     }
     $localized_data[$this->field['id']] = $params;
     wp_localize_script('redux-field-spinner-js', 'reduxSpinners', $localized_data);
     echo '<input type="text" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . ']" id="' . $this->field['id'] . '" value="' . $this->value . '" class="mini spinner-input' . $this->field['class'] . '"' . $readonly . '/>';
     echo '<div id="' . $this->field['id'] . '-spinner" class="redux_spinner" rel="' . $this->field['id'] . '"></div>';
 }
Пример #6
0
 /**
  * Enqueue scripts and styles
  *
  * @return void
  */
 static function admin_enqueue_scripts()
 {
     $url = RWMB_CSS_URL . 'jqueryui';
     wp_register_style('jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17');
     wp_register_style('jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17');
     wp_register_style('jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_register_style('jquery-ui-slider', "{$url}/jquery.ui.slider.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_enqueue_style('jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7');
     wp_register_script('jquery-ui-timepicker', RWMB_JS_URL . 'jqueryui/jquery-ui-timepicker-addon.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7', true);
     // Load localized scripts
     $locale = str_replace('_', '-', get_locale());
     $date_path = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js';
     $time_path = 'jqueryui/timepicker-i18n/jquery-ui-timepicker-' . $locale . '.js';
     $deps = array('jquery-ui-datepicker', 'jquery-ui-timepicker');
     if (file_exists(RWMB_DIR . 'js/' . $date_path)) {
         wp_register_script('jquery-ui-datepicker-i18n', RWMB_JS_URL . $date_path, array('jquery-ui-datepicker'), '1.8.17', true);
         $deps[] = 'jquery-ui-datepicker-i18n';
     }
     if (file_exists(RWMB_DIR . 'js/' . $time_path)) {
         wp_register_script('jquery-ui-timepicker-i18n', RWMB_JS_URL . $time_path, array('jquery-ui-timepicker'), '1.8.17', true);
         $deps[] = 'jquery-ui-timepicker-i18n';
     }
     wp_enqueue_script('rwmb-datetime', RWMB_JS_URL . 'datetime.js', $deps, RWMB_VER, true);
     wp_localize_script('rwmb-datetime', 'RWMB_Datetimepicker', array('lang' => $locale));
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     $remove = array_diff(array_keys($_GET), $this->baseUrlParamNames);
     if ($remove) {
         $this->baseUrl = remove_query_arg($remove);
     } else {
         $this->baseUrl = $_SERVER['REQUEST_URI'];
     }
     parent::__construct();
     // add special filter for url fields
     $this->input->addFilter(create_function('$str', 'return "http://" == $str || "ftp://" == $str ? "" : $str;'));
     // enqueue required sripts and styles
     global $wp_styles;
     if (!is_a($wp_styles, 'WP_Styles')) {
         $wp_styles = new WP_Styles();
     }
     wp_enqueue_style('pmwi-admin-style', PMWI_ROOT_URL . '/static/css/admin.css', array(), PMWI_VERSION);
     if (version_compare(get_bloginfo('version'), '3.8-RC1') >= 0) {
         wp_enqueue_style('pmwi-admin-style-wp-3.8', PMWI_ROOT_URL . '/static/css/admin-wp-3.8.css');
     }
     wp_enqueue_script('pmwi-script', PMWI_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
     wp_enqueue_script('pmwi-admin-script', PMWI_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'pmxi-admin-script'), PMWI_VERSION);
     global $woocommerce;
     $woocommerce_witepanel_params = array('remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'wpai_woocommerce_addon_plugin'), 'remove_attribute' => __('Remove this attribute?', 'wpai_woocommerce_addon_plugin'), 'name_label' => __('Name', 'wpai_woocommerce_addon_plugin'), 'remove_label' => __('Remove', 'wpai_woocommerce_addon_plugin'), 'click_to_toggle' => __('Click to toggle', 'wpai_woocommerce_addon_plugin'), 'values_label' => __('Value(s)', 'wpai_woocommerce_addon_plugin'), 'text_attribute_tip' => __('Enter some text, or some attributes by pipe (|) separating values.', 'wpai_woocommerce_addon_plugin'), 'visible_label' => __('Visible on the product page', 'wpai_woocommerce_addon_plugin'), 'used_for_variations_label' => __('Used for variations', 'wpai_woocommerce_addon_plugin'), 'new_attribute_prompt' => __('Enter a name for the new attribute term:', 'wpai_woocommerce_addon_plugin'), 'calc_totals' => __("Calculate totals based on order items, discount amount, and shipping? Note, you will need to (optionally) calculate tax rows and cart discounts manually.", 'wpai_woocommerce_addon_plugin'), 'calc_line_taxes' => __("Calculate line taxes? This will calculate taxes based on the customers country. If no billing/shipping is set it will use the store base country.", 'wpai_woocommerce_addon_plugin'), 'copy_billing' => __("Copy billing information to shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'load_billing' => __("Load the customer's billing information? This will remove any currently entered billing information.", 'wpai_woocommerce_addon_plugin'), 'load_shipping' => __("Load the customer's shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'featured_label' => __('Featured', 'wpai_woocommerce_addon_plugin'), 'tax_or_vat' => $woocommerce->countries->tax_or_vat(), 'prices_include_tax' => get_option('woocommerce_prices_include_tax'), 'round_at_subtotal' => get_option('woocommerce_tax_round_at_subtotal'), 'meta_name' => __('Meta Name', 'wpai_woocommerce_addon_plugin'), 'meta_value' => __('Meta Value', 'wpai_woocommerce_addon_plugin'), 'no_customer_selected' => __('No customer selected', 'wpai_woocommerce_addon_plugin'), 'tax_label' => __('Tax Label:', 'wpai_woocommerce_addon_plugin'), 'compound_label' => __('Compound:', 'wpai_woocommerce_addon_plugin'), 'cart_tax_label' => __('Cart Tax:', 'wpai_woocommerce_addon_plugin'), 'shipping_tax_label' => __('Shipping Tax:', 'wpai_woocommerce_addon_plugin'), 'plugin_url' => $woocommerce->plugin_url(), 'ajax_url' => admin_url('admin-ajax.php'), 'add_order_item_nonce' => wp_create_nonce("add-order-item"), 'add_attribute_nonce' => wp_create_nonce("add-attribute"), 'calc_totals_nonce' => wp_create_nonce("calc-totals"), 'get_customer_details_nonce' => wp_create_nonce("get-customer-details"), 'search_products_nonce' => wp_create_nonce("search-products"), 'calendar_image' => $woocommerce->plugin_url() . '/assets/images/calendar.png', 'post_id' => null);
     wp_localize_script('woocommerce_writepanel', 'woocommerce_writepanel_params', $woocommerce_witepanel_params);
     wp_enqueue_style('pmwi-woo-style', $woocommerce->plugin_url() . '/assets/css/admin.css');
 }
 /**
  * Đây là function thêm script
  */
 public function tp_enqueue_scripts()
 {
     wp_enqueue_script('tpu-script-uikit', TPU_JS . 'uikit.min.js', array('jquery'), '0.1', false);
     wp_enqueue_script('tpu-script-upload', TPU_JS . 'upload.js', array('jquery'), '0.1', false);
     wp_enqueue_script('tpu-script-main', TPU_JS . 'main.js', array('jquery'), '0.1', true);
     wp_localize_script('tpu-script-main', 'tp_ajax_url', array('ajax_url' => admin_url('admin-ajax.php')));
 }
Пример #9
0
 /**
  * Styles & Scripts conditional loading
  *
  * @param
  *            $hook
  */
 public function load_styles_scripts()
 {
     $lang = get_bloginfo('language');
     $lang = explode('-', $lang);
     $lang = $lang[0];
     /*
      * Item reports Styles & Scripts
      */
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_front']) && $this->gadwp->config->options['frontend_item_reports']) {
         wp_enqueue_style('gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION);
         wp_enqueue_style('gadwp-frontend-item-reports', GADWP_URL . 'front/css/item-reports.css', null, GADWP_CURRENT_VERSION);
         $country_codes = GADWP_Tools::get_countrycodes();
         if ($this->gadwp->config->options['ga_target_geomap'] && isset($country_codes[$this->gadwp->config->options['ga_target_geomap']])) {
             $region = $this->gadwp->config->options['ga_target_geomap'];
         } else {
             $region = false;
         }
         wp_enqueue_style("wp-jquery-ui-dialog");
         if (!wp_script_is('googlejsapi')) {
             wp_register_script('googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null);
         }
         wp_enqueue_script('gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array('jquery'), GADWP_CURRENT_VERSION);
         wp_enqueue_script('gadwp-frontend-item-reports', GADWP_URL . 'common/js/reports.js', array('gadwp-nprogress', 'googlejsapi', 'jquery', 'jquery-ui-dialog'), GADWP_CURRENT_VERSION);
         /* @formatter:off */
         wp_localize_script('gadwp-frontend-item-reports', 'gadwpItemData', array('ajaxurl' => admin_url('admin-ajax.php'), 'security' => wp_create_nonce('gadwp_frontend_item_reports'), 'dateList' => array('today' => __("Today", 'google-analytics-dashboard-for-wp'), 'yesterday' => __("Yesterday", 'google-analytics-dashboard-for-wp'), '7daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 7), '14daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 14), '30daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 30), '90daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 90), '365daysAgo' => sprintf(_n("%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp'), __('One', 'google-analytics-dashboard-for-wp')), '1095daysAgo' => sprintf(_n("%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp'), __('Three', 'google-analytics-dashboard-for-wp'))), 'reportList' => array('uniquePageviews' => __("Unique Views", 'google-analytics-dashboard-for-wp'), 'users' => __("Users", 'google-analytics-dashboard-for-wp'), 'organicSearches' => __("Organic", 'google-analytics-dashboard-for-wp'), 'pageviews' => __("Page Views", 'google-analytics-dashboard-for-wp'), 'visitBounceRate' => __("Bounce Rate", 'google-analytics-dashboard-for-wp'), 'locations' => __("Location", 'google-analytics-dashboard-for-wp'), 'referrers' => __("Referrers", 'google-analytics-dashboard-for-wp'), 'searches' => __("Searches", 'google-analytics-dashboard-for-wp'), 'trafficdetails' => __("Traffic", 'google-analytics-dashboard-for-wp'), 'technologydetails' => __("Technology", 'google-analytics-dashboard-for-wp')), 'i18n' => array(__("A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp'), __("Traffic Mediums", 'google-analytics-dashboard-for-wp'), __("Visitor Type", 'google-analytics-dashboard-for-wp'), __("Search Engines", 'google-analytics-dashboard-for-wp'), __("Social Networks", 'google-analytics-dashboard-for-wp'), __("Unique Views", 'google-analytics-dashboard-for-wp'), __("Users", 'google-analytics-dashboard-for-wp'), __("Page Views", 'google-analytics-dashboard-for-wp'), __("Bounce Rate", 'google-analytics-dashboard-for-wp'), __("Organic Search", 'google-analytics-dashboard-for-wp'), __("Pages/Session", 'google-analytics-dashboard-for-wp'), __("Invalid response, more details in JavaScript Console (F12).", 'google-analytics-dashboard-for-wp'), __("Not enough data collected", 'google-analytics-dashboard-for-wp'), __("This report is unavailable", 'google-analytics-dashboard-for-wp'), __("report generated by", 'google-analytics-dashboard-for-wp'), __("This plugin needs an authorization:", 'google-analytics-dashboard-for-wp') . ' <strong>' . __("authorize the plugin", 'google-analytics-dashboard-for-wp') . '</strong>!', __("Browser", 'google-analytics-dashboard-for-wp'), __("Operating System", 'google-analytics-dashboard-for-wp'), __("Screen Resolution", 'google-analytics-dashboard-for-wp'), __("Mobile Brand", 'google-analytics-dashboard-for-wp')), 'colorVariations' => GADWP_Tools::variations($this->gadwp->config->options['ga_dash_style']), 'region' => $region, 'language' => get_bloginfo('language'), 'filter' => $_SERVER["REQUEST_URI"], 'viewList' => false, 'scope' => 'front-item'));
         /* @formatter:on */
     }
 }
Пример #10
0
 function settings_edd_license_activation($field, $echo)
 {
     wp_enqueue_script('gv-admin-edd-license', GRAVITYVIEW_URL . 'assets/js/admin-edd-license.js', array('jquery'));
     $status = trim($this->Addon->get_app_setting('license_key_status'));
     $key = trim($this->Addon->get_app_setting('license_key'));
     if (!empty($key)) {
         $response = $this->Addon->get_app_setting('license_key_response');
         $response = is_array($response) ? (object) $response : json_decode($response);
     } else {
         $response = array();
     }
     wp_localize_script('gv-admin-edd-license', 'GVGlobals', array('license_box' => $this->get_license_message($response)));
     $fields = array(array('name' => 'edd-activate', 'value' => __('Activate License', 'gravityview'), 'data-pending_text' => __('Verifying license&hellip;', 'gravityview'), 'data-edd_action' => 'activate_license', 'class' => 'button-primary'), array('name' => 'edd-deactivate', 'value' => __('Deactivate License', 'gravityview'), 'data-pending_text' => __('Deactivating license&hellip;', 'gravityview'), 'data-edd_action' => 'deactivate_license', 'class' => empty($status) ? 'button-primary hide' : 'button-primary'), array('name' => 'edd-check', 'value' => __('Check License', 'gravityview'), 'data-pending_text' => __('Verifying license&hellip;', 'gravityview'), 'title' => 'Check the license before saving it', 'data-edd_action' => 'check_license', 'class' => 'button-secondary'));
     $class = 'button gv-edd-action';
     $class .= !empty($key) && $status !== 'valid' ? '' : ' hide';
     $submit = '<div class="gv-edd-button-wrapper">';
     foreach ($fields as $field) {
         $field['type'] = 'button';
         $field['class'] = isset($field['class']) ? $field['class'] . ' ' . $class : $class;
         $field['style'] = 'margin-left: 10px;';
         $submit .= $this->Addon->settings_submit($field, $echo);
     }
     $submit .= '</div>';
     return $submit;
 }
Пример #11
0
function as_on_add_scripts()
{
    // enqueue backbonejs, underscore
    add_existed_script('backbone');
    add_existed_script('underscore');
    if (as_option('as_option_smooth_scroll', '1')) {
        // Smoothscroll
        add_script('smoothscroll', TEMPLATEURL . '/js/smoothscroll.js', array('jquery'));
    }
    // Modernize
    add_script('modernizr', TEMPLATEURL . '/js/libs/modernizr.custom.js', array('jquery'));
    // Classie
    add_script('classie', TEMPLATEURL . '/js/libs/classie.js', array('jquery'));
    if (as_option('as_option_retina_img', '1')) {
        // Retina JS
        add_script('retina', TEMPLATEURL . '/js/libs/retina.min.js', array('jquery'));
    }
    // Dialog
    add_script('dialog', TEMPLATEURL . '/js/libs/dialogFx.js', array('jquery', 'modernizr', 'classie'));
    // Front Js
    add_script('front', TEMPLATEURL . '/js/front.js', array('jquery', 'backbone', 'underscore'));
    wp_localize_script('front', 'as_globals', array('ajaxURL' => admin_url('admin-ajax.php'), 'imgURL' => get_template_directory_uri() . '/img/'));
    // Custom
    add_script('main', TEMPLATEURL . '/js/main.js', array('jquery'));
    add_script('jquery.appear', TEMPLATEURL . '/js/libs/jquery.appear.js', array('jquery', 'main'));
    //video
    add_script('video.js', TEMPLATEURL . '/js/libs/video.js', array('jquery', 'main'));
    //audio
    add_script('audio.js', TEMPLATEURL . '/js/libs/audio.js', array('jquery', 'main'));
}
 public function enqueue_scripts($data)
 {
     wp_register_script('wpml-user-language', ICL_PLUGIN_URL . '/res/js/wpml-user-language.js', array('jquery'));
     $wp_mail_script_data = array('ajax_url' => admin_url('admin-ajax.php'), 'mail' => $data['mail'], 'auto_refresh_page' => $data['auto_refresh_page'], 'nonce' => wp_create_nonce($this->nonce_name));
     wp_localize_script('wpml-user-language', 'wpml_user_language_data', $wp_mail_script_data);
     wp_enqueue_script('wpml-user-language');
 }
Пример #13
0
/**
 * Add styles and scripts
 * @return (void)
 */
function han_dwa_qa_add_styles_scripts()
{
    wp_enqueue_style('dashicons');
    wp_enqueue_style('han_dwa_qa_styles', plugin_dir_url(__FILE__) . 'assets/css/han_dwa_qa_styles.css', null, '1.0.0');
    wp_enqueue_script('han_dwa_qa_scripts', plugin_dir_url(__FILE__) . 'assets/js/han_dwa_qa_scripts.js', array('jquery'), '1.0.0');
    wp_localize_script('han_dwa_qa_scripts', 'han_dwa_qa_ajax_object', array('ajax_url' => admin_url('admin-ajax.php')));
}
function tshirt_designer_init_scripts()
{
    $tshirt_designer_sticker_size = get_option('tshirt_designer_sticker_size');
    if (empty($tshirt_designer_sticker_size)) {
        $tshirt_designer_sticker_size = intval(2 * 1000 * 1000);
    } else {
        $tshirt_designer_sticker_size = intval($tshirt_designer_sticker_size * 1000 * 1000);
    }
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-widget');
    wp_enqueue_script('jquery-ui-mouse');
    wp_enqueue_script('jquery-ui-draggable');
    wp_enqueue_script('jquery-ui-resizable');
    wp_enqueue_style('jquery-ui.css', tshirt_designer_plugin_url . 'css/jquery-ui.css');
    wp_enqueue_script('html2canvas.js', plugins_url('/js/html2canvas.js', __FILE__), array('jquery'), '1.0', false);
    //wp_enqueue_script( 'circletype.js', plugins_url( '/js/circletype.js', __FILE__ ), array('jquery'), '1.0', false);
    wp_enqueue_script('jscolor.js', plugins_url('/js/jscolor.js', __FILE__), array('jquery'), '1.0', false);
    wp_enqueue_script('tshirt_designer_js', plugins_url('/js/scripts.js', __FILE__), array('jquery'));
    wp_localize_script('tshirt_designer_js', 'tshirt_designer_ajax', array('tshirt_designer_ajaxurl' => admin_url('admin-ajax.php')));
    wp_enqueue_style('tshirt_designer_style', tshirt_designer_plugin_url . 'css/style.css');
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_script('tshirt_designer_color_picker', plugins_url('/js/color-picker.js', __FILE__), false, true);
    //ParaAdmin
    wp_enqueue_style('ParaAdmin', tshirt_designer_plugin_url . 'ParaAdmin/css/ParaAdmin.css');
    //wp_enqueue_style('ParaDashboard', tshirt_designer_plugin_url.'ParaAdmin/css/ParaDashboard.css');
    //wp_enqueue_style('ParaIcons', tshirt_designer_plugin_url.'ParaAdmin/css/ParaIcons.css');
    wp_enqueue_script('ParaAdmin', plugins_url('ParaAdmin/js/ParaAdmin.js', __FILE__), array('jquery'));
    wp_enqueue_script('plupload-handlers');
    wp_enqueue_script('sticker_upload', tshirt_designer_plugin_url . 'js/upload-sticker.js', array('jquery'));
    wp_localize_script('sticker_upload', 'sticker_upload', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('sticker_upload'), 'remove' => wp_create_nonce('sticker_remove'), 'number' => 5, 'upload_enabled' => true, 'confirmMsg' => __('Are you sure you want to delete this?'), 'plupload' => array('runtimes' => 'html5,flash,html4', 'browse_button' => 'sticker-uploader', 'container' => 'sticker-upload-container', 'file_data_name' => 'sticker_upload_file', 'max_file_size' => $tshirt_designer_sticker_size . 'b', 'url' => admin_url('admin-ajax.php') . '?action=sticker_upload&nonce=' . wp_create_nonce('sticker_allow'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => 'gif,png')), 'multipart' => true, 'urlstream_upload' => true)));
}
Пример #15
0
 /**
  * Enqueue scripts and styles
  *
  * @return    void
  */
 static function admin_enqueue_scripts()
 {
     $url = RWMB_CSS_URL . 'jqueryui';
     wp_register_style('jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17');
     wp_register_style('jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17');
     wp_register_style('jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_register_style('jquery-ui-slider', "{$url}/jquery.ui.slider.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_enqueue_style('jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7');
     $url = RWMB_JS_URL . 'jqueryui';
     wp_register_script('jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7', true);
     $deps = array('jquery-ui-timepicker');
     $locale = str_replace('_', '-', get_locale());
     $timepicker_locale_js_url = '';
     if (file_exists(RWMB_DIR . "js/jqueryui/timepicker-i18n/jquery-ui-timepicker-{$locale}.js")) {
         $timepicker_locale_js_url = "{$url}/timepicker-i18n/jquery-ui-timepicker-{$locale}.js";
     } elseif (strlen($locale) > 2 && file_exists(RWMB_DIR . 'js/jqueryui/timepicker-i18n/jquery-ui-timepicker-' . substr($locale, 0, 2) . '.js')) {
         $timepicker_locale_js_url = "{$url}/timepicker-i18n/jquery-ui-timepicker-" . substr($locale, 0, 2) . '.js';
     }
     if ($timepicker_locale_js_url) {
         wp_register_script('jquery-ui-timepicker-i18n', $timepicker_locale_js_url, array('jquery-ui-timepicker'), '0.9.7', true);
         $deps = array('jquery-ui-timepicker-i18n');
     }
     wp_enqueue_script('rwmb-time', RWMB_JS_URL . 'time.js', $deps, RWMB_VER, true);
     wp_localize_script('rwmb-time', 'RWMB_Timepicker', array('lang' => $locale));
 }
 public function route()
 {
     wp_enqueue_script('wpProQuiz_front_javascript', plugins_url('js/wpProQuiz_front' . (WPPROQUIZ_DEV ? '' : '.min') . '.js', WPPROQUIZ_FILE), array('jquery', 'jquery-ui-sortable'), WPPROQUIZ_VERSION);
     wp_localize_script('wpProQuiz_front_javascript', 'WpProQuizGlobal', array('ajaxurl' => admin_url('admin-ajax.php'), 'loadData' => __('Loading', 'wp-pro-quiz'), 'questionNotSolved' => __('You must answer this question.', 'wp-pro-quiz'), 'questionsNotSolved' => __('You must answer all questions before you can completed the quiz.', 'wp-pro-quiz'), 'fieldsNotFilled' => __('All fields have to be filled.', 'wp-pro-quiz')));
     wp_enqueue_style('wpProQuiz_front_style', plugins_url('css/wpProQuiz_front' . (WPPROQUIZ_DEV ? '' : '.min') . '.css', WPPROQUIZ_FILE), array(), WPPROQUIZ_VERSION);
     $this->showAction($_GET['id']);
 }
 /**
  * Show the tag cloud
  */
 public function show_tag_filter($shortcode_atts)
 {
     if (isset($shortcode_atts['show_tags']) && ($shortcode_atts['show_tags'] === false || (string) $shortcode_atts['show_tags'] == 'false')) {
         return;
     }
     if (wp_count_terms('job_listing_tag') == 0) {
         return;
     }
     wp_register_script('wp-job-manager-ajax-tag-filters', JOB_MANAGER_TAGS_PLUGIN_URL . '/assets/js/tag-filter.js', array('jquery'), '1.0', true);
     $args_data = array('orderby' => 'count', 'order' => 'DESC');
     $jobs_tags_data = get_terms('job_listing_tag', $args_data);
     $queried_object = get_queried_object();
     foreach ($jobs_tags_data as $key => $jobs_tag_data) {
         if ($jobs_tag_data->count > 1) {
             $jobs_txt = 'jobs';
             $font_size = 2;
         } else {
             $jobs_txt = 'job';
             $font_size = 1;
         }
         //if($queried_object->term_id == $jobs_tag_data->term_id){ $active_class = 'activee'; }
         $anchor_data[] = '<a href="#" id="test_' . $key . '" "class="tag-link-' . $jobs_tag_data->term_id . ' ' . $active_class . ' show_bg_tag" title="' . $jobs_tag_data->count . ' ' . $jobs_txt . '" style="font-size: ' . $font_size . 'em;">' . $jobs_tag_data->name . '</a>';
     }
     $anchor_tag_data = array('anchor_tag_data' => $anchor_data);
     //anchor_tag_data
     wp_localize_script('wp-job-manager-ajax-tag-filters', 'anchor_tag_data_object', $anchor_tag_data);
     wp_enqueue_script('wp-job-manager-ajax-tag-filters', JOB_MANAGER_TAGS_PLUGIN_URL . '/assets/js/tag-filter.js', array('jquery'), '1.0', true);
     echo '<div class="filter_wide filter_by_tag">' . __('Filter by tag:', 'wp-job-manager-tags') . ' <span class="filter_by_tag_cloud"></span></div>';
 }
Пример #18
0
function et_vertex_load_scripts_styles()
{
    global $wp_styles;
    $template_dir = get_template_directory_uri();
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_enqueue_script('superfish', $template_dir . '/js/superfish.js', array('jquery'), '1.0', true);
    wp_enqueue_script('waypoints', $template_dir . '/js/waypoints.min.js', array('jquery'), '1.0', true);
    wp_enqueue_script('vertex-custom-script', $template_dir . '/js/custom.js', array('jquery'), '1.0', true);
    wp_localize_script('vertex-custom-script', 'et_custom', array('mobile_nav_text' => esc_html__('Navigation Menu', 'Vertex')));
    $et_gf_enqueue_fonts = array();
    $et_gf_heading_font = sanitize_text_field(et_get_option('heading_font', 'none'));
    $et_gf_body_font = sanitize_text_field(et_get_option('body_font', 'none'));
    if ('none' != $et_gf_heading_font) {
        $et_gf_enqueue_fonts[] = $et_gf_heading_font;
    }
    if ('none' != $et_gf_body_font) {
        $et_gf_enqueue_fonts[] = $et_gf_body_font;
    }
    if (!empty($et_gf_enqueue_fonts)) {
        et_gf_enqueue_fonts($et_gf_enqueue_fonts);
    }
    /*
     * Loads the main stylesheet.
     */
    wp_enqueue_style('vertex-style', get_stylesheet_uri());
}
 public function enqueue_static()
 {
     wp_enqueue_style('fw-builder-' . $this->get_builder_type() . '-item-' . $this->get_type(), $this->get_uri('/static/css/styles.css'));
     wp_enqueue_script('fw-builder-' . $this->get_builder_type() . '-item-' . $this->get_type(), $this->get_uri('/static/js/scripts.js'), array('fw-events'), false, true);
     wp_localize_script('fw-builder-' . $this->get_builder_type() . '-item-' . $this->get_type(), 'fw_form_builder_item_type_' . $this->get_type(), array('l10n' => array('item_title' => __('Dropdown', 'fw'), 'label' => __('Label', 'fw'), 'toggle_required' => __('Toggle mandatory field', 'fw'), 'edit' => __('Edit', 'fw'), 'delete' => __('Delete', 'fw'), 'edit_label' => __('Edit Label', 'fw')), 'options' => $this->get_options(), 'defaults' => array('type' => $this->get_type(), 'options' => fw_get_options_values_from_input($this->get_options(), array()))));
     fw()->backend->enqueue_options_static($this->get_options());
 }
Пример #20
0
 function md_add_footer()
 {
     // Drone JS
     wp_register_script('drone', get_template_directory_uri() . '/js/drone.js');
     wp_enqueue_script('drone');
     wp_localize_script('drone', 'mdajaxurl', array('ajax' => admin_url('admin-ajax.php')));
 }
Пример #21
0
 function emg_load_wp_enqueue()
 {
     if (get_post_type(get_the_ID()) == 'easymediagallery') {
         $eparams = array('pcnt' => emg_pcnt(), 'psts' => get_post_status(get_the_ID()), 'pcurtp' => get_post_meta(get_the_ID(), 'easmedia_metabox_media_type', true));
         wp_localize_script('cpscript', 'easyMeta', $eparams);
         if (EMG_WP_VER == "g35") {
             wp_enqueue_media();
         }
         wp_enqueue_script('jquery-multi-sel');
         wp_enqueue_style('jquery-multiselect-css');
         wp_enqueue_style('jquery-ui-themes-redmond');
         wp_enqueue_style('emg-bootstrap-css');
         wp_enqueue_script('jquery-ui');
         wp_enqueue_script('jquery-effects-highlight');
         wp_enqueue_script('easymedia-jplayer-js', plugins_url('js/jplayer/jquery.jplayer.min.js', __FILE__));
         wp_enqueue_script('cpscript');
         wp_enqueue_script('jquery-i-button', plugins_url('js/jquery/jquery.ibutton.js', __FILE__));
         wp_enqueue_style('metabox-ibuttoneditor', plugins_url('css/ibutton.css', __FILE__), false, EASYMEDIA_VERSION);
         wp_enqueue_style('easymedia-jplayer-css', plugins_url('css/jplayer/skin/pink.flag/jplayer.pink.flag.css', __FILE__), false, EASYMEDIA_VERSION);
         wp_enqueue_style('jquery-messi-css');
         wp_enqueue_script('jquery-messi-js');
         wp_enqueue_script('emg-bootstrap-js');
         wp_enqueue_script('easymedia-metascript', plugins_url('functions/metabox/metabox.js', __FILE__));
         // @since 1.3.10 >
         if (easy_get_option('easymedia_disen_autoupdt') != '1' && is_admin()) {
             add_action('admin_notices', 'easmedia_update_notify');
         }
     }
 }
Пример #22
0
 public function filter_the_content($content)
 {
     $ww_problem = false;
     if (is_page('webwork')) {
         $ww_problem = true;
     } else {
         $ww_problem = get_query_var('ww_problem');
     }
     if ($ww_problem) {
         $content = '<div id="webwork-app"></div>';
         wp_enqueue_script('webwork-app', plugins_url() . '/webwork/build/index.js');
         $route_base = get_option('home');
         $route_base = preg_replace('|https?://[^/]+/|', '', $route_base);
         // @todo Centralize this logic.
         $main_site_url = get_blog_option(1, 'home');
         $rest_api_endpoint = trailingslashit($main_site_url) . 'wp-json/webwork/v1/';
         // @todo Abstract.
         $post_data = null;
         $ww_problem_text = '';
         if (!empty($_GET['post_data_key'])) {
             $post_data = get_blog_option(1, $_GET['post_data_key']);
             $ww_problem_text = base64_decode($post_data['pg_object']);
         }
         // @todo This is awful.
         $clients = get_blog_option(1, 'webwork_clients');
         $remote_course_url = array_search(get_current_blog_id(), $clients);
         wp_localize_script('webwork-app', 'WWData', array('problem_id' => $ww_problem, 'problem_text' => $ww_problem_text, 'remote_course_url' => $remote_course_url, 'rest_api_nonce' => wp_create_nonce('wp_rest'), 'rest_api_endpoint' => $rest_api_endpoint, 'route_base' => trailingslashit($route_base) . 'webwork/', 'user_can_ask_question' => is_user_logged_in(), 'user_can_post_response' => is_user_logged_in(), 'user_can_vote' => is_user_logged_in()));
         wp_enqueue_style('webwork-app', plugins_url() . '/webwork/assets/css/app.css');
         wp_register_script('webwork-mathjax-loader', WEBWORK_PLUGIN_URL . '/assets/js/webwork-mathjax-loader.js');
         $webwork_mathjax_loader_strings = array('mathjax_src' => esc_url('https://cdn.mathjax.org/mathjax/latest/unpacked/MathJax.js?config=TeX-MML-AM_HTMLorMML-full'));
         wp_localize_script('webwork-mathjax-loader', 'WeBWorK_MathJax', $webwork_mathjax_loader_strings);
         wp_enqueue_script('webwork-mathjax-loader');
     }
     return $content;
 }
Пример #23
0
 public function print_scripts()
 {
     if (!isset($_REQUEST['page'])) {
         return;
     }
     $this->add_existed_script('jquery');
     $this->add_existed_script('plupload');
     //add de sort category
     $this->add_existed_script('jquery-ui-sortable');
     $this->add_script('lib-nested-sortable', ae_get_url() . '/assets/js/jquery.nestedSortable.js', array('jquery', 'jquery-ui-sortable'));
     // tam thoi add de xai
     $this->add_script('jquery-validator', ae_get_url() . '/assets/js/jquery.validate.min.js', 'jquery');
     $this->add_script('ae-colorpicker', ae_get_url() . '/assets/js/colorpicker.js', array('jquery'));
     $this->add_script('marionette', ae_get_url() . '/assets/js/marionette.js', array('jquery', 'underscore', 'backbone'));
     // control backend user list
     $this->add_script('gmap', ae_get_url() . '/assets/js/gmap.js', array('et-googlemap-api'));
     // ae core js appengine
     $this->add_script('appengine', ae_get_url() . '/assets/js/appengine.js', array('jquery', 'underscore', 'backbone', 'marionette', 'plupload', 'ae-colorpicker'));
     // control backend user list
     $this->add_script('backend-user', ae_get_url() . '/assets/js/user-list.js', array('appengine'));
     // control backend order list
     $this->add_script('order-list', ae_get_url() . '/assets/js/payment-list.js', array('appengine'));
     //  option settings and save
     $this->add_script('option-view', ae_get_url() . '/assets/js/option-view.js', array('appengine'));
     // control option translate
     $this->add_script('language-view', ae_get_url() . '/assets/js/language-view.js', array('appengine', 'option-view'));
     // control pack view add delete update pack
     $this->add_script('pack-view', ae_get_url() . '/assets/js/pack-view.js', array('appengine', 'option-view'));
     // backend js it should be separate by theme
     $this->add_script('backend', ae_get_url() . '/assets/js/backend.js', array('appengine'));
     wp_localize_script('appengine', 'ae_globals', array('ajaxURL' => admin_url('admin-ajax.php'), 'imgURL' => ae_get_url() . '/assets/img/', 'jsURL' => ae_get_url() . '/assets/js/', 'themeImgURL' => get_template_directory_uri() . '/img/', 'loadingImg' => '<img class="loading loading-wheel" src="' . ae_get_url() . '/assets/img/loading.gif" alt="' . __('Loading...', 'aecore-class-ae-page-backend') . '">', 'loading' => __('Loading', 'aecore-class-ae-page-backend'), 'texts' => array('limit_category_level' => __("Categories' level is limited to 3", 'aecore-class-ae-page-backend')), 'ae_is_mobile' => et_load_mobile() ? 1 : 0, 'plupload_config' => array('max_file_size' => '3mb', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Image Files', 'aecore-class-ae-page-backend'), 'extensions' => 'jpg,jpeg,gif,png')))));
 }
Пример #24
0
/**
 * Plugin Name: WP-API Client JS
 */
function json_api_client_js()
{
    $scripts = wp_scripts();
    $src = plugins_url('build/js/wp-api.js', __FILE__);
    if (isset($scripts->registered['wp-api'])) {
        $scripts->registered['wp-api']->src = $src;
    } else {
        wp_register_script('wp-api', $src, array('jquery', 'underscore', 'backbone'), '1.0', true);
    }
    /**
     * @var \WP_REST_Server $wp_rest_server
     */
    global $wp_rest_server;
    if (empty($wp_rest_server)) {
        /** This filter is documented in wp-includes/rest-api.php */
        $wp_rest_server_class = apply_filters('wp_rest_server_class', 'WP_REST_Server');
        $wp_rest_server = new $wp_rest_server_class();
        /** This filter is documented in wp-includes/rest-api.php */
        do_action('rest_api_init', $wp_rest_server);
    }
    $schema_request = new WP_REST_Request('GET', '/wp/v2');
    $schema_response = $wp_rest_server->dispatch($schema_request);
    $schema = null;
    if (!$schema_response->is_error()) {
        $schema = $schema_response->get_data();
    }
    $settings = array('root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'), 'versionString' => 'wp/v2/', 'schema' => $schema);
    wp_localize_script('wp-api', 'wpApiSettings', $settings);
}
Пример #25
0
/**
 * Pass data to Theme Javascript
 *
 * @since 1.0
 * @access public
 * @return void
 */
function hoot_localize_theme_script()
{
    $hootdata = array();
    if (!empty($hootdata)) {
        wp_localize_script('hoot-theme', 'hootData', $hootdata);
    }
}
Пример #26
0
function cg_register_debug_js()
{
    global $cg_live_preview;
    if (!is_admin()) {
        //Loading from unminified source
        wp_enqueue_script('cg_waypoints', CG_JS . '/dist/waypoints.min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_bootstrap_js', CG_BOOTSTRAP_JS . '/bootstrap.min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_magnific-popup', CG_JS . '/src/cond/jquery.magnific-popup.min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_modernizr', CG_JS . '/src/cond/modernizr.custom.min.js', array('jquery'), '', false);
        wp_enqueue_script('cg_ticker', CG_JS . '/src/cond/inewsticker.js', array('jquery'), '', true);
        wp_enqueue_script('cg_quickview', CG_JS . '/src/cond/cg_quickview.js', array('jquery'), '', true);
        wp_localize_script('cg_quickview', 'cg_ajax', array('cg_ajax_url' => admin_url('admin-ajax.php')));
        wp_enqueue_script('cg_chosen_js', CG_JS . '/src/plugins/chosen.js', array('jquery'), '', true);
        wp_enqueue_script('cg_classie_js', CG_JS . '/src/plugins/classie.js', array('jquery'), '', true);
        wp_enqueue_script('cg_uisearch_js', CG_JS . '/src/plugins/uisearch.js', array('jquery'), '', true);
        wp_enqueue_script('cg_bootstrap_select_js', CG_JS . '/src/plugins/bootstrap-select.js', array('jquery'), '', true);
        wp_enqueue_script('cg_owlcarousel', CG_JS . '/src/cond/owl.carousel.min.js', array('jquery'), '', false);
        wp_enqueue_script('cg_jrespond', CG_JS . '/src/plugins/jRespond.min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_qtip', CG_JS . '/src/plugins/jquery.qtip.min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_tipr', CG_JS . '/src/plugins/tipr.min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_cookie', CG_JS . '/src/plugins/cookie.js', array('jquery'), '', true);
        wp_enqueue_script('cg_meanmenu', CG_JS . '/src/plugins/jquery.meanmenu.min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_flexslider', CG_JS . '/src/plugins/jquery.flexslider-min.js', array('jquery'), '', true);
        wp_enqueue_script('cg_skrollr', CG_JS . '/src/plugins/skrollr.js', array('jquery'), '', true);
        if (isset($cg_live_preview)) {
            wp_enqueue_script('cg-dynamicjs', CG_JS . '/src/cond/capdynamic.php', array(), '', true);
            wp_enqueue_script('cg-jqueryui', CG_JS . '/src/cond/jquery-ui.min.js', array(), '', true);
            wp_enqueue_script('cg-livepreviewjs', CG_JS . '/src/cond/livepreview.js', array(), '', true);
        }
        // Full source commerceugurus.js call
        wp_enqueue_script('cg_commercegurus_js', CG_JS . '/src/commercegurus.js', array('jquery'), '', true);
    }
}
function theme_front_enqueue_script()
{
    wp_enqueue_script('jquery');
    wp_enqueue_script("jquery-migrate");
    wp_enqueue_script('jquery-ui-core');
    wp_register_script('SFSIjqueryModernizr', SFSI_PLUGURL . 'js/shuffle/modernizr.custom.min.js', array('jquery'), '', true);
    wp_enqueue_script("SFSIjqueryModernizr");
    wp_register_script('SFSIjqueryShuffle', SFSI_PLUGURL . 'js/shuffle/jquery.shuffle.min.js', array('jquery'), '', true);
    wp_enqueue_script("SFSIjqueryShuffle");
    wp_register_script('SFSIjqueryrandom-shuffle', SFSI_PLUGURL . 'js/shuffle/random-shuffle-min.js', array('jquery'), '', true);
    wp_enqueue_script("SFSIjqueryrandom-shuffle");
    wp_register_script('SFSICustomJs', SFSI_PLUGURL . 'js/custom.js', array('jquery'), '', true);
    wp_enqueue_script("SFSICustomJs");
    /* end cusotm js */
    /* initilaize the ajax url in javascript */
    wp_localize_script('SFSICustomJs', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php')));
    wp_localize_script('SFSICustomJs', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php'), 'plugin_url' => SFSI_PLUGURL));
    /* include CSS for front-end and backend  */
    wp_enqueue_style("SFSImainCss", SFSI_PLUGURL . 'css/sfsi-style.css');
    //including floating option css
    $option5 = unserialize(get_option('sfsi_section5_options', false));
    if ($option5['sfsi_disable_floaticons'] == 'yes') {
        wp_enqueue_style("disable_sfsi", SFSI_PLUGURL . 'css/disable_sfsi.css');
    }
}
Пример #28
0
function wen_business_custom_customize_enqueue_scripts()
{
    wp_register_script('wen_business_customizer_button', get_template_directory_uri() . '/assets/js/customizer-button.js', array('customize-controls'), '20130508', true);
    $data = array('updrade_button_text' => __('Upgrade To Pro', 'wen-business'), 'updrade_button_link' => esc_url('http://catchthemes.com/themes/wen-business-pro'));
    wp_localize_script('wen_business_customizer_button', 'WEN_Business_Customizer_Object', $data);
    wp_enqueue_script('wen_business_customizer_button');
}
Пример #29
0
 /**
  * Send data to Mixpanel by enqueuing the analytics JS file.
  * @return
  */
 public function send()
 {
     // Enqueue analytics Javascript.
     wp_enqueue_script('analytics', WYSIJA_URL . 'js/analytics.js', array(), WYSIJA::get_version());
     // Make analytics data available in JS.
     wp_localize_script('analytics', 'analytics_data', $this->analytics_data);
 }
Пример #30
0
 function add_admin_scripts()
 {
     $var = "{$this->_var}-setup-tab-script";
     $translations = array('confirm_dialog_text' => __('Using the "Use the Layouts and Views included with the theme" option will cause all of your current Layout and Views to be removed and replaced with the ones from the theme. Please confirm that you wish to do this.', 'it-l10n-Builder-Paige'));
     wp_enqueue_script($var, "{$this->_parent->_plugin_url}/js/setup.js", array('jquery'));
     wp_localize_script($var, 'builder_setup_tab', $translations);
 }