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)}
|
||||
catch(e) {console.log(e)}
|
||||
if (data && data["comment"]) {
|
||||
commentForm=document.getElementById('comment-form-space-'+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');
|
||||
bs_trigger(commentForm);
|
||||
const comments = document.getElementById('replies-of-c_' + id);
|
||||
const comment = data["comment"].replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '');
|
||||
|
||||
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 {
|
||||
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||
|
|
|
@ -895,18 +895,20 @@
|
|||
const detectionDiv = document.querySelector('#detection');
|
||||
const isAutoDark = getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';
|
||||
if (!isAutoDark) {
|
||||
const element = document.getElementsByClassName('comment-section')[0];
|
||||
let color = getComputedStyle(element).getPropertyValue('background-color');
|
||||
color = 'rgba' + color.slice(3,-1) + ', 0.1)'
|
||||
const element = document.getElementsByClassName('comment-section')[0]
|
||||
if (element) {
|
||||
let color = getComputedStyle(element).getPropertyValue('background-color');
|
||||
color = 'rgba' + color.slice(3,-1) + ', 0.1)'
|
||||
|
||||
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>`;
|
||||
};
|
||||
const base64Mark = btoa(markTemplate("{{v.id}}"));
|
||||
|
||||
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}")}`;
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
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>`;
|
||||
};
|
||||
const base64Mark = btoa(markTemplate("{{v.id}}"));
|
||||
|
||||
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}")}`;
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
|
|
@ -18,7 +18,7 @@ set CACHE_VER = {
|
|||
'js/award_modal.js': 4001,
|
||||
'js/bootstrap.js': 4006,
|
||||
'js/comments_admin.js': 4000,
|
||||
'js/comments_v.js': 4002,
|
||||
'js/comments_v.js': 4003,
|
||||
'js/submission_listing.js': 4000,
|
||||
'js/emoji_modal.js': 4004,
|
||||
'js/formatting.js': 4000,
|
||||
|
|
Loading…
Reference in New Issue