SPB Git forge

spb/admin-ka

Public
41commits 1branches 0releases
172.9 MBsize
maindefault branch
19 days agolast push
JavaScript 65.5% Python 17.8% CSS 13% HTML 3.7%
2.5 KB · 53 lines javascript
Raw Blame History
1"use strict";23Object.defineProperty(exports, "__esModule", {4  value: true5});6exports["default"] = void 0;7function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }8function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }9function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }10function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }11function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }12function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }13/*14 * noVNC: HTML5 VNC client15 * Copyright (C) 2019 The noVNC authors16 * Licensed under MPL 2.0 (see LICENSE.txt)17 *18 * See README.md for usage and integration instructions.19 */20var EventTargetMixin = exports["default"] = /*#__PURE__*/function () {21  function EventTargetMixin() {22    _classCallCheck(this, EventTargetMixin);23    this._listeners = new Map();24  }25  return _createClass(EventTargetMixin, [{26    key: "addEventListener",27    value: function addEventListener(type, callback) {28      if (!this._listeners.has(type)) {29        this._listeners.set(type, new Set());30      }31      this._listeners.get(type).add(callback);32    }33  }, {34    key: "removeEventListener",35    value: function removeEventListener(type, callback) {36      if (this._listeners.has(type)) {37        this._listeners.get(type)["delete"](callback);38      }39    }40  }, {41    key: "dispatchEvent",42    value: function dispatchEvent(event) {43      var _this = this;44      if (!this._listeners.has(event.type)) {45        return true;46      }47      this._listeners.get(event.type).forEach(function (callback) {48        return callback.call(_this, event);49      });50      return !event.defaultPrevented;51    }52  }]);53}();