diff --git a/converse.js b/converse.js index 46a264fc7..c87b91414 100644 --- a/converse.js +++ b/converse.js @@ -347,7 +347,7 @@ this.reconnect = function () { converse.giveFeedback(__('Reconnecting'), 'error'); - converse.emit('onReconnect'); + converse.emit('reconnect'); if (!converse.prebind) { this.connection.connect( this.connection.jid, @@ -595,7 +595,7 @@ } } }, this)); - converse.emit('onReady'); + converse.emit('ready'); }; // Backbone Models and Views @@ -938,7 +938,7 @@ ) ); this.renderToolbar().renderAvatar(); - converse.emit('onChatBoxOpened', this); + converse.emit('chatBoxOpened', this); setTimeout(function () { converse.refreshWebkit(); }, 50); @@ -1116,7 +1116,7 @@ } else { this.sendMessage(message); } - converse.emit('onMessageSend', message); + converse.emit('messageSend', message); } this.$el.data('composing', false); } else if (!this.model.get('chatroom')) { @@ -1260,7 +1260,7 @@ toggleCall: function (ev) { ev.stopPropagation(); - converse.emit('onCallButtonClicked', { + converse.emit('callButtonClicked', { connection: converse.connection, model: this.model }); @@ -1282,11 +1282,11 @@ this.$el.find('div.chat-event').remove(); } } - converse.emit('onBuddyStatusChanged', item.attributes, item.get('chat_status')); + converse.emit('buddyStatusChanged', item.attributes, item.get('chat_status')); } if (_.has(item.changed, 'status')) { this.showStatusMessage(); - converse.emit('onBuddyStatusMessageChanged', item.attributes, item.get('status')); + converse.emit('buddyStatusMessageChanged', item.attributes, item.get('status')); } if (_.has(item.changed, 'image')) { this.renderAvatar(); @@ -1321,7 +1321,7 @@ } else { this.model.trigger('hide'); } - converse.emit('onChatBoxClosed', this); + converse.emit('chatBoxClosed', this); return this; }, @@ -1330,7 +1330,7 @@ this.$el.insertAfter(converse.chatboxviews.get("controlbox").$el).show('fast', $.proxy(function () { converse.refreshWebkit(); this.focus(); - converse.emit('onChatBoxMaximized', this); + converse.emit('chatBoxMaximized', this); }, this)); }, @@ -1341,7 +1341,7 @@ // Minimizes a chat box this.model.minimize(); this.$el.hide('fast', converse.refreshwebkit); - converse.emit('onChatBoxMinimized', this); + converse.emit('chatBoxMinimized', this); }, updateVCard: function () { @@ -1441,7 +1441,7 @@ focus: function () { this.$el.find('.chat-textarea').focus(); - converse.emit('onChatBoxFocused', this); + converse.emit('chatBoxFocused', this); return this; }, @@ -1841,7 +1841,7 @@ hide: function (callback) { this.$el.hide('fast', function () { converse.refreshWebkit(); - converse.emit('onChatBoxClosed', this); + converse.emit('chatBoxClosed', this); converse.controlboxtoggle.show(function () { if (typeof callback === "function") { callback(); @@ -1855,7 +1855,7 @@ this.$el.show('fast', function () { converse.refreshWebkit(); }.bind(this)); - converse.emit('onControlBoxOpened', this); + converse.emit('controlBoxOpened', this); }, this)); return this; }, @@ -2374,7 +2374,7 @@ }); if (display_sender === 'room') { // We only emit an event if it's not our own message - converse.emit('onMessage', message); + converse.emit('message', message); } return true; }, @@ -2489,7 +2489,7 @@ } chatbox.receiveMessage($message); converse.roster.addResource(buddy_jid, resource); - converse.emit('onMessage', message); + converse.emit('message', message); return true; } }); @@ -2663,7 +2663,7 @@ } this.remove(); this.model.destroy(); - converse.emit('onChatBoxClosed', this); + converse.emit('chatBoxClosed', this); return this; }, @@ -3048,7 +3048,7 @@ }, rosterHandler: function (items) { - converse.emit('onRoster', items); + converse.emit('roster', items); this.cleanCache(items); _.each(items, function (item, index, items) { if (this.isSelf(item.jid)) { return; } @@ -3352,7 +3352,7 @@ if (!$count.is(':visible')) { $count.show(); } - converse.emit('onRosterViewUpdated'); + converse.emit('rosterViewUpdated'); return this; }, @@ -3383,10 +3383,10 @@ ); } if (_.has(item.changed, 'status')) { - converse.emit('onStatusChanged', this.get('status')); + converse.emit('statusChanged', this.get('status')); } if (_.has(item.changed, 'status_message')) { - converse.emit('onStatusMessageChanged', this.get('status_message')); + converse.emit('statusMessageChanged', this.get('status_message')); } }, this)); }, @@ -3762,7 +3762,7 @@ } if (this.show_controlbox_by_default) { this.controlboxtoggle.showControlBox(); } this.registerGlobalEventHandlers(); - converse.emit('onInitialized'); + converse.emit('initialized'); }; return { 'initialize': function (settings, callback) { diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index 2811d0790..8e04aac22 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -9,6 +9,7 @@ Changelog 2. Configuration options for the chat toolbar have changed. Please refer to the `relevant documentation `_. +* Events have been renamed to remove "on" prefix (which is redundant when used with 'on' method). [jcbrand] * Simplified Chinese Translations [Lancelot] * No initial HTML markup is now needed in the document body for converse.js to work. [jcbrand] * All date handling is now done with moment.js. [jcbrand] diff --git a/docs/doctrees/index.doctree b/docs/doctrees/index.doctree index 30f698f08..0c3659c33 100644 Binary files a/docs/doctrees/index.doctree and b/docs/doctrees/index.doctree differ diff --git a/docs/html/_sources/index.txt b/docs/html/_sources/index.txt index 9c9de92cd..78b22d75a 100644 --- a/docs/html/_sources/index.txt +++ b/docs/html/_sources/index.txt @@ -52,13 +52,6 @@ bottom of your page (after the closing ** element). }); }); - -Finally, Converse.js requires a special snippet of HTML markup to be included in your page: - -:: - -
- The `index.html `_ file inside the Converse.js repository serves as a nice usable example of this. @@ -734,7 +727,7 @@ Event Methods For example:: - converse.on('onMessage', function (messageXML) { ... }); + converse.on('message', function (messageXML) { ... }); * **once(eventName, callback)**: @@ -748,7 +741,7 @@ Event Methods For example:: - converse.once('onMessage', function (messageXML) { ... }); + converse.once('message', function (messageXML) { ... }); * **off(eventName, callback)** @@ -768,35 +761,37 @@ Here are the different events that are emitted: +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ | Event Type | When is it triggered? | Example | +==================================+===================================================================================================+=========================================================================================+ -| **onInitialized** | Once converse.js has been initialized. | ``converse.on('onInitialized', function () { ... });`` | +| **initialized** | Once converse.js has been initialized. | ``converse.on('initialized', function () { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onReady** | After connection has been established and converse.js has got all its ducks in a row. | ``converse.on('onReady', function () { ... });`` | +| **ready** | After connection has been established and converse.js has got all its ducks in a row. | ``converse.on('ready', function () { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onReconnect** | After the connection has dropped. Converse.js will attempt to reconnect when not in prebind mode. | ``converse.on('onReconnect', function () { ... });`` | +| **reconnect** | After the connection has dropped. Converse.js will attempt to reconnect when not in prebind mode. | ``converse.on('reconnect', function () { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onMessage** | When a message is received. | ``converse.on('onMessage', function (messageXML) { ... });`` | +| **message** | When a message is received. | ``converse.on('message', function (messageXML) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onMessageSend** | When a message will be sent out. | ``converse.on('onMessageSend', function (messageText) { ... });`` | +| **messageSend** | When a message will be sent out. | ``converse.on('messageSend', function (messageText) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onRoster** | When the roster is updated. | ``converse.on('onRoster', function (items) { ... });`` | +| **roster** | When the roster is updated. | ``converse.on('roster', function (items) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onRosterViewUpdated** | Whenever the roster view (i.e. the rendered HTML) has changed. | ``converse.on('onRosterViewUpdated', function (items) { ... });`` | +| **rosterViewUpdated** | Whenever the roster view (i.e. the rendered HTML) has changed. | ``converse.on('rosterViewUpdated', function (items) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onChatBoxOpened** | When a chat box has been opened. | ``converse.on('onChatBoxOpened', function (chatbox) { ... });`` | +| **callButtonClicked** | When a call button (i.e. with class .toggle-call) on a chat box has been clicked. | ``converse.on('callButtonClicked', function (connection, model) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onChatBoxClosed** | When a chat box has been closed. | ``converse.on('onChatBoxClosed', function (chatbox) { ... });`` | +| **chatBoxOpened** | When a chat box has been opened. | ``converse.on('chatBoxOpened', function (chatbox) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onChatBoxFocused** | When the focus has been moved to a chat box. | ``converse.on('onChatBoxFocused', function (chatbox) { ... });`` | +| **chatBoxClosed** | When a chat box has been closed. | ``converse.on('chatBoxClosed', function (chatbox) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onChatBoxToggled** | When a chat box has been minimized or maximized. | ``converse.on('onChatBoxToggled', function (chatbox) { ... });`` | +| **chatBoxFocused** | When the focus has been moved to a chat box. | ``converse.on('chatBoxFocused', function (chatbox) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onStatusChanged** | When own chat status has changed. | ``converse.on('onStatusChanged', function (status) { ... });`` | +| **chatBoxToggled** | When a chat box has been minimized or maximized. | ``converse.on('chatBoxToggled', function (chatbox) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onStatusMessageChanged** | When own custom status message has changed. | ``converse.on('onStatusMessageChanged', function (message) { ... });`` | +| **statusChanged** | When own chat status has changed. | ``converse.on('statusChanged', function (status) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onBuddyStatusChanged** | When a chat buddy's chat status has changed. | ``converse.on('onBuddyStatusChanged', function (buddy, status) { ... });`` | +| **statusMessageChanged** | When own custom status message has changed. | ``converse.on('statusMessageChanged', function (message) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ -| **onBuddyStatusMessageChanged** | When a chat buddy's custom status message has changed. | ``converse.on('onBuddyStatusMessageChanged', function (buddy, messageText) { ... });`` | +| **buddyStatusChanged** | When a chat buddy's chat status has changed. | ``converse.on('buddyStatusChanged', function (buddy, status) { ... });`` | ++----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ +| **buddyStatusMessageChanged** | When a chat buddy's custom status message has changed. | ``converse.on('buddyStatusMessageChanged', function (buddy, messageText) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ ============= @@ -1005,7 +1000,7 @@ The "controlbox" refers to the special chatbox containing your contacts roster, status widget, chatrooms and other controls. By default this box is hidden and can be toggled by clicking on any element in -the page with class *toggle-online-users*. +the page with class *toggle-controlbox*. If this options is set to true, the controlbox will by default be shown upon page load. @@ -1018,6 +1013,25 @@ Default: ``false`` If set to ``true``, only online users will be shown in the contacts roster. Users with any other status (e.g. away, busy etc.) will not be shown. +storage +------- + +Default: ``session`` + +Valid options: ``session``, ``local``. + +This option determines the type of `storage `_ +(``localStorage`` or ``sessionStorage``) used by converse.js to cache user data. + +Originally converse.js used only localStorage, however sessionStorage is from a +privacy perspective a better choice. + +The main difference between the two is that sessionStorage only persists while +the current tab or window containing a converse.js instance is open. As soon as +it's closed, the data is cleared. + +Data in localStorage on the other hand is kept indefinitely. + use_otr_by_default ------------------ @@ -1058,7 +1072,7 @@ Allows you to show or hide buttons on the chat boxes' toolbars. :: - converse.on('onCallButtonClicked', function(event, data) { + converse.on('callButtonClicked', function(event, data) { console.log('Strophe connection is', data.connection); console.log('Bare buddy JID is', data.model.get('jid')); // ... Third-party library code ... diff --git a/docs/html/index.html b/docs/html/index.html index 064222366..2f95cb8f6 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -65,85 +65,86 @@

Table of Contents

-

Quickstart (to get a demo up and running)

+

Quickstart (to get a demo up and running)

When you download a specific release of Converse.js there will be two minified files inside the zip file.

  • converse.min.js
  • @@ -181,9 +182,6 @@ bottom of your page (after the closing </body> element).

    }); });
-

Finally, Converse.js requires a special snippet of HTML markup to be included in your page:

-
<div id="conversejs"></div>
-

The index.html file inside the Converse.js repository serves as a nice usable example of this.

These minified files provide the same demo-like functionality as is available @@ -198,7 +196,7 @@ the minified Javascript file. Read -

Introduction

+

Introduction

Even though you can connect to public XMPP servers on the conversejs.org website, Converse.js is not really meant to be a “Software-as-a-service” (SaaS) webchat.

@@ -217,9 +215,9 @@ code.

requirements.

-

What you will need

+

What you will need

-

An XMPP/Jabber server

+

An XMPP/Jabber server

Converse.js implements XMPP as its messaging protocol, and therefore needs to connect to an XMPP/Jabber server (Jabber is really just a synonym for XMPP).

You can connect to public XMPP servers like jabber.org but if you want to @@ -228,7 +226,7 @@ have Session Support y servers that you can set up yourself on xmpp.org.

-

Connection Manager

+

Connection Manager

Your website and Converse.js use HTTP as protocol to communicate with the webserver. HTTP connections are stateless and usually shortlived.

XMPP on the other hand, is the protocol that enables instant messaging, and @@ -243,7 +241,7 @@ includes a connection manager (but you have to enable it).

This connection manager is for testing purposes only, please don’t use it in production.

-

Overcoming cross-domain request restrictions

+

Overcoming cross-domain request restrictions

The domain of the Converse.js demo is conversejs.org, but the domain of the connection manager is opkode.im. HTTP requests are made by Converse.js to the connection manager via XmlHttpRequests (XHR). Until recently, it was not possible to make such requests to a different domain @@ -292,9 +290,9 @@ the cross-domain restriction is m

-

Server-side authentication

+

Server-side authentication

-

Prebinding and Single Session Support

+

Prebinding and Single Session Support

It’s possible to enable single-site login, whereby users already authenticated in your website will also automatically be logged in on the chat server,

This session should also persist across page loads. In other words, we don’t @@ -351,7 +349,7 @@ Additionally you need to pass in valid jid, sid

-

Example code for server-side prebinding

+

Example code for server-side prebinding

  • PHP:
    @@ -369,14 +367,14 @@ Michael Weibel and the folks from Candy chat.

-

Setting up a BOSH server

+

Setting up a BOSH server

The Movim project wiki has a very thorough page on setting up a BOSH server for a wide variety of standalone or XMPP servers.

http://wiki.movim.eu/manual:bosh_servers

-

Facebook integration

+

Facebook integration

Note

It should be possible to integrate Converse.js with Facebook chat, and @@ -419,9 +417,9 @@ Until then, people will have to do this themselves.

-

Features

+

Features

-

Off-the-record encryption

+

Off-the-record encryption

Converse.js supports Off-the-record (OTR) encrypted messaging.

The OTR protocol not only encrypts your messages, it provides ways to @@ -444,13 +442,13 @@ communications privacy, then you’re much better off using native software.

-

Development

+

Development

If you want to work with the non-minified Javascript and CSS files you’ll soon notice that there are references to a missing components folder. Please follow the instructions below to create this folder and fetch Converse’s 3rd-party dependencies.

-

Install the development and front-end dependencies

+

Install the development and front-end dependencies

We use development tools (Grunt and Bower) which depend on Node.js and npm (the Node package manager).

If you don’t have Node.js installed, you can download and install the latest @@ -483,7 +481,7 @@ Converse.js directly depends and which will therefore be loaded in the browser.<

-

Without AMD and require.js

+

Without AMD and require.js

Converse.js can also be used without require.js. If you for some reason prefer to use it this way, please refer to non_amd.html @@ -504,9 +502,9 @@ for an example of how and in what order all the Javascript files that converse.j depends on need to be loaded.

-

Before submitting a pull request

+

Before submitting a pull request

-

Add tests for your bugfix or feature

+

Add tests for your bugfix or feature

Add a test for any bug fixed or feature added. We use Jasmine for testing.

Take a look at tests.html and spec/MainSpec.js to see how @@ -515,7 +513,7 @@ the tests are implemented.

contact me and I’ll be happy to help.

-

Check that the tests pass

+

Check that the tests pass

Check that the Jasmine tests complete sucessfully. Open tests.html in your browser, and the tests will run automatically.

@@ -524,7 +522,7 @@ in your browser, and the tests will run automatically.

-

Check your code for errors or bad habits by running JSHint

+

Check your code for errors or bad habits by running JSHint

JSHint will do a static analysis of your code and hightlight potential errors and/or bad habits.

grunt jshint
@@ -535,9 +533,9 @@ and/or bad habits.

-

Minification

+

Minification

-

Minifying Javascript and CSS

+

Minifying Javascript and CSS

Please make sure to read the section Development and that you have installed all development dependencies (long story short, you can run npm install and then grunt fetch).

@@ -554,7 +552,7 @@ using alm
-

Translations

+

Translations

Note

Translations take up a lot of space and will bloat your minified file. @@ -631,18 +629,18 @@ those hoops you had to jump through.

-

Troubleshooting

+

Troubleshooting

-

Conflicts with other Javascript libraries

+

Conflicts with other Javascript libraries

-

Problem:

+

Problem:

You are using other Javascript libraries (like JQuery plugins), and get errors like these in your browser console:

Uncaught TypeError: Object [object Object] has no method 'xxx' from example.js
-

Solution:

+

Solution:

First, find out which object is referred to by Object [object Object].

It will probably be the jQuery object $ or perhaps the underscore.js object _.

For the purpose of demonstration, I’m going to assume its $, but the same @@ -684,11 +682,11 @@ jQuery plugins must load after jQuery).

-

Events

+

Events

Converse.js emits events to which you can subscribe from your own Javascript.

Concerning events, the following methods are available:

-

Event Methods

+

Event Methods

  • on(eventName, callback):

    @@ -701,7 +699,7 @@ called.

  • callback is the callback method to be called when the event is emitted.

For example:

-
converse.on('onMessage', function (messageXML) { ... });
+
converse.on('message', function (messageXML) { ... });
@@ -715,7 +713,7 @@ exactly once.

  • callback is the callback method to be called when the event is emitted.
  • For example:

    -
    converse.once('onMessage', function (messageXML) { ... });
    +
    converse.once('message', function (messageXML) { ... });
    @@ -732,7 +730,7 @@ exactly once.

    -

    Event Types

    +

    Event Types

    Here are the different events that are emitted:

    @@ -747,72 +745,76 @@ exactly once.

    - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
    onInitialized
    initialized Once converse.js has been initialized.converse.on('onInitialized', function () { ... });converse.on('initialized', function () { ... });
    onReady
    ready After connection has been established and converse.js has got all its ducks in a row.converse.on('onReady', function () { ... });converse.on('ready', function () { ... });
    onReconnect
    reconnect After the connection has dropped. Converse.js will attempt to reconnect when not in prebind mode.converse.on('onReconnect', function () { ... });converse.on('reconnect', function () { ... });
    onMessage
    message When a message is received.converse.on('onMessage', function (messageXML) { ... });converse.on('message', function (messageXML) { ... });
    onMessageSend
    messageSend When a message will be sent out.converse.on('onMessageSend', function (messageText) { ... });converse.on('messageSend', function (messageText) { ... });
    onRoster
    roster When the roster is updated.converse.on('onRoster', function (items) { ... });converse.on('roster', function (items) { ... });
    onRosterViewUpdated
    rosterViewUpdated Whenever the roster view (i.e. the rendered HTML) has changed.converse.on('onRosterViewUpdated', function (items) { ... });converse.on('rosterViewUpdated', function (items) { ... });
    onChatBoxOpened
    callButtonClickedWhen a call button (i.e. with class .toggle-call) on a chat box has been clicked.converse.on('callButtonClicked', function (connection, model) { ... });
    chatBoxOpened When a chat box has been opened.converse.on('onChatBoxOpened', function (chatbox) { ... });converse.on('chatBoxOpened', function (chatbox) { ... });
    onChatBoxClosed
    chatBoxClosed When a chat box has been closed.converse.on('onChatBoxClosed', function (chatbox) { ... });converse.on('chatBoxClosed', function (chatbox) { ... });
    onChatBoxFocused
    chatBoxFocused When the focus has been moved to a chat box.converse.on('onChatBoxFocused', function (chatbox) { ... });converse.on('chatBoxFocused', function (chatbox) { ... });
    onChatBoxToggled
    chatBoxToggled When a chat box has been minimized or maximized.converse.on('onChatBoxToggled', function (chatbox) { ... });converse.on('chatBoxToggled', function (chatbox) { ... });
    onStatusChanged
    statusChanged When own chat status has changed.converse.on('onStatusChanged', function (status) { ... });converse.on('statusChanged', function (status) { ... });
    onStatusMessageChanged
    statusMessageChanged When own custom status message has changed.converse.on('onStatusMessageChanged', function (message) { ... });converse.on('statusMessageChanged', function (message) { ... });
    onBuddyStatusChanged
    buddyStatusChanged When a chat buddy’s chat status has changed.converse.on('onBuddyStatusChanged', function (buddy, status) { ... });converse.on('buddyStatusChanged', function (buddy, status) { ... });
    onBuddyStatusMessageChanged
    buddyStatusMessageChanged When a chat buddy’s custom status message has changed.converse.on('onBuddyStatusMessageChanged', function (buddy, messageText) { ... });converse.on('buddyStatusMessageChanged', function (buddy, messageText) { ... });
    -

    Configuration

    +

    Configuration

    The included minified JS and CSS files can be used for demoing or testing, but you’ll want to configure Converse.js to suit your needs before you deploy it on your website.

    @@ -826,9 +828,9 @@ all the available configuration settings.

    JS file so that it will include the new settings. Please refer to the Minification section for more info on how to do this.

    -

    Configuration variables

    +

    Configuration variables

    -

    allow_contact_requests

    +

    allow_contact_requests

    Default: true

    Allow users to add one another as contacts. If this is set to false, the Add a contact widget, Contact Requests and Pending Contacts roster @@ -836,23 +838,23 @@ sections will all not appear. Additionally, all incoming contact requests will b ignored.

    -

    allow_muc

    +

    allow_muc

    Default: true

    Allow multi-user chat (muc) in chatrooms. Setting this to false will remove the Chatrooms tab from the control box.

    -

    allow_muc

    +

    allow_muc

    Default: true

    Allow Off-the-record encryption of single-user chat messages.

    -

    animate

    +

    animate

    Default: true

    Show animations, for example when opening and closing chat boxes.

    -

    auto_list_rooms

    +

    auto_list_rooms

    Default: false

    If true, and the XMPP server on which the current user is logged in supports multi-user chat, then a list of rooms on that server will be fetched.

    @@ -862,24 +864,24 @@ features, number of occupants etc.), so on servers with many rooms this option will create lots of extra connection traffic.

    -

    auto_reconnect

    +

    auto_reconnect

    Default: true

    Automatically reconnect to the XMPP server if the connection drops unexpectedly.

    -

    auto_subscribe

    +

    auto_subscribe

    Default: false

    If true, the user will automatically subscribe back to any contact requests.

    -

    bosh_service_url

    +

    bosh_service_url

    Connections to an XMPP server depend on a BOSH connection manager which acts as a middle man between HTTP and XMPP.

    See here for more information.

    -

    cache_otr_key

    +

    cache_otr_key

    Default: false

    Let the OTR (Off-the-record encryption) private key be cached in your browser’s session storage.

    @@ -898,17 +900,17 @@ current session. Previous sessions however cannot be decrypted.

    -

    debug

    +

    debug

    Default: false

    If set to true, debugging output will be logged to the browser console.

    -

    expose_rid_and_sid

    +

    expose_rid_and_sid

    Default: false

    Allow the prebind tokens, RID (request ID) and SID (session ID), to be exposed globally via the API. This allows other scripts served on the same page to use @@ -917,7 +919,7 @@ these values.

    and inject fake chat messages.

    -

    forward_messages

    +

    forward_messages

    Default: false

    If set to true, sent messages will also be forwarded to other connected XMPP resources (e.g. chat clients) of the same user.

    @@ -926,24 +928,24 @@ browser and you want sent messages to appear in all of them.

    See also XEP 0297: Stanza Forwarding

    -

    fullname

    +

    fullname

    If you are using prebinding, can specify the fullname of the currently logged in user, otherwise the user’s vCard will be fetched.

    -

    hide_muc_server

    +

    hide_muc_server

    Default: false

    Hide the server input field of the form inside the Room panel of the controlbox. Useful if you want to restrict users to a specific XMPP server of your choosing.

    -

    i18n

    +

    i18n

    Specify the locale/language. The language must be in the locales object. Refer to ./locale/locales.js to see which locales are supported.

    -

    prebind

    +

    prebind

    Default: false

    Use this option when you want to attach to an existing XMPP connection that was already authenticated (usually on the backend before page load).

    @@ -956,36 +958,49 @@ values as jid, Additionally, you have to specify bosh_service_url.

    -

    show_controlbox_by_default

    +

    show_controlbox_by_default

    Default: false

    The “controlbox” refers to the special chatbox containing your contacts roster, status widget, chatrooms and other controls.

    By default this box is hidden and can be toggled by clicking on any element in -the page with class toggle-online-users.

    +the page with class toggle-controlbox.

    If this options is set to true, the controlbox will by default be shown upon page load.

    -

    show_only_online_users

    +

    show_only_online_users

    Default: false

    If set to true, only online users will be shown in the contacts roster. Users with any other status (e.g. away, busy etc.) will not be shown.

    +
    +

    storage

    +

    Default: session

    +

    Valid options: session, local.

    +

    This option determines the type of storage +(localStorage or sessionStorage) used by converse.js to cache user data.

    +

    Originally converse.js used only localStorage, however sessionStorage is from a +privacy perspective a better choice.

    +

    The main difference between the two is that sessionStorage only persists while +the current tab or window containing a converse.js instance is open. As soon as +it’s closed, the data is cleared.

    +

    Data in localStorage on the other hand is kept indefinitely.

    +
    -

    use_otr_by_default

    +

    use_otr_by_default

    Default: false

    If set to true, Converse.js will automatically try to initiate an OTR (off-the-record) encrypted chat session every time you open a chat box.

    -

    use_vcards

    +

    use_vcards

    Default: true

    Determines whether the XMPP server will be queried for roster contacts’ VCards or not. VCards contain extra personal information such as your fullname and avatar image.

    -

    visible_toolbar_buttons

    +

    visible_toolbar_buttons

    Default:

    {
         'emoticons': true,
    @@ -1006,7 +1021,7 @@ avatar image.

    call:

    Provides a button with a picture of a telephone on it. When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.

    -
    converse.on('onCallButtonClicked', function(event, data) {
    +
    converse.on('callButtonClicked', function(event, data) {
         console.log('Strophe connection is', data.connection);
         console.log('Bare buddy JID is', data.model.get('jid'));
         // ... Third-party library code ...
    @@ -1024,7 +1039,7 @@ When the call button is pressed, it will emit an event that can be used by a thi
     
     
    -

    xhr_custom_status

    +

    xhr_custom_status

    Default: false

    Note

    @@ -1034,7 +1049,7 @@ When the call button is pressed, it will emit an event that can be used by a thi remote server.

    -

    xhr_custom_status_url

    +

    xhr_custom_status_url

    Note

    XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous Javascript and XML).

    @@ -1046,7 +1061,7 @@ message will be made.

    The message itself is sent in the request under the key msg.