Ejemplo n.º 1
0
/**
 * Load admin scripts
 *
 * @since       1.0.0
 * @param       string $hook The hook for the current page
 * @return      void
 */
function edd_wallet_admin_scripts($hook)
{
    if (!apply_filters('edd_load_admin_scripts', edd_is_admin_page(), $hook)) {
        return;
    }
    // Use minified libraries if SCRIPT_DEBUG is turned off
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    wp_enqueue_style('edd-wallet', EDD_WALLET_URL . 'assets/css/admin' . $suffix . '.css', EDD_WALLET_VER);
    wp_enqueue_script('edd-wallet', EDD_WALLET_URL . 'assets/js/admin' . $suffix . '.js', array('jquery'), EDD_WALLET_VER);
    wp_localize_script('edd-wallet', 'edd_wallet_vars', array('type_to_search' => __('Type to search levels', 'edd-wallet')));
}
Ejemplo n.º 2
0
/**
 * Load Admin Scripts
 *
 * Enqueues the required admin scripts.
 *
 * @since 1.0
 * @global $post
 * @param string $hook Page hook
 * @return void
 */
function edd_load_admin_scripts($hook)
{
    if (!apply_filters('edd_load_admin_scripts', edd_is_admin_page(), $hook)) {
        return;
    }
    global $wp_version, $post;
    $js_dir = EDD_PLUGIN_URL . 'assets/js/';
    $css_dir = EDD_PLUGIN_URL . 'assets/css/';
    // Use minified libraries if SCRIPT_DEBUG is turned off
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    // These have to be global
    wp_register_style('jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), EDD_VERSION);
    wp_enqueue_style('jquery-chosen');
    wp_register_script('jquery-chosen', $js_dir . 'chosen.jquery' . $suffix . '.js', array('jquery'), EDD_VERSION);
    wp_enqueue_script('jquery-chosen');
    wp_register_script('edd-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array('jquery'), EDD_VERSION, false);
    wp_enqueue_script('edd-admin-scripts');
    wp_localize_script('edd-admin-scripts', 'edd_vars', array('post_id' => isset($post->ID) ? $post->ID : null, 'edd_version' => EDD_VERSION, 'add_new_download' => __('Add New Download', 'edd'), 'use_this_file' => __('Use This File', 'edd'), 'quick_edit_warning' => __('Sorry, not available for variable priced products.', 'edd'), 'delete_payment' => __('Are you sure you wish to delete this payment?', 'edd'), 'delete_payment_note' => __('Are you sure you wish to delete this note?', 'edd'), 'delete_tax_rate' => __('Are you sure you wish to delete this tax rate?', 'edd'), 'revoke_api_key' => __('Are you sure you wish to revoke this API key?', 'edd'), 'regenerate_api_key' => __('Are you sure you wish to regenerate this API key?', 'edd'), 'resend_receipt' => __('Are you sure you wish to resend the purchase receipt?', 'edd'), 'copy_download_link_text' => __('Copy these links to your clipboard and give them to your customer', 'edd'), 'delete_payment_download' => sprintf(__('Are you sure you wish to delete this %s?', 'edd'), edd_get_label_singular()), 'one_price_min' => __('You must have at least one price', 'edd'), 'one_field_min' => __('You must have at least one field', 'edd'), 'one_download_min' => __('Payments must contain at least one item', 'edd'), 'one_option' => sprintf(__('Choose a %s', 'edd'), edd_get_label_singular()), 'one_or_more_option' => sprintf(__('Choose one or more %s', 'edd'), edd_get_label_plural()), 'numeric_item_price' => __('Item price must be numeric', 'edd'), 'numeric_quantity' => __('Quantity must be numeric', 'edd'), 'currency' => edd_get_currency(), 'currency_sign' => edd_currency_filter(''), 'currency_pos' => edd_get_option('currency_position', 'before'), 'currency_decimals' => edd_currency_decimal_filter(), 'new_media_ui' => apply_filters('edd_use_35_media_ui', 1), 'remove_text' => __('Remove', 'edd'), 'type_to_search' => sprintf(__('Type to search %s', 'edd'), edd_get_label_plural()), 'quantities_enabled' => edd_item_quantities_enabled()));
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_script('wp-color-picker');
    wp_register_style('colorbox', $css_dir . 'colorbox' . $suffix . '.css', array(), '1.3.20');
    wp_enqueue_style('colorbox');
    wp_register_script('colorbox', $js_dir . 'jquery.colorbox-min.js', array('jquery'), '1.3.20');
    wp_enqueue_script('colorbox');
    if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) {
        //call for new media manager
        wp_enqueue_media();
    }
    wp_register_script('jquery-flot', $js_dir . 'jquery.flot' . $suffix . '.js');
    wp_enqueue_script('jquery-flot');
    wp_enqueue_script('jquery-ui-datepicker');
    wp_enqueue_script('jquery-ui-dialog');
    $ui_style = 'classic' == get_user_option('admin_color') ? 'classic' : 'fresh';
    wp_register_style('jquery-ui-css', $css_dir . 'jquery-ui-' . $ui_style . $suffix . '.css');
    wp_enqueue_style('jquery-ui-css');
    wp_enqueue_script('media-upload');
    wp_enqueue_script('thickbox');
    wp_enqueue_style('thickbox');
    wp_register_style('edd-admin', $css_dir . 'edd-admin' . $suffix . '.css', EDD_VERSION);
    wp_enqueue_style('edd-admin');
}
Ejemplo n.º 3
0
/**
 * Load Admin Scripts
 *
 * Enqueues the required admin scripts.
 *
 * @since 1.0
 * @global $post
 * @param string $hook Page hook
 * @return void
 */
function edd_load_admin_scripts($hook)
{
    if (!apply_filters('edd_load_admin_scripts', edd_is_admin_page(), $hook)) {
        return;
    }
    global $post;
    $js_dir = EDD_PLUGIN_URL . 'assets/js/';
    $css_dir = EDD_PLUGIN_URL . 'assets/css/';
    // Use minified libraries if SCRIPT_DEBUG is turned off
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    // These have to be global
    wp_register_style('jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), EDD_VERSION);
    wp_enqueue_style('jquery-chosen');
    wp_register_script('jquery-chosen', $js_dir . 'chosen.jquery' . $suffix . '.js', array('jquery'), EDD_VERSION);
    wp_enqueue_script('jquery-chosen');
    wp_enqueue_script('jquery-form');
    $admin_deps = array();
    if (!edd_is_admin_page($hook, 'edit') && !edd_is_admin_page($hook, 'new')) {
        $admin_deps = array('jquery', 'jquery-form', 'inline-edit-post');
    } else {
        $admin_deps = array('jquery', 'jquery-form');
    }
    wp_register_script('edd-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', $admin_deps, EDD_VERSION, false);
    wp_enqueue_script('edd-admin-scripts');
    wp_localize_script('edd-admin-scripts', 'edd_vars', array('post_id' => isset($post->ID) ? $post->ID : null, 'edd_version' => EDD_VERSION, 'add_new_download' => __('Add New Download', 'easy-digital-downloads'), 'use_this_file' => __('Use This File', 'easy-digital-downloads'), 'quick_edit_warning' => __('Sorry, not available for variable priced products.', 'easy-digital-downloads'), 'delete_payment' => __('Are you sure you wish to delete this payment?', 'easy-digital-downloads'), 'delete_payment_note' => __('Are you sure you wish to delete this note?', 'easy-digital-downloads'), 'delete_tax_rate' => __('Are you sure you wish to delete this tax rate?', 'easy-digital-downloads'), 'revoke_api_key' => __('Are you sure you wish to revoke this API key?', 'easy-digital-downloads'), 'regenerate_api_key' => __('Are you sure you wish to regenerate this API key?', 'easy-digital-downloads'), 'resend_receipt' => __('Are you sure you wish to resend the purchase receipt?', 'easy-digital-downloads'), 'copy_download_link_text' => __('Copy these links to your clipboard and give them to your customer', 'easy-digital-downloads'), 'delete_payment_download' => sprintf(__('Are you sure you wish to delete this %s?', 'easy-digital-downloads'), edd_get_label_singular()), 'one_price_min' => __('You must have at least one price', 'easy-digital-downloads'), 'one_field_min' => __('You must have at least one field', 'easy-digital-downloads'), 'one_download_min' => __('Payments must contain at least one item', 'easy-digital-downloads'), 'one_option' => sprintf(__('Choose a %s', 'easy-digital-downloads'), edd_get_label_singular()), 'one_or_more_option' => sprintf(__('Choose one or more %s', 'easy-digital-downloads'), edd_get_label_plural()), 'numeric_item_price' => __('Item price must be numeric', 'easy-digital-downloads'), 'numeric_quantity' => __('Quantity must be numeric', 'easy-digital-downloads'), 'currency' => edd_get_currency(), 'currency_sign' => edd_currency_filter(''), 'currency_pos' => edd_get_option('currency_position', 'before'), 'currency_decimals' => edd_currency_decimal_filter(), 'new_media_ui' => apply_filters('edd_use_35_media_ui', 1), 'remove_text' => __('Remove', 'easy-digital-downloads'), 'type_to_search' => sprintf(__('Type to search %s', 'easy-digital-downloads'), edd_get_label_plural()), 'quantities_enabled' => edd_item_quantities_enabled(), 'batch_export_no_class' => __('You must choose a method.', 'easy-digital-downloads'), 'batch_export_no_reqs' => __('Required fields not completed.', 'easy-digital-downloads'), 'reset_stats_warn' => __('Are you sure you want to reset your store? This process is <strong><em>not reversible</em></strong>. Please be sure you have a recent backup.', 'easy-digital-downloads'), 'search_placeholder' => sprintf(__('Type to search all %s', 'easy-digital-downloads'), edd_get_label_plural()), 'search_placeholder_customer' => __('Type to search all Customers', 'easy-digital-downloads'), 'search_placeholder_country' => __('Type to search all Countries', 'easy-digital-downloads'), 'search_placeholder_state' => __('Type to search all States/Provinces', 'easy-digital-downloads'), 'unsupported_browser' => __('We are sorry but your browser is not compatible with this kind of file upload. Please upgrade your browser.', 'easy-digital-downloads')));
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_script('wp-color-picker');
    wp_register_style('colorbox', $css_dir . 'colorbox' . $suffix . '.css', array(), '1.3.20');
    wp_enqueue_style('colorbox');
    wp_register_script('colorbox', $js_dir . 'jquery.colorbox-min.js', array('jquery'), '1.3.20');
    wp_enqueue_script('colorbox');
    //call for media manager
    wp_enqueue_media();
    wp_register_script('jquery-flot', $js_dir . 'jquery.flot' . $suffix . '.js');
    wp_enqueue_script('jquery-flot');
    wp_enqueue_script('jquery-ui-datepicker');
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_script('jquery-ui-tooltip');
    $ui_style = 'classic' == get_user_option('admin_color') ? 'classic' : 'fresh';
    wp_register_style('jquery-ui-css', $css_dir . 'jquery-ui-' . $ui_style . $suffix . '.css');
    wp_enqueue_style('jquery-ui-css');
    wp_enqueue_script('media-upload');
    wp_enqueue_script('thickbox');
    wp_enqueue_style('thickbox');
    wp_register_style('edd-admin', $css_dir . 'edd-admin' . $suffix . '.css', EDD_VERSION);
    wp_enqueue_style('edd-admin');
}