Merge branch 'add-audio-onebox' of git://github.com/jamesaanderson/discourse into jamesaanderson-add-audio-onebox
Conflicts: app/assets/stylesheets/application/compose.css.scss app/assets/stylesheets/application/topic-post.css.scss
This commit is contained in:
commit
29519ece23
|
@ -299,10 +299,15 @@
|
|||
webkit-border-radius: 4px;
|
||||
ms-border-radius: 4px;
|
||||
}
|
||||
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
audio {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
#wmd-preview {
|
||||
border: 1px dashed $gray;
|
||||
|
|
|
@ -534,6 +534,10 @@
|
|||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
audio {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.topic-body {
|
||||
position: relative;
|
||||
.contents {
|
||||
|
|
|
@ -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
|
||||
class VideoOnebox < BaseOnebox
|
||||
|
||||
matcher /^https?:\/\/.*\.(mov|mp4|ogg)$/
|
||||
matcher /^https?:\/\/.*\.(mov|mp4)$/
|
||||
|
||||
def onebox
|
||||
"<video controls><source src='#{@url}'><a href='#{@url}'>#{@url}</a></video>"
|
||||
|
|
Loading…
Reference in New Issue