MediaWiki:Common.js: Unterschied zwischen den Versionen

aus Memory Alpha, der freien deutschen Star-Trek-Datenbank
Spring zu: Navigation, suche
imported>Shisma
imported>Shisma
(caching .. 💩)
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() {var fullImage = $('#file > a');
 
var regionBrowser = $('<div />', {
 
  id: 'region-browser'
 
});
 
 
fullImage.after(regionBrowser);
 
 
$('.region-info').each(function() {
 
  var that = $(this);
 
  var src = $('.fullMedia > a').attr('href');
 
  var c = that.attr('title').split(' ');
 
  var thumbHeight = 100;
 
 
  svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
 
  svg.setAttribute('preserveAspectRatio', 'none');
 
 
  var ratio = thumbHeight / c[3];
 
 
 
  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] * 1.5) * ratio);
 
 
  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);
 
  $(svg).appendTo(regionBrowser);
 
});
 
 
 
   });
 
   });
 
})(jQuery);
 
})(jQuery);

Version vom 23. Oktober 2014, 19:43 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);