vxcvcxvcxxcv
This commit is contained in:
parent
2db66c6149
commit
cbaed361b4
13 changed files with 16 additions and 23 deletions
|
@ -9,8 +9,6 @@ function post(url) {
|
|||
};
|
||||
|
||||
function post_toast3(url, button1, button2) {
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url, true);
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
|
@ -39,6 +37,7 @@ function post_toast3(url, button1, button2) {
|
|||
document.getElementById(button2).classList.toggle("d-md-inline-block");
|
||||
|
||||
} else {
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||
new bootstrap.Toast(document.getElementById('toast-post-error')).show();
|
||||
}
|
||||
|
@ -115,8 +114,6 @@ function delete_commentModal(id) {
|
|||
};
|
||||
|
||||
function post_reply(id){
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
|
||||
var form = new FormData();
|
||||
form.append('formkey', formkey());
|
||||
form.append('parent_id', id);
|
||||
|
@ -131,6 +128,7 @@ function post_reply(id){
|
|||
commentForm.innerHTML = xhr.response.replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '').replace('comment-collapse-desktop d-none d-md-block','d-none').replace('border-left: 2px solid','padding-left:0;border-left: 0px solid')
|
||||
}
|
||||
else {
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
try{
|
||||
let data = JSON.parse(xhr.response)
|
||||
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||
|
@ -143,8 +141,6 @@ function post_reply(id){
|
|||
}
|
||||
|
||||
function comment_edit(id){
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
form.append('formkey', formkey());
|
||||
|
@ -162,6 +158,7 @@ function comment_edit(id){
|
|||
document.getElementById('cancel-edit-'+id).click()
|
||||
}
|
||||
else {
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
try{
|
||||
let data = JSON.parse(xhr.response)
|
||||
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||
|
@ -174,8 +171,6 @@ function comment_edit(id){
|
|||
}
|
||||
|
||||
function post_comment(fullname){
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
|
||||
const btn = document.getElementById('save-reply-to-'+fullname)
|
||||
btn.classList.add('disabled');
|
||||
|
||||
|
@ -197,6 +192,7 @@ function post_comment(fullname){
|
|||
commentForm.innerHTML = xhr.response.replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '')
|
||||
}
|
||||
else {
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
try{
|
||||
let data = JSON.parse(xhr.response)
|
||||
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue