mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:12:40 +08:00
FEATURE: Enable pausing images from Giphy and Tenor (#13185)
This commit is contained in:
@ -7,6 +7,7 @@ class CookedPostProcessor
|
||||
LIGHTBOX_WRAPPER_CSS_CLASS = "lightbox-wrapper"
|
||||
LOADING_SIZE = 10
|
||||
LOADING_COLORS = 32
|
||||
GIF_SOURCES_REGEXP = /(giphy|tenor)\.com\//
|
||||
|
||||
attr_reader :cooking_options, :doc
|
||||
|
||||
@ -320,7 +321,7 @@ class CookedPostProcessor
|
||||
|
||||
upload = Upload.get_from_url(src)
|
||||
|
||||
if upload.present? && upload.animated?
|
||||
if (upload.present? && upload.animated?) || src.match?(GIF_SOURCES_REGEXP)
|
||||
img.add_class("animated")
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user