[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/system/js/ -> joomla-core-loader-es5.js (source)

   1  (function () {
   2    'use strict';
   3  
   4    function _defineProperties(target, props) {
   5      for (var i = 0; i < props.length; i++) {
   6        var descriptor = props[i];
   7        descriptor.enumerable = descriptor.enumerable || false;
   8        descriptor.configurable = true;
   9        if ("value" in descriptor) descriptor.writable = true;
  10        Object.defineProperty(target, descriptor.key, descriptor);
  11      }
  12    }
  13  
  14    function _createClass(Constructor, protoProps, staticProps) {
  15      if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  16      if (staticProps) _defineProperties(Constructor, staticProps);
  17      Object.defineProperty(Constructor, "prototype", {
  18        writable: false
  19      });
  20      return Constructor;
  21    }
  22  
  23    function _inheritsLoose(subClass, superClass) {
  24      subClass.prototype = Object.create(superClass.prototype);
  25      subClass.prototype.constructor = subClass;
  26  
  27      _setPrototypeOf(subClass, superClass);
  28    }
  29  
  30    function _getPrototypeOf(o) {
  31      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  32        return o.__proto__ || Object.getPrototypeOf(o);
  33      };
  34      return _getPrototypeOf(o);
  35    }
  36  
  37    function _setPrototypeOf(o, p) {
  38      _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  39        o.__proto__ = p;
  40        return o;
  41      };
  42  
  43      return _setPrototypeOf(o, p);
  44    }
  45  
  46    function _isNativeReflectConstruct() {
  47      if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  48      if (Reflect.construct.sham) return false;
  49      if (typeof Proxy === "function") return true;
  50  
  51      try {
  52        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  53        return true;
  54      } catch (e) {
  55        return false;
  56      }
  57    }
  58  
  59    function _construct(Parent, args, Class) {
  60      if (_isNativeReflectConstruct()) {
  61        _construct = Reflect.construct;
  62      } else {
  63        _construct = function _construct(Parent, args, Class) {
  64          var a = [null];
  65          a.push.apply(a, args);
  66          var Constructor = Function.bind.apply(Parent, a);
  67          var instance = new Constructor();
  68          if (Class) _setPrototypeOf(instance, Class.prototype);
  69          return instance;
  70        };
  71      }
  72  
  73      return _construct.apply(null, arguments);
  74    }
  75  
  76    function _isNativeFunction(fn) {
  77      return Function.toString.call(fn).indexOf("[native code]") !== -1;
  78    }
  79  
  80    function _wrapNativeSuper(Class) {
  81      var _cache = typeof Map === "function" ? new Map() : undefined;
  82  
  83      _wrapNativeSuper = function _wrapNativeSuper(Class) {
  84        if (Class === null || !_isNativeFunction(Class)) return Class;
  85  
  86        if (typeof Class !== "function") {
  87          throw new TypeError("Super expression must either be null or a function");
  88        }
  89  
  90        if (typeof _cache !== "undefined") {
  91          if (_cache.has(Class)) return _cache.get(Class);
  92  
  93          _cache.set(Class, Wrapper);
  94        }
  95  
  96        function Wrapper() {
  97          return _construct(Class, arguments, _getPrototypeOf(this).constructor);
  98        }
  99  
 100        Wrapper.prototype = Object.create(Class.prototype, {
 101          constructor: {
 102            value: Wrapper,
 103            enumerable: false,
 104            writable: true,
 105            configurable: true
 106          }
 107        });
 108        return _setPrototypeOf(Wrapper, Class);
 109      };
 110  
 111      return _wrapNativeSuper(Class);
 112    }
 113  
 114    function _assertThisInitialized(self) {
 115      if (self === void 0) {
 116        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
 117      }
 118  
 119      return self;
 120    }
 121  
 122    (function (customElements) {
 123      'strict';
 124      /**
 125       * Creates a custom element with the default spinner of the Joomla logo
 126       */
 127  
 128      var JoomlaCoreLoader = /*#__PURE__*/function (_HTMLElement) {
 129        _inheritsLoose(JoomlaCoreLoader, _HTMLElement);
 130  
 131        function JoomlaCoreLoader() {
 132          var _this;
 133  
 134          _this = _HTMLElement.call(this) || this;
 135          var template = document.createElement('template');
 136          template.innerHTML = "<style>:host{align-items:center;display:flex;height:100%;left:0;opacity:.8;overflow:hidden;position:fixed;top:0;width:100%;z-index:10000}.box{height:345px;margin:0 auto;position:relative;width:345px}.box p{color:#999;float:right;font:normal 1.25em/1em sans-serif;margin:95px 0 0}.box>span{-webkit-animation:jspinner 2s ease-in-out infinite;animation:jspinner 2s ease-in-out infinite}.box .red{-webkit-animation-delay:-1.5s;animation-delay:-1.5s}.box .blue{-webkit-animation-delay:-1s;animation-delay:-1s}.box .green{-webkit-animation-delay:-.5s;animation-delay:-.5s}.yellow{background:#f9a541;border-radius:90px;height:90px;width:90px}.yellow,.yellow:after,.yellow:before{content:\"\";left:0;position:absolute;top:0}.yellow:after,.yellow:before{background:transparent;border:50px solid #f9a541;box-sizing:content-box;width:50px}.yellow:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.yellow:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.red{background:#f44321;border-radius:90px;height:90px;width:90px}.red,.red:after,.red:before{content:\"\";left:0;position:absolute;top:0}.red:after,.red:before{background:transparent;border:50px solid #f44321;box-sizing:content-box;width:50px}.red:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.red:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.blue{background:#5091cd;border-radius:90px;height:90px;width:90px}.blue,.blue:after,.blue:before{content:\"\";left:0;position:absolute;top:0}.blue:after,.blue:before{background:transparent;border:50px solid #5091cd;box-sizing:content-box;width:50px}.blue:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.blue:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.green{background:#7ac143;border-radius:90px;height:90px;width:90px}.green,.green:after,.green:before{content:\"\";left:0;position:absolute;top:0}.green:after,.green:before{background:transparent;border:50px solid #7ac143;box-sizing:content-box;width:50px}.green:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.green:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.yellow{margin:0 0 0 255px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.red{margin:255px 0 0 255px;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.blue{margin:255px 0 0;-webkit-transform:rotate(225deg);transform:rotate(225deg)}.green{-webkit-transform:rotate(315deg);transform:rotate(315deg)}@-webkit-keyframes jspinner{0%,40%,to{opacity:.3}20%{opacity:1}}@keyframes jspinner{0%,40%,to{opacity:.3}20%{opacity:1}}@media (prefers-reduced-motion:reduce){.box>span{-webkit-animation:none;animation:none}}</style>\n<div>\n    <span class=\"yellow\"></span>\n    <span class=\"red\"></span>\n    <span class=\"blue\"></span>\n    <span class=\"green\"></span>\n    <p>&trade;</p>\n</div>"; // Patch the shadow DOM
 137  
 138          if (window.ShadyCSS) {
 139            window.ShadyCSS.prepareTemplate(template, 'joomla-core-loader');
 140          }
 141  
 142          _this.attachShadow({
 143            mode: 'open'
 144          });
 145  
 146          _this.shadowRoot.appendChild(template.content.cloneNode(true)); // Patch the shadow DOM
 147  
 148  
 149          if (window.ShadyCSS) {
 150            window.ShadyCSS.styleElement(_assertThisInitialized(_this));
 151          }
 152  
 153          return _this;
 154        }
 155  
 156        var _proto = JoomlaCoreLoader.prototype;
 157  
 158        _proto.connectedCallback = function connectedCallback() {
 159          this.style.backgroundColor = this.color;
 160          this.style.opacity = 0.8;
 161          this.shadowRoot.querySelector('div').classList.add('box');
 162        };
 163  
 164        _proto.attributeChangedCallback = function attributeChangedCallback(attr, oldValue, newValue) {
 165          switch (attr) {
 166            case 'color':
 167              if (newValue && newValue !== oldValue) {
 168                this.style.backgroundColor = this.color;
 169              }
 170  
 171              break;
 172          }
 173        };
 174  
 175        _createClass(JoomlaCoreLoader, [{
 176          key: "color",
 177          get: function get() {
 178            return this.getAttribute('color') || '#fff';
 179          },
 180          set: function set(value) {
 181            this.setAttribute('color', value);
 182          }
 183        }], [{
 184          key: "observedAttributes",
 185          get: function get() {
 186            return ['color'];
 187          }
 188        }]);
 189  
 190        return JoomlaCoreLoader;
 191      }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
 192  
 193      if (!customElements.get('joomla-core-loader')) {
 194        customElements.define('joomla-core-loader', JoomlaCoreLoader);
 195      }
 196    })(customElements);
 197  
 198  })();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer