VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-full/dist/js/mdls__absol-acomp__js__MultiLanguageText.js
/*** module: node_modules/absol-acomp/js/MultiLanguageText.js ***/
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _ACore = _interopRequireWildcard(require("../ACore"));



/***
 * @extends AElement
 * @constructor
 */
function MultiLanguageText() {
  this._v = Array(5).fill(null);
  this._key = null;
  this.$text = document.createTextNode('');
  this.addChild(this.$text);
}

MultiLanguageText.tag = 'mlt';

MultiLanguageText.render = function () {
  return (0, _ACore._)('span');
};

MultiLanguageText.prototype._updateText = function () {
  var text = '';

  if (this._key && window.LanguageModule && window.LanguageModule.text2) {
    text = window.LanguageModule.text2(this._key, this._v);
  }

  text = text.replace(/<br>/g, '\n');
  this.$text.data = text;
};

MultiLanguageText.attribute = Array(5).fill(0).reduce((ac, u, i) => {
  ac['v' + i] = {
    set: function (value) {
      this._v[i] = value;

      this._updateText();
    },
    get: function () {
      return this._v[i];
    },
    remove: function () {
      this._v[i] = null;
    }
  };
  return ac;
}, {});
MultiLanguageText.attribute.key = {
  set: function (value) {
    this._key = value;

    this._updateText();
  },
  get: function () {
    return this._key;
  },
  remove: function () {
    this._key = null;
  }
};

MultiLanguageText.replaceAll = function (root) {
  (0, _ACore.$$)('mlt', root).forEach(elt => {
    if (elt.tagName !== 'MLT') return;
    var attr = Array.prototype.reduce.call(elt.attributes, (ac, at) => {
      ac[at.name] = at.value;
      return ac;
    }, {});
    elt.selfReplace((0, _ACore._)({
      tag: MultiLanguageText,
      attr: attr
    }));
  });
};

var _default = MultiLanguageText;
exports.default = _default;

VaKeR 2022