forked from GithubBackups/vichan
ajax.js: trim
This commit is contained in:
parent
d36c6244e4
commit
886bfdc52a
12
js/ajax.js
12
js/ajax.js
@ -18,7 +18,7 @@ $(window).ready(function() {
|
|||||||
|
|
||||||
// Enable submit button if disabled (cache problem)
|
// Enable submit button if disabled (cache problem)
|
||||||
$('input[type="submit"]').removeAttr('disabled');
|
$('input[type="submit"]').removeAttr('disabled');
|
||||||
|
|
||||||
var setup_form = function($form) {
|
var setup_form = function($form) {
|
||||||
$form.submit(function() {
|
$form.submit(function() {
|
||||||
if (do_not_ajax)
|
if (do_not_ajax)
|
||||||
@ -27,7 +27,7 @@ $(window).ready(function() {
|
|||||||
var submit_txt = $(this).find('input[type="submit"]').val();
|
var submit_txt = $(this).find('input[type="submit"]').val();
|
||||||
if (window.FormData === undefined)
|
if (window.FormData === undefined)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var formData = new FormData(this);
|
var formData = new FormData(this);
|
||||||
formData.append('json_response', '1');
|
formData.append('json_response', '1');
|
||||||
formData.append('post', submit_txt);
|
formData.append('post', submit_txt);
|
||||||
@ -91,11 +91,11 @@ $(window).ready(function() {
|
|||||||
setTimeout(function() { $(window).trigger("scroll"); }, 100);
|
setTimeout(function() { $(window).trigger("scroll"); }, 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
highlightReply(post_response.id);
|
highlightReply(post_response.id);
|
||||||
window.location.hash = post_response.id;
|
window.location.hash = post_response.id;
|
||||||
$(window).scrollTop($('div.post#reply_' + post_response.id).offset().top);
|
$(window).scrollTop($('div.post#reply_' + post_response.id).offset().top);
|
||||||
|
|
||||||
$(form).find('input[type="submit"]').val(submit_txt);
|
$(form).find('input[type="submit"]').val(submit_txt);
|
||||||
$(form).find('input[type="submit"]').removeAttr('disabled');
|
$(form).find('input[type="submit"]').removeAttr('disabled');
|
||||||
$(form).find('input[name="subject"],input[name="file_url"],\
|
$(form).find('input[name="subject"],input[name="file_url"],\
|
||||||
@ -125,10 +125,10 @@ $(window).ready(function() {
|
|||||||
contentType: false,
|
contentType: false,
|
||||||
processData: false
|
processData: false
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
$(form).find('input[type="submit"]').val(_('Posting...'));
|
$(form).find('input[type="submit"]').val(_('Posting...'));
|
||||||
$(form).find('input[type="submit"]').attr('disabled', true);
|
$(form).find('input[type="submit"]').attr('disabled', true);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user