summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-08-24 18:21:29 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-08-24 18:21:29 +0200
commit8ebb79ffe8f8d6172c7ff664f086ae96863fb4bf (patch)
treec36a8b8f1f602c02405d9b4ac465ab4cedf86cc7
parent3a89720aac71d32b0be5cc8893779d2b382391a3 (diff)
Removed audio and log from playlist.js.
-rw-r--r--static/playlist.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/static/playlist.js b/static/playlist.js
index 4b818d6..a84e3d5 100644
--- a/static/playlist.js
+++ b/static/playlist.js
@@ -1,6 +1,5 @@
-function Playlist(pl, audio) {
+function Playlist(pl) {
this.pl = pl;
- this.audio = audio;
this.current = null;
this.lastalbum = null;
@@ -42,7 +41,6 @@ function Playlist(pl, audio) {
ml.play();
var nextsong = li.nextElementSibling;
- log('nextsong: ' + nextsong);
// avoid breaking when a track has been removed
while(nextsong && nextsong.childElementCount == 0)
nextsong = nextsong.nextElementSibling;
@@ -55,8 +53,8 @@ function Playlist(pl, audio) {
return false;
}
- log(a.click);
+ // album header
if(ml.metadata.album != this.lastalbum) {
var album_li = document.createElement('li');
album_li.appendChild(document.createTextNode(ml.metadata.album));
@@ -109,8 +107,6 @@ function Playlist(pl, audio) {
del_img.src = '/static/icons/delete.png';
a_del.appendChild(del_img);
a_del.onclick = function() {
- log(li.previousElementSibling);
- log(li.nextElementSibling);
// remove previous element if it is an album header and we're at end of queue,
// or next element is an album header
if(li.previousElementSibling && li.previousElementSibling.getAttribute('class') == 'album'
@@ -175,19 +171,13 @@ function Playlist(pl, audio) {
// play the next queued song
this.next = function() {
- log('next');
- log('this: ' + this);
- log('current: ' + this.current);
if(this.current) {
var old = this.current;
- log('old: ' + old);
this.current = this.current.nextElementSibling;
- log('new current: ' + this.current);
old.parentElement.removeChild(old);
}
// avoid breaking when a track has been removed
while(this.current && this.current.getAttribute('class') == 'album') {
- log('next while loop');
this.current = this.current.nextElementSibling;
}
if(this.current) {