Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
MediaWiki:Common.js
(view source)
Revision as of 21:43, 9 May 2023
57 bytes added
,
1 year ago
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
7,060
edits