![]() 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-card/js/dom/CActivityTooltip.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; require("../../css/cactivitytooltip.css"); var _Core = _interopRequireDefault(require("./Core")); var _Dom = _interopRequireDefault(require("absol/src/HTML5/Dom")); var _ = _Core.default._; var $ = _Core.default.$; function CActivityTooltip() { this.$headerTime = $('.cd-activity-tooltip-header-time', this); this.$timeTextNode = this.$headerTime.childNodes[1].firstChild; this.$name = $('.cd-activity-tooltip-name', this); this.$nameTextNode = this.$name.firstChild; this.$desc = $('.cd-activity-tooltip-desc', this); this.$descTextNode = this.$desc.firstChild; this.$board = $('.cd-activity-tooltip-board', this); this.$boardTextNode = this.$board.childNodes[1].firstChild; this.$list = $('.cd-activity-tooltip-list', this); this.$listTextNode = this.$list.childNodes[1].firstChild; this.$card = $('.cd-activity-tooltip-card', this); this.$cardTextNode = this.$card.childNodes[1].firstChild; } CActivityTooltip.tag = 'CActivityTooltip'.toLowerCase(); CActivityTooltip.render = function () { return _({ class: 'cd-activity-tooltip', child: [{ class: 'cd-activity-tooltip-header-time', child: ['span.mdi.mdi-flag-outline', { tag: 'span', child: { text: "" } }] }, { class: 'cd-activity-tooltip-name', child: { text: '' } }, { class: 'cd-activity-tooltip-desc', child: { text: '' } }, { class: 'cd-activity-tooltip-board', child: ['span.mdi.mdi-square', { tag: 'span', child: { text: '' } }] }, { class: 'cd-activity-tooltip-list', child: ['span.mdi.mdi-view-list', { tag: 'span', child: { text: '' } }] }, { class: 'cd-activity-tooltip-card', child: ['span.mdi.mdi-card-bulleted', { tag: 'span', child: { text: '' } }] }] }); }; CActivityTooltip.property = {}; /** * @type {CActivityTooltip} */ CActivityTooltip.property.time = { set: function (value) { this.$timeTextNode.data = value; if (value) { this.$headerTime.removeStyle('display'); } else { this.$headerTime.addStyle('display', 'none'); } }, get: function () { return this.$timeTextNode.data; } }; /** * @type {CActivityTooltip} */ CActivityTooltip.property.name = { set: function (value) { this.$nameTextNode.data = value; if (value) { this.$name.removeStyle('display'); } else { this.$name.addStyle('display', 'none'); } }, get: function () { return this.$nameTextNode.data; } }; /** * @type {CActivityTooltip} */ CActivityTooltip.property.board = { set: function (value) { this.$boardTextNode.data = value; if (value) { this.$board.removeStyle('display'); } else { this.$board.addStyle('display', 'none'); } }, get: function () { return this.$boardTextNode.data; } }; /** * @type {CActivityTooltip} */ CActivityTooltip.property.list = { set: function (value) { this.$listTextNode.data = value; if (value) { this.$list.removeStyle('display'); } else { this.$list.addStyle('display', 'none'); } }, get: function () { return this.$listTextNode.data; } }; /** * @type {CActivityTooltip} */ CActivityTooltip.property.card = { set: function (value) { this.$cardTextNode.data = value; if (value) { this.$card.removeStyle('display'); } else { this.$card.addStyle('display', 'none'); } }, get: function () { return this.$cardTextNode.data; } }; /** * @type {CActivityTooltip} */ CActivityTooltip.property.desc = { set: function (value) { this.$descTextNode.data = value; if (value) { this.$desc.removeStyle('display'); } else { this.$desc.addStyle('display', 'none'); } }, get: function () { return this.$descTextNode.data; } }; CActivityTooltip._token = null; CActivityTooltip.$instance = null; CActivityTooltip.defaultPops = { list: '', board: '', name: '', time: '' }; /** * @param {import('absol/src/Math/Vec2').default} pos * @param {*} props */ CActivityTooltip.show = function (pos, props) { if (!CActivityTooltip.$instance) { CActivityTooltip.$instance = _(CActivityTooltip.tag); } CActivityTooltip.$instance.addClass('cd-hidden'); if (!CActivityTooltip.$instance.parentElement) document.body.appendChild(CActivityTooltip.$instance); CActivityTooltip._token = Math.floor(Math.random() * 100000000) + ''; Object.assign(CActivityTooltip.$instance, CActivityTooltip.defaultPops, props); var screenSize = _Dom.default.getScreenSize(); var bound = CActivityTooltip.$instance.getBoundingClientRect(); var dx = 0, dy = 10; if (bound.width + pos.x > screenSize.width - 5) { dx = -bound.width; } if (bound.height + pos.y > screenSize.height - 5) { dy = -bound.height; } CActivityTooltip.$instance.addStyle({ left: pos.x + dx + 'px', top: pos.y + dy + 'px' }); CActivityTooltip.$instance.removeClass('cd-hidden'); return CActivityTooltip._token; }; CActivityTooltip.close = function (token) { if (arguments.length == 0) token = CActivityTooltip._token; if (token != CActivityTooltip._token) return; if (CActivityTooltip.$instance) CActivityTooltip.$instance.remove(); CActivityTooltip._token = "NONE_ACTIVE"; }; _Core.default.install(CActivityTooltip); var _default = CActivityTooltip; exports.default = _default;