From ICIHelp7.15
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | |||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
+ | |||
$(document).ready( function() { | $(document).ready( function() { | ||
+ | |||
var tree = $('#wikitext-sidebar'); | var tree = $('#wikitext-sidebar'); | ||
$('#p-logo').after( tree.html() ); | $('#p-logo').after( tree.html() ); | ||
tree.remove(); | tree.remove(); | ||
+ | |||
}); | }); | ||
$(document).ready(function(){var t="",e="";if($("#c_topPage").length){var o=$("#c_topPage");t=o.html(),o.remove()}if($("#c_bottomPage").length){var m=$("#c_bottomPage");e=m.html(),m.remove()}var a=$("#mw-content-text").html();$("#mw-content-text").html(t+a+e)}); | $(document).ready(function(){var t="",e="";if($("#c_topPage").length){var o=$("#c_topPage");t=o.html(),o.remove()}if($("#c_bottomPage").length){var m=$("#c_bottomPage");e=m.html(),m.remove()}var a=$("#mw-content-text").html();$("#mw-content-text").html(t+a+e)}); | ||
− | |||
/* image zoom javascript starts here */ | /* image zoom javascript starts here */ | ||
− | $("a.image").each(function(){ | + | $("a.image").each(function(){ |
+ | |||
var imgSrc = $(this).children('img').attr('src'); | var imgSrc = $(this).children('img').attr('src'); | ||
if(imgSrc.indexOf("/thumb")!=-1){ | if(imgSrc.indexOf("/thumb")!=-1){ | ||
Line 19: | Line 23: | ||
var arrayCnt = splitUrl.length; | var arrayCnt = splitUrl.length; | ||
imgSrc = imgSrc.replace("/"+splitUrl[arrayCnt-1],""); | imgSrc = imgSrc.replace("/"+splitUrl[arrayCnt-1],""); | ||
− | $(this).attr('href', | + | $(this).attr('href',wgServer+imgSrc); |
} | } | ||
+ | |||
}); | }); | ||
− | $('a.image').spzoom(); | + | $('a.image').spzoom(); /* image zoom javascript starts here */ |
− | /* image zoom javascript starts here */ | + | |
+ | $('img.iframe_videos').click(function(){ | ||
+ | |||
+ | var video = '<video controls autoplay controlsList="nodownload" width="'+$(this).attr('width')+'"><source src="'+wgServer+wgScriptPath+$(this).attr('data-video')+'" type="video/mp4">Your browser does not support HTML5 video.</video>'; | ||
+ | $(this).replaceWith(video); | ||
+ | }); |
Latest revision as of 08:16, 17 September 2018
/* Any JavaScript here will be loaded for all users on every page load. */ $(document).ready( function() { var tree = $('#wikitext-sidebar'); $('#p-logo').after( tree.html() ); tree.remove(); }); $(document).ready(function(){var t="",e="";if($("#c_topPage").length){var o=$("#c_topPage");t=o.html(),o.remove()}if($("#c_bottomPage").length){var m=$("#c_bottomPage");e=m.html(),m.remove()}var a=$("#mw-content-text").html();$("#mw-content-text").html(t+a+e)}); /* image zoom javascript starts here */ $("a.image").each(function(){ var imgSrc = $(this).children('img').attr('src'); if(imgSrc.indexOf("/thumb")!=-1){ imgSrc = imgSrc.replace("/thumb",""); $(this).parent(".thumbinner").css( "overflow", "visible" ); var splitUrl= imgSrc.split("/"); var arrayCnt = splitUrl.length; imgSrc = imgSrc.replace("/"+splitUrl[arrayCnt-1],""); $(this).attr('href',wgServer+imgSrc); } }); $('a.image').spzoom(); /* image zoom javascript starts here */ $('img.iframe_videos').click(function(){ var video = '<video controls autoplay controlsList="nodownload" width="'+$(this).attr('width')+'"><source src="'+wgServer+wgScriptPath+$(this).attr('data-video')+'" type="video/mp4">Your browser does not support HTML5 video.</video>'; $(this).replaceWith(video); });