/*@import url('//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Tabs.js&action=raw&ctype=text/javascript');
@import url('//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Gadget-TapToShow.js&action=raw&ctype=text/javascript');
@import url('//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Sidebar.js&action=raw&ctype=text/javascript');*/
mw.loader.load( '/mediawiki/index.php?title=MediaWiki:Sidebar.js&action=raw&ctype=text/javascript');
//mw.loader.load( '/mediawiki/index.php?title=MediaWiki:Details.js&action=raw&ctype=text/javascript');
//mw.loader.load( '/wiki/MediaWiki:Details.js&action=raw&ctype=text/javascript');
/*(function ($) {
$(function() {
var sidebarjs = $('<script type="text/javascript" />');
sidebarjs.attr('src', '//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Sidebar.js&action=raw&ctype=text/javascript');
$('head').append(sidebarjs);
});
})(jQuery);
*/
/*(function ($) {
$(function() {
var details = $('<script type="text/javascript" />');
details.attr('src', '//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Details.js&action=raw&ctype=text/javascript');
$('head').append(details);
});
})(jQuery);
*/
(function ($) {
$(function() {
var tabsjs = $('<script type="text/javascript" />');
tabjs.attr('src', '//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Tabs.js&action=raw&ctype=text/javascript');
$('head').append(tabjs);
});
})(jQuery);
/*(function ($) {
$(function() {
var gadget-TapToShowjs = $('<script type="text/javascript" />');
gadget-TapToShowjs.attr('src', '//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Gadget-TapToShow.js&action=raw&ctype=text/javascript');
$('head').append(gadget-TapToShowjs);
});
})(jQuery);
(function ($) {
$(function() {
var Gadget-Tabjs = $('<script type="text/javascript" />');
Gadget-Tabjs.attr('src', '//memory-alpha.wiki/mediawiki/index.php?title=MediaWiki:Gadget-Tab.js&action=raw&ctype=text/javascript');
$('head').append(Gadget-Tabjs);
});
})(jQuery);*/
//Kopie von Sidebar.js
/*
(function ($) {
$(function() {
$('.nav dt, .links > dt').bind('click', function() {
var _this = $(this);
_this.siblings('.next + dd, .prev + dd').slideDown();
_this.nextUntil('dt:not(.next, .prev)', 'dd').slideDown().children('ul').children('li').each(function(index) {
var delay = index * 50;
$(this).delay(delay).animate({opacity:1});
});
}).css({cursor:'pointer'}).siblings('dd').hide().find('li').css({opacity:0});
$('.sidebar-title').bind('click', function() {
var sidebar = $(this).parent();
sidebar.children('*:not(.sidebar-title):not(.sidebar-title + .thumb)').slideUp('slow', function() {
sidebar.find('.sidebar-title + .thumb .thumbcaption').sideDown();
});
}).css({cursor:'pointer'});
$('.sidebar-division').each(function() {
var divisionHeader = $(this).children('.division-header');
var expandabilityIndicator = '<span class="expandability-indicator">…</span>';
var divisionLabel = divisionHeader.html();
var cookieName = divisionLabel.toLowerCase().replace(/(<([^>]+)>)/ig,"");
$(divisionHeader).append(expandabilityIndicator);
if($.cookie('sidebar-division-state-' + cookieName) == 'expended') {
$(this).find('.expandability-indicator').hide();
} else {
$(this).addClass('collapsed').children('.division-header').siblings().hide();
}
});
$('.division-header').css({cursor:'pointer'}).click(function() {
var wrapper = $(this).parent();
if(wrapper.hasClass('collapsed')) {
var divisionLabel = $(this).children('strong').html();
var cookieName = divisionLabel.toLowerCase().replace(/(<([^>]+)>)/ig,"");
$(this).siblings().slideDown('slow');
$(this).find('.expandability-indicator').fadeOut();
wrapper.removeClass('collapsed');
$.cookie('sidebar-division-state-' + cookieName, 'expended');
} else {
var divisionLabel = $(this).children('strong').html();
var cookieName = divisionLabel.toLowerCase().replace(/(<([^>]+)>)/ig,"")
$(this).siblings().slideUp('slow', function() {
wrapper.addClass('collapsed');
});
$(this).find('.expandability-indicator').fadeIn();
$.cookie('sidebar-division-state-' + cookieName, 'collapsed');
}
});
$('.details > .summary').each(function() {
var $summary = $(this);
var $details = $summary.parent();
var $button = $('<a />').html('anzeigen');
$summary.append(" [").append($button).append(']');
$summary.bind('click', function() {
$details.toggleClass('open');
if($details.hasClass('open')) {
$button.html('verbergen');
} else {
$button.html('anzeigen');
}
});
});
});
})(jQuery);
*/
/**
* jQuery Cookie plugin
function cookie_encode(string){
//full uri decode not only to encode ",; =" but to save uicode charaters var decoded = encodeURIComponent(string); //encod back common and allowed charaters {}:"#[] to save space and make the cookies more human readable var ns = decoded.replace(/(%7B|%7D|%3A|%22|%23|%5B|%5D)/g,function(charater){return decodeURIComponent(charater);}); return ns;
}
(function ($) {
$(function() {
/* * jQuery Cycle Lite Plugin * http://malsup.com/jquery/cycle/lite/ * Copyright var fullImage = $(c'#file > a') 2008-2011 M. Alsup; * Version: 1.3 var regionBrowser = $(01-JUN-2011)'<div />', { * Dual licensed under the MIT and GPL licenses id: * http://www.opensource.org/licenses/mit'region-license.php * http://www.gnu.org/licenses/gpl.html * Requires: jQuery v1.3.2 or later */browser'});(function($) {
var ver = 'Lite-1fullImage.3'after(regionBrowser);
$fullImage.fn.cycle = functioncss(options) { return this.each(function() { display: 'inline-block', position: 'relative' options = options || {}; if (this.cycleTimeout) clearTimeout(this.cycleTimeout); this.cycleTimeout = 0; this.cyclePause = 0; var $cont = $(this); var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children('img'); var els = $slides.get(); if css(els.length < 2) { window.console && console.log('terminating; too few slides verticalAlign: ' + els.length); return; // donbottom't bother });
// support metadata plugin $(v1.0 and v2'.0region-info') var opts = $.extendeach({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadatafunction() : $.meta ? $cont.data() : {}); var meta that = $.isFunction($cont.datathis) ? $cont.data(opts.metaAttr) : null; if (meta) opts var src = $('.extend(opts, metafullMedia > a'); opts.before = opts.before ? [opts.before] : []; opts.after = opts.after ? [opts.after] : []; opts.after.unshift(functionattr(){ opts.busy=0; }'href'); // allow shorthand overrides of width, height and timeout var cls = this.className; opts.width c = parseInt((clsthat.match(/w:attr(\d+)/)||[])[1]'title') || opts.width; opts.height = parseIntsplit((cls.match(/h:(\d+)/)||[]' ')[1]) || opts.height; opts.timeout var thumbHeight = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout100;
if ($cont.css('position') == 'static')
$cont.css('position', 'relative');
if (opts.width)
$cont.width(opts.width);
if (opts.height && opts.height != 'auto')
$cont.height(opts.height);
var first svg = 0; $slidesdocument.csscreateElementNS({position"http: 'absolute', top:0, left:0})//www.each(function(i) { $(this)w3.css('z-index'org/2000/svg", els.length-i) }"svg"); $(els[first]) svg.csssetAttribute('opacitypreserveAspectRatio',1).show(); // opacity bit needed to handle reinit case if ($.browser.msie) els[first].style.removeAttribute('filternone');
if (opts.fit && opts.width) $slides.width(opts.width); if (opts.fit && opts.height && opts.height ! var ratio = 'auto') $slides.height(opts.height); if (opts.pause) $cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;})thumbHeight / c[3];
var txFn = $.fn.cycle.transitions[opts.fx];
txFn && txFn($cont, $slides, opts);
$slides.each(function() {
var $el = $(this);
this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height();
this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width();
});
if svg.setAttribute('viewBox', (c[0] - (c[2] / 2)) + ' ' + (optsc[1] - (c[3] / 2)) + ' ' + c[2] + ' ' + c[3]); svg.cssFirstsetAttribute('height', thumbHeight); $ svg.setAttribute($slides'width', c[first2]* ratio); svg.csssetAttribute(opts.cssFirst'style', 'margin: 1em 1em 0 0');
if image = document.createElementNS(opts.timeout) { "http:// ensure that timeout and speed settings are sane if (optswww.speedw3.constructor == Stringorg/2000/svg", "image"); opts image.speed = {slow: 600setAttribute('width', fast: 200}[opts.speed] || 400100); if image.setAttribute(!opts.sync'height', 100); opts.speed = opts image.speed / 2; whilesetAttribute((opts.timeout - opts.speed'preserveAspectRatio', 'none') < 250) opts.timeout += opts.speed; } opts image.speedIn = optssetAttributeNS('http://www.speed; optsw3.speedOut = opts.speedorg/1999/xlink', 'href', src);
opts.slideCount var marker = els$('<span />').length;css({ border: '1px solid white', position: 'absolute', display: 'none', left: c[0] + '%', top: c[1] + '%', opts.currSlide = first; width: c[2] + '%', height: c[3] + '%', marginLeft: ((c[2]/2)*-1) + '%', opts.nextSlide = marginTop: ((c[3]/2)*-1) + '%' });
// fire artificial events var e0 = $slides[first]; if (opts.before marker.length) opts.before[0].applyappendTo(e0, [e0, e0, opts, true]fullImage); if $(opts.after.length > 1image) opts.after[1].applyappendTo(e0, [e0, e0, opts, true]svg); if $(opts.click && !opts.nextsvg) opts.next = opts.click; if (opts.next) $appendTo(opts.nextregionBrowser).bindhover('click', function(){return advance(els,opts,opts.rev?-1:1)}); if (opts.prev) $(opts.prev) marker.bind('click', functionfadeIn(){return advance(els,opts,opts.rev?1:-1)}); if (opts.timeout) this.cycleTimeout = setTimeout( }, function() { go(els,opts,0,!opts.rev) }, opts marker.timeout + fadeOut(opts.delay||0)); });}; function go(els, opts, manual, fwd) { if (opts.busy) return; var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide]; if (p.cycleTimeout === 0 && !manual) return;
if (manual || !p.cyclePause) {
if (opts.before.length)
$.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
var after = function() {
if ($.browser.msie)
this.style.removeAttribute('filter');
$.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
};
if (opts.nextSlide != opts.currSlide) {
opts.busy = 1;
$.fn.cycle.custom(curr, next, opts, after);
}
var roll = (opts.nextSlide + 1) == els.length;
opts.nextSlide = roll ? 0 : opts.nextSlide+1;
opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
}
if (opts.timeout)
p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout);
};
// advance slide forward or back
function advance(els, opts, val) {
var p = els[0].parentNode, timeout = p.cycleTimeout;
if (timeout) {
clearTimeout(timeout);
p.cycleTimeout = 0;
}
opts.nextSlide = opts.currSlide + val;
if (opts.nextSlide < 0) {
opts.nextSlide = els.length - 1;
}
else if (opts.nextSlide >= els.length) {
opts.nextSlide = 0;
}
go(els, opts, 1, val>=0);
return false;
};
$.fn.cycle.custom = function(curr, next, opts, cb) {
var $l = $(curr), $n = $(next);
$n.css(opts.cssBefore);
var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb)};
$l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() {
$l.css(opts.cssAfter);
if (!opts.sync) fn();
});
if (opts.sync) fn();
};
$.fn.cycle.transitions = {
fade: function($cont, $slides, opts) {
$slides.not(':eq(0)').hide();
opts.cssBefore = { opacity: 0, display: 'block' };
opts.cssAfter = { display: 'none' };
opts.animOut = { opacity: 0 };
opts.animIn = { opacity: 1 };
},
fadeout: function($cont, $slides, opts) {
opts.before.push(function(curr,next,opts,fwd) {
$(curr).css('zIndex',opts.slideCount + (fwd === true ? 1 : 0));
$(next).css('zIndex',opts.slideCount + (fwd === true ? 0 : 1));
});
$slides.not(':eq(0)').hide();
opts.cssBefore = { opacity: 1, display: 'block', zIndex: 1 };
opts.cssAfter = { display: 'none', zIndex: 0 };
opts.animOut = { opacity: 0 };
}
};
$.fn.cycle.ver = function() { return ver; };
// @see: http://malsup.com/jquery/cycle/lite/
$.fn.cycle.defaults = {
animIn: {},
animOut: {},
fx: 'fade',
after: null,
before: null,
cssBefore: {},
cssAfter: {},
delay: 0,
fit: 0,
height: 'auto',
metaAttr: 'cycle',
next: null,
pause: 0,
prev: null,
speed: 1000,
slideExpr: null,
sync: 1,
timeout: 4000
};
})(jQuery);
(function($) {
$(function() {
var max_height = 0;
$('.slideshow > .wikia-gallery').children().each(function() {
if(!$(this).hasClass('wikia-gallery-item')) {
$(this).remove();
} else {
var elm_height = parseInt($(this).height());
if(elm_height > max_height) {
max_height = elm_height;
$(this).parent().css({height:max_height});
}
}
});
$('.slideshow > .wikia-gallery').css({margin:0}).cycle('fade').children('span').css({padding:0});
});
$('.division-header').css({cursor:'pointer'}).click(function() {
var wrapper = $(this).parent();
if(wrapper.hasClass('collapsed')) {
$(this).siblings().slideDown('slow');
wrapper.removeClass('collapsed');
} else {
$(this).siblings().slideUp('slow');
wrapper.addClass('collapsed');
}
});
})(jQuery);