summaryrefslogtreecommitdiff
path: root/expandvideo.js
diff options
context:
space:
mode:
authorccd0 <admin@containerchan.org>2013-11-10 04:57:45 -0800
committerccd0 <admin@containerchan.org>2013-11-10 04:57:45 -0800
commit8119058ac9d9e27197f6c8d2e837979b75828a71 (patch)
treedc8c2ea9edc3fee9b6f812eaff4916b35c962275 /expandvideo.js
parent2a770f27d1a35e8dc7914f9d230e541a93f38d9b (diff)
loop setting on player page, various other changes
Diffstat (limited to 'expandvideo.js')
-rw-r--r--expandvideo.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/expandvideo.js b/expandvideo.js
index 26979bea..260ff17d 100644
--- a/expandvideo.js
+++ b/expandvideo.js
@@ -27,12 +27,12 @@ function setupVideo(thumb, url) {
video.src = url;
video.loop = true;
video.innerText = "Your browser does not support HTML5 video.";
- video.onclick = function(e) {
+ video.addEventListener("click", function(e) {
if (e.shiftKey) {
unexpand();
e.preventDefault();
}
- };
+ }, false);
videoHide = document.createElement("img");
videoHide.src = configRoot + "cc/collapse.gif";
@@ -40,7 +40,7 @@ function setupVideo(thumb, url) {
videoHide.title = "Collapse to thumbnail";
videoHide.style.verticalAlign = "top";
videoHide.style.marginRight = "2px";
- videoHide.onclick = unexpand;
+ videoHide.addEventListener("click", unexpand, false);
videoContainer = document.createElement("div");
videoContainer.style.whiteSpace = "nowrap";
@@ -50,7 +50,7 @@ function setupVideo(thumb, url) {
}
}
- thumb.onclick = function(e) {
+ thumb.addEventListener("click", function(e) {
if (setting("videoexpand") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
getVideo();
expanded = true;
@@ -69,11 +69,11 @@ function setupVideo(thumb, url) {
video.muted = setting("videomuted");
video.controls = true;
video.play();
- return false;
+ e.preventDefault();
}
- };
+ }, false);
- thumb.onmouseover = function(e) {
+ thumb.addEventListener("mouseover", function(e) {
if (setting("videohover")) {
getVideo();
expanded = false;
@@ -101,12 +101,14 @@ function setupVideo(thumb, url) {
video.controls = false;
video.play();
}
- };
+ }, false);
- thumb.onmouseout = unhover;
+ thumb.addEventListener("mouseout", unhover, false);
}
if (window.addEventListener) window.addEventListener("load", function(e) {
+ document.body.insertBefore(settingsMenu, document.body.firstChild);
+
var thumbs = document.querySelectorAll("a.file");
for (var i = 0; i < thumbs.length; i++) {
if (/\.webm$/.test(thumbs[i].pathname)) {