forked from MarseyWorld/MarseyWorld
Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost
commit
d5d738e1fd
|
@ -152,9 +152,19 @@ function post_reply(id){
|
||||||
try {data = JSON.parse(xhr.response)}
|
try {data = JSON.parse(xhr.response)}
|
||||||
catch(e) {console.log(e)}
|
catch(e) {console.log(e)}
|
||||||
if (data && data["comment"]) {
|
if (data && data["comment"]) {
|
||||||
commentForm=document.getElementById('comment-form-space-'+id);
|
const comments = document.getElementById('replies-of-c_' + id);
|
||||||
commentForm.innerHTML = data["comment"].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');
|
const comment = data["comment"].replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '');
|
||||||
bs_trigger(commentForm);
|
|
||||||
|
comments.innerHTML = comments.innerHTML + comment;
|
||||||
|
|
||||||
|
bs_trigger(comments);
|
||||||
|
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.classList.remove('disabled');
|
||||||
|
|
||||||
|
document.getElementById('reply-form-body-'+id).value = ''
|
||||||
|
document.getElementById('message-reply-'+id).innerHTML = ''
|
||||||
|
ToggleReplyBox('reply-message-'+id)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||||
|
|
|
@ -895,18 +895,20 @@
|
||||||
const detectionDiv = document.querySelector('#detection');
|
const detectionDiv = document.querySelector('#detection');
|
||||||
const isAutoDark = getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';
|
const isAutoDark = getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';
|
||||||
if (!isAutoDark) {
|
if (!isAutoDark) {
|
||||||
const element = document.getElementsByClassName('comment-section')[0];
|
const element = document.getElementsByClassName('comment-section')[0]
|
||||||
let color = getComputedStyle(element).getPropertyValue('background-color');
|
if (element) {
|
||||||
color = 'rgba' + color.slice(3,-1) + ', 0.1)'
|
let color = getComputedStyle(element).getPropertyValue('background-color');
|
||||||
|
color = 'rgba' + color.slice(3,-1) + ', 0.1)'
|
||||||
|
|
||||||
const markTemplate = (name) => {
|
const markTemplate = (name) => {
|
||||||
return `<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='50px' height='50px'><text transform='translate(10, 50) rotate(-45)' fill='${color}' font-size='20'>${name}</text></svg>`;
|
return `<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='50px' height='50px'><text transform='translate(10, 50) rotate(-45)' fill='${color}' font-size='20'>${name}</text></svg>`;
|
||||||
};
|
};
|
||||||
const base64Mark = btoa(markTemplate("{{v.id}}"));
|
const base64Mark = btoa(markTemplate("{{v.id}}"));
|
||||||
|
|
||||||
var style = document.createElement('style');
|
var style = document.createElement('style');
|
||||||
style.innerHTML = `.actual-post:not(.deleted):not(.banned),.comment-section>.comment{background-image:url("data:image/svg+xml;base64,${base64Mark}")}`;
|
style.innerHTML = `.actual-post:not(.deleted):not(.banned),.comment-section>.comment{background-image:url("data:image/svg+xml;base64,${base64Mark}")}`;
|
||||||
document.getElementsByTagName('head')[0].appendChild(style);
|
document.getElementsByTagName('head')[0].appendChild(style);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -18,7 +18,7 @@ set CACHE_VER = {
|
||||||
'js/award_modal.js': 4001,
|
'js/award_modal.js': 4001,
|
||||||
'js/bootstrap.js': 4006,
|
'js/bootstrap.js': 4006,
|
||||||
'js/comments_admin.js': 4000,
|
'js/comments_admin.js': 4000,
|
||||||
'js/comments_v.js': 4002,
|
'js/comments_v.js': 4003,
|
||||||
'js/submission_listing.js': 4000,
|
'js/submission_listing.js': 4000,
|
||||||
'js/emoji_modal.js': 4004,
|
'js/emoji_modal.js': 4004,
|
||||||
'js/formatting.js': 4000,
|
'js/formatting.js': 4000,
|
||||||
|
|
Loading…
Reference in New Issue