fixed problems with youtube video inline

This commit is contained in:
Jeena Paradies 2013-02-28 18:23:37 +01:00
parent 5d8b6887a6
commit cd983cdb26
5 changed files with 47 additions and 18 deletions

View file

@ -891,7 +891,7 @@
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="690752143"/> <reference key="NSNextKeyView" ref="690752143"/>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName">bungloo</string> <string key="NSFrameAutosaveName">bungloo</string>
<bool key="NSWindowIsRestorable">YES</bool> <bool key="NSWindowIsRestorable">YES</bool>
@ -970,7 +970,7 @@
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="126069112"/> <reference key="NSNextKeyView" ref="126069112"/>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName">mentions</string> <string key="NSFrameAutosaveName">mentions</string>
<bool key="NSWindowIsRestorable">YES</bool> <bool key="NSWindowIsRestorable">YES</bool>
@ -1029,7 +1029,7 @@
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="352293288"/> <reference key="NSNextKeyView" ref="352293288"/>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName">conversation</string> <string key="NSFrameAutosaveName">conversation</string>
<bool key="NSWindowIsRestorable">YES</bool> <bool key="NSWindowIsRestorable">YES</bool>
@ -1088,7 +1088,7 @@
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="106985301"/> <reference key="NSNextKeyView" ref="106985301"/>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName">profile</string> <string key="NSFrameAutosaveName">profile</string>
<bool key="NSWindowIsRestorable">YES</bool> <bool key="NSWindowIsRestorable">YES</bool>
@ -1258,7 +1258,7 @@
<reference key="NSNextKeyView" ref="433812480"/> <reference key="NSNextKeyView" ref="433812480"/>
<string key="NSReuseIdentifierKey">_NS:20</string> <string key="NSReuseIdentifierKey">_NS:20</string>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName">preferences</string> <string key="NSFrameAutosaveName">preferences</string>
<bool key="NSWindowIsRestorable">YES</bool> <bool key="NSWindowIsRestorable">YES</bool>
@ -1350,7 +1350,7 @@
<reference key="NSNextKeyView" ref="98105857"/> <reference key="NSNextKeyView" ref="98105857"/>
<string key="NSReuseIdentifierKey">_NS:21</string> <string key="NSReuseIdentifierKey">_NS:21</string>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">NO</bool> <bool key="NSWindowIsRestorable">NO</bool>
</object> </object>

View file

@ -345,4 +345,21 @@ header.profile button {
header.profile button.following { header.profile button.following {
background: #D84A38; background: #D84A38;
}
a.youtube {
position: relative;
display: inline-block;
}
a.youtube:before {
content: " ";
background: url(../img/play.png) no-repeat;
width: 37px;
height: 24px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -19px;
margin-top: -12px;
} }

BIN
WebKit/img/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -246,7 +246,6 @@ function(HostApp, Core, Paths, URI) {
Profile.prototype.showProfile = function(profile) { Profile.prototype.showProfile = function(profile) {
var basic = profile["https://tent.io/types/info/basic/v0.1.0"]; var basic = profile["https://tent.io/types/info/basic/v0.1.0"];
debug(basic)
if (profile && basic) { if (profile && basic) {

View file

@ -934,19 +934,32 @@ function(jQuery, Paths, URI, HostApp, Cache) {
} }
Core.prototype.addYouTube = function(id, images) { Core.prototype.addYouTube = function(id, images) {
var iframe = $('<iframe class="youtube" type="text/html" width="100%" height="200" frameborder="0" webkitAllowFullScreen allowFullScreen />') var a = $("<a>", {
iframe.appendTo(images); href: "http://youtu.be/" + id,
class: "youtube"
// This is a workaround without it it in the Mentions view it scrolls
// down to the first video on load.
iframe.load(function() {
iframe.contents().find('*').each(function () {
$(this).removeAttr("tabindex");
});
}); });
// Appending the src var img = $("<img>", {src: "http://img.youtube.com/vi/" + id + "/0.jpg"});
iframe.attr("src", 'http://www.youtube.com/embed/' + id + '?rel=0&showsearch=0&version=3&modestbranding=1'); var h = 200;
img.load(function() {
h = img.height();
});
a.click(function() {
var iframe = $('<iframe />', {
class: "youtube",
type: "text/html",
width: "100%",
height: h,
frameborder: 0,
src: 'http://www.youtube.com/embed/' + id + '?rel=0&showsearch=0&version=3&modestbranding=1&autoplay=1'
})
a.replaceWith(iframe);
return false;
})
img.appendTo(a);
a.appendTo(images);
} }
Core.prototype.addVimeo = function(id, images) { Core.prototype.addVimeo = function(id, images) {