MediaWiki:Ytlinkpopup2.js

// DO NOT USE THIS TOGETHER WITH THE OLDER ytlinkpopup.js importStylesheetPage('User:Mfaizsyahmi/ytlinkpopup2.css', 'hitlerparody'); var ytlinkpopup_ctrl = 0 if ( $(".YT_popup").length==0 ) { $('.WikiaArticle').prepend('Alo '); $(".YT_popup").hide function closeYtPopup { $(".YT_popup").html("").hide } $('a.external[href*="www.youtube.com/watch"]').wrap(' '); $('a.external[href*="www.youtube.com/watch"]').click(function(e) {		if (ytlinkpopup_ctrl == 1) return		e.preventDefault;		$(".YT_popup").hide		var vidurl=$(this).attr("href");		var videoid=vidurl.split("v=")[1].substr(0,11);		$(".YT_popup").html(' Don\'t forget to like the parodies on their watch page! Close  '); //?autoplay=1		$(".YT_popup").appendTo( $(this).parent ).show	}).attr('title', 'Click to preview video\nCtrl+click to go to watch page'); $(document).keydown(function(e) {		if (e.keyCode=17) {				ytlinkpopup_ctrl = 1;			console.log( 'CTRL key pressed')		}	}).keyup(function(e) {		ytlinkpopup_ctrl = 0		console.log('global keyup')	}); }