В чем ошибки помогите пожалуйста
// save edited post
function Wo_EditPost(post_id) {
var post = $('#post-' + post_id);
var edit_box = $('#post-' + post_id).find('#edit-post');
var edit_textarea = post.find('.edit-textarea-' + post_id + ' textarea');
var text = edit_textarea.val();
var post_text = post.find('.post-description p');
Wo_progressIconLoader(post.find('#edit-post-button'));
$.post(Wo_Ajax_Requests_File() + '?f=posts&s=edit_post', {
post_id: post_id,
text: text
}, function (data) {
if(data.status == 200) {
post_text.html(data.html);
edit_box.modal('hide');
}
Wo_progressIconLoader(post.find('#edit-post-button'));
if (data.can_send == 1) {
Wo_postText();
}
});
}
$("#publisher-photos").change(function () {
var numFiles = this.files.length;
$("#photo-form input").val(numFiles + ' photo(s) selected');
$("#photo-form").slideDown(200);
});
$("#publisher-video").change(function () {
var filename = $(this).val().replace(/C:\\fakepath\\/i, '');
$("#video-form input").val(filename);
$("#video-form").slideDown(200);
});
$("#publisher-music").change(function () {
var filename = $(this).val().replace(/C:\\fakepath\\/i, '');
$("#music-form input").val(filename);
$("#music-form").slideDown(200);
});
var bar = $('#bar');
var percent = $('#percent');
var status = $('#status');
var publisher_button = $('#publisher-button');
$('form.post').ajaxForm({
url: Wo_Ajax_Requests_File() + '?f=posts&s=insert_new_post&title='+$("#title").val(), beforeSend: function () {
var percentVal = '0%';
bar.width(percentVal);
percent.html(percentVal);
publisher_button.attr('disabled', true);
publisher_button.css('color', '#333');
Wo_progressIconLoader($('form.post').find('button'));
},
uploadProgress: function (event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
bar.width(percentVal);
$('#progress').slideDown(200);
if(percentComplete > 50) {
percent.addClass('white');
}
percent.html(percentVal);
},
success: function (data) {
$('#progress').slideUp(200);
publisher_button.attr('disabled', false);
publisher_button.css('color', '#fff');
percent.removeClass('white');
$('.postText').css('height', 'auto');
if(data.status == 200) {
$('#myModal').modal('hide');
if(data.html.length > 0) {
$('#posts, #posts_hashtag').find('.posts-container').remove();
}
$('#posts, #posts_hashtag').prepend(data.html);
$('#video-form, #emo-form, #music-form, #map-form, #file-form, #photo-form, #album-form, .feeling-type, #poll-form').slideUp(200);
Wo_RemoveFetchedUrl();
$('form.post').clearForm();
$('.note-editable.panel-body').html('');
$('.feelings-value').html('');
$('select').prop('selectedIndex', 1);
} else if (data.status == 400) {
alert(data.errors);
}
Wo_progressIconLoader($('form.post').find('button'));
}
});