Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: static/js/index.js

Issue 29703633: Noissue - Abstracted embedded video for use in blog (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org
Patch Set: Addressed #9 and added urlencode to innerHTML Created Feb. 27, 2018, 1:09 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « static/css/main.css ('k') | static/js/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: static/js/index.js
===================================================================
--- a/static/js/index.js
+++ b/static/js/index.js
@@ -1,12 +1,10 @@
(function()
{
- document.documentElement.className = "js";
-
var visibleTab;
var container = document.getElementById("more-container");
window.toggleMore = function()
{
if (container.className == "hidden")
container.className = visibleTab || getDefaultTab();
else
@@ -23,55 +21,9 @@
function getDefaultTab()
{
var content = document.getElementById("content");
var ua = content.className.match(/ua\-([^\s]+)/);
visibleTab = ua && ua[1] || "firefox";
return visibleTab;
}
- // Change overlay icon on #video to play icon
- document
- .getElementById("video-play")
- .setAttribute("src", "/img/video-play.png");
-
- // Save time user clicked to show video disclaimer
- var timeClickedVideo;
-
- function changeImageToVideo(event)
- {
- event.preventDefault();
-
- var videoContainer = document.getElementById("video-container");
-
- if (videoContainer.className == "show-disclaimer")
- {
- // Enfore 600ms delay
- var currentTime = new Date().getTime();
- if (currentTime - timeClickedVideo < 600) return;
-
- var image = this;
-
- var video = document.createElement("iframe");
- video.id = "video";
- video.setAttribute("frameborder", "0");
- video.setAttribute("height", "285");
- video.setAttribute("width", "520");
- video.setAttribute("itemprop", "video");
- video.setAttribute("allowfullscreen", "allowfullscreen");
- video.setAttribute("src", image.getAttribute("href"));
-
- image.parentNode.replaceChild(video, image);
-
- videoContainer.className = "";
- }
- else
- {
- videoContainer.className = "show-disclaimer";
- timeClickedVideo = new Date().getTime();
- }
- }
-
- document
- .getElementById("video")
- .addEventListener("click", changeImageToVideo);
-
})();
« no previous file with comments | « static/css/main.css ('k') | static/js/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld