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
a15c9e54
Commit
a15c9e54
authored
Apr 22, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also test for when XEP-0363 is not supported
Updates #161
parent
d73394fa
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
8 deletions
+52
-8
css/converse.css
css/converse.css
+1
-2
css/inverse.css
css/inverse.css
+1
-2
sass/_core.scss
sass/_core.scss
+0
-1
spec/http-file-upload.js
spec/http-file-upload.js
+45
-0
src/converse-chatview.js
src/converse-chatview.js
+5
-3
No files found.
css/converse.css
View file @
a15c9e54
...
...
@@ -7123,8 +7123,7 @@ body.reset {
#conversejs
form
.converse-form
.text-muted.error
{
color
:
#A53214
;
}
#conversejs
form
.converse-centered-form
{
text-align
:
center
;
width
:
100%
;
}
text-align
:
center
;
}
#conversejs
.chat-textarea-chatbox-selected
{
border
:
1px
solid
#578308
;
margin
:
0
;
}
...
...
css/inverse.css
View file @
a15c9e54
...
...
@@ -7123,8 +7123,7 @@ body.reset {
#conversejs
form
.converse-form
.text-muted.error
{
color
:
#A53214
;
}
#conversejs
form
.converse-centered-form
{
text-align
:
center
;
width
:
100%
;
}
text-align
:
center
;
}
#conversejs
.chat-textarea-chatbox-selected
{
border
:
1px
solid
#578308
;
margin
:
0
;
}
...
...
sass/_core.scss
View file @
a15c9e54
...
...
@@ -440,7 +440,6 @@ body.reset {
}
&
.converse-centered-form
{
text-align
:
center
;
width
:
100%
;
}
}
...
...
spec/http-file-upload.js
View file @
a15c9e54
...
...
@@ -172,6 +172,51 @@
}));
});
describe
(
"
When not supported
"
,
function
()
{
describe
(
"
A file upload toolbar button
"
,
function
()
{
it
(
"
does not appear in private chats
"
,
mock
.
initConverseWithAsync
(
function
(
done
,
_converse
)
{
var
contact_jid
=
mock
.
cur_names
[
2
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
test_utils
.
waitUntilDiscoConfirmed
(
_converse
,
_converse
.
domain
,
[{
'
category
'
:
'
server
'
,
'
type
'
:
'
IM
'
}],
[
'
http://jabber.org/protocol/disco#items
'
],
[],
'
info
'
).
then
(
function
()
{
test_utils
.
waitUntilDiscoConfirmed
(
_converse
,
_converse
.
domain
,
[],
[],
[],
'
items
'
).
then
(
function
()
{
var
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
expect
(
view
.
el
.
querySelector
(
'
.chat-toolbar .upload-file
'
)).
toBe
(
null
);
done
();
});
});
}));
it
(
"
does not appear in MUC chats
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
).
then
(
function
()
{
test_utils
.
waitUntilDiscoConfirmed
(
_converse
,
_converse
.
domain
,
[{
'
category
'
:
'
server
'
,
'
type
'
:
'
IM
'
}],
[
'
http://jabber.org/protocol/disco#items
'
],
[],
'
info
'
).
then
(
function
()
{
test_utils
.
waitUntilDiscoConfirmed
(
_converse
,
_converse
.
domain
,
[],
[],
[
'
upload.localhost
'
],
'
items
'
).
then
(
function
()
{
test_utils
.
waitUntilDiscoConfirmed
(
_converse
,
'
upload.localhost
'
,
[],
[
Strophe
.
NS
.
HTTPUPLOAD
],
[]).
then
(
function
()
{
var
view
=
_converse
.
chatboxviews
.
get
(
'
lounge@localhost
'
);
expect
(
view
.
el
.
querySelector
(
'
.chat-toolbar .upload-file
'
)).
toBe
(
null
);
done
();
});
});
});
});
}));
});
});
describe
(
"
When supported
"
,
function
()
{
describe
(
"
A file upload toolbar button
"
,
function
()
{
...
...
src/converse-chatview.js
View file @
a15c9e54
...
...
@@ -334,9 +334,11 @@
addFileUploadButton
(
options
)
{
_converse
.
api
.
disco
.
supports
(
Strophe
.
NS
.
HTTPUPLOAD
,
_converse
.
domain
).
then
((
result
)
=>
{
if
(
result
.
length
)
{
this
.
el
.
querySelector
(
'
.chat-toolbar
'
).
insertAdjacentHTML
(
'
beforeend
'
,
tpl_toolbar_fileupload
({
'
tooltip_upload_file
'
:
__
(
'
Choose a file to send
'
)}));
}
});
},
...
...
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