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
30f3114c
Commit
30f3114c
authored
Feb 12, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to get the latest RID. Updates #93
parent
1a4044dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
converse.js
converse.js
+6
-0
spec/converse.js
spec/converse.js
+27
-0
tests_main.js
tests_main.js
+2
-0
No files found.
converse.js
View file @
30f3114c
...
...
@@ -3585,6 +3585,12 @@
'
initialize
'
:
function
(
settings
,
callback
)
{
converse
.
initialize
(
settings
,
callback
);
},
'
getRID
'
:
function
()
{
if
(
typeof
converse
.
connection
!==
"
undefined
"
)
{
return
converse
.
connection
.
rid
;
}
return
null
;
},
'
once
'
:
function
(
evt
,
handler
)
{
converse
.
once
(
evt
,
handler
);
},
...
...
spec/converse.js
0 → 100644
View file @
30f3114c
(
function
(
root
,
factory
)
{
define
([
"
mock
"
,
"
utils
"
],
function
(
mock
,
utils
)
{
return
factory
(
mock
,
utils
);
}
);
}
(
this
,
function
(
mock
,
utils
)
{
return
describe
(
"
Converse
"
,
$
.
proxy
(
function
(
mock
,
utils
)
{
beforeEach
(
$
.
proxy
(
function
()
{
window
.
localStorage
.
clear
();
window
.
sessionStorage
.
clear
();
},
converse
));
it
(
"
has an API method for retrieving the next RID
"
,
$
.
proxy
(
function
()
{
var
old_connection
=
converse
.
connection
;
converse
.
connection
.
rid
=
'
1234
'
;
expect
(
converse_api
.
getRID
()).
toBe
(
'
1234
'
);
converse
.
connection
=
undefined
;
expect
(
converse_api
.
getRID
()).
toBe
(
null
);
// Restore the connection
converse
.
connection
=
old_connection
;
},
converse
));
},
converse
,
mock
,
utils
));
}));
tests_main.js
View file @
30f3114c
...
...
@@ -100,6 +100,7 @@ require([
"
jasmine-html
"
],
function
(
$
,
converse
,
mock
,
jasmine
)
{
// Set up converse.js
window
.
converse_api
=
converse
;
window
.
localStorage
.
clear
();
converse
.
initialize
({
prebind
:
false
,
...
...
@@ -122,6 +123,7 @@ require([
require
([
"
jasmine-console-reporter
"
,
"
jasmine-junit-reporter
"
,
"
spec/converse
"
,
"
spec/otr
"
,
"
spec/eventemitter
"
,
"
spec/controlbox
"
,
...
...
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