This commit is contained in:
Aevann1 2021-12-31 15:02:54 +02:00
parent bb7258f786
commit f8256fd405
8 changed files with 11 additions and 7 deletions

View file

@ -24,7 +24,8 @@ function post_toast3(url, button1, button2) {
xhr.withCredentials=true;
xhr.onload = function() {
let data = JSON.parse(xhr.response)
try {let data = JSON.parse(xhr.response)}
catch(e) {new bootstrap.Toast(document.getElementById('toast-post-error')).show();}
if (xhr.status >= 200 && xhr.status < 300 && !data['error']) {
document.getElementById('toast-post-success-text').innerText = data["message"];
new bootstrap.Toast(document.getElementById('toast-post-success')).show();

View file

@ -26,7 +26,8 @@ function post_toast(url, reload, data) {
xhr.withCredentials=true;
xhr.onload = function() {
let data = JSON.parse(xhr.response)
try {let data = JSON.parse(xhr.response)}
catch(e) {new bootstrap.Toast(document.getElementById('toast-post-error')).show();}
if (xhr.status >= 200 && xhr.status < 300 && !data['error']) {
document.getElementById('toast-post-success-text').innerText = data["message"];
new bootstrap.Toast(document.getElementById('toast-post-success')).show();

View file

@ -15,7 +15,8 @@ function post_toast2(url, button1, button2) {
xhr.withCredentials=true;
xhr.onload = function() {
let data = JSON.parse(xhr.response)
try {let data = JSON.parse(xhr.response)}
catch(e) {new bootstrap.Toast(document.getElementById('toast-post-error')).show();}
if (xhr.status >= 200 && xhr.status < 300 && !data['error']) {
document.getElementById('toast-post-success-text').innerText = data["message"];
new bootstrap.Toast(document.getElementById('toast-post-success')).show();

View file

@ -17,6 +17,7 @@ from files.__main__ import app, cache, limiter
from .front import frontlist
from files.helpers.discord import add_role
from datetime import datetime
import requests
SITE_NAME = environ.get("SITE_NAME", "").strip()
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()

View file

@ -104,6 +104,6 @@
</nav>
{% endif %}
<script src="/static/assets/js/post_toast2.js?a=4"></script>
<script src="/static/assets/js/post_toast2.js?a=5"></script>
{% endblock %}

View file

@ -844,7 +844,7 @@
{% if v %}
<script src="/static/assets/js/marked.js?a=3"></script>
<script src="/static/assets/js/comments_v.js?a=4"></script>
<script src="/static/assets/js/comments_v.js?a=5"></script>
{% endif %}
<script src="/static/assets/js/clipboard.js?a=3"></script>

View file

@ -322,7 +322,7 @@
<script src="/static/assets/js/lozad.js?a=3"></script>
{% if v %}
<script src="/static/assets/js/post_toast2.js?a=4"></script>
<script src="/static/assets/js/post_toast2.js?a=5"></script>
<script src="/static/assets/js/formatting.js?a=3"></script>
<script src="/static/assets/js/default.js?a=3"></script>
{% endif %}

View file

@ -210,7 +210,7 @@
</div>
</nav>
<script src="/static/assets/js/header.js?a=4"></script>
<script src="/static/assets/js/header.js?a=5"></script>
<style>
.notif-count {