![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/gadevoir/app/dom/ |
Upload File : |
import Core, {$, _} from "./Core"; import '../../style/contactitem.css'; /*** * @extends AElement * @constructor */ function ContactItem() { this.$name = $('.gdv-contact-item-name', this); this.$status = $('.gdv-contact-item-status', this); this._name = ''; this.name = 'Noname'; this.$voiceBtn = $('.gdv-contact-item-voice-btn', this) .on('click', this.emit.bind(this, 'pressvoice', { type: 'pressvoice', target: this }, this)); this.$videoBtn = $('.gdv-contact-item-video-btn', this) .on('click', this.emit.bind(this, 'pressvideo', { type: 'pressvideo', target: this }, this)); } ContactItem.tag = 'ContactItem'.toLowerCase(); ContactItem.render = function () { return _({ extendEvent: ['pressvoice', 'pressvideo'], class: 'gdv-contact-item', child: [ { class: 'gdv-contact-item-name', child: { text: "NoName" } }, { class: 'gdv-contact-item-status', child: { text: "offline" } }, { tag: 'button', class: 'gdv-contact-item-voice-btn', child: 'span.mdi.mdi-phone-message-outline' }, { tag: 'button', class: 'gdv-contact-item-video-btn', child: 'span.mdi.mdi-message-video' } ] }); }; ContactItem.property = {}; ContactItem.property.name = { set: function (value) { value = (value || '') + ''; this.$name.firstChild.data = value; }, get: function () { return this.$name.firstChild.data; } }; ContactItem.property.online = { set: function (value) { if (value) { this.addClass('gdv-online'); this.$status.firstChild.data = 'online'; } else { this.$status.firstChild.data = 'offline'; this.removeClass('gdv-online'); } }, get: function () { return this.containsClass('gdv-online'); } }; Core.install(ContactItem); export default ContactItem;