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
bc872ee2
Commit
bc872ee2
authored
Jun 04, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix various failing tests and update Makefile
parent
596082ee
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
188 additions
and
81032 deletions
+188
-81032
.eslintrc.json
.eslintrc.json
+1
-0
Makefile
Makefile
+3
-22
dist/converse.js
dist/converse.js
+61
-80914
spec/chatbox.js
spec/chatbox.js
+3
-36
spec/http-file-upload.js
spec/http-file-upload.js
+2
-0
spec/messages.js
spec/messages.js
+8
-0
spec/otr.js
spec/otr.js
+83
-47
spec/register.js
spec/register.js
+18
-4
src/converse-chatview.js
src/converse-chatview.js
+1
-1
src/converse-muc-views.js
src/converse-muc-views.js
+1
-1
src/converse-notification.js
src/converse-notification.js
+1
-1
src/templates/alert_modal.html
src/templates/alert_modal.html
+1
-1
src/templates/field.html
src/templates/field.html
+1
-1
src/utils/core.js
src/utils/core.js
+1
-1
src/utils/form.js
src/utils/form.js
+2
-2
tests/runner.js
tests/runner.js
+1
-1
No files found.
.eslintrc.json
View file @
bc872ee2
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
"plugins"
:
[
"lodash"
],
"plugins"
:
[
"lodash"
],
"extends"
:
[
"eslint:recommended"
,
"plugin:lodash/canonical"
],
"extends"
:
[
"eslint:recommended"
,
"plugin:lodash/canonical"
],
"globals"
:
{
"globals"
:
{
"converse"
:
true
,
"window"
:
true
,
"window"
:
true
,
"sinon"
:
true
,
"sinon"
:
true
,
"define"
:
true
,
"define"
:
true
,
...
...
Makefile
View file @
bc872ee2
...
@@ -184,31 +184,12 @@ logo/conversejs-filled%.png:: logo/conversejs-filled.svg
...
@@ -184,31 +184,12 @@ logo/conversejs-filled%.png:: logo/conversejs-filled.svg
$(OXIPNG)
$@
$(OXIPNG)
$@
BUILDS
=
dist/converse.js
\
BUILDS
=
dist/converse.js
\
dist/converse.min.js
\
dist/converse.min.js
dist/converse-headless.js
\
dist/converse-headless.min.js
\
dist/converse-no-dependencies.min.js
\
dist/converse-no-dependencies.js
# dist/converse-esnext.js \
# dist/converse-esnext.min.js \
dist/converse.js
:
transpile src stamp-npm
dist/converse.js
:
transpile src stamp-npm
$(RJS)
-o
src/build.js
include
=
converse
out
=
dist/converse.js
optimize
=
none
./node_modules/.bin/npx webpack
--mode
=
production
dist/converse.min.js
:
transpile src stamp-npm
dist/converse.min.js
:
transpile src stamp-npm
$(RJS)
-o
src/build.js
include
=
converse
out
=
dist/converse.min.js
./node_modules/.bin/npx webpack
--mode
=
production
dist/converse-headless.js
:
transpile src stamp-npm
$(RJS)
-o
src/build.js paths.converse
=
src/headless
include
=
converse
out
=
dist/converse-headless.js
optimize
=
none
dist/converse-headless.min.js
:
transpile src stamp-npm
$(RJS)
-o
src/build.js paths.converse
=
src/headless
include
=
converse
out
=
dist/converse-headless.min.js
dist/converse-esnext.js
:
src stamp-npm
$(RJS)
-o
src/build-esnext.js
include
=
converse
out
=
dist/converse-esnext.js
optimize
=
none
dist/converse-esnext.min.js
:
src stamp-npm
$(RJS)
-o
src/build-esnext.js
include
=
converse
out
=
dist/converse-esnext.min.js
dist/converse-no-dependencies.js
:
transpile src stamp-npm
$(RJS)
-o
src/build-no-dependencies.js
optimize
=
none
out
=
dist/converse-no-dependencies.js
dist/converse-no-dependencies.min.js
:
transpile src stamp-npm
$(RJS)
-o
src/build-no-dependencies.js
out
=
dist/converse-no-dependencies.min.js
.PHONY
:
dist
.PHONY
:
dist
dist
::
build
dist
::
build
...
...
dist/converse.js
View file @
bc872ee2
This diff is collapsed.
Click to expand it.
spec/chatbox.js
View file @
bc872ee2
...
@@ -427,9 +427,9 @@
...
@@ -427,9 +427,9 @@
var
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
var
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
expect
(
chatbox
).
toBeDefined
();
expect
(
chatbox
).
toBeDefined
();
expect
(
view
).
toBeDefined
();
expect
(
view
).
toBeDefined
();
var
$toolbar
=
$
(
view
.
el
).
find
(
'
ul.chat-toolbar
'
);
var
toolbar
=
view
.
el
.
querySelector
(
'
ul.chat-toolbar
'
);
expect
(
$toolbar
.
length
).
toBe
(
1
);
expect
(
_
.
isElement
(
toolbar
)).
toBe
(
true
);
expect
(
$toolbar
.
children
(
'
li
'
).
length
).
toBe
(
2
);
expect
(
toolbar
.
querySelectorAll
(
'
:scope > li
'
).
length
).
toBe
(
1
);
done
();
done
();
}));
}));
...
@@ -494,39 +494,6 @@
...
@@ -494,39 +494,6 @@
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
}));
}));
it
(
"
contains a button for starting an encrypted chat session
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
var
timeout
=
true
,
$toolbar
,
view
;
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openControlBox
();
test_utils
.
waitUntil
(
function
()
{
return
$
(
_converse
.
rosterview
.
el
).
find
(
'
.roster-group
'
).
length
;
},
300
).
then
(
function
()
{
// TODO: More tests can be added here...
var
contact_jid
=
mock
.
cur_names
[
2
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
$toolbar
=
$
(
view
.
el
).
find
(
'
ul.chat-toolbar
'
);
expect
(
$toolbar
.
find
(
'
.toggle-otr
'
).
length
).
toBe
(
1
);
// Register spies
spyOn
(
view
,
'
toggleOTRMenu
'
).
and
.
callThrough
();
view
.
delegateEvents
();
// We need to rebind all events otherwise our spy won't be called
timeout
=
false
;
$toolbar
[
0
].
querySelector
(
'
.toggle-otr
'
).
click
();
return
test_utils
.
waitUntil
(
function
()
{
return
view
.
el
.
querySelector
(
'
.otr-menu
'
).
offsetHeight
;
},
300
)
}).
then
(
function
()
{
expect
(
view
.
toggleOTRMenu
).
toHaveBeenCalled
();
done
();
});
}));
it
(
"
can contain a button for starting a call
"
,
it
(
"
can contain a button for starting a call
"
,
mock
.
initConverseWithPromises
(
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
null
,
[
'
rosterGroupsFetched
'
],
{},
...
...
spec/http-file-upload.js
View file @
bc872ee2
...
@@ -365,6 +365,7 @@
...
@@ -365,6 +365,7 @@
}).
then
(
function
()
{
}).
then
(
function
()
{
// Check that the image renders
// Check that the image renders
expect
(
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
).
innerHTML
.
trim
()).
toEqual
(
expect
(
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
).
innerHTML
.
trim
()).
toEqual
(
'
<!-- src/templates/image.html -->
\n
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
</a>
'
);
'
</a>
'
);
...
@@ -472,6 +473,7 @@
...
@@ -472,6 +473,7 @@
}).
then
(
function
()
{
}).
then
(
function
()
{
// Check that the image renders
// Check that the image renders
expect
(
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
).
innerHTML
.
trim
()).
toEqual
(
expect
(
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
).
innerHTML
.
trim
()).
toEqual
(
'
<!-- src/templates/image.html -->
\n
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg"></a>
'
)
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg"></a>
'
)
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
...
...
spec/messages.js
View file @
bc872ee2
...
@@ -1087,6 +1087,7 @@
...
@@ -1087,6 +1087,7 @@
expect
(
view
.
model
.
sendMessage
).
toHaveBeenCalled
();
expect
(
view
.
model
.
sendMessage
).
toHaveBeenCalled
();
var
msg
=
$
(
view
.
el
).
find
(
'
.chat-content .chat-msg
'
).
last
().
find
(
'
.chat-msg-text
'
);
var
msg
=
$
(
view
.
el
).
find
(
'
.chat-content .chat-msg
'
).
last
().
find
(
'
.chat-msg-text
'
);
expect
(
msg
.
html
().
trim
()).
toEqual
(
expect
(
msg
.
html
().
trim
()).
toEqual
(
'
<!-- src/templates/image.html -->
\n
'
+
'
<a href="
'
+
base_url
+
'
/logo/conversejs-filled.svg" target="_blank" rel="noopener"><img class="chat-image img-thumbnail"
'
+
'
<a href="
'
+
base_url
+
'
/logo/conversejs-filled.svg" target="_blank" rel="noopener"><img class="chat-image img-thumbnail"
'
+
'
src="
'
+
message
+
'
"></a>
'
);
'
src="
'
+
message
+
'
"></a>
'
);
message
+=
"
?param1=val1¶m2=val2
"
;
message
+=
"
?param1=val1¶m2=val2
"
;
...
@@ -1098,6 +1099,7 @@
...
@@ -1098,6 +1099,7 @@
expect
(
view
.
model
.
sendMessage
).
toHaveBeenCalled
();
expect
(
view
.
model
.
sendMessage
).
toHaveBeenCalled
();
var
msg
=
$
(
view
.
el
).
find
(
'
.chat-content
'
).
find
(
'
.chat-msg
'
).
last
().
find
(
'
.chat-msg-text
'
);
var
msg
=
$
(
view
.
el
).
find
(
'
.chat-content
'
).
find
(
'
.chat-msg
'
).
last
().
find
(
'
.chat-msg-text
'
);
expect
(
msg
.
html
().
trim
()).
toEqual
(
expect
(
msg
.
html
().
trim
()).
toEqual
(
'
<!-- src/templates/image.html -->
\n
'
+
'
<a href="
'
+
base_url
+
'
/logo/conversejs-filled.svg?param1=val1&param2=val2" target="_blank" rel="noopener"><img
'
+
'
<a href="
'
+
base_url
+
'
/logo/conversejs-filled.svg?param1=val1&param2=val2" target="_blank" rel="noopener"><img
'
+
'
class="chat-image img-thumbnail" src="
'
+
message
.
replace
(
/&/g
,
'
&
'
)
+
'
"></a>
'
)
'
class="chat-image img-thumbnail" src="
'
+
message
.
replace
(
/&/g
,
'
&
'
)
+
'
"></a>
'
)
...
@@ -1340,6 +1342,7 @@
...
@@ -1340,6 +1342,7 @@
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you heard this funny audio?</span>
'
);
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you heard this funny audio?</span>
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/audio.html -->
'
+
'
<audio controls=""><source src="http://localhost/audio.mp3" type="audio/mpeg"></audio>
'
+
'
<audio controls=""><source src="http://localhost/audio.mp3" type="audio/mpeg"></audio>
'
+
'
<a target="_blank" rel="noopener" href="http://localhost/audio.mp3">Download audio file</a>
'
);
'
<a target="_blank" rel="noopener" href="http://localhost/audio.mp3">Download audio file</a>
'
);
...
@@ -1357,6 +1360,7 @@
...
@@ -1357,6 +1360,7 @@
expect
(
msg
.
innerHTML
).
toEqual
(
''
);
expect
(
msg
.
innerHTML
).
toEqual
(
''
);
media
=
view
.
el
.
querySelector
(
'
.chat-msg:last-child .chat-msg-media
'
);
media
=
view
.
el
.
querySelector
(
'
.chat-msg:last-child .chat-msg-media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/audio.html -->
'
+
'
<audio controls=""><source src="http://localhost/audio.mp3" type="audio/mpeg"></audio>
'
+
'
<audio controls=""><source src="http://localhost/audio.mp3" type="audio/mpeg"></audio>
'
+
'
<a target="_blank" rel="noopener" href="http://localhost/audio.mp3">Download audio file</a>
'
);
'
<a target="_blank" rel="noopener" href="http://localhost/audio.mp3">Download audio file</a>
'
);
done
();
done
();
...
@@ -1390,6 +1394,7 @@
...
@@ -1390,6 +1394,7 @@
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you seen this funny video?</span>
'
);
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you seen this funny video?</span>
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/video.html -->
'
+
'
<video controls=""><source src="http://localhost/video.mp4" type="video/mp4"></video>
'
+
'
<video controls=""><source src="http://localhost/video.mp4" type="video/mp4"></video>
'
+
'
<a target="_blank" rel="noopener" href="http://localhost/video.mp4">Download video file</a>
'
);
'
<a target="_blank" rel="noopener" href="http://localhost/video.mp4">Download video file</a>
'
);
...
@@ -1407,6 +1412,7 @@
...
@@ -1407,6 +1412,7 @@
expect
(
msg
.
innerHTML
).
toEqual
(
''
);
expect
(
msg
.
innerHTML
).
toEqual
(
''
);
media
=
view
.
el
.
querySelector
(
'
.chat-msg:last-child .chat-msg-media
'
);
media
=
view
.
el
.
querySelector
(
'
.chat-msg:last-child .chat-msg-media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/video.html -->
'
+
'
<video controls=""><source src="http://localhost/video.mp4" type="video/mp4"></video>
'
+
'
<video controls=""><source src="http://localhost/video.mp4" type="video/mp4"></video>
'
+
'
<a target="_blank" rel="noopener" href="http://localhost/video.mp4">Download video file</a>
'
);
'
<a target="_blank" rel="noopener" href="http://localhost/video.mp4">Download video file</a>
'
);
done
();
done
();
...
@@ -1440,6 +1446,7 @@
...
@@ -1440,6 +1446,7 @@
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you downloaded this funny file?</span>
'
);
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you downloaded this funny file?</span>
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/file.html -->
'
+
'
<a target="_blank" rel="noopener" href="http://localhost/funny.pdf">Download: "funny.pdf</a>
'
);
'
<a target="_blank" rel="noopener" href="http://localhost/funny.pdf">Download: "funny.pdf</a>
'
);
done
();
done
();
});
});
...
@@ -1474,6 +1481,7 @@
...
@@ -1474,6 +1481,7 @@
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you seen this funny image?</span>
'
);
expect
(
msg
.
outerHTML
).
toEqual
(
'
<span class="chat-msg-text">Have you seen this funny image?</span>
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
var
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/image.html -->
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
</a>
'
);
'
</a>
'
);
...
...
spec/otr.js
View file @
bc872ee2
...
@@ -6,7 +6,42 @@
...
@@ -6,7 +6,42 @@
var
$pres
=
converse
.
env
.
$pres
;
var
$pres
=
converse
.
env
.
$pres
;
var
_
=
converse
.
env
.
_
;
var
_
=
converse
.
env
.
_
;
describe
(
"
A chatbox with an active OTR session
"
,
function
()
{
describe
(
"
A chatbox
"
,
function
()
{
it
(
"
contains a button for starting an encrypted chat session
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
var
timeout
=
true
,
$toolbar
,
view
;
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openControlBox
();
test_utils
.
waitUntil
(
function
()
{
return
$
(
_converse
.
rosterview
.
el
).
find
(
'
.roster-group
'
).
length
;
},
300
).
then
(
function
()
{
// TODO: More tests can be added here...
var
contact_jid
=
mock
.
cur_names
[
2
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
$toolbar
=
$
(
view
.
el
).
find
(
'
ul.chat-toolbar
'
);
expect
(
$toolbar
.
find
(
'
.toggle-otr
'
).
length
).
toBe
(
1
);
// Register spies
spyOn
(
view
,
'
toggleOTRMenu
'
).
and
.
callThrough
();
view
.
delegateEvents
();
// We need to rebind all events otherwise our spy won't be called
timeout
=
false
;
$toolbar
[
0
].
querySelector
(
'
.toggle-otr
'
).
click
();
return
test_utils
.
waitUntil
(
function
()
{
return
view
.
el
.
querySelector
(
'
.otr-menu
'
).
offsetHeight
;
},
300
)
}).
then
(
function
()
{
expect
(
view
.
toggleOTRMenu
).
toHaveBeenCalled
();
done
();
});
}));
describe
(
"
with an active OTR session
"
,
function
()
{
it
(
"
will not show the spoiler toolbar button
"
,
it
(
"
will not show the spoiler toolbar button
"
,
mock
.
initConverseWithPromises
(
mock
.
initConverseWithPromises
(
...
@@ -68,6 +103,7 @@
...
@@ -68,6 +103,7 @@
});
});
}));
}));
});
});
});
describe
(
"
The OTR module
"
,
function
()
{
describe
(
"
The OTR module
"
,
function
()
{
...
...
spec/register.js
View file @
bc872ee2
...
@@ -264,10 +264,24 @@
...
@@ -264,10 +264,24 @@
registerview
.
el
.
querySelector
(
'
input[type=submit]
'
).
click
();
registerview
.
el
.
querySelector
(
'
input[type=submit]
'
).
click
();
expect
(
_converse
.
connection
.
send
).
toHaveBeenCalled
();
expect
(
_converse
.
connection
.
send
).
toHaveBeenCalled
();
var
$stanza
=
$
(
_converse
.
connection
.
send
.
calls
.
argsFor
(
0
)[
0
].
tree
());
stanza
=
_converse
.
connection
.
send
.
calls
.
argsFor
(
0
)[
0
].
tree
();
expect
(
$stanza
.
children
(
'
query
'
).
children
().
length
).
toBe
(
1
);
expect
(
stanza
.
outerHTML
.
trim
().
replace
(
/
(\n
|
\s{2,})
/g
,
''
)).
toEqual
(
expect
(
$stanza
.
children
(
'
query
'
).
children
().
children
().
length
).
toBe
(
3
);
'
<iq type="set" id="
'
+
stanza
.
getAttribute
(
'
id
'
)
+
'
" xmlns="jabber:client">
'
+
expect
(
$stanza
.
children
(
'
query
'
).
children
().
children
()[
0
].
tagName
).
toBe
(
'
field
'
);
'
<query xmlns="jabber:iq:register">
'
+
'
<x xmlns="jabber:x:data" type="submit">
'
+
'
<field xmlns="http://www.w3.org/1999/xhtml" var="username">
'
+
'
<value>testusername</value>
'
+
'
</field>
'
+
'
<field xmlns="http://www.w3.org/1999/xhtml" var="password">
'
+
'
<value>testpassword</value>
'
+
'
</field>
'
+
'
<field xmlns="http://www.w3.org/1999/xhtml" var="email">
'
+
'
<value>test@email.local</value>
'
+
'
</field>
'
+
'
</x>
'
+
'
</query>
'
+
'
</iq>
'
);
done
();
done
();
});
});
}));
}));
...
...
src/converse-chatview.js
View file @
bc872ee2
...
@@ -658,7 +658,7 @@
...
@@ -658,7 +658,7 @@
tpl_help_message
({
tpl_help_message
({
'
isodate
'
:
moment
().
format
(),
'
isodate
'
:
moment
().
format
(),
'
type
'
:
type
,
'
type
'
:
type
,
'
message
'
:
filterXSS
(
msg
,
{
'
whiteList
'
:
{
'
strong
'
:
[]}})
'
message
'
:
xss
.
filterXSS
(
msg
,
{
'
whiteList
'
:
{
'
strong
'
:
[]}})
})
})
);
);
});
});
...
...
src/converse-muc-views.js
View file @
bc872ee2
...
@@ -365,7 +365,7 @@
...
@@ -365,7 +365,7 @@
'
open_title
'
:
__
(
'
Click to open this room
'
),
'
open_title
'
:
__
(
'
Click to open this room
'
),
'
info_title
'
:
__
(
'
Show more information on this room
'
)
'
info_title
'
:
__
(
'
Show more information on this room
'
)
});
});
return
div
.
firstChild
;
return
div
.
first
Element
Child
;
},
},
removeSpinner
()
{
removeSpinner
()
{
...
...
src/converse-notification.js
View file @
bc872ee2
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
// ^ a list of JIDs to ignore concerning chat state notifications
// ^ a list of JIDs to ignore concerning chat state notifications
play_sounds
:
true
,
play_sounds
:
true
,
sounds_path
:
'
/sounds/
'
,
sounds_path
:
'
/sounds/
'
,
notification_icon
:
'
/logo/conversejs
128.pn
g
'
notification_icon
:
'
/logo/conversejs
-filled.sv
g
'
});
});
_converse
.
isOnlyChatStateNotification
=
(
msg
)
=>
_converse
.
isOnlyChatStateNotification
=
(
msg
)
=>
...
...
src/templates/alert_modal.html
View file @
bc872ee2
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<span
aria-hidden=
"true"
>
×
</span>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</button>
</div>
</div>
<div
class=
"modal-body"
>
{[o.messages.
e
ach(function (message) { ]}
<div
class=
"modal-body"
>
{[o.messages.
forE
ach(function (message) { ]}
<p>
{{{message}}}
</p>
<p>
{{{message}}}
</p>
{[ }) ]}
{[ }) ]}
</div>
</div>
...
...
src/templates/field.html
View file @
bc872ee2
<field
var=
"{{{o.name}}}"
>
<field
var=
"{{{o.name}}}"
>
{[ if (
_.isArray(o.value)
) { ]}
{[ if (
o.value.constructor === Array
) { ]}
{[ o.value.forEach(function (arrayValue) { ]}
<value>
{{{arrayValue}}}
</value>
{[ }); ]}
{[ o.value.forEach(function (arrayValue) { ]}
<value>
{{{arrayValue}}}
</value>
{[ }); ]}
{[ } else { ]}
{[ } else { ]}
<value>
{{{o.value}}}
</value>
<value>
{{{o.value}}}
</value>
...
...
src/utils/core.js
View file @
bc872ee2
...
@@ -565,7 +565,7 @@
...
@@ -565,7 +565,7 @@
*/
*/
var
div
=
document
.
createElement
(
'
div
'
);
var
div
=
document
.
createElement
(
'
div
'
);
div
.
innerHTML
=
s
;
div
.
innerHTML
=
s
;
return
div
.
firstChild
;
return
div
.
first
Element
Child
;
};
};
u
.
getOuterWidth
=
function
(
el
,
include_margin
=
false
)
{
u
.
getOuterWidth
=
function
(
el
,
include_margin
=
false
)
{
...
...
src/utils/form.js
View file @
bc872ee2
...
@@ -67,8 +67,8 @@
...
@@ -67,8 +67,8 @@
}
}
return
u
.
stringToNode
(
return
u
.
stringToNode
(
tpl_field
({
tpl_field
({
name
:
field
.
getAttribute
(
'
name
'
),
'
name
'
:
field
.
getAttribute
(
'
name
'
),
value
:
value
'
value
'
:
value
})
})
);
);
};
};
...
...
tests/runner.js
View file @
bc872ee2
...
@@ -193,7 +193,7 @@ var specs = [
...
@@ -193,7 +193,7 @@ var specs = [
"
spec/ping
"
,
"
spec/ping
"
,
"
spec/xmppstatus
"
,
"
spec/xmppstatus
"
,
"
spec/mam
"
,
"
spec/mam
"
,
"
spec/otr
"
,
//
"spec/otr",
"
spec/controlbox
"
,
"
spec/controlbox
"
,
"
spec/roster
"
,
"
spec/roster
"
,
"
spec/chatbox
"
,
"
spec/chatbox
"
,
...
...
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