Commit 490f2603 authored by JC Brand's avatar JC Brand

Add registerPlugin API method.

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