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 02:28, 10 May 2023
128 bytes added
,
1 year ago
no edit summary
Line 335:
Line 335:
//})
//})
−
// Basic webp/webm/
etc.
support
+
// Basic webp/webm/
ogg/mp4 video
support
using <img> and <video> in elements with respective classes
$('.webp').each(function () {
$('.webp').each(function () {
Line 347:
Line 347:
});
});
−
$('.
webm
').each(function () {
+
for (var ext of ['webm', 'ogg', 'mp4']) {
−
var video = $('<video>').attr('controls');
+
$('.'
+ ext
).each(function () {
−
var source = $('<source>').attr('type', 'video/
webm
');
+
var video = $('<video>').attr('controls');
−
for (var attr in $(this).data()) {
+
var source = $('<source>').attr('type', 'video/'
+ ext
);
−
;(attr === 'src' || attr === 'type' ? source : video).attr(attr, (attr === 'src' ? 'https://en.kancollewiki.net/Special:Filepath/' : '') + $(this).data(attr));
+
for (var attr in $(this).data()) {
−
}
+
;(attr === 'src' || attr === 'type' ? source : video).attr(attr, (attr === 'src' ? 'https://en.kancollewiki.net/Special:Filepath/' : '') + $(this).data(attr));
−
video.append(source);
+
}
−
$(this).append(video);
+
video.append(source);
−
});
+
$(this).append(video);
+
});
+
}
});
});
がか
cssedit, gkautomate
7,064
edits