Hauptmenü öffnen

Memory Alpha Nova β

Änderungen

MediaWiki:Common.js

132 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() { 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.cycleTimeoutfunction(charater){return decodeURIComponent(charater);}); return ns; if }  (function ($) { $(function(timeout) { clearTimeoutvar fullImage = $(timeout'#file > a'); p.cycleTimeout var regionBrowser = 0$('<div />', { id: 'region-browser'}); } optsfullImage.nextSlide = opts.currSlide + valafter(regionBrowser); if fullImage.css(opts{ display: 'inline-block', position: 'relative'}).nextSlide < 0children('img') .css({ opts.nextSlide = els.length - 1 verticalAlign: 'bottom'}); } else if $(opts'.nextSlide >= elsregion-info').lengtheach(function() { opts.nextSlide var that = 0$(this); } go var src = $(els, opts, 1, val'.fullMedia >=0a').attr('href'); return false var c = that.attr('title').split(' ');} var thumbHeight = 100;
$.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 svg = { fade: function($cont, $slides, opts) { $slides.not(':eq(0)')document.hidecreateElementNS(); opts.cssBefore = { opacity: 0, display: 'block' }; opts.cssAfter = { display: 'none' }; opts.animOut = { opacity: 0 }; opts.animIn = { opacity: 1 }; }, fadeout"http: function($cont, $slides, opts) { opts.before.push(function(curr,next,opts,fwd) { $(curr).css('zIndex',opts//www.slideCount + (fwd === true ? 1 : 0)); $(next)w3.css('zIndex'org/2000/svg",opts.slideCount + (fwd === true ? 0 : 1)); }"svg"); $slides.not(':eq(0)') svg.hidesetAttribute(); opts.cssBefore = { opacity: 1, display: 'blockpreserveAspectRatio', zIndex: 1 }; opts.cssAfter = { display: 'none', zIndex: 0 }; opts.animOut = { opacity: 0 }; }});
$.fn.cycle.ver var ratio = function() { return ver; }thumbHeight / c[3];
// @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
};
} 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(jQuery'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);
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: ((c[3]/2)*-1) + '%'
});
marker.appendTo(function($fullImage) {; $(functionimage).appendTo(svg) { var max_height = 0; $('.slideshow > .wikia-gallery'svg).childrenappendTo(regionBrowser).eachhover(function() { if(!$(this) marker.hasClass('wikia-gallery-item')) { $(this).removefadeIn(); } else { var elm_height = parseInt($, function(this).height()); if(elm_height > max_height) { max_height = elm_height; $(this).parent().css({height:max_height}); } } }); $('marker.slideshow > .wikia-gallery').cssfadeOut({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().show();
wrapper.removeClass('collapsed');
} else {
$(this).siblings().hide();
wrapper.addClass('collapsed');
}
});
   });
})(jQuery);
1.098
Bearbeitungen