Fix clipboard
This commit is contained in:
parent
dec5cd97b2
commit
225c6786af
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -404,7 +404,7 @@ class ChannelConversation extends Conversation implements Interfaces.ChannelConv
|
|||
protected async doSend(): Promise<void> {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue