![]() 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/libs/absol-full/dist/js/ |
Upload File : |
/*** module: node_modules/absol-acomp/js/KVCommentItem.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; require("../css/kvcommentitem.css"); var _ACore = _interopRequireWildcard(require("../ACore")); var _datetime = require("absol/src/Time/datetime"); var _ContextMenu = _interopRequireDefault(require("./ContextMenu")); var _utils = require("./utils"); /*** * @extends AElement * @constructor */ function KVCommentItem() { this._time = new Date(); this._text = ''; this.$text = (0, _ACore.$)('.kv-comment-item-text', this); this.$time = (0, _ACore.$)('.kv-comment-item-time', this); this.$avatar = (0, _ACore.$)('.kv-comment-avatar', this); this.quickmenu = null; this.on('contextmenu', this.eventHandler.kv_contextmenu); _ContextMenu.default.auto(); } KVCommentItem.tag = 'KVCommentItem'.toLowerCase(); KVCommentItem.render = function () { return (0, _ACore._)({ extendEvent: 'contextmenu', class: "kv-comment-item", child: [{ class: "kv-comment-avatar-ctn", child: { class: 'kv-comment-avatar', style: { backgroundImage: 'url(https://raw.githubusercontent.com/duthienkt/absol/master/logo.svg?sanitize=true)' } } }, { class: "kv-comment-item-content", child: [{ class: 'kv-comment-item-text', child: { text: '' } }, { class: 'kv-comment-item-time', child: { text: (0, _datetime.formatDateTime)(new Date(), 'dd/MM/yyyy HH:mm') } }] }, { class: "kv-comment-item-flag-ctn", child: ['.kv-comment-item-flag-unread'] }] }); }; KVCommentItem.property = {}; KVCommentItem.property.text = { set: function (value) { value = value || ''; if (typeof value === 'string') this.$text.innerHTML = value;else if (absol.Dom.isDomNode(value)) { this.$text.clearChild().addChild(value); } else { this.$text.clearChild().addChild((0, _ACore._)(value)); } this._text = value; }, get: function () { return this._text; } }; KVCommentItem.property.unread = { set: function (value) { if (value) { this.addClass('as-unread'); } else { this.removeClass('as-unread'); } }, get: function () { return this.hasClass('as-unread'); } }; KVCommentItem.property.time = { set: function (value) { this._time = value; var text = ''; if (typeof value === 'string') text = value;else if (value instanceof Date) { text = (0, _datetime.formatDateTime)(value, 'dd/MM/yyyy HH:mm'); } this.$time.firstChild.data = text; }, get: function () { return this._time; } }; KVCommentItem.property.avatar = { set: function (value) { value = value || 'https://raw.githubusercontent.com/duthienkt/absol/master/logo.svg?sanitize=true'; this._avatar = value; this.$avatar.addStyle('backgroundImage', 'url(' + value + ')'); }, get: function () { return this._avatar; } }; /*** * @memberOf KVCommentItem# * @type {{}} */ KVCommentItem.eventHandler = {}; /*** * @this KVCommentItem * @param event */ KVCommentItem.eventHandler.kv_contextmenu = function (event) { if (this.quickmenu) { event.showContextMenu(this.quickmenu.props, function (event) { var menuItem = (0, _utils.cleanMenuItemProperty)(event.menuItem); if (this.quickmenu.onSelect) { this.quickmenu.onSelect.call(this, menuItem); } }.bind(this)); } }; _ACore.default.install(KVCommentItem); var _default = KVCommentItem; exports.default = _default;