Skip to content

Commit

Permalink
Add spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nb committed Apr 17, 2013
1 parent daf589a commit 881ccd9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions js/liveblog-admin.js
@@ -1,24 +1,24 @@
/* global ajaxurl, liveblog_admin_settings, jQuery */
jQuery(function($) {
var $meta_box = $('#liveblog'),
post_id = $('#post_ID').val(),
show_error = function(message) {
$('p.error', $meta_box).show().html(message);
jQuery( function( $ ) {
var $meta_box = $( '#liveblog' ),
post_id = $( '#post_ID' ).val(),
show_error = function( message ) {
$( 'p.error', $meta_box ).show().html( message );
};
$meta_box.on('click', 'button', function(e) {
$meta_box.on( 'click', 'button', function( e ) {
e.preventDefault();
var url = ajaxurl + '?action=set_liveblog_state_for_post&post_id=' + encodeURIComponent(post_id) + '&state=' + encodeURIComponent($(this).val()) + '&' + liveblog_admin_settings.nonce_key + '=' + liveblog_admin_settings.nonce;
$('.inside', $meta_box).load(url, function(response, status, xhr) {
var url = ajaxurl + '?action=set_liveblog_state_for_post&post_id=' + encodeURIComponent( post_id ) + '&state=' + encodeURIComponent( $( this ).val() ) + '&' + liveblog_admin_settings.nonce_key + '=' + liveblog_admin_settings.nonce;
$( '.inside', $meta_box ).load( url, function( response, status, xhr ) {
var message;
if ( status === 'success') {
return;
}
if (xhr.status && xhr.status > 200) {
message = liveblog_admin_settings.error_message_template.replace('{error-code}', xhr.status).replace('{error-message}', xhr.statusText);
message = liveblog_admin_settings.error_message_template.replace( '{error-code}', xhr.status ).replace( '{error-message}', xhr.statusText );
} else {
message = liveblog_admin_settings.short_error_message_template.replace('{error-message}', status);
message = liveblog_admin_settings.short_error_message_template.replace( '{error-message}', status );
}
show_error(message);
});
});
});
} );
} );
} );

0 comments on commit 881ccd9

Please sign in to comment.