Loading Changelog.md +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ ## Features * Deleted comments will be removed when loading more comments [#7045](https://github.com/diaspora/diaspora/pull/7045) * The "subscribe" indicator on a post now gets toggled when you like or rehsare a post [#7040](https://github.com/diaspora/diaspora/pull/7040) * Add OpenGraph video support [#7043](https://github.com/diaspora/diaspora/pull/7043) # 0.6.0.0 Loading app/assets/javascripts/app/helpers/open_graph.jsdeleted 100644 → 0 +0 −12 Original line number Diff line number Diff line // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later (function(){ app.helpers.openGraph = { html : function (open_graph_cache) { if (!open_graph_cache) { return ""; } return '<img src="' + open_graph_cache.image + '" />'; }, }; })(); // @license-end app/assets/javascripts/app/views/content_view.js +10 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ app.views.OEmbed = app.views.Base.extend({ app.views.OpenGraph = app.views.Base.extend({ templateName : "opengraph", events: { "click .video-overlay": "loadVideo" }, initialize: function() { this.truncateDescription(); }, Loading @@ -161,6 +165,12 @@ app.views.OpenGraph = app.views.Base.extend({ var ogdesc = this.model.get('open_graph_cache'); ogdesc.description = app.helpers.truncate(ogdesc.description, 250); } }, loadVideo: function() { this.$(".opengraph-container").html( "<iframe src='" + this.$(".video-overlay").attr("data-video-url") + "' frameBorder=0 width='100%'></iframe>" ); } }); Loading app/assets/stylesheets/opengraph.scss +28 −7 Original line number Diff line number Diff line Loading @@ -10,20 +10,41 @@ overflow: hidden; a { color: #000; img { margin: 5px 5px 5px 0px; float: left; max-width: 150px; padding-right: 5px; } .og-title { margin-bottom: 5px; font-weight: bold; } } a:hover { color: $blue; } .thumb { float: left; margin: 5px; margin-left: 0; max-width: 150px; padding-right: 5px; .video-overlay { cursor: pointer; height: 145px; width: 145px; } .overlay { background-color: rgba($black, .2); background-image: image-url('buttons/playbtn.png'); background-position: center; background-repeat: no-repeat; background-size: 60px 60px; display: inline-block; height: 145px; position: relative; top: -145px; width: 145px; } } .og-description { color: $text-grey; } Loading app/assets/templates/opengraph_tpl.jst.hbs +10 −2 Original line number Diff line number Diff line {{#unless o_embed_cache}} {{#if open_graph_cache}} <div class="opengraph-container"> <a href="{{open_graph_cache.url}}" target="_blank"> <div class="thumb"> {{#if open_graph_cache.video_url }} <div class="video-overlay" data-video-url="{{open_graph_cache.video_url}}"> <img src="{{open_graph_cache.image}}" /> <div class="overlay"></div> </div> {{else}} <img src="{{open_graph_cache.image}}" /> {{/if}} </div> <a href="{{open_graph_cache.url}}" target="_blank"> <p class="og-title">{{open_graph_cache.title}}</p> </a> <p class="og-description">{{open_graph_cache.description}}</p> </div> {{/if}} {{/unless}} Loading
Changelog.md +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ ## Features * Deleted comments will be removed when loading more comments [#7045](https://github.com/diaspora/diaspora/pull/7045) * The "subscribe" indicator on a post now gets toggled when you like or rehsare a post [#7040](https://github.com/diaspora/diaspora/pull/7040) * Add OpenGraph video support [#7043](https://github.com/diaspora/diaspora/pull/7043) # 0.6.0.0 Loading
app/assets/javascripts/app/helpers/open_graph.jsdeleted 100644 → 0 +0 −12 Original line number Diff line number Diff line // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later (function(){ app.helpers.openGraph = { html : function (open_graph_cache) { if (!open_graph_cache) { return ""; } return '<img src="' + open_graph_cache.image + '" />'; }, }; })(); // @license-end
app/assets/javascripts/app/views/content_view.js +10 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ app.views.OEmbed = app.views.Base.extend({ app.views.OpenGraph = app.views.Base.extend({ templateName : "opengraph", events: { "click .video-overlay": "loadVideo" }, initialize: function() { this.truncateDescription(); }, Loading @@ -161,6 +165,12 @@ app.views.OpenGraph = app.views.Base.extend({ var ogdesc = this.model.get('open_graph_cache'); ogdesc.description = app.helpers.truncate(ogdesc.description, 250); } }, loadVideo: function() { this.$(".opengraph-container").html( "<iframe src='" + this.$(".video-overlay").attr("data-video-url") + "' frameBorder=0 width='100%'></iframe>" ); } }); Loading
app/assets/stylesheets/opengraph.scss +28 −7 Original line number Diff line number Diff line Loading @@ -10,20 +10,41 @@ overflow: hidden; a { color: #000; img { margin: 5px 5px 5px 0px; float: left; max-width: 150px; padding-right: 5px; } .og-title { margin-bottom: 5px; font-weight: bold; } } a:hover { color: $blue; } .thumb { float: left; margin: 5px; margin-left: 0; max-width: 150px; padding-right: 5px; .video-overlay { cursor: pointer; height: 145px; width: 145px; } .overlay { background-color: rgba($black, .2); background-image: image-url('buttons/playbtn.png'); background-position: center; background-repeat: no-repeat; background-size: 60px 60px; display: inline-block; height: 145px; position: relative; top: -145px; width: 145px; } } .og-description { color: $text-grey; } Loading
app/assets/templates/opengraph_tpl.jst.hbs +10 −2 Original line number Diff line number Diff line {{#unless o_embed_cache}} {{#if open_graph_cache}} <div class="opengraph-container"> <a href="{{open_graph_cache.url}}" target="_blank"> <div class="thumb"> {{#if open_graph_cache.video_url }} <div class="video-overlay" data-video-url="{{open_graph_cache.video_url}}"> <img src="{{open_graph_cache.image}}" /> <div class="overlay"></div> </div> {{else}} <img src="{{open_graph_cache.image}}" /> {{/if}} </div> <a href="{{open_graph_cache.url}}" target="_blank"> <p class="og-title">{{open_graph_cache.title}}</p> </a> <p class="og-description">{{open_graph_cache.description}}</p> </div> {{/if}} {{/unless}}