12
12
ply.parentNode.removeChild(ply);
15
// look to see if this is WMA or AAC only and if so inject a warning
16
var hasNonMP3 = false;
18
var medias = document.querySelectorAll("img.mediaIcon");
19
for (var i=0; i<medias.length; i++) {
20
if (medias[i].src.indexOf("fmt_mp3") != -1) {
22
} else if (medias[i].src.indexOf("fmt_320") != -1) { // sigh
24
} else if (medias[i].src.indexOf("fmt_") != -1) {
28
if (hasMP3 && hasNonMP3) {
29
// has both; do nothing; mp3 will be downloaded automatically
30
} else if (hasMP3 && !hasNonMP3) {
31
// only has MP3, no problem
32
} else if (!hasMP3 && !hasNonMP3) {
33
// doesn't have a format at all. Probably means that the HTML
34
// has changed. Do nothing.
35
} else if (!hasMP3 && hasNonMP3) {
36
// does not have MP3, does have others. Problem. Add a warning.
37
var warn = document.createElement("div");
38
warn.appendChild(document.createTextNode(
39
"Warning: this album does not appear to be in MP3 format."));
40
warn.style.borderWidth = "3px";
41
warn.style.borderColor = "red";
42
warn.style.borderStyle = "solid";
43
warn.style.padding = "25px";
44
warn.style.textAlign = "center";
45
warn.style.backgroundColor = "#ff9b9b";
47
var mainContent = document.querySelector("td.mainContent");
48
if (mainContent && mainContent.firstChild) {
49
mainContent.insertBefore(warn, mainContent.firstChild);