mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
parent
9c617d051e
commit
d7d3be1130
@ -299,6 +299,9 @@
|
|||||||
webkit-border-radius: 4px;
|
webkit-border-radius: 4px;
|
||||||
ms-border-radius: 4px;
|
ms-border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
audio {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#wmd-preview {
|
#wmd-preview {
|
||||||
border: 1px dashed $gray;
|
border: 1px dashed $gray;
|
||||||
|
@ -515,6 +515,9 @@
|
|||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
audio {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
.topic-body {
|
.topic-body {
|
||||||
position: relative;
|
position: relative;
|
||||||
.contents {
|
.contents {
|
||||||
|
12
lib/oneboxer/audio_onebox.rb
Normal file
12
lib/oneboxer/audio_onebox.rb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
require_dependency 'oneboxer/base_onebox'
|
||||||
|
|
||||||
|
module Oneboxer
|
||||||
|
class AudioOnebox < BaseOnebox
|
||||||
|
|
||||||
|
matcher /^https?:\/\/.*\.mp3$/
|
||||||
|
|
||||||
|
def onebox
|
||||||
|
"<audio controls><source src='#{@url}'><a href='#{@url}'>#{@url}</a></audio>"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -3,7 +3,7 @@ require_dependency 'oneboxer/base_onebox'
|
|||||||
module Oneboxer
|
module Oneboxer
|
||||||
class VideoOnebox < BaseOnebox
|
class VideoOnebox < BaseOnebox
|
||||||
|
|
||||||
matcher /^https?:\/\/.*\.(mov|mp4|ogg)$/
|
matcher /^https?:\/\/.*\.(mov|mp4)$/
|
||||||
|
|
||||||
def onebox
|
def onebox
|
||||||
"<video width='100%' height='100%' controls><source src='#{@url}'><a href='#{@url}'>#{@url}</a></video>"
|
"<video width='100%' height='100%' controls><source src='#{@url}'><a href='#{@url}'>#{@url}</a></video>"
|
||||||
|
Loading…
Reference in New Issue
Block a user