1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 19:35:55 +00:00

rework appearance of audio/video tags patch

This commit is contained in:
Andrew Dolgov
2009-06-22 16:50:17 +04:00
parent 99ea1043da
commit 9324c2c24f
3 changed files with 29 additions and 24 deletions

View File

@@ -2134,25 +2134,29 @@ function truncate_string(s, length) {
return tmp;
}
function switchToFlash(e) {
var targ = e;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
try {
var targ = e;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
//targ is the link that was clicked
var audioTag=targ;
do {
audioTag=audioTag.previousSibling;
} while(audioTag && audioTag.nodeType != 1)
var flashPlayer = audioTag.getElementsByTagName('span')[0];
targ.parentNode.insertBefore(flashPlayer,targ);
targ.parentNode.removeChild(targ);
audioTag.parentNode.removeChild(audioTag);
//targ is the link that was clicked
var audioTag=targ;
do {
audioTag=audioTag.previousSibling;
} while(audioTag && audioTag.nodeType != 1)
var flashPlayer = audioTag.getElementsByTagName('div')[0];
targ.parentNode.insertBefore(flashPlayer,targ);
targ.parentNode.removeChild(targ);
audioTag.parentNode.removeChild(audioTag);
return false;
return false;
} catch (e) {
exception_error("switchToFlash", e);
}
}
function html5AudioOrFlash(type) {
var audioTag = document.createElement('audio');