![]() 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-form/js/components/CKEditor.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ScalableComponent = _interopRequireDefault(require("../core/ScalableComponent")); var _FCore = require("../core/FCore"); var _Assembler = require("../core/Assembler"); var _ResizeSystem = _interopRequireDefault(require("absol/src/HTML5/ResizeSystem")); var _inheritComponentClass = _interopRequireDefault(require("../core/inheritComponentClass")); var _CKPlaceholder = _interopRequireDefault(require("absol-acomp/js/ckeditor/CKPlaceholder")); /*** * @extends ScalableComponent * @constructor */ function CKEditor() { _ScalableComponent.default.call(this); this.editior = null; this._pendingData = null; setTimeout(() => { if (this.style.width !== 'auto') return; var bf = this.domElt.previousSibling; if (!bf || !bf.fmComponent) return; var bfComp = bf.fmComponent; var subWidth = 0; if (bfComp.tag !== 'Label') return; if (bfComp.style.hidden === true) return; if (typeof bfComp.style.width === "number") { subWidth = bfComp.style.width; if (typeof bfComp.style.marginRight === "number") { subWidth += bfComp.style.marginRight; } } if (subWidth) { this.domElt.style.setProperty('width', 'calc(100% - ' + Math.ceil(subWidth) + 'px)'); dispatchEvent(new Event('change')); } }); } (0, _inheritComponentClass.default)(CKEditor, _ScalableComponent.default); CKEditor.prototype.menuIcon = 'span.mdi.mdi-file-word-box'; CKEditor.prototype.tag = 'CKEditor'; CKEditor.prototype.style.width = 600; CKEditor.prototype.style.height = 'auto'; CKEditor.prototype.style.display = 'inline-block'; CKEditor.prototype.style.vAlign = 'top'; CKEditor.prototype.render = function () { this.placeHolderElt = (0, _FCore._)({ tag: _CKPlaceholder.default.tag, on: { editorcreated: this.ev_editorCreated.bind(this), change: function () { this.pinFire('data'); this.notifyChange(); }.bind(this), editorready: function () { _ResizeSystem.default.update(); } } }); return (0, _FCore._)({ class: 'as-ckeditor-wrapper', child: this.placeHolderElt }); }; CKEditor.prototype.onCreated = function () { this.placeHolderElt.requestUpdateSize = this.requestUpdateSize.bind(this); _ResizeSystem.default.add(this.placeHolderElt); }; CKEditor.prototype.ev_editorCreated = function () { this.editor = this.placeHolderElt.editor; this.editor.on('instanceReady', this.requestUpdateSize.bind(this)); }; CKEditor.prototype.onSizeChange = function () { this.requestUpdateSize(); }; CKEditor.prototype.requestUpdateSize = function () { if (this.editor) { var b = this.domElt.getBoundingClientRect(); try { this.editor.resize(typeof this.style.width === "number" ? this.style.width : null, typeof this.style.height === "number" ? this.style.height : b.height); } catch (err) {} } }; CKEditor.prototype.attributes.toolbar = 'SIMPLE'; CKEditor.prototype.pinHandlers.data = { get: function () { return this.attributes.data; }, receives: function (value) { this.attributes.data = value; }, descriptor: { type: 'text' } }; CKEditor.prototype.attributeHandlers.data = { set: function (value) { var prevData = this.placeHolderElt.data; this.placeHolderElt.data = value; if (value !== prevData) { this.pinFire('data'); this.notifyChange(); } }, get: function () { return this.placeHolderElt.data; }, descriptor: { type: 'text' } }; CKEditor.prototype.attributeHandlers.toolbar = { set: function (value) { this.placeHolderElt.config = this.placeHolderElt.config || {}; this.placeHolderElt.config.toolbar = value; }, descriptor: { type: 'enum', values: ['SIMPLE', 'ADVANCE'] } }; CKEditor.prototype.createDataBindingDescriptor = function () { var thisC = this; return { configurable: true, set: function (value) { thisC.attributes.data = value; }, get: function () { return thisC.attributes.data; } }; }; _Assembler.AssemblerInstance.addClass(CKEditor); var _default = CKEditor; exports.default = _default;