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
9da214fb
Commit
9da214fb
authored
Sep 06, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Match uppercase file names and extensions
parent
c7ae1880
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
dist/converse.js
dist/converse.js
+7
-5
src/utils/core.js
src/utils/core.js
+13
-10
No files found.
dist/converse.js
View file @
9da214fb
...
...
@@ -80956,22 +80956,24 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
u.renderFileURL = function (_converse, url) {
const uri = new URI(url),
__ = _converse.__,
filename = uri.filename();
filename = uri.filename(),
lower_filename = filename.toLowerCase();
if (!_.includes(["https", "http"], uri.protocol()
) || filename.endsWith('mp3') || filename.endsWith('mp4') || filename.endsWith('jpg') || filename.endsWith('jpeg') || filename.endsWith('png') || filename.endsWith('gif') ||
filename.endsWith('svg')) {
if (!_.includes(["https", "http"], uri.protocol()
.toLowerCase()) || lower_filename.endsWith('mp3') || lower_filename.endsWith('mp4') || lower_filename.endsWith('jpg') || lower_filename.endsWith('jpeg') || lower_filename.endsWith('png') || lower_filename.endsWith('gif') || lower_
filename.endsWith('svg')) {
return url;
}
return tpl_file({
'url': url,
'label_download': __('Download "%1$s"',
filename
)
'label_download': __('Download "%1$s"',
uri.filename()
)
});
};
u.renderImageURL = function (_converse, url) {
const __ = _converse.__;
const __ = _converse.__,
lurl = url.toLowerCase();
if (
url.endsWith('jpg') || url.endsWith('jpeg') || url.endsWith('png') || url.endsWith('gif') ||
url.endsWith('svg')) {
if (
lurl.endsWith('jpg') || lurl.endsWith('jpeg') || lurl.endsWith('png') || lurl.endsWith('gif') || l
url.endsWith('svg')) {
return tpl_image({
'url': url,
'label_download': __('Download')
src/utils/core.js
View file @
9da214fb
...
...
@@ -308,25 +308,28 @@
u
.
renderFileURL
=
function
(
_converse
,
url
)
{
const
uri
=
new
URI
(
url
),
{
__
}
=
_converse
,
filename
=
uri
.
filename
();
if
(
!
_
.
includes
([
"
https
"
,
"
http
"
],
uri
.
protocol
())
||
filename
.
endsWith
(
'
mp3
'
)
||
filename
.
endsWith
(
'
mp4
'
)
||
filename
.
endsWith
(
'
jpg
'
)
||
filename
.
endsWith
(
'
jpeg
'
)
||
filename
.
endsWith
(
'
png
'
)
||
filename
.
endsWith
(
'
gif
'
)
||
filename
.
endsWith
(
'
svg
'
))
{
filename
=
uri
.
filename
(),
lower_filename
=
filename
.
toLowerCase
();
if
(
!
_
.
includes
([
"
https
"
,
"
http
"
],
uri
.
protocol
().
toLowerCase
())
||
lower_filename
.
endsWith
(
'
mp3
'
)
||
lower_filename
.
endsWith
(
'
mp4
'
)
||
lower_filename
.
endsWith
(
'
jpg
'
)
||
lower_filename
.
endsWith
(
'
jpeg
'
)
||
lower_filename
.
endsWith
(
'
png
'
)
||
lower_filename
.
endsWith
(
'
gif
'
)
||
lower_filename
.
endsWith
(
'
svg
'
))
{
return
url
;
}
return
tpl_file
({
'
url
'
:
url
,
'
label_download
'
:
__
(
'
Download "%1$s"
'
,
filename
)
'
label_download
'
:
__
(
'
Download "%1$s"
'
,
uri
.
filename
()
)
})
};
u
.
renderImageURL
=
function
(
_converse
,
url
)
{
const
{
__
}
=
_converse
;
if
(
url
.
endsWith
(
'
jpg
'
)
||
url
.
endsWith
(
'
jpeg
'
)
||
url
.
endsWith
(
'
png
'
)
||
url
.
endsWith
(
'
gif
'
)
||
url
.
endsWith
(
'
svg
'
))
{
const
{
__
}
=
_converse
,
lurl
=
url
.
toLowerCase
();
if
(
lurl
.
endsWith
(
'
jpg
'
)
||
lurl
.
endsWith
(
'
jpeg
'
)
||
lurl
.
endsWith
(
'
png
'
)
||
lurl
.
endsWith
(
'
gif
'
)
||
lurl
.
endsWith
(
'
svg
'
))
{
return
tpl_image
({
'
url
'
:
url
,
...
...
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