From d38582c5dea0737c5cc74fbbeed150ef40ff77f5 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Sat, 21 Apr 2012 23:06:32 -0700 Subject: [PATCH] youtube in canvas [ci skip] --- app/assets/javascripts/app/views/small_frame.js | 6 ++++-- app/assets/stylesheets/new_styles/_canvas.scss | 13 +++++++++++++ app/assets/templates/small-frame.jst.hbs | 7 +++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/views/small_frame.js b/app/assets/javascripts/app/views/small_frame.js index f85b7985d..071356a35 100644 --- a/app/assets/javascripts/app/views/small_frame.js +++ b/app/assets/javascripts/app/views/small_frame.js @@ -25,13 +25,15 @@ app.views.SmallFrame = app.views.Base.extend({ if(!firstPhoto || (firstPhoto && !firstPhoto.dimensions.height || !firstPhoto.dimensions.width)) { return className } + if(this.model.get("o_embed_cache")) { + return("x2 width") + } + return(className + ratio(firstPhoto.dimensions)) function ratio(dimensions) { var ratio = (dimensions.width / dimensions.height) - console.log(ratio, dimensions) - if(ratio > 1.5) { return "x2 width" } else if(ratio < 0.75) { diff --git a/app/assets/stylesheets/new_styles/_canvas.scss b/app/assets/stylesheets/new_styles/_canvas.scss index b3df19f50..a2a38d0ca 100644 --- a/app/assets/stylesheets/new_styles/_canvas.scss +++ b/app/assets/stylesheets/new_styles/_canvas.scss @@ -84,6 +84,19 @@ body { } } + .embed-frame { + position : absolute; + top : 0; + left : 0; + width : 100%; + height : 100%; + + iframe { + height : 100%; + width : 100%; + } + } + /* larger declarations */ &.x2.width .content { @include wide(); } &.x2.height .content { @include tall(); } diff --git a/app/assets/templates/small-frame.jst.hbs b/app/assets/templates/small-frame.jst.hbs index 4bcc53214..87803d547 100644 --- a/app/assets/templates/small-frame.jst.hbs +++ b/app/assets/templates/small-frame.jst.hbs @@ -8,6 +8,13 @@ {{/if}} + {{#if o_embed_cache.data}} +
+ {{{o_embed_cache.data.html}}} +
+ {{/if}} + +
{{{text}}}