![]() 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-poser/dom/viewer/PVSection.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _Core = _interopRequireWildcard(require("../Core")); var _Attributes = _interopRequireDefault(require("absol/src/AppPattern/Attributes")); var _utils = require("../../utils"); var _utils2 = require("absol-acomp/js/utils"); function PVSection() { this.$name = (0, _Core.$)('.ap-section-name-ctn > span', this); this.$description = (0, _Core.$)('.ap-section-description', this); this.$imageCtn = (0, _Core.$)('.ap-section-image-ctn', this); this.$idx = (0, _Core.$)('.ap-section-idx', this); this._idx = 1; this.idx = this._idx; this._data = new _Attributes.default(this); this._data.loadAttributeHandlers(this.dataHandlers); } PVSection.tag = 'PVSection'.toLowerCase(); PVSection.render = function () { return (0, _Core._)({ class: ['ap-block', 'ap-section'], child: [{ class: 'ap-section-header', child: [{ child: { class: 'ap-section-idx', child: { text: 1 } } }, { class: 'ap-section-name-ctn', child: { tag: 'span', child: { text: '' } } }] }, { class: 'ap-section-body', child: [{ class: 'ap-section-description', child: { text: '' } }, { class: 'ap-section-image-ctn' }] }] }); }; PVSection.property = {}; PVSection.property.idx = { set: function (value) { this._idx = value; this.$idx.firstChild.data = value + ''; }, get: function () { return this._idx; } }; PVSection.property.data = { set: function (data) { Object.assign(this._data, data); }, get: function () { return this._data; } }; PVSection.prototype.dataHandlers = {}; PVSection.prototype.dataHandlers.name = { set: function (value) { this.$name.firstChild.data = value; }, get: function () { return this.$name.firstChild.data; } }; PVSection.prototype.dataHandlers.description = { set: function (value) { this.$description.firstChild.data = value; }, get: function () { return this.$description.firstChild.data; } }; PVSection.prototype.dataHandlers.images = { set: function (images) { images = images || []; this.$imageCtn.clearChild(); this.$images = images.map(function (img) { if (img instanceof Blob || img instanceof File) { img = (0, _utils.toImageUrl)(img); } return (0, _Core._)({ tag: 'img', props: { src: img } }); }); this.$imageCtn.addChild(this.$images); return images; } }; PVSection.prototype.dataHandlers.ident = { set: function (value) { if (!(0, _utils2.isRealNumber)(value)) value = 0; this.attr('data-ident', value + ''); }, get: function () { var ident = parseInt(this.attr('data-ident')); if (!(0, _utils2.isRealNumber)(ident)) ident = 0; return ident; } }; _Core.default.install(PVSection); var _default = PVSection; exports.default = _default;