mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-13 23:16:46 +00:00
feat: enhance UI and fix video handling
- Hide video elements in widget for improved user experience - Update header background for better contrast - Prevent empty image containers from rendering - Remove unsupported video player elements - Add onclick attribute to links for enhanced functionality - Include Yandex.ru in target whitelist for expanded compatibility
This commit is contained in:
@@ -118,6 +118,10 @@
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.tgme_widget_message_video_wrap {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tgme_widget_message_poll_options {
|
||||
display: block;
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
|
||||
<style>
|
||||
#site-intro {
|
||||
color: var(--secondary-color);
|
||||
background-color: var(--code-background-color);
|
||||
word-break: break-word;
|
||||
|
||||
& :global(.emoji) {
|
||||
|
||||
@@ -45,7 +45,7 @@ function getImages($, item, { staticProxy, id, index, title }) {
|
||||
</button>
|
||||
`
|
||||
})?.get()
|
||||
return `<div class="image-list-container ${images.length % 2 === 0 ? 'image-list-even' : 'image-list-odd'}">${images?.join('')}</div>`
|
||||
return images.length ? `<div class="image-list-container ${images.length % 2 === 0 ? 'image-list-even' : 'image-list-odd'}">${images?.join('')}</div>` : ''
|
||||
}
|
||||
|
||||
function getVideo($, item, { staticProxy, index }) {
|
||||
@@ -100,7 +100,7 @@ function getReply($, item, { channel }) {
|
||||
function modifyHTMLContent($, content, { index } = {}) {
|
||||
$(content).find('.emoji')?.attr('style', '')
|
||||
$(content).find('a')?.each((_index, a) => {
|
||||
$(a)?.attr('title', $(a)?.text())
|
||||
$(a)?.attr('title', $(a)?.text())?.attr('onclick', '')
|
||||
})
|
||||
$(content).find('tg-spoiler')?.each((_index, spoiler) => {
|
||||
const id = `spoiler-${index}-${_index}`
|
||||
@@ -141,6 +141,7 @@ function getPost($, item, { channel, staticProxy, index = 0 }) {
|
||||
// $(item).find('.tgme_widget_message_sticker_wrap')?.html(),
|
||||
$(item).find('.tgme_widget_message_poll')?.html(),
|
||||
$.html($(item).find('.tgme_widget_message_document_wrap')),
|
||||
$.html($(item).find('.tgme_widget_message_video_player.not_supported')),
|
||||
$.html($(item).find('.tgme_widget_message_location_wrap')),
|
||||
getLinkPreview($, item, { staticProxy, index }),
|
||||
].filter(Boolean).join('').replace(/(url\(["'])((https?:)?\/\/)/g, (match, p1, p2, _p3) => {
|
||||
|
||||
@@ -5,6 +5,7 @@ const targetWhitelist = [
|
||||
'telegram.dog',
|
||||
'cdn-telegram.org',
|
||||
'telesco.pe',
|
||||
'yandex.ru',
|
||||
]
|
||||
|
||||
export const prerender = false
|
||||
|
||||
Reference in New Issue
Block a user