Oembed Update - Added instagram, better display for rich/photo
This commit is contained in:
parent
31849e1442
commit
89042078ca
3 changed files with 14 additions and 4 deletions
|
|
@ -82,8 +82,14 @@ app.views.OEmbed = app.views.Base.extend({
|
|||
},
|
||||
|
||||
presenter:function () {
|
||||
o_embed_cache = this.model.get("o_embed_cache")
|
||||
if(o_embed_cache) {
|
||||
typemodel = { rich: false, photo: false, video: false, link: false }
|
||||
typemodel[o_embed_cache.data.type] = true
|
||||
o_embed_cache.data.types = typemodel
|
||||
}
|
||||
return _.extend(this.defaultPresenter(), {
|
||||
o_embed_html : app.helpers.oEmbed.html(this.model.get("o_embed_cache"))
|
||||
o_embed_html : app.helpers.oEmbed.html(o_embed_cache)
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{#if o_embed_cache}}
|
||||
{{#if o_embed_cache.data.thumbnail_url}}
|
||||
{{#if o_embed_cache.data.types.video }}
|
||||
<div class="thumb">
|
||||
<img src="{{o_embed_cache.data.thumbnail_url}}" />
|
||||
<div class="video-overlay">
|
||||
|
|
@ -17,6 +17,6 @@
|
|||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{{o_embed_html}}}
|
||||
{{{o_embed_html}}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -9,11 +9,15 @@ require 'uri'
|
|||
|
||||
OEmbedCubbies = OEmbed::Provider.new("http://cubbi.es/oembed")
|
||||
|
||||
# patch in support for new https soundcloud
|
||||
OEmbed::Providers::SoundCloud << "https://*.soundcloud.com/*"
|
||||
|
||||
oembed_provider_list = [
|
||||
OEmbed::Providers::Youtube,
|
||||
OEmbed::Providers::Vimeo,
|
||||
OEmbed::Providers::Flickr,
|
||||
OEmbed::Providers::SoundCloud,
|
||||
OEmbed::Providers::Instagram,
|
||||
OEmbed::Providers::Flickr,
|
||||
OEmbedCubbies
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue