From 7aa203150fc1a2ec79c681c13f0d486d531746eb Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 12 Mar 2023 23:57:48 +0200 Subject: error pages; js system to support back/front-end --- html/content/lib/emitter/dist/emitter.js | 88 -------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 html/content/lib/emitter/dist/emitter.js (limited to 'html/content/lib/emitter/dist') diff --git a/html/content/lib/emitter/dist/emitter.js b/html/content/lib/emitter/dist/emitter.js deleted file mode 100644 index 6b2a6fa..0000000 --- a/html/content/lib/emitter/dist/emitter.js +++ /dev/null @@ -1,88 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.emitter = factory()); -}(this, (function () { 'use strict'; - - function emitter(context, options) { - var _events = {}, o = options || {}, _constantEvents = {}, noop = function(){}; - - function invoke(handler, args){ - window.setTimeout(function () { - handler.apply(context, args); - }); - } - - function emit(event) { - var handlers = (_events[event] || (_events[event] = [])); - if (!handlers){ - return; - } - var args = Array.prototype.slice.call(arguments, 1); - if (o.emitting) { - o.emitting({ event: event, data: args, context: context }); - } - for (var i = 0, l = handlers.length; i < l; i++) { - invoke(handlers[i], args); - } - } - - function replay (event) { - var args = Array.prototype.slice.call(arguments, 1); - _constantEvents[event] = args; - emit.apply(null, arguments); - } - - function on(event, fn) { - if (_constantEvents[event]){ - invoke(fn, _constantEvents[event]); - return noop; - } - var handlers = (_events[event] || (_events[event] = [])); - handlers.push(fn); - return function () { - off(event, fn); - }; - } - - function off(event, fn) { - var handlers = _events[event], i, h; - if (!handlers) { - return; - } - if (Array.isArray(event)) { - for (i = 0, l = event.length; i < l; i++) { - off(event[i], fn); - } - return; - } - i = handlers.length; - while(i--) { - h = handlers[i]; - if (fn === h){ - handlers.splice(i, 1); - break; - } - } - } - - function once(event, fn) { - var unsub = on(event, function () { - fn.apply(context, arguments); - unsub(); - }); - return unsub; - } - - return { - on: on, - off: off, - emit: emit, - once: once, - replay: replay - }; - } - - return emitter; - -}))); -- cgit v1.2.3