Commit a30cf931 authored by JC Brand's avatar JC Brand

Split API into public and private (plugin only) parts.

parent aacee2eb
...@@ -670,9 +670,7 @@ To open a single chat box, provide the JID of the contact: ...@@ -670,9 +670,7 @@ To open a single chat box, provide the JID of the contact:
converse.plugins.add('myplugin', { converse.plugins.add('myplugin', {
initialize: function () { initialize: function () {
this._converse.chats.open('buddy@example.com') this._converse.chats.open('buddy@example.com')
} }
}); });
...@@ -682,9 +680,7 @@ To return an array of chat boxes, provide an array of JIDs: ...@@ -682,9 +680,7 @@ To return an array of chat boxes, provide an array of JIDs:
converse.plugins.add('myplugin', { converse.plugins.add('myplugin', {
initialize: function () { initialize: function () {
this._converse.chats.open(['buddy1@example.com', 'buddy2@example.com']) this._converse.chats.open(['buddy1@example.com', 'buddy2@example.com'])
} }
}); });
...@@ -743,7 +739,6 @@ It takes 3 parameters: ...@@ -743,7 +739,6 @@ It takes 3 parameters:
converse.plugins.add('myplugin', { converse.plugins.add('myplugin', {
initialize: function () { initialize: function () {
var nick = 'dread-pirate-roberts'; var nick = 'dread-pirate-roberts';
var create_if_not_found = true; var create_if_not_found = true;
this._converse.rooms.open( this._converse.rooms.open(
...@@ -751,7 +746,6 @@ It takes 3 parameters: ...@@ -751,7 +746,6 @@ It takes 3 parameters:
{'nick': nick}, {'nick': nick},
create_if_not_found create_if_not_found
) )
} }
}); });
...@@ -957,11 +951,7 @@ grouping: ...@@ -957,11 +951,7 @@ grouping:
.. code-block:: javascript .. code-block:: javascript
<<<<<<< 3699a0af5c53a1ba4f8fd030421e4f976368b404
_converse.listen.on('message', function (messageXML) { ... }); _converse.listen.on('message', function (messageXML) { ... });
=======
converse.listen.on('message', function (messageXML) { ... });
>>>>>>> Replace jQuery-based event emitter with Backbone.Events
* **once(eventName, callback, [context])**: * **once(eventName, callback, [context])**:
...@@ -978,11 +968,7 @@ grouping: ...@@ -978,11 +968,7 @@ grouping:
.. code-block:: javascript .. code-block:: javascript
<<<<<<< 3699a0af5c53a1ba4f8fd030421e4f976368b404
_converse.listen.once('message', function (messageXML) { ... }); _converse.listen.once('message', function (messageXML) { ... });
=======
converse.listen.once('message', function (messageXML) { ... });
>>>>>>> Replace jQuery-based event emitter with Backbone.Events
* **not(eventName, callback)** * **not(eventName, callback)**
...@@ -997,9 +983,4 @@ grouping: ...@@ -997,9 +983,4 @@ grouping:
.. code-block:: javascript .. code-block:: javascript
<<<<<<< 3699a0af5c53a1ba4f8fd030421e4f976368b404
_converse.listen.not('message', function (messageXML) { ... }); _converse.listen.not('message', function (messageXML) { ... });
=======
converse.listen.not('message', function (messageXML) { ... });
>>>>>>> Replace jQuery-based event emitter with Backbone.Events
...@@ -239,11 +239,9 @@ ...@@ -239,11 +239,9 @@
// Test on chat that doesn't exist. // Test on chat that doesn't exist.
expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy(); expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy();
var jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; var jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost';
// Test on chat that's not open // Test on chat that's not open
var box = _converse.api.chats.get(jid); var box = _converse.api.chats.get(jid);
expect(typeof box === 'undefined').toBeTruthy(); expect(typeof box === 'undefined').toBeTruthy();
var chatboxview = _converse.chatboxviews.get(jid); var chatboxview = _converse.chatboxviews.get(jid);
// Test for single JID // Test for single JID
test_utils.openChatBoxFor(_converse, jid); test_utils.openChatBoxFor(_converse, jid);
......
...@@ -9,9 +9,7 @@ ...@@ -9,9 +9,7 @@
var Strophe = converse.env.Strophe; var Strophe = converse.env.Strophe;
describe("Service Discovery", function () { describe("Service Discovery", function () {
describe("Whenever converse.js discovers a new server feature", function () {
describe("Whenever _converse.js discovers a new server feature", function () {
it("emits the serviceDiscovered event", mock.initConverse(function (_converse) { it("emits the serviceDiscovered event", mock.initConverse(function (_converse) {
spyOn(_converse, 'emit'); spyOn(_converse, 'emit');
_converse.features.create({'var': Strophe.NS.MAM}); _converse.features.create({'var': Strophe.NS.MAM});
......
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