diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ac76d2..7714931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.14.0 +* Fixed Redgifs previews +* Fixed zoom in/out/reset (Ctrl +/-/0) +* Fixed tiger sharks being labeled as felines +* Fixed bug that prevented posting normal channel messages when auto-posting is active +* Fixed bug that removed links when chat messages were copied to clipboard + ## 1.13.0 * Position is now part of the profile match score diff --git a/bbcode/UrlTagView.vue b/bbcode/UrlTagView.vue index 864a550..af5557c 100644 --- a/bbcode/UrlTagView.vue +++ b/bbcode/UrlTagView.vue @@ -36,11 +36,19 @@ @Prop({required: true}) readonly domain!: string; + readonly type!: 'UrlTagView'; + @Hook('beforeDestroy') beforeDestroy(): void { this.dismiss(); } + @Hook('mounted') + mounted(): void { + (this.$el as any).bbcodeTag = 'url'; + (this.$el as any).bbcodeParam = this.url; + } + @Hook('deactivated') deactivate(): void { this.dismiss(); diff --git a/bbcode/standard.ts b/bbcode/standard.ts index ef53df5..80f851b 100644 --- a/bbcode/standard.ts +++ b/bbcode/standard.ts @@ -197,10 +197,10 @@ export class StandardBBCodeParser extends CoreBBCodeParser { 'url', (parser, parent, _, content) => { const tagData = analyzeUrlTag(parser, _, content); - const root = parser.createElement('span'); - // const el = parser.createElement('span'); + parent.appendChild(root); + // root.appendChild(el); if (!tagData.success) { diff --git a/chat/Chat.vue b/chat/Chat.vue index 2b80e4b..98fcbcc 100644 --- a/chat/Chat.vue +++ b/chat/Chat.vue @@ -64,12 +64,24 @@ function scanNode(node: BBCodeNode, end: Node, range: Range, flags: {endFound?: true}, hide?: boolean): string { let str = ''; hide = hide || node instanceof HTMLElement && node.classList.contains('bbcode-pseudo'); + + const component = (node as any)?.__vue__; + + if ((component?.$el?.bbcodeTag) || (component?.$el?.bbcodeParam)) { + // nothing? + } + if(node === end) flags.endFound = true; if(node.bbcodeTag !== undefined) str += `[${node.bbcodeTag}${node.bbcodeParam !== undefined ? `=${node.bbcodeParam}` : ''}]`; + // if(component?.$el?.bbcodeTag !== undefined) str += `[${component?.$el?.bbcodeTag}${component?.$el?.bbcodeParam !== undefined ? `=${component?.$el?.bbcodeParam}` : ''}]`; if(node instanceof Text) str += node === range.endContainer ? node.nodeValue!.substr(0, range.endOffset) : node.nodeValue; else if(node instanceof HTMLImageElement) str += node.alt; + // else if ((node as any)?.__vue__ && (node as any)?.__vue__ instanceof UrlTagView) { + // console.log('URLTAGVIEWNODE', node); + // } if(node.firstChild !== null && !flags.endFound) str += scanNode(node.firstChild, end, range, flags, hide); if(node.bbcodeTag !== undefined) str += `[/${node.bbcodeTag}]`; + // if(component?.$el?.bbcodeTag !== undefined) str += `[/${component?.$el?.bbcodeTag}]`; if(node instanceof HTMLElement && getComputedStyle(node).display === 'block' && !flags.endFound) str += '\r\n'; if(node.nextSibling !== null && !flags.endFound) str += scanNode(node.nextSibling, end, range, flags, hide); return hide ? '' : str; diff --git a/chat/conversations.ts b/chat/conversations.ts index 55a9c55..d6a192c 100644 --- a/chat/conversations.ts +++ b/chat/conversations.ts @@ -404,7 +404,7 @@ class ChannelConversation extends Conversation implements Interfaces.ChannelConv protected async doSend(): Promise { const isAd = this.isSendingAds; - if(this.adManager.isActive()) { + if(isAd && this.adManager.isActive()) { this.errorText = 'Cannot post ads manually while ad auto-posting is active'; return; }