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
2f9089ee
Commit
2f9089ee
authored
Oct 26, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates #1261 More file upload fixes
parent
98b27fbe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
src/converse-message-view.js
src/converse-message-view.js
+2
-1
src/headless/converse-chatboxes.js
src/headless/converse-chatboxes.js
+6
-5
src/templates/file_progress.html
src/templates/file_progress.html
+1
-1
No files found.
src/converse-message-view.js
View file @
2f9089ee
...
...
@@ -208,7 +208,8 @@ converse.plugins.add('converse-message-view', {
renderFileUploadProgresBar
()
{
const
msg
=
u
.
stringToElement
(
tpl_file_progress
(
_
.
extend
(
this
.
model
.
toJSON
(),
{
'
filesize
'
:
filesize
(
this
.
model
.
file
.
size
),
'
filename
'
:
this
.
model
.
file
.
name
,
'
filesize
'
:
filesize
(
this
.
model
.
file
.
size
)
})));
this
.
replaceElement
(
msg
);
this
.
renderAvatar
();
...
...
src/headless/converse-chatboxes.js
View file @
2f9089ee
...
...
@@ -206,8 +206,8 @@ converse.plugins.add('converse-chatboxes', {
});
};
xhr
.
open
(
'
PUT
'
,
this
.
get
(
'
put
'
),
true
);
xhr
.
setRequestHeader
(
"
Content-type
"
,
this
.
get
(
'
file
'
)
.
type
);
xhr
.
send
(
this
.
get
(
'
file
'
)
);
xhr
.
setRequestHeader
(
"
Content-type
"
,
this
.
file
.
type
);
xhr
.
send
(
this
.
file
);
}
});
...
...
@@ -331,8 +331,9 @@ converse.plugins.add('converse-chatboxes', {
}
stanza
.
c
(
'
reference
'
,
attrs
).
up
();
});
if
(
message
.
get
(
'
file
'
))
{
stanza
.
c
(
'
x
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
OUTOFBAND
}).
c
(
'
url
'
).
t
(
message
.
get
(
'
message
'
)).
up
();
if
(
message
.
get
(
'
oob_url
'
))
{
stanza
.
c
(
'
x
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
OUTOFBAND
}).
c
(
'
url
'
).
t
(
message
.
get
(
'
oob_url
'
)).
up
();
}
if
(
message
.
get
(
'
edited
'
))
{
stanza
.
c
(
'
replace
'
,
{
...
...
@@ -440,7 +441,7 @@ converse.plugins.add('converse-chatboxes', {
const
message
=
this
.
messages
.
create
(
_
.
extend
(
this
.
getOutgoingMessageAttributes
(),
{
'
file
'
:
fil
e
,
'
file
'
:
tru
e
,
'
progress
'
:
0
,
'
slot_request_url
'
:
slot_request_url
}),
{
'
silent
'
:
true
}
...
...
src/templates/file_progress.html
View file @
2f9089ee
<div
class=
"message chat-msg"
data-isodate=
"{{{o.time}}}"
data-msgid=
"{{{o.msgid}}}"
>
<canvas
class=
"avatar chat-msg__avatar"
height=
"36"
width=
"36"
></canvas>
<div
class=
"chat-msg__content"
>
<span
class=
"chat-msg__text"
>
Uploading file:
<strong>
{{{o.file
.
name}}}
</strong>
, {{{o.filesize}}}
</span>
<span
class=
"chat-msg__text"
>
Uploading file:
<strong>
{{{o.filename}}}
</strong>
, {{{o.filesize}}}
</span>
<progress
value=
"{{{o.progress}}}"
/>
</div>
</div>
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