Changes

no edit summary
Line 338: Line 338:     
$('.webp').each(function () {
 
$('.webp').each(function () {
    const src = $(this).data('src');
+
var a = $('<a>').addClass('image').attr('href', '/File:' + $(this).data('src'));
    const init = $(this).data('init');
+
var img = $('<img>');
    if (!src || init) return;
+
for (var attr in $(this).data()) {
      $(this).append($('<img>').attr('src', 'https://en.kancollewiki.net/Special:Filepath/' + src));
+
img.attr(attr, (attr === 'src' ? 'https://en.kancollewiki.net/Special:Filepath/' : '') + $(this).data(attr));
        $(this).data('init', true);
+
}
 +
a.append(img);
 +
      $(this).append(a);
 
});
 
});
    
});
 
});
cssedit, gkautomate
6,926

edits