Add registerPlugin API method.

This commit is contained in:
JC Brand 2014-10-12 14:49:45 +02:00
parent 1955c611e1
commit 490f26031e

View File

@ -135,6 +135,7 @@
};
var converse = {
plugins: {},
templates: templates,
emit: function (evt, data) {
$(this).trigger(evt, data);
@ -4666,6 +4667,7 @@
'initialize': function (settings, callback) {
converse.initialize(settings, callback);
},
'jQuery': $,
'openChatBox': function (jid) {
var contact = converse.roster.get(Strophe.getBareJidFromJid(jid));
if (contact) {
@ -4681,6 +4683,8 @@
'off': function (evt, handler) {
converse.off(evt, handler);
},
'jQuery': $
'registerPlugin': function (name, callback) {
converse.plugins[name] = callback(converse);
},
};
}));