bb
This commit is contained in:
parent
f0fd826b54
commit
68c64a63f3
11 changed files with 40 additions and 17 deletions
|
@ -8,6 +8,8 @@ function post(url) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function post_toast3(url, button1, button2) {
|
function post_toast3(url, button1, button2) {
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("POST", url, true);
|
xhr.open("POST", url, true);
|
||||||
var form = new FormData()
|
var form = new FormData()
|
||||||
|
@ -24,7 +26,8 @@ function post_toast3(url, button1, button2) {
|
||||||
xhr.withCredentials=true;
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
let data = JSON.parse(xhr.response)
|
try {let data = JSON.parse(xhr.response)}
|
||||||
|
catch(e) {}
|
||||||
if (xhr.status >= 200 && xhr.status < 300 && data && data["message"]) {
|
if (xhr.status >= 200 && xhr.status < 300 && data && data["message"]) {
|
||||||
document.getElementById('toast-post-success-text').innerText = data["message"];
|
document.getElementById('toast-post-success-text').innerText = data["message"];
|
||||||
new bootstrap.Toast(document.getElementById('toast-post-success')).show();
|
new bootstrap.Toast(document.getElementById('toast-post-success')).show();
|
||||||
|
@ -107,9 +110,9 @@ function delete_commentModal(id) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function post_reply(id){
|
function post_reply(id){
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
|
|
||||||
var form = new FormData();
|
var form = new FormData();
|
||||||
|
|
||||||
form.append('formkey', formkey());
|
form.append('formkey', formkey());
|
||||||
form.append('parent_id', id);
|
form.append('parent_id', id);
|
||||||
form.append('body', document.getElementById('reply-form-body-'+id).value);
|
form.append('body', document.getElementById('reply-form-body-'+id).value);
|
||||||
|
@ -122,8 +125,11 @@ 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')
|
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 {
|
else {
|
||||||
let data = JSON.parse(xhr.response)
|
try{
|
||||||
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
let data = JSON.parse(xhr.response)
|
||||||
|
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||||
|
}
|
||||||
|
catch(e) {}
|
||||||
new bootstrap.Toast(document.getElementById('toast-post-error')).show();
|
new bootstrap.Toast(document.getElementById('toast-post-error')).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,6 +137,7 @@ function post_reply(id){
|
||||||
}
|
}
|
||||||
|
|
||||||
function comment_edit(id){
|
function comment_edit(id){
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
|
|
||||||
var form = new FormData();
|
var form = new FormData();
|
||||||
|
|
||||||
|
@ -148,8 +155,11 @@ function comment_edit(id){
|
||||||
document.getElementById('cancel-edit-'+id).click()
|
document.getElementById('cancel-edit-'+id).click()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let data = JSON.parse(xhr.response)
|
try{
|
||||||
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
let data = JSON.parse(xhr.response)
|
||||||
|
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||||
|
}
|
||||||
|
catch(e) {}
|
||||||
new bootstrap.Toast(document.getElementById('toast-post-error')).show();
|
new bootstrap.Toast(document.getElementById('toast-post-error')).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,6 +167,8 @@ function comment_edit(id){
|
||||||
}
|
}
|
||||||
|
|
||||||
function post_comment(fullname){
|
function post_comment(fullname){
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
|
|
||||||
const btn = document.getElementById('save-reply-to-'+fullname)
|
const btn = document.getElementById('save-reply-to-'+fullname)
|
||||||
btn.classList.add('disabled');
|
btn.classList.add('disabled');
|
||||||
|
|
||||||
|
@ -177,8 +189,11 @@ 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, '')
|
commentForm.innerHTML = xhr.response.replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '')
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let data = JSON.parse(xhr.response)
|
try{
|
||||||
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
let data = JSON.parse(xhr.response)
|
||||||
|
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||||
|
}
|
||||||
|
catch(e) {}
|
||||||
new bootstrap.Toast(document.getElementById('toast-post-error')).show();
|
new bootstrap.Toast(document.getElementById('toast-post-error')).show();
|
||||||
btn.classList.remove('disabled');
|
btn.classList.remove('disabled');
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ document.addEventListener("DOMContentLoaded", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
function post_toast(url, reload, data) {
|
function post_toast(url, reload, data) {
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("POST", url, true);
|
xhr.open("POST", url, true);
|
||||||
var form = new FormData()
|
var form = new FormData()
|
||||||
|
@ -26,7 +28,8 @@ function post_toast(url, reload, data) {
|
||||||
xhr.withCredentials=true;
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
let data = JSON.parse(xhr.response)
|
try {let data = JSON.parse(xhr.response)}
|
||||||
|
catch(e) {}
|
||||||
if (xhr.status >= 200 && xhr.status < 300 && data && data['message']) {
|
if (xhr.status >= 200 && xhr.status < 300 && data && data['message']) {
|
||||||
document.getElementById('toast-post-success-text').innerText = data["message"];
|
document.getElementById('toast-post-success-text').innerText = data["message"];
|
||||||
new bootstrap.Toast(document.getElementById('toast-post-success')).show();
|
new bootstrap.Toast(document.getElementById('toast-post-success')).show();
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
function post_toast2(url, button1, button2) {
|
function post_toast2(url, button1, button2) {
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("POST", url, true);
|
xhr.open("POST", url, true);
|
||||||
var form = new FormData()
|
var form = new FormData()
|
||||||
|
@ -15,7 +17,8 @@ function post_toast2(url, button1, button2) {
|
||||||
xhr.withCredentials=true;
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
let data = JSON.parse(xhr.response)
|
try {let data = JSON.parse(xhr.response)}
|
||||||
|
catch(e) {}
|
||||||
if (xhr.status >= 200 && xhr.status < 300 && data && data["message"]) {
|
if (xhr.status >= 200 && xhr.status < 300 && data && data["message"]) {
|
||||||
document.getElementById('toast-post-success-text').innerText = data["message"];
|
document.getElementById('toast-post-success-text').innerText = data["message"];
|
||||||
new bootstrap.Toast(document.getElementById('toast-post-success')).show();
|
new bootstrap.Toast(document.getElementById('toast-post-success')).show();
|
||||||
|
|
|
@ -124,6 +124,8 @@ function transferBux(mobile=false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitFormAjax(e) {
|
function submitFormAjax(e) {
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
|
|
||||||
document.getElementById('message').classList.add('d-none');
|
document.getElementById('message').classList.add('d-none');
|
||||||
document.getElementById('message-mobile').classList.add('d-none');
|
document.getElementById('message-mobile').classList.add('d-none');
|
||||||
document.getElementById('message-preview').classList.add('d-none');
|
document.getElementById('message-preview').classList.add('d-none');
|
||||||
|
|
|
@ -104,6 +104,6 @@
|
||||||
</nav>
|
</nav>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<script src="/static/assets/js/post_toast2.js?a=7"></script>
|
<script src="/static/assets/js/post_toast2.js?a=8"></script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -848,7 +848,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<script src="/static/assets/js/marked.js?a=3"></script>
|
<script src="/static/assets/js/marked.js?a=3"></script>
|
||||||
<script src="/static/assets/js/comments_v.js?a=12"></script>
|
<script src="/static/assets/js/comments_v.js?a=13"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<script src="/static/assets/js/clipboard.js?a=3"></script>
|
<script src="/static/assets/js/clipboard.js?a=3"></script>
|
||||||
|
|
|
@ -317,7 +317,7 @@
|
||||||
<script src="/static/assets/js/lozad.js?a=3"></script>
|
<script src="/static/assets/js/lozad.js?a=3"></script>
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<script src="/static/assets/js/post_toast2.js?a=7"></script>
|
<script src="/static/assets/js/post_toast2.js?a=8"></script>
|
||||||
<script src="/static/assets/js/formatting.js?a=3"></script>
|
<script src="/static/assets/js/formatting.js?a=3"></script>
|
||||||
<script src="/static/assets/js/default.js?a=4"></script>
|
<script src="/static/assets/js/default.js?a=4"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<script src="/static/assets/js/header.js?a=7"></script>
|
<script src="/static/assets/js/header.js?a=8"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.notif-count {
|
.notif-count {
|
||||||
|
|
|
@ -691,7 +691,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<div id='tax' class="d-none">{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}</div>
|
<div id='tax' class="d-none">{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}</div>
|
||||||
<script src="/static/assets/js/userpage_v.js?a=8"></script>
|
<script src="/static/assets/js/userpage_v.js?a=9"></script>
|
||||||
<div id="username" class="d-none">{{u.username}}</div>
|
<div id="username" class="d-none">{{u.username}}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||||
<script src="/static/assets/js/userpage_v.js?a=8"></script>
|
<script src="/static/assets/js/userpage_v.js?a=9"></script>
|
||||||
<div id="username" class="d-none">{{u.username}}</div>
|
<div id="username" class="d-none">{{u.username}}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||||
<script src="/static/assets/js/userpage_v.js?a=8"></script>
|
<script src="/static/assets/js/userpage_v.js?a=9"></script>
|
||||||
<div id="username" class="d-none">{{u.username}}</div>
|
<div id="username" class="d-none">{{u.username}}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue