forked from rDrama/rDrama
dfs
parent
8efb3ab9af
commit
5efe1640ad
|
@ -19,8 +19,9 @@
|
|||
|
||||
xhr.onload = function() {
|
||||
if (xhr.status >= 200 && xhr.status < 300) {
|
||||
document.getElementById('toast-post-success').toast('dispose');
|
||||
document.getElementById('toast-post-success').toast('show');
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
myToast.show();
|
||||
try {
|
||||
document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"];
|
||||
} catch(e) {
|
||||
|
@ -34,14 +35,18 @@
|
|||
try {
|
||||
data=JSON.parse(xhr.response);
|
||||
|
||||
document.getElementById('toast-post-error').toast('dispose');
|
||||
document.getElementById('toast-post-error').toast('show');
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||
myToast.hide();
|
||||
myToast.show();
|
||||
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||
return false
|
||||
} catch(e) {
|
||||
document.getElementById('toast-post-success').toast('dispose');
|
||||
document.getElementById('toast-post-error').toast('dispose');
|
||||
document.getElementById('toast-post-error').toast('show');
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||
myToast.hide();
|
||||
myToast.show();
|
||||
document.getElementById('toast-post-error-text').innerText = "Error. Try again later.";
|
||||
return false
|
||||
}
|
||||
|
@ -412,8 +417,9 @@
|
|||
document.getElementById(button1).classList.toggle("d-none");
|
||||
document.getElementById(button2).classList.toggle("d-none");
|
||||
|
||||
document.getElementById('toast-post-success').toast('dispose');
|
||||
document.getElementById('toast-post-success').toast('show');
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
myToast.show();
|
||||
if (distinguish=='yes') {
|
||||
document.getElementById('toast-post-success-text').innerText = "Comment distinguished!";
|
||||
}
|
||||
|
@ -489,7 +495,7 @@
|
|||
|
||||
<div class="comment-body">
|
||||
|
||||
<div id="comment-{{c.id}}-only" class="">
|
||||
<div id="comment-{{c.id}}-only">
|
||||
|
||||
<div class="user-info">
|
||||
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.id}}')"></span>
|
||||
|
|
|
@ -62,9 +62,12 @@
|
|||
let result = callback(xhr);
|
||||
|
||||
if (xhr.status >= 200 && xhr.status < 300) {
|
||||
document.getElementById('toast-post-error').toast('dispose');
|
||||
document.getElementById('toast-post-success').toast('dispose');
|
||||
document.getElementById('toast-post-success').toast('show');
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||
myToast.hide();
|
||||
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
myToast.show();
|
||||
|
||||
try {
|
||||
if(typeof result == "string") {
|
||||
|
@ -78,9 +81,12 @@
|
|||
|
||||
return true;
|
||||
} else {
|
||||
document.getElementById('toast-post-success').toast('dispose');
|
||||
document.getElementById('toast-post-error').toast('dispose');
|
||||
document.getElementById('toast-post-error').toast('show');
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||
myToast.hide();
|
||||
myToast.show();
|
||||
|
||||
try {
|
||||
if(typeof result == "string") {
|
||||
|
|
Loading…
Reference in New Issue