Fixed some js conding standards

This commit is contained in:
Claudio Sanches 2015-08-05 15:57:15 -03:00
parent 1a2ccd741b
commit b091f12393
2 changed files with 18 additions and 17 deletions

View File

@ -14,7 +14,6 @@ if ( ! defined( 'ABSPATH' ) ) {
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
jQuery( '.wc-update-now' ).click( 'click', function() { jQuery( '.wc-update-now' ).click( 'click', function() {
var answer = confirm( '<?php echo esc_js( __( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'woocommerce' ) ); ?>' ); return window.confirm( '<?php echo esc_js( __( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'woocommerce' ) ); ?>' );
return answer;
}); });
</script> </script>

View File

@ -803,45 +803,47 @@ class WC_Email extends WC_Settings_API {
</div> </div>
<?php <?php
wc_enqueue_js( " wc_enqueue_js( "
jQuery('select.email_type').change(function() { jQuery( 'select.email_type' ).change( function() {
var val = jQuery( this ).val(); var val = jQuery( this ).val();
jQuery('.template_plain, .template_html').show(); jQuery( '.template_plain, .template_html' ).show();
if ( val != 'multipart' && val != 'html' ) if ( val != 'multipart' && val != 'html' ) {
jQuery('.template_html').hide(); jQuery('.template_html').hide();
}
if ( val != 'multipart' && val != 'plain' ) if ( val != 'multipart' && val != 'plain' ) {
jQuery('.template_plain').hide(); jQuery('.template_plain').hide();
}
}).change(); }).change();
var view = '" . esc_js( __( 'View template', 'woocommerce' ) ) . "'; var view = '" . esc_js( __( 'View template', 'woocommerce' ) ) . "';
var hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "'; var hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "';
jQuery('a.toggle_editor').text( view ).toggle( function() { jQuery( 'a.toggle_editor' ).text( view ).toggle( function() {
jQuery( this ).text( hide ).closest('.template').find('.editor').slideToggle(); jQuery( this ).text( hide ).closest(' .template' ).find( '.editor' ).slideToggle();
return false; return false;
}, function() { }, function() {
jQuery( this ).text( view ).closest('.template').find('.editor').slideToggle(); jQuery( this ).text( view ).closest( '.template' ).find( '.editor' ).slideToggle();
return false; return false;
} ); } );
jQuery('a.delete_template').click(function(){ jQuery( 'a.delete_template' ).click( function() {
var answer = confirm('" . esc_js( __( 'Are you sure you want to delete this template file?', 'woocommerce' ) ) . "'); if ( window.confirm('" . esc_js( __( 'Are you sure you want to delete this template file?', 'woocommerce' ) ) . "') ) {
if (answer)
return true; return true;
}
return false; return false;
}); });
jQuery('.editor textarea').change(function(){ jQuery( '.editor textarea' ).change( function() {
var name = jQuery(this).attr( 'data-name' ); var name = jQuery( this ).attr( 'data-name' );
if ( name ) if ( name ) {
jQuery(this).attr( 'name', name ); jQuery( this ).attr( 'name', name );
}
}); });
" ); " );
} }