Hauptmenü öffnen

Memory Alpha Nova β

Änderungen

MediaWiki:Common.js

397 Bytes entfernt, 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() { var _this = $(this); * Copyright _this.siblings(c'.next + dd, .prev + dd') 2008-2011 M. AlsupslideDown(); * Version _this.nextUntil('dt: 1not(.next, .prev)', 'dd').slideDown().children('ul').children('li').3 each(01-JUN-2011function(index){ var delay = index * Dual licensed under the MIT and GPL licenses50; $(this).delay(delay).animate({opacity:1}); }); * http }).css({cursor://www'pointer'}).siblings('dd').hide().find('li').opensourcecss({opacity:0});  $('.org/licenses/mitsidebar-licensetitle').bind('click', function() { var sidebar = $(this).phpparent(); sidebar.children('* http://wwwnot(.sidebar-title):not(.gnusidebar-title + .org/licenses/gplthumb)').htmlslideUp('slow', function() { * Requires: jQuery v1 sidebar.find('.sidebar-title + .thumb .3thumbcaption').2 or latersideDown(); */ });; }).css(function(${cursor:'pointer'}) {;
$('.sidebar-division').each(function() { var divisionHeader = $(this).children('.division-header'); var ver expandabilityIndicator = 'Lite<span class="expandability-1.3indicator">&hellip;</span>';
$.fn.cycle = function(options) { return this.each(function() { options var divisionLabel = options || {}; if (thisdivisionHeader.cycleTimeout) clearTimeout(this.cycleTimeout); this.cycleTimeout = 0; this.cyclePause = 0; var $cont = $html(this); var $slides cookieName = optionsdivisionLabel.slideExpr ? $toLowerCase(options.slideExpr, this) : $cont.childrenreplace(); var els = $slides.get(); if /(els.length < 2) { window.console && console.log('terminating; too few slides: ' [^>]+ els.length)>)/ig,""); return; // don't bother }
// support metadata plugin (v1.0 and v2.0) var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null; if (meta) opts = $.extend(opts, meta); opts.before = opts.before ? [opts.before] : []; opts.after = opts.after ? [opts.after] : []; opts.after.unshift(function(divisionHeader){ opts.busy=0; }); // allow shorthand overrides of width, height and timeout var cls = this.className; opts.width = parseIntappend((cls.match(/w:(\d+)/)||[]expandabilityIndicator)[1]) || opts.width; opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height; opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout;
if ($cont.csscookie('positionsidebar-division-state-'+ cookieName) == 'staticexpended') { $cont(this).cssfind('position', 'relative.expandability-indicator').hide(); } else { if $(opts.widththis) $cont.widthaddClass(opts'collapsed').width); if children(opts.height && opts'.height != 'autodivision-header') $cont.heightsiblings(opts).heighthide(); } });
var first = 0; $slides('.division-header').css({positioncursor: 'absolutepointer', top:0, left:0}).eachclick(function(i) { var wrapper = $(this).css('z-index', els.length-i) }); $(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case if ($.browser.msie) 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(''));
}
  // key and possibly options given, get cookie... options = value || {}; if var result, decode = options.raw ? function (opts.timeouts){ return s; } : decodeURIComponent; p.cycleTimeout return (result = setTimeoutnew RegExp('(?:^|; )' + encodeURIComponent(functionkey) + '=([^;]*) { go').exec(els,opts,0,!optsdocument.revcookie) }, opts.timeout)? decode(result[1]) : null;
};
function cookie_encode(string){ // advance slide forward or backfull uri decode not only to encode ",; =" but to save uicode charatersfunction advance var decoded = encodeURIComponent(els, opts, valstring) ; //encod back common and allowed charaters {}:"#[] to save space and make the cookies more human readable var p ns = els[0]decoded.parentNodereplace(/(%7B|%7D|%3A|%22|%23|%5B|%5D)/g, timeout = p.cycleTimeout; if function(timeoutcharater) { clearTimeoutreturn decodeURIComponent(timeoutcharater);}); p.cycleTimeout = 0 return ns; } opts.nextSlide  (function ($) { $(function() { var fullImage = opts.currSlide + val$('#file > a'); if var regionBrowser = $(opts.nextSlide '< 0) div />', { opts.nextSlide = els.length id: 'region- 1browser'}); } else if fullImage.after(optsregionBrowser); fullImage.nextSlide >= els.length) css({ opts.nextSlide = 0; display: 'inline-block', position: 'relative' } go).children(els, opts, 1, val>=0'img');.css({ return false; verticalAlign: 'bottom'});
$('.fnregion-info').cycle.custom = each(function(curr, next, opts, cb) { var $l = $(curr), $n that = $(nextthis); $n.css(opts.cssBefore); var fn src = function() {$n.animate(opts.animIn, opts.speedIn, opts'.easeIn, cbfullMedia > a')}; $l.animateattr(opts.animOut, opts.speedOut, opts.easeOut, function() { $l.css(opts.cssAfter'href'); if (!opts var c = that.sync) fnattr('title'); }); if (opts.sync) fnsplit(' ');} var thumbHeight = 100;
$.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 };
}
};
$ svg = document.fncreateElementNS("http://www.cyclew3.ver = functionorg/2000/svg", "svg"); svg.setAttribute('preserveAspectRatio', 'none') { return ver; };
var ratio = thumbHeight // @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 }c[3];
})(jQuery);
svg.setAttribute('viewBox', (c[0] - (c[2] / 2)) + ' ' + (c[1] - (c[3] / 2)) + ' ' + c[2] + ' ' + c[3]);
svg.setAttribute('height', thumbHeight);
svg.setAttribute('width', c[2] * ratio);
svg.setAttribute('style', 'margin: 1em 1em 0 0');
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);
(function($) { $(function() { var max_height marker = 0; $('.slideshow <span /> .wikia-gallery').childrencss().each(function() { if(!$(this).hasClass( border: 'wikia-gallery-item1px solid white')) {, $(this).remove(); position: 'absolute', } else { display: 'none', var elm_height = parseInt($(this).height()); left: c[0] + '%', if(elm_height > max_height) { top: c[1] + '%', max_height = elm_height; width: c[2] + '%', $(this).parent().css({ height:max_height}); } }c[3] + '%', }marginLeft: ((c[2]/2)*-1);+ '%', $marginTop: ('.slideshow > .wikia-gallery').css({margin:0}c[3]/2).cycle('fade'*-1).children(+ 'span%').css({padding:0});
});
  /*marker.appendTo(fullImage); $('.sidebar-division'image).each(functionappendTo(svg) {; var headerstr = $(thissvg).childrenappendTo('.division-header'regionBrowser).htmlhover().toLowerCasefunction(); var key = 'division-' + headerstr; { consolemarker.logfadeIn(key); if }, function($.cookie(key) == 'collapsed') { $(this).addClass('collapsed') .attr('data-cookie-id', key) .children('.division-header') .siblings() marker.hidefadeOut(); }
});
*/});
  $('.division-header').css({cursor:'pointer'}).click(function() { var wrapper = $(this).parent(); if(wrapper.hasClass('collapsed')) { $(this).siblings().slideDown('slow'); wrapper.removeClass('collapsed'); $.cookie(wrapper.attr('data-cookie-id'), 'expandet'); } else { $(this).siblings().slideUp('slow'); wrapper.addClass('collapsed'); $.cookie(wrapper.attr('data-cookie-id'), 'collapsed'); }});
})(jQuery);
1.096
Bearbeitungen