From 490f26031ec25f603fc839e0b92e8cafeb323a47 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sun, 12 Oct 2014 14:49:45 +0200 Subject: [PATCH] Add registerPlugin API method. --- converse.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/converse.js b/converse.js index a475b9140..f6bbbc251 100644 --- a/converse.js +++ b/converse.js @@ -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); + }, }; }));