Hauptmenü öffnen

Memory Alpha Nova β

Änderungen

MediaWiki:Common.js

108 Bytes hinzugefügt, 12:16, 17. Jan. 2020
keine Bearbeitungszusammenfassung
/*@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
/*
* jQuery Cycle Lite Plugin(function ($) { $(function() {  * http://malsup $('.nav dt, .links > dt').com/jquery/cycle/lite/bind('click', function() { * Copyright var _this = $(cthis) 2008-2011 M; _this. Alsup * Version: 1siblings('.next + dd, .prev + dd').3 slideDown(01-JUN-2011); * Dual licensed under the MIT and GPL licenses _this.nextUntil('dt: * http://wwwnot(.opensourcenext, .org/licenses/mit-licenseprev)', 'dd').php * http://wwwslideDown().gnuchildren('ul').org/licenses/gplchildren('li').htmleach(function(index) { var delay = index * Requires: jQuery v150; $(this).3delay(delay).2 or lateranimate({opacity:1}); */ });; }).css({cursor:'pointer'}).siblings('dd').hide(function).find($'li') .css({opacity:0});
$('.sidebar-title').bind('click', function() { var ver sidebar = $(this).parent(); sidebar.children('*:not(.sidebar-title):not(.sidebar-title + .thumb)').slideUp('Liteslow', function() { sidebar.find('.sidebar-1title + .thumb .thumbcaption').3sideDown(); }); }).css({cursor:'pointer'});
$('.fn.cycle = function(optionssidebar-division') { return this.each(function() { options = options || {}; if (this.cycleTimeout) clearTimeout(this.cycleTimeout); this.cycleTimeout = 0; this.cyclePause = 0; var $cont = $(this); var $slides divisionHeader = options.slideExpr ? $(options.slideExpr, this) : $cont.children('.division-header'); var els expandabilityIndicator = $slides.get(); if (els.length '< 2) { window.console span class="expandability-indicator">&& console.log('terminatinghellip; too few slides: </span>' + els.length); return; // don't bother }
// support metadata plugin (v1.0 and v2.0) var opts divisionLabel = $divisionHeader.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadatahtml() : $.meta ? $cont.data() : {}); var meta cookieName = $.isFunction($cont.data) ? $cont.data(optsdivisionLabel.metaAttr) : null; if toLowerCase(meta) opts = $.extendreplace(opts, meta); opts.before = opts.before ? [opts.before] : []; opts.after = opts.after ? [opts.after] : []; opts.after.unshift(function(){ opts.busy=0; }); // allow shorthand overrides of width, height and timeout var cls = this.className; opts.width = parseInt((cls.match<(/w:(\d+)/)||[])[1^>]) || opts.width; opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height; opts.timeout = parseInt((cls.match(/t:(\d+>)/ig,"")||[])[1]) || opts.timeout;
if ( $cont.css('position') == 'static'divisionHeader) $cont.cssappend('position', 'relative'); if (opts.width) $cont.width(opts.width); if (opts.height && opts.height != 'auto') $cont.height(opts.heightexpandabilityIndicator);
var first if($.cookie('sidebar-division-state-' + cookieName) == 0;'expended') { $slides(this).cssfind({position: 'absolute.expandability-indicator', top:0, left:0}).eachhide(function(i) ; } else { $(this).cssaddClass('collapsed').children('z.division-indexheader', els).length-isiblings().hide() ; } }); $(els[first]'.division-header').css({cursor:'opacitypointer',1}).showclick(function(); // opacity bit needed to handle reinit case{ if var wrapper = $($.browser.msiethis) els[first].style.removeAttributeparent('filter');
if (optswrapper.fit && opts.width) $slides.width(opts.width); if hasClass(opts.fit && opts.height && opts.height != 'autocollapsed') $slides.height(opts.height); if (opts.pause) $cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;});
var txFn divisionLabel = $(this).fn.cycle.transitions[optschildren('strong').fx]; txFn && txFnhtml($cont, $slides, opts); $slides.each(function() { var $el cookieName = $divisionLabel.toLowerCase(this); this.cycleH = replace(opts.fit && opts.height) ? opts.height : $el.height/(); this.cycleW = <(opts.fit && opts.width[^>]+) ? opts.width : $el.width(>); }/ig,"");
if $(optsthis).siblings().cssFirstslideDown('slow'); $($slides[first]this).find('.expandability-indicator').cssfadeOut(opts); wrapper.cssFirstremoveClass('collapsed'); $.cookie('sidebar-division-state-' + cookieName, 'expended');
if (opts.timeout) { // ensure that timeout and speed settings are sane if (opts.speed.constructor == String) opts.speed = } else {slow: 600, fast: 200}[opts.speed] || 400; if (!opts.sync) opts.speed = opts.speed / 2; while((opts.timeout - opts.speed) < 250) opts.timeout += opts.speed; } opts.speedIn = opts.speed; opts.speedOut = opts.speed;
opts.slideCount = els.length;
opts.currSlide = first;
opts.nextSlide = 1;
// fire artificial events var e0 divisionLabel = $slides[first]; if (opts.before.lengththis) opts.before[0].applychildren(e0, [e0, e0, opts, true]); if (opts.after.length > 1'strong') opts.after[1].applyhtml(e0, [e0, e0, opts, true]); if (opts.click && !opts.next) opts.next var cookieName = opts.click; if (optsdivisionLabel.next) $toLowerCase(opts.next).bindreplace('click', function/(){return advance<(els,opts,opts.rev?-1:1[^>]+)}>); if (opts.prev) $(opts.prev).bind('click'/ig, function(""){return advance(els,opts,opts.rev?1:-1)});
if $(optsthis).timeoutsiblings() this.cycleTimeout = setTimeoutslideUp('slow', function() { go wrapper.addClass(els,opts,0,!opts.rev'collapsed'); }, opts); $(this).timeout + find(opts'.delay||0expandability-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 * * Copyright (c) 2010 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */jQuery.cookie = function (key, value, options) {
function go(els // key and at least value given, opts, manual, fwd) {set cookie... if (optsarguments.busylength > 1 && String(value) return; var p != els[0].parentNode, curr = els"[opts.currSlideobject Object], next ") { options = els[optsjQuery.nextSlide]; if extend(p.cycleTimeout === 0 && !manual{}, options) return;
if (manual value === null || !p.cyclePausevalue === undefined) { if (opts.before.length) $.each(opts.before, function(i,o) { ooptions.apply(next, [curr, next, opts, fwd]); }); var after expires = function() { if ($.browser.msie) this.style.removeAttribute('filter'); $.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); })-1; };
if (optstypeof options.nextSlide !expires = opts.currSlide== 'number') { optsvar days = options.expires, t = options.busy expires = 1new Date(); $t.fn.cyclesetDate(t.customgetDate(curr, next, opts, after) + days);
}
  var roll value = String(opts.nextSlide + 1value) == els.lengthoptsreturn (document.nextSlide cookie = [ encodeURIComponent(key), '= roll ', options.raw ? 0 value : optscookie_encode(value), options.nextSlideexpires ? '; expires=' +1options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? ';path=' + options.path : '', opts options.currSlide domain ? '; domain= roll ' + options.domain : '', options.secure ? els.length-1 '; secure' : opts'' ].nextSlide-1join(''));
}
if (opts.timeout)
p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout);
};
// advance slide forward or backkey and possibly options given, get cookie...function advance(els, opts, val) options = value || {}; var p = els[0].parentNoderesult, timeout decode = poptions.cycleTimeout; if raw ? function (timeouts) { clearTimeout(timeout)return s; p.cycleTimeout = 0} : decodeURIComponent; } opts.nextSlide return (result = opts.currSlide new RegExp('(?:^|; )' + val; if encodeURIComponent(opts.nextSlide < 0key) { opts.nextSlide + '= els([^;]*)').length - 1; } else if exec(optsdocument.nextSlide >= els.lengthcookie)) { opts.nextSlide = 0; } go? decode(els, opts, result[1, val>=0]); return false: null;
};
$.fn.cycle.custom = functioncookie_encode(curr, next, opts, cbstring) { //full uri decode not only to encode ",; =" but to save uicode charaters var $l = $(curr), $n decoded = $encodeURIComponent(nextstring); $n.css(opts.cssBefore); //encod back common and allowed charaters {}:"#[] to save space and make the cookies more human readable var fn ns = functiondecoded.replace() {$n.animate/(opts.animIn, opts.speedIn, opts.easeIn, cb%7B|%7D|%3A|%22|%23|%5B|%5D)}; $l.animate(opts.animOut, opts.speedOut, opts.easeOut/g, function(charater) { $l.css(opts.cssAfter); if (!opts.sync) fnreturn decodeURIComponent(charater); }); if (opts.sync) fn() return ns;};
$.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 };
}
};
(function ($.fn.cycle.ver = ) { $(function() { return ver; };
// @see: http://malsup.com/jquery/cycle/lite/var fullImage = $.fn.cycle.defaults = { animIn: {}, animOut: {}, fx: ('fade#file > a',); after: null, before: null, cssBefore: {}, cssAfter: {}, delay: 0, fit: 0, height: var regionBrowser = $('auto<div />',{ metaAttr id: 'cycleregion-browser', next: null, pause: 0, prev: null, speed: 1000, slideExpr: null, sync: 1, timeout: 4000 });
})fullImage.after(jQueryregionBrowser);
fullImage.css({
display: 'inline-block',
position: 'relative'
}).children('img').css({
verticalAlign: 'bottom'
});
$('.region-info').each(function() {
var that = $(this);
var src = $('.fullMedia > a').attr('href');
var c = that.attr('title').split(' ');
var thumbHeight = 100;
(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});
});
$svg = document.createElementNS('"http://www.w3.division-header'org/2000/svg", "svg"); svg.csssetAttribute({cursor:'pointerpreserveAspectRatio', 'none'}).click(function() {;
var wrapper ratio = $(this).parent()thumbHeight / c[3];
if(wrapper.hasClass('collapsed')) {
$ svg.setAttribute('viewBox', (thisc[0] - (c[2] / 2)) + ' ' + (c[1] - (c[3] / 2)) + ' ' + c[2] + ' ' + c[3]); svg.siblingssetAttribute('height', thumbHeight); svg.slideDownsetAttribute('slowwidth', c[2] * ratio); wrapper svg.removeClasssetAttribute('collapsedstyle', 'margin: 1em 1em 0 0');
} else { image = document.createElementNS("http://www.w3.org/2000/svg", "image"); image.setAttribute('width', 100); image.setAttribute('height', 100); image.setAttribute('preserveAspectRatio', 'none'); image.setAttributeNS('http://www.w3.org/1999/xlink', 'href', src);
var marker = $(this'<span />').siblingscss({ border: '1px solid white', position: 'absolute', display: 'none', left: c[0] + '%', top: c[1] + '%', width: c[2] + '%', height: c[3] + '%', marginLeft: ((c[2]/2).slideUp(*-1) + 'slow%');, wrapper.addClass marginTop: ((c[3]/2)*-1) + 'collapsed%' });
marker.appendTo(fullImage); $(image).appendTo(svg); $(svg).appendTo(regionBrowser).hover(function() { marker.fadeIn(); }, function() { marker.fadeOut(); });
});
   });
})(jQuery);
1.096
Bearbeitungen