From 319362738b316844bc72ce8f8251b7668c489fb7 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 Mar 2013 22:05:23 +0100 Subject: [PATCH] Link diretti per download su RaiTV --- raitv.user.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/raitv.user.js b/raitv.user.js index 99912a8..c2940eb 100644 --- a/raitv.user.js +++ b/raitv.user.js @@ -39,6 +39,17 @@ return srctag(urls[fmt], 'video', (fmt == 'std' ? null : fmt)); } + function H5a(fmt) { + if (urls[fmt]) { + var a = document.createElement('a'); + a.href = urls[fmt]; + a.innerHTML = fmt.toUpperCase(); + a.style='font-weight:bold;margin-left:1em;color:white'; + return a; + } + return null + } + var sch = document.getElementById("silverlightControlHost"); if (sch) { // if we are on a page that defines the videourl* metas, go straight to creating @@ -52,6 +63,27 @@ H5video('std') + "

Sorry, no supported video format found :-(

"; console.log(sch, 'hacked'); + + var list = document.createElement("li"); + list.id = 'mediaurl'; + list.innerHTML = 'Download:'; + var a = H5a('mp4'); + if (a) + list.appendChild(a); + a = H5a('h264'); + if (a) + list.appendChild(a); + a = H5a('wmv'); + if (a) + list.appendChild(a); + // find place to append the list to: + var specs = sch.parentNode.parentNode.previousElementSibling.getElementsByTagName('ul'); + if (specs && specs[0]) { + specs[0].appendChild(list); + console.log(list, 'enumerated and appended'); + } else { + console.log(list, 'enumerated, but not appended'); + } return; // done } -- 2.32.0.93.g670b81a890