mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Improve support for old browsers (#9515)
* FEATURE: Improve crawler view * FIX: Make lazyYT crawler-friendly * DEV: Rename discourse-internet-explorer to discourse-unsupported-browser * DEV: Detect more unsupported browsers Follow-up to 4eebbd221239eaa3fc7e6f1bd6a9dcf0239b8444. * FIX: Hide browser update notice in print view
This commit is contained in:
@ -27,7 +27,19 @@ class Onebox::Engine::YoutubeOnebox
|
||||
|
||||
# Put in the LazyYT div instead of the iframe
|
||||
escaped_title = ERB::Util.html_escape(video_title)
|
||||
"<div class=\"lazyYT\" data-youtube-id=\"#{video_id}\" data-youtube-title=\"#{escaped_title}\" data-width=\"#{video_width}\" data-height=\"#{video_height}\" data-parameters=\"#{embed_params}\"></div>"
|
||||
|
||||
<<~EOF
|
||||
<div class="lazyYT"
|
||||
data-youtube-id="#{video_id}"
|
||||
data-youtube-title="#{escaped_title}"
|
||||
data-width="#{video_width}"
|
||||
data-height="#{video_height}"
|
||||
data-parameters="#{embed_params}">
|
||||
<a href="https://www.youtube.com/watch?v=#{video_id}" target="_blank">
|
||||
<img src="https://img.youtube.com/vi/#{video_id}/hqdefault.jpg" width="#{video_width}" height="#{video_height}" title="#{escaped_title}">
|
||||
</a>
|
||||
</div>
|
||||
EOF
|
||||
else
|
||||
yt_onebox_to_html
|
||||
end
|
||||
|
Reference in New Issue
Block a user