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:
Robin Ward 2013-07-26 11:30:40 -04:00
commit 29519ece23
4 changed files with 22 additions and 1 deletions

View File

@ -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;

View File

@ -534,6 +534,10 @@
max-width: 100%;
height: auto;
}
audio {
max-width: 100%;
}
.topic-body {
position: relative;
.contents {

View 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

View File

@ -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>"