Localize scripts
This commit is contained in:
@@ -437,7 +437,7 @@ if ( !function_exists( 'sportspress_get_equation_selector' ) ) {
|
||||
$options[ __( 'Constants', 'sportspress' ) ] = (array) $constants;
|
||||
|
||||
?>
|
||||
<select name="sp_equation[]" data-remove-text="<?php _e( 'Remove', 'sportspress' ); ?>">
|
||||
<select name="sp_equation[]">
|
||||
<option value="">(<?php _e( 'Select', 'sportspress' ); ?>)</option>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<?php
|
||||
function sportspress_admin_enqueue_scripts() {
|
||||
wp_register_style( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL . 'assets/css/admin.css', array(), time() );
|
||||
wp_enqueue_style( 'sportspress-admin');
|
||||
wp_enqueue_style( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL . 'assets/css/admin.css', array(), time() );
|
||||
|
||||
wp_enqueue_script( 'jquery' );
|
||||
wp_enqueue_script( 'google-maps', 'http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places' );
|
||||
wp_enqueue_script( 'jquery-locationpicker', SPORTSPRESS_PLUGIN_URL .'/assets/js/locationpicker.jquery.js', array( 'jquery' ), '0.1.6', true );
|
||||
wp_enqueue_script( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL .'/assets/js/admin.js', array( 'jquery' ), time(), true );
|
||||
wp_localize_script( 'sportspress-admin', 'localized_strings', array(
|
||||
'remove_text' => __( 'Remove', 'sportspress' )
|
||||
) );
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'sportspress_admin_enqueue_scripts' );
|
||||
|
||||
@@ -15,24 +15,24 @@ function sportspress_plugins_loaded() {
|
||||
// Add image sizes
|
||||
if ( function_exists( 'add_image_size' ) ) {
|
||||
|
||||
// Header (1680 width minus 15 for scrollbar)
|
||||
add_image_size( 'sportspress-header', 1665, 705, true );
|
||||
// Header
|
||||
add_image_size( 'sportspress-header', 1600, 700, true );
|
||||
|
||||
// Standard (4:3)
|
||||
add_image_size( 'sportspress-standard', 800, 600, true );
|
||||
add_image_size( 'sportspress-standard-thumbnail', 400, 300, true );
|
||||
// Standard (3:2)
|
||||
add_image_size( 'sportspress-standard', 637, 425, true );
|
||||
add_image_size( 'sportspress-standard-thumbnail', 303, 202, true );
|
||||
|
||||
// Wide (16:9)
|
||||
add_image_size( 'sportspress-wide', 800, 450, true );
|
||||
add_image_size( 'sportspress-wide-thumbnail', 400, 225, true );
|
||||
add_image_size( 'sportspress-wide', 637, 358, true );
|
||||
add_image_size( 'sportspress-wide-thumbnail', 303, 170, true );
|
||||
|
||||
// Square (1:1)
|
||||
add_image_size( 'sportspress-square', 612, 612, true );
|
||||
add_image_size( 'sportspress-square-thumbnail', 200, 200, true );
|
||||
add_image_size( 'sportspress-square', 637, 637, true );
|
||||
add_image_size( 'sportspress-square-thumbnail', 303, 303, true );
|
||||
|
||||
// Fit (Proportional)
|
||||
add_image_size( 'sportspress-fit', 300, 300, false );
|
||||
add_image_size( 'sportspress-fit-thumbnail', 150, 150, false );
|
||||
add_image_size( 'sportspress-fit', 637, 637, false );
|
||||
add_image_size( 'sportspress-fit-thumbnail', 303, 303, false );
|
||||
|
||||
// Icon (Proportional)
|
||||
add_image_size( 'sportspress-icon', 32, 32, false );
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<?php
|
||||
function sportspress_enqueue_scripts() {
|
||||
// Styles
|
||||
wp_register_style( 'sportspress', SPORTSPRESS_PLUGIN_URL . 'assets/css/sportspress.css', array( 'dashicons' ), time() );
|
||||
wp_enqueue_style( 'sportspress');
|
||||
wp_enqueue_style( 'sportspress', SPORTSPRESS_PLUGIN_URL . 'assets/css/sportspress.css', array( 'dashicons' ), time() );
|
||||
|
||||
// Scripts
|
||||
wp_enqueue_script( 'jquery' );
|
||||
|
||||
@@ -121,7 +121,7 @@ function sportspress_event_team_meta( $post ) {
|
||||
?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="sp-clone" data-remove-text="<?php _e( 'Remove', 'sportspress' ); ?>" data-clone-name="sp_team">
|
||||
<div class="sp-clone" data-clone-name="sp_team">
|
||||
<p class="sp-tab-select sp-title-generator">
|
||||
<?php
|
||||
$args = array(
|
||||
|
||||
@@ -39,7 +39,7 @@ jQuery(document).ready(function($){
|
||||
$(".sp-clone:last").find("select").change(function() {
|
||||
$(this).closest(".sp-clone").siblings().find("select").change(function() {
|
||||
if($(this).val() == "0") $(this).closest(".sp-clone").remove();
|
||||
}).find("option:first").text($(this).closest(".sp-clone").attr("data-remove-text"));
|
||||
}).find("option:first").text(localized_strings.remove_text);
|
||||
if($(this).val() != "0") {
|
||||
$original = $(this).closest(".sp-clone");
|
||||
$original.before($original.clone().find("select").attr("name", $original.attr("data-clone-name") + "[]").val($(this).val()).closest(".sp-clone")).attr("data-clone-num", parseInt($original.attr("data-clone-num")) + 1).find("select").val("0").change();
|
||||
@@ -97,7 +97,7 @@ jQuery(document).ready(function($){
|
||||
$(".sp-equation-selector select:last").change(function() {
|
||||
$(this).siblings().change(function() {
|
||||
if($(this).val() == "") $(this).remove();
|
||||
}).find("option:first").text($(this).attr("data-remove-text"));
|
||||
}).find("option:first").text(localized_strings.remove_text);
|
||||
if($(this).val() != "") {
|
||||
$(this).before($(this).clone().val($(this).val())).val("").change();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user