From 081ed060ed7cad2995fde32a3e2dcccede3dea61 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 17 Mar 2021 21:23:07 +0100 Subject: [PATCH] Removed the old html tag system for channels --- shared/js/tree/Channel.ts | 8 ----- shared/js/ui/htmltags.ts | 65 --------------------------------------- 2 files changed, 73 deletions(-) diff --git a/shared/js/tree/Channel.ts b/shared/js/tree/Channel.ts index e189d163..5d2db21e 100644 --- a/shared/js/tree/Channel.ts +++ b/shared/js/tree/Channel.ts @@ -680,14 +680,6 @@ export class ChannelEntry extends ChannelTreeEntry { return "[url=channel://" + this.channelId + "/" + encodeURIComponent(this.properties.channel_name) + "]" + this.formattedChannelName() + "[/url]"; } - generate_tag(braces: boolean = false) : JQuery { - return $(htmltags.generate_channel({ - channel_name: this.properties.channel_name, - channel_id: this.channelId, - add_braces: braces - })); - } - channelType() : ChannelType { if(this.properties.channel_flag_permanent == true) return ChannelType.PERMANENT; if(this.properties.channel_flag_semi_permanent == true) return ChannelType.SEMI_PERMANENT; diff --git a/shared/js/ui/htmltags.ts b/shared/js/ui/htmltags.ts index 7e463d39..c25e9044 100644 --- a/shared/js/ui/htmltags.ts +++ b/shared/js/ui/htmltags.ts @@ -24,13 +24,6 @@ export interface ClientProperties { client_database_id?: number; /* not yet used */ } -export interface ChannelProperties { - channel_id: number, - channel_name: string, - channel_display_name?: string, - add_braces?: boolean -} - const callback_object_id = guid(); /* required for the bbcodes */ function generate_client_open(properties: ClientProperties) : string { @@ -88,48 +81,6 @@ export function generate_client_object(properties: ClientProperties) : JQuery { return $(this.generate_client(properties)); } -/* required for the bbcodes */ -function generate_channel_open(properties: ChannelProperties) : string { - let result = ""; - - /* build the opening tag:
*/ - result = result + "
"; - return result; -} - -export function generate_channel(properties: ChannelProperties) : string { - let result = generate_channel_open(properties); - /* content */ - { - if(properties.add_braces) - result = result + "\""; - result = result + htmlEscape(properties.channel_display_name || properties.channel_name || "undefined").join(" "); - if(properties.add_braces) - result = result + "\""; - } - - /* close tag */ - { - result += "
"; - } - return result; -} - -export function generate_channel_object(properties: ChannelProperties) : JQuery { - return $(this.generate_channel(properties)); -} - export namespace callbacks { export function callback_context_client(element: JQuery) { @@ -171,21 +122,5 @@ export namespace callbacks { client.showContextMenu(mouse_coordinates.x, mouse_coordinates.y); return false; } - - export function callback_context_channel(element: JQuery) { - const channel_id = parseInt(element.attr("channel-id") || "0"); - - const current_connection = server_connections.getActiveConnectionHandler(); - let channel: ChannelEntry; - if(current_connection && current_connection.channelTree) { - channel = current_connection.channelTree.findChannel(channel_id); - } - - if(!channel) - return false; - - channel.showContextMenu(mouse_coordinates.x, mouse_coordinates.y); - return false; - } } window[callback_object_id] = callbacks; \ No newline at end of file