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