Commit c6e57c00 authored by JC Brand's avatar JC Brand

Add jquery.eventemitter

parent 762ba21c
......@@ -26,6 +26,7 @@ require.config({
"crypto.mode-ctr": "components/otr/vendor/cryptojs/mode-ctr",
"crypto": "src/crypto",
"eventemitter": "components/otr/build/dep/eventemitter",
"jquery.eventemitter": "src/jquery.eventemitter",
"otr": "components/otr/build/otr",
"converse-dependencies": "src/deps-full"
},
......
......@@ -2,6 +2,7 @@ define("converse-dependencies", [
"otr",
"locales",
"backbone.localStorage",
"jquery.eventemitter",
"jquery.tinysort",
"strophe",
"strophe.muc",
......
(function (root, factory) {
if (typeof console === "undefined" || typeof console.log === "undefined") {
console = { log: function () {}, error: function () {} };
}
if (typeof define === 'function' && define.amd) {
define("converse", ["jquery"], function($) {
return factory($);
});
} else {
factory($);
}
}(this, function ($) {
$.eventEmitter = {
emit: function(evt, data) {
$(this).trigger(evt, data);
},
once: function(evt, handler) {
$(this).one(evt, handler);
},
on: function(evt, handler) {
$(this).bind(evt, handler);
},
off: function(evt, handler) {
$(this).unbind(evt, handler);
}
};
}));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment