MediaWiki:Common.js: Unterschied zwischen den Versionen
imported>Shisma (wird nicht mehr gebraucht) |
imported>Shisma (test) |
||
Zeile 4: | Zeile 4: | ||
sidebarjs.attr('src', 'http://de.memory-alpha.org/wiki/MediaWiki:Fusion/scripts/Sidebar.js?action=raw&ctype=text/javascript'); | sidebarjs.attr('src', 'http://de.memory-alpha.org/wiki/MediaWiki:Fusion/scripts/Sidebar.js?action=raw&ctype=text/javascript'); | ||
$('head').append(sidebarjs); | $('head').append(sidebarjs); | ||
+ | }); | ||
+ | })(jQuery); | ||
+ | |||
+ | (function ($) { | ||
+ | $(function() { | ||
+ | $('html').attr('xmlns:svg', "http://www.w3.org/2000/svg"); | ||
+ | $('.region-info').each(function() { | ||
+ | var that = $(this); | ||
+ | var src = $('.fullMedia > a').attr('href'); | ||
+ | var c = that.attr('title').split(' '); | ||
+ | |||
+ | svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); | ||
+ | svg.setAttribute('width', 60); | ||
+ | svg.setAttribute('height', 80); | ||
+ | svg.setAttribute('preserveAspectRatio', 'none'); | ||
+ | svg.setAttribute('viewBox', (c[0] - (c[2] / 2)) + ' ' + (c[1] - (c[3] / 2)) + ' ' + c[2] + ' ' + c[3]); | ||
+ | |||
+ | 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); | ||
+ | $(image).appendTo(svg); | ||
+ | that.html(svg); | ||
+ | }); | ||
}); | }); | ||
})(jQuery); | })(jQuery); |
Version vom 23. Oktober 2014, 16:30 Uhr
(function ($) {
$(function() {
var sidebarjs = $('<script type="text/javascript" />');
sidebarjs.attr('src', 'http://de.memory-alpha.org/wiki/MediaWiki:Fusion/scripts/Sidebar.js?action=raw&ctype=text/javascript');
$('head').append(sidebarjs);
});
})(jQuery);
(function ($) {
$(function() {
$('html').attr('xmlns:svg', "http://www.w3.org/2000/svg");
$('.region-info').each(function() {
var that = $(this);
var src = $('.fullMedia > a').attr('href');
var c = that.attr('title').split(' ');
svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg.setAttribute('width', 60);
svg.setAttribute('height', 80);
svg.setAttribute('preserveAspectRatio', 'none');
svg.setAttribute('viewBox', (c[0] - (c[2] / 2)) + ' ' + (c[1] - (c[3] / 2)) + ' ' + c[2] + ' ' + c[3]);
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);
$(image).appendTo(svg);
that.html(svg);
});
});
})(jQuery);