diff --git a/includes/class-displayfeaturedimagegenesis-output.php b/includes/class-displayfeaturedimagegenesis-output.php index 5f007a0..ecc40a2 100644 --- a/includes/class-displayfeaturedimagegenesis-output.php +++ b/includes/class-displayfeaturedimagegenesis-output.php @@ -151,8 +151,8 @@ class Display_Featured_Image_Genesis_Output { 'medium_large' => $medium_large[3] ? $medium_large[1] : '', ), 'height' => (int) $this->setting['less_header'], - 'centeredX' => (int) (bool) $backstretch_vars['centeredX'], - 'centeredY' => (int) (bool) $backstretch_vars['centeredY'], + 'centeredX' => (bool) $backstretch_vars['centeredX'], + 'centeredY' => (bool) $backstretch_vars['centeredY'], 'fade' => (int) $backstretch_vars['fade'], ); diff --git a/includes/js/settings-upload.js b/includes/js/settings-upload.js index 4aa3d44..b6623c8 100644 --- a/includes/js/settings-upload.js +++ b/includes/js/settings-upload.js @@ -1,8 +1,9 @@ -jQuery(document).ready(function($){ +jQuery( document ).ready( function ( $ ) { + 'use strict'; - var custom_uploader; - var target_input; - var preview; + var custom_uploader, + target_input, + preview; $( '.upload_default_image' ).click(function(e) { @@ -11,16 +12,16 @@ jQuery(document).ready(function($){ e.preventDefault(); //If the uploader object has already been created, reopen the dialog - if (custom_uploader) { + if ( custom_uploader ) { custom_uploader.open(); return; } //Extend the wp.media object custom_uploader = wp.media.frames.file_frame = wp.media({ - title: ([objectL10n.text]), + title: ( [ objectL10n.text ] ), button: { - text: ([objectL10n.text]) + text: ( [ objectL10n.text ] ) }, multiple: false }); @@ -28,12 +29,12 @@ jQuery(document).ready(function($){ //When a file is selected, grab the URL and set it as the text field's value custom_uploader.on( 'select', function() { - attachment = custom_uploader.state().get( 'selection' ).first().toJSON(); - preview = $( target_input ).prevAll( '.upload_logo_preview' ); - previewImage = $( '
' ); + var attachment = custom_uploader.state().get( 'selection' ).first().toJSON(), + preview = $( target_input ).prevAll( '.upload_logo_preview' ), + previewImage = $( '
' ); $( target_input ).val( attachment.id ); - if ( $( preview ).length ) { - $( preview ).remove(); + if ( preview.length ) { + preview.remove(); } $( target_input ).before( previewImage ); }); @@ -45,8 +46,8 @@ jQuery(document).ready(function($){ $( '.delete_image' ).click( function() { - target_input = $(this).prevAll( '.upload_image_id' ); - previewView = $(this).prevAll( '.upload_logo_preview' ); + target_input = $( this ).prevAll( '.upload_image_id' ); + var previewView = $( this ).prevAll( '.upload_logo_preview' ); $( target_input ).val( '' ); $( previewView ).remove(); @@ -54,9 +55,9 @@ jQuery(document).ready(function($){ }); $( '#submit' ).click( function() { - submitButton = $(this).parentsUntil( '#addtag' ); - previewView = submitButton.siblings( '.term-image-wrap' ).children( '.upload_logo_preview' ); - clearInput = submitButton.siblings( '.term-image-wrap' ).children( '.upload_image_id' ); + var submitButton = $( this ).parentsUntil( '#addtag' ), + previewView = submitButton.siblings( '.term-image-wrap' ).children( '.upload_logo_preview' ), + clearInput = submitButton.siblings( '.term-image-wrap' ).children( '.upload_image_id' ); if ( $( previewView ).length && $( submitButton ).length ) { $( previewView ).delay( 1000 ).fadeOut( 200, function() { @@ -65,5 +66,4 @@ jQuery(document).ready(function($){ }); } }); - }); diff --git a/includes/js/widget-selector.js b/includes/js/widget-selector.js index 4a86a86..48aff25 100644 --- a/includes/js/widget-selector.js +++ b/includes/js/widget-selector.js @@ -1,4 +1,5 @@ function term_postback( select_id, taxonomy ) { + 'use strict'; var data = { action: 'widget_selector', taxonomy: taxonomy @@ -22,4 +23,4 @@ function term_postback( select_id, taxonomy ) { control.append(new_option); }); }); -} \ No newline at end of file +}