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/application/sidebar/src/ |
Upload File : |
/** * Bitrix Im * Core application * * @package bitrix * @subpackage im * @copyright 2001-2020 Bitrix */ import {Core} from "im.application.core"; import {VueVendorV2} from "ui.vue"; // vue components import './component/bx-messenger-sidebar'; import './sidebar.css'; import "im.view.list.recent"; import "im.view.list.sidebar"; export class SidebarApplication { /* region 01. Initialize */ constructor(params = {}) { this.inited = false; this.initPromise = new BX.Promise; this.params = params; this.template = null; this.rootNode = this.params.node || document.createElement('div'); this.templateTemp = null; this.rootNodeTemp = this.params.nodeTemp || document.createElement('div'); this.eventBus = new VueVendorV2; this.initCore() .then(() => this.initParams()) .then(() => this.initComponent()) .then(() => this.initComplete()) ; } initCore() { return new Promise((resolve, reject) => { Core.ready().then(controller => { this.controller = controller; resolve(); }) }); } initParams() { return new Promise((resolve, reject) => resolve()); } initComponent() { return this.controller.createVue(this, { el: this.rootNode, template: `<bx-im-component-sidebar/>`, }) .then(vue => { this.template = vue; return new Promise((resolve, reject) => resolve()); }) } initComplete() { this.inited = true; this.initPromise.resolve(this); return this.requestData(); } requestData() { this.controller.recent.drawPlaceholders(); this.controller.recent.getRecentData(); return new Promise((resolve, reject) => resolve()); } ready() { if (this.inited) { let promise = new BX.Promise; promise.resolve(this); return promise; } return this.initPromise; } /* endregion 01. Initialize */ /* region 02. Event Bus */ emit(eventName, params = {}) { this.eventBus.$emit(eventName, params); return true; } listen(eventName, callback) { if (typeof callback !== 'function') { return false; } this.eventBus.$on(eventName, callback); return true; } /* endregion 02. Event Bus */ }