diff options
Diffstat (limited to 'web/src/js/utils.js')
-rw-r--r-- | web/src/js/utils.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/web/src/js/utils.js b/web/src/js/utils.js index 459b18f3..21b7a868 100644 --- a/web/src/js/utils.js +++ b/web/src/js/utils.js @@ -58,35 +58,6 @@ var formatTimeStamp = function (seconds) { return ts.replace("T", " ").replace("Z", ""); }; -function EventEmitter() { - this.listeners = {}; -} -EventEmitter.prototype.emit = function (event) { - if (!(event in this.listeners)) { - return; - } - var args = Array.prototype.slice.call(arguments, 1); - this.listeners[event].forEach(function (listener) { - listener.apply(this, args); - }.bind(this)); -}; -EventEmitter.prototype.addListener = function (events, f) { - events.split(" ").forEach(function (event) { - this.listeners[event] = this.listeners[event] || []; - this.listeners[event].push(f); - }.bind(this)); -}; -EventEmitter.prototype.removeListener = function (events, f) { - if (!(events in this.listeners)) { - return false; - } - events.split(" ").forEach(function (event) { - var index = this.listeners[event].indexOf(f); - if (index >= 0) { - this.listeners[event].splice(index, 1); - } - }.bind(this)); -}; function getCookie(name) { var r = document.cookie.match("\\b" + name + "=([^;]*)\\b"); @@ -113,7 +84,6 @@ $(document).ajaxError(function (event, jqXHR, ajaxSettings, thrownError) { }); module.exports = { - EventEmitter: EventEmitter, formatSize: formatSize, formatTimeDelta: formatTimeDelta, formatTimeStamp: formatTimeStamp, |