Index: include.postload.js |
=================================================================== |
--- a/include.postload.js |
+++ b/include.postload.js |
@@ -138,88 +138,6 @@ |
} |
} |
-function getURLsFromObjectElement(element) |
-{ |
- var url = element.getAttribute("data"); |
- if (url) |
- return [url]; |
- |
- for (var i = 0; i < element.children.length; i++) |
- { |
- var child = element.children[i]; |
- if (child.localName != "param") |
- continue; |
- |
- var name = child.getAttribute("name"); |
- if (name != "movie" && // Adobe Flash |
- name != "source" && // Silverlight |
- name != "src" && // Real Media + Quicktime |
- name != "FileName") // Windows Media |
- continue; |
- |
- var value = child.getAttribute("value"); |
- if (!value) |
- continue; |
- |
- return [value]; |
- } |
- |
- return []; |
-} |
- |
-function getURLsFromAttributes(element) |
-{ |
- var urls = []; |
- |
- if (element.src) |
- urls.push(element.src); |
- |
- if (element.srcset) |
- { |
- var candidates = element.srcset.split(","); |
- for (var i = 0; i < candidates.length; i++) |
- { |
- var url = candidates[i].trim().replace(/\s+\S+$/, ""); |
- if (url) |
- urls.push(url); |
- } |
- } |
- |
- return urls; |
-} |
- |
-function getURLsFromMediaElement(element) |
-{ |
- var urls = getURLsFromAttributes(element); |
- |
- for (var i = 0; i < element.children.length; i++) |
- { |
- var child = element.children[i]; |
- if (child.localName == "source" || child.localName == "track") |
- urls.push.apply(urls, getURLsFromAttributes(child)); |
- } |
- |
- if (element.poster) |
- urls.push(element.poster); |
- |
- return urls; |
-} |
- |
-function getURLsFromElement(element) { |
- switch (element.localName) |
- { |
- case "object": |
- return getURLsFromObjectElement(element); |
- |
- case "video": |
- case "audio": |
- case "picture": |
- return getURLsFromMediaElement(element); |
- } |
- |
- return getURLsFromAttributes(element); |
-} |
- |
// Adds an overlay to an element, which is probably a Flash object |
function addElementOverlay(elt) { |
var position = "absolute"; |