removed pc and ss
This commit is contained in:
@@ -480,6 +480,25 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.politictalk-hidden-video-screen-control {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.politictalk-room-chat-only-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
html:not(.politictalk-direct-access-blocked) #chat-recipient,
|
||||
html:not(.politictalk-direct-access-blocked) #select-chat-recipient,
|
||||
html:not(.politictalk-direct-access-blocked) [class*="privateMessageRecipientsList"],
|
||||
html:not(.politictalk-direct-access-blocked) [class*="chat-recipient"],
|
||||
html:not(.politictalk-direct-access-blocked) [class*="chatRecipient"],
|
||||
html:not(.politictalk-direct-access-blocked) [class*="ChatRecipient"],
|
||||
html:not(.politictalk-direct-access-blocked) [class*="recipientDropdown"],
|
||||
html:not(.politictalk-direct-access-blocked) [class*="RecipientDropdown"] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
html:not(.politictalk-direct-access-blocked),
|
||||
html:not(.politictalk-direct-access-blocked) body,
|
||||
@@ -1293,6 +1312,216 @@
|
||||
}, 800);
|
||||
}
|
||||
|
||||
function isPoliticTalkVideoOrScreenText(text) {
|
||||
var normalized = normalizePoliticTalkText(text);
|
||||
|
||||
return normalized.indexOf('video') !== -1
|
||||
|| normalized.indexOf('camera') !== -1
|
||||
|| normalized.indexOf('screen-share') !== -1
|
||||
|| normalized.indexOf('screen share') !== -1
|
||||
|| normalized.indexOf('screen sharing') !== -1
|
||||
|| normalized.indexOf('screenshare') !== -1
|
||||
|| normalized.indexOf('share screen') !== -1
|
||||
|| normalized.indexOf('share your screen') !== -1;
|
||||
}
|
||||
|
||||
function getPoliticTalkParticipantsPane() {
|
||||
var candidates = Array.prototype.slice.call(document.querySelectorAll([
|
||||
'#sideToolbarContainer',
|
||||
'.sideToolbarContainer',
|
||||
'.participants-pane',
|
||||
'.participants_pane',
|
||||
'[class*="participantsPane"]'
|
||||
].join(',')));
|
||||
|
||||
return candidates.find(function(candidate) {
|
||||
var text = normalizePoliticTalkText(candidate.textContent);
|
||||
var rect = candidate.getBoundingClientRect();
|
||||
|
||||
return rect.width > 120
|
||||
&& rect.height > 240
|
||||
&& (
|
||||
text.indexOf('meeting participants') !== -1
|
||||
|| text.indexOf('search participants') !== -1
|
||||
|| text.indexOf('anwesende') !== -1
|
||||
|| text.indexOf('mute all') !== -1
|
||||
|| text.indexOf('alle stummschalten') !== -1
|
||||
);
|
||||
}) || null;
|
||||
}
|
||||
|
||||
function findPoliticTalkActionContainer(element) {
|
||||
var current = element;
|
||||
|
||||
while (current && current !== document.body) {
|
||||
var role = normalizePoliticTalkText(current.getAttribute('role'));
|
||||
var text = normalizePoliticTalkText(current.textContent);
|
||||
var rect = current.getBoundingClientRect();
|
||||
|
||||
if (
|
||||
current.tagName === 'BUTTON'
|
||||
|| role === 'button'
|
||||
|| role === 'menuitem'
|
||||
|| (
|
||||
isPoliticTalkVideoOrScreenText(text)
|
||||
&& rect.width > 40
|
||||
&& rect.width < 720
|
||||
&& rect.height > 24
|
||||
&& rect.height < 160
|
||||
)
|
||||
) {
|
||||
return current;
|
||||
}
|
||||
|
||||
current = current.parentElement;
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
function hidePoliticTalkVideoScreenControls() {
|
||||
if (directAccessBlocked || !document.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
var pane = getPoliticTalkParticipantsPane();
|
||||
|
||||
if (!pane) {
|
||||
return;
|
||||
}
|
||||
|
||||
var controls = pane.querySelectorAll('button, [role="button"], [role="menuitem"], li, div, span');
|
||||
|
||||
controls.forEach(function(control) {
|
||||
var controlText = [
|
||||
control.getAttribute('aria-label'),
|
||||
control.getAttribute('title'),
|
||||
control.textContent
|
||||
].join(' ');
|
||||
|
||||
if (!isPoliticTalkVideoOrScreenText(controlText)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rect = control.getBoundingClientRect();
|
||||
var isSemanticAction = control.tagName === 'BUTTON'
|
||||
|| control.tagName === 'LI'
|
||||
|| control.hasAttribute('role')
|
||||
|| control.hasAttribute('aria-label')
|
||||
|| control.hasAttribute('title');
|
||||
|
||||
if (!isSemanticAction && (
|
||||
rect.width < 40
|
||||
|| rect.width > 720
|
||||
|| rect.height < 20
|
||||
|| rect.height > 160
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var container = findPoliticTalkActionContainer(control);
|
||||
|
||||
container.classList.add('politictalk-hidden-video-screen-control');
|
||||
container.setAttribute('aria-hidden', 'true');
|
||||
container.setAttribute('tabindex', '-1');
|
||||
});
|
||||
}
|
||||
|
||||
function mountPoliticTalkAudioOnlyUiPolicy() {
|
||||
hidePoliticTalkVideoScreenControls();
|
||||
|
||||
if (window.politicTalkAudioOnlyUiObserver || !document.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.politicTalkAudioOnlyUiObserver = new MutationObserver(function() {
|
||||
window.cancelAnimationFrame(window.politicTalkAudioOnlyUiFrame);
|
||||
window.politicTalkAudioOnlyUiFrame = window.requestAnimationFrame(hidePoliticTalkVideoScreenControls);
|
||||
});
|
||||
window.politicTalkAudioOnlyUiObserver.observe(document.body, {
|
||||
attributes: true,
|
||||
attributeFilter: [ 'aria-label', 'class', 'role', 'style', 'title' ],
|
||||
childList: true,
|
||||
characterData: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
function selectPoliticTalkRoomChatRecipient(select) {
|
||||
if (!select || select.tagName !== 'SELECT') {
|
||||
return;
|
||||
}
|
||||
|
||||
var groupChatOption = Array.prototype.slice.call(select.options || []).find(function(option) {
|
||||
return normalizePoliticTalkText(option.value) === 'groupchat'
|
||||
|| normalizePoliticTalkText(option.textContent) === 'everyone';
|
||||
});
|
||||
|
||||
if (!groupChatOption) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (select.value !== groupChatOption.value) {
|
||||
select.value = groupChatOption.value;
|
||||
select.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
select.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
}
|
||||
|
||||
function hidePoliticTalkChatRecipientTarget(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.tagName === 'SELECT') {
|
||||
selectPoliticTalkRoomChatRecipient(element);
|
||||
} else if (element.querySelectorAll) {
|
||||
element.querySelectorAll('select').forEach(selectPoliticTalkRoomChatRecipient);
|
||||
}
|
||||
|
||||
element.classList.add('politictalk-room-chat-only-hidden');
|
||||
element.setAttribute('aria-hidden', 'true');
|
||||
element.setAttribute('tabindex', '-1');
|
||||
}
|
||||
|
||||
function enforcePoliticTalkRoomChatOnly() {
|
||||
if (directAccessBlocked || !document.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
var recipientTargets = document.querySelectorAll([
|
||||
'#chat-recipient',
|
||||
'#select-chat-recipient',
|
||||
'[class*="privateMessageRecipientsList"]',
|
||||
'[class*="chat-recipient"]',
|
||||
'[class*="chatRecipient"]',
|
||||
'[class*="ChatRecipient"]',
|
||||
'[class*="recipientDropdown"]',
|
||||
'[class*="RecipientDropdown"]'
|
||||
].join(','));
|
||||
|
||||
recipientTargets.forEach(hidePoliticTalkChatRecipientTarget);
|
||||
}
|
||||
|
||||
function mountPoliticTalkRoomChatOnlyPolicy() {
|
||||
enforcePoliticTalkRoomChatOnly();
|
||||
|
||||
if (window.politicTalkRoomChatOnlyObserver || !document.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.politicTalkRoomChatOnlyObserver = new MutationObserver(function() {
|
||||
window.cancelAnimationFrame(window.politicTalkRoomChatOnlyFrame);
|
||||
window.politicTalkRoomChatOnlyFrame = window.requestAnimationFrame(enforcePoliticTalkRoomChatOnly);
|
||||
});
|
||||
window.politicTalkRoomChatOnlyObserver.observe(document.body, {
|
||||
attributes: true,
|
||||
attributeFilter: [ 'class', 'id', 'value' ],
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
function mountPoliticTalkLogo() {
|
||||
if (!document.body || document.getElementById('politictalk-room-logo')) {
|
||||
return;
|
||||
@@ -1372,6 +1601,8 @@
|
||||
mountMobileToolbarPositioning();
|
||||
mountPoliticTalkStageBrandInset();
|
||||
mountPoliticTalkModerationNotificationPolicy();
|
||||
mountPoliticTalkAudioOnlyUiPolicy();
|
||||
mountPoliticTalkRoomChatOnlyPolicy();
|
||||
});
|
||||
} else {
|
||||
mountPoliticTalkDocumentTitle();
|
||||
@@ -1381,6 +1612,8 @@
|
||||
mountMobileToolbarPositioning();
|
||||
mountPoliticTalkStageBrandInset();
|
||||
mountPoliticTalkModerationNotificationPolicy();
|
||||
mountPoliticTalkAudioOnlyUiPolicy();
|
||||
mountPoliticTalkRoomChatOnlyPolicy();
|
||||
}
|
||||
}());
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user