Browse Source

expand-video.js: fix regexp

pull/40/head
czaks 8 years ago
parent
commit
f6efdee873
  1. 4
      js/expand-video.js

4
js/expand-video.js

@ -204,13 +204,13 @@ function setupVideo(thumb, url) {
function setupVideosIn(element) {
var thumbs = element.querySelectorAll("a.file");
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);
} else {
var m = thumbs[i].search.match(/\bv=([^&]*)/);
if (m != null) {
var url = decodeURIComponent(m[1]);
if (/\.webm|\.mp4$/.test(url)) setupVideo(thumbs[i], url);
if (/\.webm$|\.mp4$/.test(url)) setupVideo(thumbs[i], url);
}
}
}

Loading…
Cancel
Save