MediaWiki:Common.js: Difference between revisions

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

Navigation menu