Hauptmenü öffnen

Memory Alpha Nova β

Änderungen

MediaWiki:Common.js

878 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
/*
(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 * jQuery Cycle Lite Plugin50; $(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('* http: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">&hellip;</span>';  var divisionLabel = divisionHeader.html(); var cookieName = divisionLabel.toLowerCase().replace(/(<([^>]+)>)/malsupig,"");  $(divisionHeader).comappend(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(/jquery(<([^>]+)>)/cycleig,"");  $(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(/lite(<([^>]+)>)/ig,"")  $(this).siblings().slideUp('slow', function() { wrapper.addClass('collapsed'); }); * Copyright $(cthis) 2008.find('.expandability-2011 Mindicator'). AlsupfadeIn(); * Version: 1 $.3 cookie(01'sidebar-division-JUNstate-2011' + 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
* Requires: jQuery v1.3.2 or later
*/
;(jQuery.cookie = function($key, value, options) {
var ver // key and at least value given, set cookie... if (arguments.length > 1 && String(value) !== "[object Object]") { options = 'Lite-1jQuery.3'extend({}, options);
$.fn.cycle = function(options) { return this.each(function() { options = options || {}; if (this.cycleTimeout) clearTimeout(this.cycleTimeout); this.cycleTimeout value == 0; this.cyclePause = 0; var $cont null || value = $(this); var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children(); var els = $slides.get(); if (els.length < 2undefined) { windowoptions.console && console.log('terminating; too few slides: ' + els.length); returnexpires = -1; // don't bother
}
// support metadata plugin if (v1typeof options.0 and v2.0) var opts expires === $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data('number') : {}); var meta days = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null; if (meta) opts = $options.extend(optsexpires, meta); opts.before t = opts.before ? [opts.before] : []; optsoptions.after expires = opts.after ? [opts.after] : []; opts.after.unshift(functionnew Date(){ opts.busy=0; }); // allow shorthand overrides of width, height and timeout var cls = this.className; optst.width = parseIntsetDate((clst.match(/w:getDate(\d+)/)||[])[1]) || opts.width; opts.height = parseInt((cls.match(/h:(\d+days)/)||[])[1]) || opts.height; opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout;}
if ($cont.css('position') == 'static') $cont.css('position', 'relative'); if (opts.width) $cont.width(opts.width); if (opts.height && opts.height !value = 'auto') $cont.heightString(opts.heightvalue);
var first return (document.cookie = 0;[ $slides.css encodeURIComponent({position: key), 'absolute=', top:0, left options.raw ? value :0}).eachcookie_encode(function(ivalue) { , $options.expires ? '; expires=' + options.expires.toUTCString(this).css(: 'z-index', els.length// use expires attribute, max-i) age is not supported by IE }) options.path ? ';path=' + options.path : '', $(els[first]) options.domain ? '; domain=' + options.css(domain : 'opacity',1) options.show()secure ? '; // opacity bit needed to handle reinit casesecure' : '' if ($.browser.msie) els[first].style.removeAttributejoin('filter')); }
if (opts // key and possibly options given, get cookie.fit && opts.width) $slides.width(opts.width); if (opts.fit && opts.height && opts.height ! options = 'auto') $slides.height(opts.height)value || {}; if (opts var result, decode = options.pause) $cont.hover(raw ? function(s){this.cyclePause=1return s;}, function(){this.cyclePause=0;}): decodeURIComponent var txFn return (result = $.fn.cycle.transitions[opts.fx]new RegExp('(?:^|; txFn && txFn($cont, $slides, opts); $slides.each(function' + encodeURIComponent(key) { var $el + '= $(this)[^; this.cycleH = (opts.fit && opts.height]*) ? opts.height : $el.height('); this.cycleW = exec(optsdocument.fit && opts.widthcookie)) ? opts.width : $el.widthdecode(result[1]): null; });
if function cookie_encode(opts.cssFirststring){ $ //full uri decode not only to encode ",; =" but to save uicode charaters var decoded = encodeURIComponent($slidesstring); //encod back common and allowed charaters {}:"#[first]to save space and make the cookies more human readable var ns = decoded.replace(/(%7B|%7D|%3A|%22|%23|%5B|%5D).css/g,function(charater){return decodeURIComponent(opts.cssFirstcharater);}); return ns;}
if (opts.timeout) {
// ensure that timeout and speed settings are sane
if (opts.speed.constructor == String)
opts.speed = {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;(function ($) { opts.currSlide = first; opts.nextSlide = 1; $(function() {
// fire artificial events var e0 fullImage = $slides[first]; if (opts.before.length) opts.before[0].apply(e0, [e0, e0, opts, true]); if (opts.after.length '#file > 1) opts.after[1].apply(e0, [e0, e0, opts, true]a'); if (opts.click && !opts.next) opts.next var regionBrowser = opts.click; if (opts.next) $(opts.next).bind('click<div />', function(){return advance(els,opts,opts.rev?-1 id:1)}); if (opts.prev) $(opts.prev).bind('clickregion-browser', function(){return advance(els,opts,opts.rev?1:-1)});
if (opts.timeout) thisfullImage.cycleTimeout = setTimeoutafter(function() { go(els,opts,0,!opts.rev) }, opts.timeout + (opts.delay||0)); }regionBrowser);};
function gofullImage.css(els{ display: 'inline-block', opts, manual, fwd position: 'relative'}) { if .children(opts'img').busy) return;css({ var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide]; verticalAlign: 'bottom' if (p.cycleTimeout === 0 && !manual}) return;
if $(manual || !p'.cyclePauseregion-info') { if (opts.before.length) $.each(opts.before, function(i,o) { o.apply var that = $(next, [curr, next, opts, fwd]); }this); var after src = function$() { if ($'.browser.msiefullMedia > a') this.style.removeAttributeattr('filterhref'); $.each(opts var c = that.after, functionattr(i,o'title') { o.applysplit(next, [curr, next, opts, fwd]); }' '); } var thumbHeight = 100;
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 backfunction advance(els, opts, val) { var p = els[0].parentNode, timeout svg = pdocument.cycleTimeout; if createElementNS(timeout) { clearTimeout(timeout); p"http://www.cycleTimeout = 0; } optsw3.nextSlide = opts.currSlide + val; if (opts.nextSlide < 0org/2000/svg", "svg") { opts.nextSlide = els.length - 1; } else if (opts.nextSlide >= els.length) { opts svg.nextSlide = 0; } gosetAttribute(els, opts, 1'preserveAspectRatio', val>=0'none'); return false;};
$.fn.cycle.custom = function(curr, next, opts, cb) { var $l = $(curr), $n = $(next); $n.css(opts.cssBefore); var fn ratio = 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();}thumbHeight / c[3];
$.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.fnsetAttribute('viewBox', (c[0] - (c[2] / 2)) + ' ' + (c[1] - (c[3] / 2)) + ' ' + c[2] + ' ' + c[3]); svg.cyclesetAttribute('height', thumbHeight); svg.ver = functionsetAttribute('width', c[2] * ratio) { return ver; } svg.setAttribute('style', 'margin: 1em 1em 0 0');
// @see: image = document.createElementNS("http://malsupwww.w3.comorg/jquery/cycle/lite2000/svg", "image");$ image.fn.cycle.defaults = { animIn: {}setAttribute('width',100); animOut: {}, fx: image.setAttribute('fadeheight',100); after: null, before: null, cssBefore: {}, cssAfter: {}, delay: 0, fit: 0, height: image.setAttribute('autopreserveAspectRatio', metaAttr: 'cyclenone',); next image.setAttributeNS('http: null//www.w3.org/1999/xlink', pause: 0, prev: null, speed: 1000'href', slideExpr: null, sync: 1, timeout: 4000 }src);
} var marker = $('<span />').css({ border: '1px solid white', position: 'absolute', display: 'none', left: c[0] + '%', top: c[1] + '%', width: c[2] + '%', height: c[3] + '%', marginLeft: ((c[2]/2)*-1)+ '%', marginTop: (jQuery(c[3]/2)*-1) + '%' });
marker.appendTo(fullImage);
$(image).appendTo(svg);
$(svg).appendTo(regionBrowser).hover(function() {
marker.fadeIn();
}, function() {
marker.fadeOut();
});
});
(function($) {
$(function() {
$('.slideshow > .wikia-gallery').cycle('fade');
});
})(jQuery);
1.096
Bearbeitungen