chat ui
This commit is contained in:
@@ -348,6 +348,17 @@
|
|||||||
fill: currentColor !important;
|
fill: currentColor !important;
|
||||||
stroke: currentColor !important;
|
stroke: currentColor !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html:not(.politictalk-direct-access-blocked) .politictalk-chat-recipient-control,
|
||||||
|
html:not(.politictalk-direct-access-blocked) .politictalk-chat-recipient-control *,
|
||||||
|
html:not(.politictalk-direct-access-blocked) #chat-recipient-selector,
|
||||||
|
html:not(.politictalk-direct-access-blocked) #chat-recipient-selector *,
|
||||||
|
html:not(.politictalk-direct-access-blocked) [data-testid*="recipient" i],
|
||||||
|
html:not(.politictalk-direct-access-blocked) [data-testid*="recipient" i] * {
|
||||||
|
color: #ffffff !important;
|
||||||
|
fill: currentColor !important;
|
||||||
|
stroke: currentColor !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
html.politictalk-direct-access-blocked,
|
html.politictalk-direct-access-blocked,
|
||||||
@@ -816,6 +827,57 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isChatRecipientControl(element) {
|
||||||
|
var label = [
|
||||||
|
element.getAttribute('aria-label'),
|
||||||
|
element.getAttribute('title'),
|
||||||
|
element.textContent
|
||||||
|
].join(' ').replace(/\s+/g, ' ').trim().toLowerCase();
|
||||||
|
|
||||||
|
return label.indexOf('everyone') !== -1
|
||||||
|
|| label.indexOf('alle') !== -1
|
||||||
|
|| label.indexOf('الجميع') !== -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function markChatRecipientControls() {
|
||||||
|
if (!document.body) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var controls = document.querySelectorAll('button, [role="button"], [aria-haspopup], [data-testid*="recipient" i], #chat-recipient-selector');
|
||||||
|
|
||||||
|
controls.forEach(function(control) {
|
||||||
|
if (!isChatRecipientControl(control)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
control.classList.add('politictalk-chat-recipient-control');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function mountChatRecipientStyling() {
|
||||||
|
if (!document.body) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
markChatRecipientControls();
|
||||||
|
|
||||||
|
if (window.politicTalkChatRecipientObserver) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.politicTalkChatRecipientObserver = new MutationObserver(function() {
|
||||||
|
window.requestAnimationFrame(markChatRecipientControls);
|
||||||
|
});
|
||||||
|
window.politicTalkChatRecipientObserver.observe(document.body, {
|
||||||
|
attributes: true,
|
||||||
|
attributeFilter: [ 'aria-label', 'title', 'class' ],
|
||||||
|
childList: true,
|
||||||
|
characterData: true,
|
||||||
|
subtree: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function mountPoliticTalkLogo() {
|
function mountPoliticTalkLogo() {
|
||||||
if (!document.body || document.getElementById('politictalk-room-logo')) {
|
if (!document.body || document.getElementById('politictalk-room-logo')) {
|
||||||
return;
|
return;
|
||||||
@@ -892,12 +954,14 @@
|
|||||||
mountPoliticTalkLogo();
|
mountPoliticTalkLogo();
|
||||||
mountDirectAccessMessage();
|
mountDirectAccessMessage();
|
||||||
mountHostHangupPolicy();
|
mountHostHangupPolicy();
|
||||||
|
mountChatRecipientStyling();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
mountPoliticTalkDocumentTitle();
|
mountPoliticTalkDocumentTitle();
|
||||||
mountPoliticTalkLogo();
|
mountPoliticTalkLogo();
|
||||||
mountDirectAccessMessage();
|
mountDirectAccessMessage();
|
||||||
mountHostHangupPolicy();
|
mountHostHangupPolicy();
|
||||||
|
mountChatRecipientStyling();
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user