MediaWiki:Neowikimon.js

$(document).ready( function {   $("#link,#closeLink").click( function  { popup('popUpDiv')}); });

function toggle(div_id) { var el = document.getElementById(div_id); if ( el.style.display == 'none' ) {	el.style.display = 'block';} else {el.style.display = 'none';} } function blanket_size(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight; } else { viewportheight = document.documentElement.clientHeight; }	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) { blanket_height = viewportheight; } else { if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) { blanket_height = document.body.parentNode.clientHeight; } else { blanket_height = document.body.parentNode.scrollHeight; }	}	var blanket = document.getElementById('blanket'); blanket.style.height = blanket_height + 'px'; var popUpDiv = document.getElementById(popUpDivVar); popUpDiv_height=blanket_height/2-200;//200 is half popup's height popUpDiv.style.top = popUpDiv_height + 'px'; } function window_pos(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerHeight; } else { viewportwidth = document.documentElement.clientHeight; }	if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) { window_width = viewportwidth; } else { if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) { window_width = document.body.parentNode.clientWidth; } else { window_width = document.body.parentNode.scrollWidth; }	}	var popUpDiv = document.getElementById(popUpDivVar); window_width=window_width/2-200;//200 is half popup's width popUpDiv.style.left = window_width + 'px'; } function popup(windowname) { blanket_size(windowname); window_pos(windowname); toggle('blanket'); toggle(windowname); }

$(function{           var overlay = $(' ');

$('.closephoto').click(function {                $('.popup').hide;                overlay.appendTo(document.body).remove;                return false;            });

$('.photoclick').click(function {                overlay.show;                overlay.appendTo(document.body);                $('.popup').show;                return false;            }); });

/*Test*/

(function($, undefined) {   var open = [];

var opts = { selector: '.dropdown2', toggle: 'dropdown2-toggle', open: 'dropdown2-open', nest: true };

$(document).on('click.dropdown2 touchstart.dropdown2', function(e)   {        // Close the last open dropdown2 if click is from outside the target dropdown2        if ( open.length && ( ! opts.nest || ! open[ open.length - 1 ].find( e.target ).length ) )        {            open.pop.removeClass( opts.open );        }

var $this = $(e.target);

// If target is a dropdown2 then toggle it... if ( $this.hasClass( opts.toggle ) ) {           e.preventDefault;

$this = $this.closest( opts.selector );

if ( ! $this.hasClass( opts.open ) ) {               open.push( $this.addClass( opts.open ) ); }           else {               open.pop.removeClass( opts.open ); }       }    });

})(jQuery);

var parH = $('.sleek').outerHeight(true); var areaH = $('.sleekable').outerHeight(true); var scrH = parH / (areaH/parH);

function dragging{ var scrPos = $('.sleekbar').position.top; $('.sleekable').css({top: -(scrPos*(areaH/parH)-1)}); }

$('.sleekbar').height(scrH); $('.sleekbar').draggable({   axis: 'y',    containment: 'parent',        drag: function {         dragging    }

});