Commit cb241dd5 authored by JC Brand's avatar JC Brand

Moved all the registration code into a plugin

parent 147a3c9e
......@@ -6,10 +6,11 @@
define("converse", [
/* Removable components
* --------------------
* Any of the following components can be removed if they're not needed.
* Any of the following components may be removed if they're not needed.
*/
"converse-muc", // XEP-0045 Multi-user chat
"converse-otr", // Off-the-record encryption for one-on-one messages
"converse-register", // XEP-0077 In-band registration
/* End: Removable components */
"converse-core"
......
......@@ -2,9 +2,9 @@
## 0.11.0 (Unreleased)
- Split converse.js into different modules. The code for the OTR and MUC
features are now in separate modules and these can be removed completely from
the build. [jcbrand]
- Split converse.js into different modules.
The code for the OTR, MUC and registration features are now in separate
modules and these can be removed completely from the build. [jcbrand]
- Don't play sound notifications for OTR messages which are setting up an
encrypted session. [jcbrand]
- Removed the `account.logout` API, instead use `user.logout`. [jcbrand]
......
......@@ -47,6 +47,7 @@ require.config({
"converse-core": "src/converse-core",
"converse-muc": "src/converse-muc",
"converse-otr": "src/converse-otr",
"converse-register": "src/converse-register",
"converse-dependencies": "src/deps-full",
"converse-templates": "src/templates",
......
This diff is collapsed.
......@@ -22,6 +22,7 @@
factory(converse, utils);
}
}(this, function (converse_api, utils) {
"use strict";
// Strophe methods for building stanzas
var Strophe = converse_api.env.Strophe,
$iq = converse_api.env.$iq,
......@@ -36,7 +37,10 @@
// Translation machinery
// ---------------------
var __ = utils.__.bind(this);
// __ is just a placeholder for now, we need to bind the utils.__ method
// to the inner converse object, which we can't here, so we do it in the
// initialize method.
var __ = function () {};
var ___ = utils.___;
// Add Strophe Namespaces
......@@ -194,8 +198,9 @@
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
var converse = this.converse;
// For translations
__ = utils.__.bind(converse);
// Configuration values for this plugin
var settings = {
allow_muc: true,
......
......@@ -23,6 +23,7 @@
factory(otr, converse, utils);
}
}(this, function (otr, converse_api, utils) {
"use strict";
// Strophe methods for building stanzas
var Strophe = converse_api.env.Strophe,
b64_sha1 = converse_api.env.b64_sha1;
......@@ -30,10 +31,6 @@
var $ = converse_api.env.jQuery,
_ = converse_api.env._;
// Translation machinery
// ---------------------
var __ = utils.__.bind(this);
var HAS_CSPRNG = ((typeof crypto !== 'undefined') &&
((typeof crypto.randomBytes === 'function') ||
(typeof crypto.getRandomValues === 'function')
......@@ -49,20 +46,28 @@
var VERIFIED= 2;
var FINISHED = 3;
// Translation aware constants
// ---------------------------
var OTR_CLASS_MAPPING = {};
OTR_CLASS_MAPPING[UNENCRYPTED] = 'unencrypted';
OTR_CLASS_MAPPING[UNVERIFIED] = 'unverified';
OTR_CLASS_MAPPING[VERIFIED] = 'verified';
OTR_CLASS_MAPPING[FINISHED] = 'finished';
// Translation aware constants
// ---------------------------
// Just a placeholder for now, we need to bind the utils.__ method to the
// inner converse object, which we can't here, so we do it in the
// initialize method.
var __ = function () {};
var OTR_TRANSLATED_MAPPING = {};
OTR_TRANSLATED_MAPPING[UNENCRYPTED] = __('unencrypted');
OTR_TRANSLATED_MAPPING[UNVERIFIED] = __('unverified');
OTR_TRANSLATED_MAPPING[VERIFIED] = __('verified');
OTR_TRANSLATED_MAPPING[FINISHED] = __('finished');
converse_api.plugins.add('otr', {
overrides: {
......@@ -486,6 +491,8 @@
* loaded by converse.js's plugin machinery.
*/
var converse = this.converse;
// For translations
__ = utils.__.bind(converse);
// Configuration values for this plugin
var settings = {
allow_otr: true,
......
This diff is collapsed.
/*global jQuery, templates, escape, Jed, _, locales */
/*global jQuery, templates, escape, _, locales */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(["jquery", "underscore", "converse-templates", "locales"], factory);
define(["jquery", "underscore", "jed", "converse-templates", "locales"], factory);
} else {
root.utils = factory(jQuery, _, templates, locales);
}
}(this, function ($, _, templates, locales) {
}(this, function ($, _, Jed, templates, locales) {
"use strict";
var XFORM_TYPE_MAP = {
......@@ -110,12 +110,12 @@
___: function (str) {
/* XXX: This is part of a hack to get gettext to scan strings to be
* translated. Strings we cannot send to the function above because
* they require variable interpolation and we don't yet have the
* variables at scan time.
*
* See actionInfoMessages
*/
* translated. Strings we cannot send to the function above because
* they require variable interpolation and we don't yet have the
* variables at scan time.
*
* See actionInfoMessages in src/converse-muc.js
*/
return str;
},
......
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