![]() 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/RemoteSvg.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ACore = _interopRequireDefault(require("../ACore")); var _XHR = _interopRequireDefault(require("absol/src/Network/XHR")); var _ = _ACore.default._; var $ = _ACore.default.$; function RemoteSvg() {} RemoteSvg.tag = 'RemoteSvg'.toLowerCase(); RemoteSvg.render = function () { return _('svg').defineEvent('load'); }; RemoteSvg.property = { src: { set: function (value) { this._src = value; var self = this; RemoteSvg.loadIcon(value).then(function (data) { self.emit('load', { target: self, src: value, data: data }, self); self.attr(data.attr); self.init(data.props); }); }, get: function () { return this._name; } } }; RemoteSvg.attribute = { src: { set: function (value) {}, get: function () {}, remove: function () {} } }; RemoteSvg.__cache__ = {}; RemoteSvg.__div_parser__ = document.createElement('div'); RemoteSvg.loadIcon = function (path) { if (RemoteSvg.__cache__[path]) { return RemoteSvg.__cache__[path]; } else { RemoteSvg.__cache__[path] = _XHR.default.getRequest(path, 'text').then(function (result) { RemoteSvg.__div_parser__.innerHTML = result; var svgElt = $('svg', RemoteSvg.__div_parser__); var res = { attr: {}, props: {} }; if (svgElt) { Array.prototype.forEach.call(svgElt.attributes, function (attribute) { res.attr[attribute.name] = attribute.value; }); res.props.innerHTML = svgElt.innerHTML; } return res; }, function () { return {}; }); return RemoteSvg.__cache__[path]; } }; _ACore.default.install(RemoteSvg); var _default = RemoteSvg; exports.default = _default;