Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
cb241dd5
Commit
cb241dd5
authored
Feb 19, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved all the registration code into a plugin
parent
147a3c9e
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
566 additions
and
467 deletions
+566
-467
converse.js
converse.js
+2
-1
docs/CHANGES.md
docs/CHANGES.md
+3
-3
main.js
main.js
+1
-0
src/converse-core.js
src/converse-core.js
+4
-446
src/converse-muc.js
src/converse-muc.js
+7
-2
src/converse-otr.js
src/converse-otr.js
+13
-6
src/converse-register.js
src/converse-register.js
+527
-0
src/utils.js
src/utils.js
+9
-9
No files found.
converse.js
View file @
cb241dd5
...
...
@@ -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
"
...
...
docs/CHANGES.md
View file @
cb241dd5
...
...
@@ -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]
...
...
main.js
View file @
cb241dd5
...
...
@@ -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
"
,
...
...
src/converse-core.js
View file @
cb241dd5
This diff is collapsed.
Click to expand it.
src/converse-muc.js
View file @
cb241dd5
...
...
@@ -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
,
...
...
src/converse-otr.js
View file @
cb241dd5
...
...
@@ -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
,
...
...
src/converse-register.js
0 → 100644
View file @
cb241dd5
This diff is collapsed.
Click to expand it.
src/utils.js
View file @
cb241dd5
/*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 actionInfoMessage
s
*/
* 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.j
s
*/
return
str
;
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment