Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
f08e1d3c
Commit
f08e1d3c
authored
Jan 17, 2020
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TESTS for gifs
parent
f7037644
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
app/javascript/gabsocial/components/media_gallery.js
app/javascript/gabsocial/components/media_gallery.js
+5
-1
app/javascript/gabsocial/features/account_gallery/components/media_item.js
...bsocial/features/account_gallery/components/media_item.js
+2
-0
No files found.
app/javascript/gabsocial/components/media_gallery.js
View file @
f08e1d3c
...
...
@@ -175,6 +175,9 @@ class Item extends React.PureComponent {
}
else
if
(
attachment
.
get
(
'
type
'
)
===
'
gifv
'
)
{
const
autoPlay
=
!
isIOS
()
&&
autoPlayGif
;
const
attachUrl
=
attachment
.
get
(
'
url
'
);
const
gifsrc
=
attachUrl
.
indexOf
(
'
?
'
)
>
-
1
?
attachUrl
.
split
(
"
?
"
)[
0
]
:
attachUrl
;
thumbnail
=
(
<
div
className
=
{
classNames
(
'
media-gallery__gifv
'
,
{
autoplay
:
autoPlay
})}
>
<
video
...
...
@@ -182,11 +185,12 @@ class Item extends React.PureComponent {
aria
-
label
=
{
attachment
.
get
(
'
description
'
)}
title
=
{
attachment
.
get
(
'
description
'
)}
role
=
'
application
'
src
=
{
attachment
.
get
(
'
url
'
)
}
src
=
{
gifsrc
}
onClick
=
{
this
.
handleClick
}
onMouseEnter
=
{
this
.
handleMouseEnter
}
onMouseLeave
=
{
this
.
handleMouseLeave
}
autoPlay
=
{
autoPlay
}
preload
=
'
auto
'
loop
muted
playsInline
...
...
app/javascript/gabsocial/features/account_gallery/components/media_item.js
View file @
f08e1d3c
...
...
@@ -7,6 +7,7 @@ import { autoPlayGif, displayMedia } from 'gabsocial/initial_state';
import
classNames
from
'
classnames
'
;
import
{
decode
}
from
'
blurhash
'
;
import
{
isIOS
}
from
'
gabsocial/is_mobile
'
;
import
conversations_list_container
from
'
../../direct_timeline/containers/conversations_list_container
'
;
export
default
class
MediaItem
extends
ImmutablePureComponent
{
...
...
@@ -125,6 +126,7 @@ export default class MediaItem extends ImmutablePureComponent {
onMouseEnter
=
{
this
.
handleMouseEnter
}
onMouseLeave
=
{
this
.
handleMouseLeave
}
autoPlay
=
{
autoPlay
}
preload
=
'
auto
'
loop
muted
playsInline
...
...
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