This commit is contained in:
Aevann1 2022-02-21 02:49:28 +02:00
parent 4c9cca2b33
commit 3180bd2079
3 changed files with 7 additions and 7 deletions

View file

@ -158,14 +158,14 @@ function post_reply(id){
xhr.onload=function(){ xhr.onload=function(){
if (xhr.status==200) { if (xhr.status==200) {
commentForm=document.getElementById('comment-form-space-'+id); commentForm=document.getElementById('comment-form-space-'+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');
bs_trigger();
} }
else { else {
document.getElementById('toast-post-error-text').innerText = "Error, please try again later." document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
try{ try{
let data = JSON.parse(xhr.response) let data = JSON.parse(xhr.response)
document.getElementById('toast-post-error-text').innerText = data["error"]; document.getElementById('toast-post-error-text').innerText = data["error"];
bs_trigger()
} }
catch(e) {console.log(e)} catch(e) {console.log(e)}
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show();
@ -234,14 +234,14 @@ function post_comment(fullname){
xhr.onload=function(){ xhr.onload=function(){
if (xhr.status==200) { if (xhr.status==200) {
commentForm=document.getElementById('comment-form-space-'+fullname); commentForm=document.getElementById('comment-form-space-'+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, '');
bs_trigger();
} }
else { else {
document.getElementById('toast-post-error-text').innerText = "Error, please try again later." document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
try{ try{
let data = JSON.parse(xhr.response) let data = JSON.parse(xhr.response)
document.getElementById('toast-post-error-text').innerText = data["error"]; document.getElementById('toast-post-error-text').innerText = data["error"];
bs_trigger()
} }
catch(e) {console.log(e)} catch(e) {console.log(e)}
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show();

View file

@ -1013,7 +1013,7 @@
{% if v %} {% if v %}
<script src="/static/assets/js/marked.js?a=242"></script> <script src="/static/assets/js/marked.js?a=242"></script>
<script src="/static/assets/js/comments_v.js?a=255"></script> <script src="/static/assets/js/comments_v.js?a=256"></script>
{% endif %} {% endif %}
<script src="/static/assets/js/clipboard.js?a=250"></script> <script src="/static/assets/js/clipboard.js?a=250"></script>
@ -1024,7 +1024,7 @@
{% include "expanded_image_modal.html" %} {% include "expanded_image_modal.html" %}
<script src="/static/assets/js/comments+submission_listing.js?a=251"></script> <script src="/static/assets/js/comments+submission_listing.js?a=252"></script>
<script src="/static/assets/js/comments.js?a=251"></script> <script src="/static/assets/js/comments.js?a=251"></script>
<script> <script>

View file

@ -711,5 +711,5 @@
</style> </style>
<script src="/static/assets/js/clipboard.js?a=240"></script> <script src="/static/assets/js/clipboard.js?a=240"></script>
<script src="/static/assets/js/comments+submission_listing.js?a=251"></script> <script src="/static/assets/js/comments+submission_listing.js?a=252"></script>
<script src="/static/assets/js/submission_listing.js?a=240"></script> <script src="/static/assets/js/submission_listing.js?a=240"></script>