MediaWiki:Vector.js

From DM Live - the Depeche Mode live encyclopedia for the masses
Jump to navigationJump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for users using the Vector skin */


$(document).ready(function() {

	var $toggleButton = $('.toggle-button'),
    	$menuWrap = $('.menu-wrap'),
    	$sidebarArrow = $('.sidebar-menu-arrow');

	// Hamburger button

	$toggleButton.on('click', function() {
		$(this).toggleClass('button-open');
		$menuWrap.toggleClass('menu-show');
	});

	// Sidebar navigation arrows

	$sidebarArrow.click(function() {
		$(this).next().slideToggle(300);
	});

});

!function(e){e.skdslider=function(i,t){var n={delay:2e3,animationSpeed:500,showNav:!1,autoSlide:!0,showNextPrev:!0,pauseOnHover:!1,numericNav:!1,stopSlidingAfter:!1,showPlayButton:!1,animationType:"fading"};t&&e.extend(n,t),n.touch="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e(i).wrap('<div class="skdslider"></div>');var l=e(i).closest("div.skdslider");l.find("ul").addClass("slides");var a=l.find("ul.slides li"),r=l.find("ul.slides li:first-child img")[0].naturalWidth||l.find("ul.slides li:first-child img")[0].width,s=l.find("ul.slides li:first-child img")[0].naturalHeight||l.find("ul.slides li:first-child img")[0].height,d=0;if(n.currentSlide=0,n.currentState="pause",n.running=!1,n.stopSlidingAfter&&("all"==n.stopSlidingAfter&&(n.stopSlidingAfter=a.length),n.stopSlidingAfter-=1),"fading"==n.animationType){var o=Math.ceil(s*(l.outerWidth()/r));l.css({height:o}),a.each(function(){e(this).css({position:"absolute",left:"0",top:"0",bottom:"0",right:"0"})}),e(window).resize(function(){var e=Math.ceil(s*(l.outerWidth()/r));l.css({height:e})})}if("sliding"==n.animationType){a.each(function(){e(this).css({"float":"left",display:"block",position:"relative"})});var u=l.outerWidth()*a.size(),o=Math.ceil(s*(l.outerWidth()/r));l.find("ul.slides").css({position:"absolute",left:"0",width:u}),a.css({width:l.outerWidth(),height:o}),l.css({height:o}),e(window).resize(function(){var e=l.outerWidth()*a.size(),i=Math.ceil(s*(l.outerWidth()/r));l.find("ul.slides").css({position:"absolute",left:"0",width:e}),a.css({width:l.outerWidth(),height:i}),l.css({height:i})})}n.touch&&e.skdslider.enableTouch(l,a,n),e.skdslider.createNav(l,a,n),a.eq(d).show(),1==n.autoSlide&&(n.currentState="play",n.interval=setTimeout(function(){e.skdslider.playSlide(l,a,n)},n.delay)),1==n.pauseOnHover&&a.hover(function(){1==n.autoSlide&&(n.currentState="pause",clearTimeout(n.interval))},function(){1==n.autoSlide&&(n.currentState="play",1==n.autoSlide&&e.skdslider.playSlide(l,a,n))})},e.skdslider.createNav=function(t,n,l){var a='<ul class="slide-navs">';for(i=0;i<n.length;i++){var r="";1==l.numericNav&&(r=i+1),a+=0==i?'<li class="current-slide slide-nav-'+i+'"><a>'+r+"</a></li>":'<li class="slide-nav-'+i+'"><a>'+r+"</a></li>"}if(a+="</ul>",1==l.showNav){t.append(a);var s=t.find(".slide-navs")[0].offsetWidth;s=parseInt(s/2),s=-1*s,t.find(".slide-navs").css("margin-left",s),t.find(".slide-navs li").click(function(){return index=t.find(".slide-navs li").index(this),targetSlide=index,clearTimeout(l.interval),l.currentState="play",l.running=!1,e.skdslider.playSlide(t,n,l,targetSlide),!1})}if(1==l.showNextPrev){var d='<a class="prev"></a>';d+='<a class="next"></a>',t.append(d),t.find("a.prev").click(function(){e.skdslider.prev(t,n,l)}),t.find("a.next").click(function(){e.skdslider.next(t,n,l)})}if(1==l.showPlayButton){var o="play"==l.currentState||1==l.autoSlide?'<a class="play-control pause"></a>':'<a class="play-control play"></a>';t.append(o),t.hover(function(){t.find("a.play-control").css("display","block")},function(){t.find("a.play-control").css("display","none")}),t.find("a.play-control").click(function(){return 1==l.autoSlide?(clearTimeout(l.interval),l.autoSlide=!1,l.currentState="pause",e(this).addClass("play"),e(this).removeClass("pause")):(l.currentState="play",l.autoSlide=!0,e(this).addClass("pause"),e(this).removeClass("play"),targetSlide=l.currentSlide+1==n.length?0:l.currentSlide+1,clearTimeout(l.interval),e.skdslider.playSlide(t,n,l,targetSlide)),!1})}},e.skdslider.next=function(i,t,n){return targetSlide=n.currentSlide+1==t.length?0:n.currentSlide+1,clearTimeout(n.interval),n.currentState="play",e.skdslider.playSlide(i,t,n,targetSlide),!1},e.skdslider.prev=function(i,t,n){return targetSlide=0==n.currentSlide?t.length-1:n.currentSlide-1,clearTimeout(n.interval),n.currentState="play",n.running=!1,e.skdslider.playSlide(i,t,n,targetSlide),!0},e.skdslider.prev=function(i,t,n){return targetSlide=0==n.currentSlide?t.length-1:n.currentSlide-1,clearTimeout(n.interval),n.currentState="play",n.running=!1,e.skdslider.playSlide(i,t,n,targetSlide),!0},e.skdslider.playSlide=function(i,t,n,l){if("play"==n.currentState&&0==n.running){if(i.find(".slide-navs li").removeClass("current-slide"),"undefined"==typeof l&&(l=n.currentSlide+1==t.length?0:n.currentSlide+1),"fading"==n.animationType&&(n.running=!0,t.eq(n.currentSlide).fadeOut(n.animationSpeed),t.eq(l).fadeIn(n.animationSpeed,function(){e.skdslider.removeIEFilter(e(this)[0]),n.running=!1})),"sliding"==n.animationType){var a=l*i.outerWidth()*-1;n.running=!0,i.find("ul.slides").animate({left:a},n.animationSpeed,function(){n.running=!1})}i.find(".slide-navs li").eq(l).addClass("current-slide"),n.currentSlide=l}n.stopSlidingAfter&&n.stopSlidingAfter==n.currentSlide&&(clearTimeout(n.interval),n.autoSlide=!1,n.currentState="pause",i.find("a.play-control").addClass("play"),i.find("a.play-control").removeClass("pause")),1==n.autoSlide&&"play"==n.currentState&&(n.interval=setTimeout(function(){e.skdslider.playSlide(i,t,n)},n.delay))},e.skdslider.enableTouch=function(i,t,n){function l(e){s=e.touches[0].pageX,d=e.touches[0].pageY,i[0].addEventListener("touchmove",a,!1),i[0].addEventListener("touchend",r,!1)}function a(e){e.preventDefault();var i=e.touches[0].pageX,t=e.touches[0].pageY;o=s-i,u=d-t}function r(){i[0].removeEventListener("touchmove",a,!1),o>0?e.skdslider.next(i,t,n):e.skdslider.prev(i,t,n),i[0].removeEventListener("touchend",r,!1)}i[0].addEventListener("touchstart",l,!1);var s,d,o,u},e.skdslider.removeIEFilter=function(e){e.style.removeAttribute&&e.style.removeAttribute("filter")},e.fn.skdslider=function(i){return this.each(function(){new e.skdslider(this,i)})}}(jQuery);

 <script type="text/javascript">
		jQuery(document).ready(function(){
			jQuery('#demo1').skdslider({delay:8000, animationSpeed: 2000,showNextPrev:false,showPlayButton:false,autoSlide:true,animationType:'fading'});
			
			jQuery('#responsive').change(function(){
			  $('#responsive_wrapper').width(jQuery(this).val());
			  $(window).trigger('resize');
			});
			
		});
		
		jQuery(document).ready(function(){
			jQuery('#demo2').skdslider({delay:8000, animationSpeed: 2000,showNextPrev:false,showPlayButton:false,autoSlide:true,animationType:'fading'});
			
			jQuery('#responsive').change(function(){
			  $('#responsive_wrapper').width(jQuery(this).val());
			  $(window).trigger('resize');
			});
			
		});
		
$(window).on("scroll", function() {
    if($(window).scrollTop() > 350) {
        $(".toggle-button").addClass("active");
		$(".toggle-logo").addClass("active");
		$(".toggle-button .menu-bar-top").addClass("active");
		$(".toggle-button .menu-bar-middle").addClass("active");
		$(".toggle-button .menu-bar-bottom").addClass("active");
    } else {
        //remove the background property so it comes transparent again (defined in your css)
       $(".toggle-button").removeClass("active");
	   $(".toggle-logo").removeClass("active");
	   $(".toggle-button .menu-bar-top").removeClass("active");
		$(".toggle-button .menu-bar-middle").removeClass("active");
		$(".toggle-button .menu-bar-bottom").removeClass("active");
    }
});
</script>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-90564284-1', 'auto');
  ga('send', 'pageview');

</script>
<script>
	function validarFormulario1(){
		var cmbSelector = document.getElementById('id1').selectedIndex;
		
		if(cmbSelector == null || cmbSelector == 0){
			alert('You must select an option!');
			return false;
		}
	}
	
	function validarFormulario2(){
		var cmbSelector = document.getElementById('id2').selectedIndex;
		
		if(cmbSelector == null || cmbSelector == 0){
			alert('You must select an option!');
			return false;
		}
	}
</script>