* * * MEDIA CONTROLS * * *
(n)
| 1088 | ***********************/ |
| 1089 | |
| 1090 | function change_sound(n) |
| 1091 | { |
| 1092 | g_enable=false; |
| 1093 | var s=""; |
| 1094 | var s_title=""; |
| 1095 | var s_file=""; |
| 1096 | var r=0; |
| 1097 | var b_explicit=false; |
| 1098 | |
| 1099 | r=Math.random()*a_songs.length; |
| 1100 | r=parseInt(r); |
| 1101 | var e=document.getElementById("chgsnd"); |
| 1102 | |
| 1103 | if (n>=0) |
| 1104 | { |
| 1105 | r=n; |
| 1106 | } |
| 1107 | |
| 1108 | if (g_sequential) |
| 1109 | { |
| 1110 | g_current_song++; |
| 1111 | if (g_current_song>=a_songs.length) g_current_song=0; |
| 1112 | r=g_current_song; |
| 1113 | } |
| 1114 | |
| 1115 | s=a_songs[r]; |
| 1116 | s_file=s; |
| 1117 | // Remove the extension. |
| 1118 | s=remove_ext(s); |
| 1119 | s_title=convert_to_song_and_artist(s); |
| 1120 | s=convert_string(s); |
| 1121 | if (string_ends_in(s,"EXPLICIT")) b_explicit=true; |
| 1122 | if (s.indexOf("BITCH")>=0) b_explicit=true; |
| 1123 | if (s.indexOf("RAPE")>=0) b_explicit=true; |
| 1124 | if (s.indexOf("FUCK")>=0) b_explicit=true; |
| 1125 | if (s.indexOf("JESUS")>=0) b_explicit=true; |
| 1126 | if (s.indexOf("DAMN")>=0) b_explicit=true; |
| 1127 | if (s.indexOf("DEVIL")>=0) b_explicit=true; |
| 1128 | if (s.indexOf("DEMON")>=0) b_explicit=true; |
| 1129 | if (s.indexOf("SATAN")>=0) b_explicit=true; |
| 1130 | if (s.indexOf("HELL")>=0) b_explicit=true; |
| 1131 | if (s.indexOf("GOD")>=0) b_explicit=true; |
| 1132 | |
| 1133 | if (b_explicit==true) |
| 1134 | { |
| 1135 | if (g_user_choice==true) |
| 1136 | { |
| 1137 | var n=confirm("This song is explicit.\nPlay it anyway ?","Confirm","Confirm"); |
| 1138 | if (n==false) return; |
| 1139 | } |
| 1140 | else |
| 1141 | { |
| 1142 | return; |
| 1143 | } |
| 1144 | } |
| 1145 | |
| 1146 | g_previous_song=g_current_song; |
| 1147 | g_current_song=r; |
no test coverage detected