PortableInfobox/js/PortableInfoboxMonobook.js

19 lines
449 B
JavaScript
Raw Normal View History

(function () {
'use strict';
var ImageLink = {
init: function ($content) {
2016-11-03 15:11:23 +00:00
$content.find('.portable-infobox .pi-image > a.image').on('click', function () {
var $anchor = $(this),
fileName = $anchor.children('.pi-image-thumbnail').data('image-key');
$anchor.attr('href', '/wiki/File:' + encodeURIComponent(fileName));
});
}
};
mw.hook('wikipage.content').add(function ($content) {
ImageLink.init($content);
});
})();