mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
expand-video.js: fix regexp
This commit is contained in:
parent
77bec71399
commit
f6efdee873
@ -204,13 +204,13 @@ function setupVideo(thumb, url) {
|
|||||||
function setupVideosIn(element) {
|
function setupVideosIn(element) {
|
||||||
var thumbs = element.querySelectorAll("a.file");
|
var thumbs = element.querySelectorAll("a.file");
|
||||||
for (var i = 0; i < thumbs.length; i++) {
|
for (var i = 0; i < thumbs.length; i++) {
|
||||||
if (/\.webm|\.mp4$/.test(thumbs[i].pathname)) {
|
if (/\.webm$|\.mp4$/.test(thumbs[i].pathname)) {
|
||||||
setupVideo(thumbs[i], thumbs[i].href);
|
setupVideo(thumbs[i], thumbs[i].href);
|
||||||
} else {
|
} else {
|
||||||
var m = thumbs[i].search.match(/\bv=([^&]*)/);
|
var m = thumbs[i].search.match(/\bv=([^&]*)/);
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
var url = decodeURIComponent(m[1]);
|
var url = decodeURIComponent(m[1]);
|
||||||
if (/\.webm|\.mp4$/.test(url)) setupVideo(thumbs[i], url);
|
if (/\.webm$|\.mp4$/.test(url)) setupVideo(thumbs[i], url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user