Bureaucrats, coding, Administrators
2,634
edits
(Improted from tfwiki (@seb)) |
(Backported from tf wiki) |
||
Line 194: | Line 194: | ||
} | } | ||
}, | }, | ||
setUrl:function() { | |||
var obj = $(this).children('object'); | var obj = $(this).children('object'); | ||
if(!obj) return; | if(!obj) return; | ||
var playerUrl = obj.children('param[name="movie"]').attr('value') + '&theme=dark' + ($(this).hasClass('hd-on') ? '&hd=1' : ''); | |||
obj.children('param[name="movie"]').attr('value', playerUrl); | |||
obj.children('embed').attr('src', playerUrl); | |||
var resultHtml = $(this).html(); | |||
$(this).html('').html(resultHtml); | |||
}, | }, | ||
setWidth:function(youtube, width) { | setWidth:function(youtube, width) { | ||
Line 233: | Line 231: | ||
}, | }, | ||
init:function() { | init:function() { | ||
$('.youtubebox').each(youtubeHelper. | $('.youtubebox').each(youtubeHelper.setUrl); | ||
$(window).resize(youtubeHelper.resize); | $(window).resize(youtubeHelper.resize); | ||
youtubeHelper.onResize(); | youtubeHelper.onResize(); |