summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-08-13 16:23:34 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-08-13 16:23:34 +0200
commit4722c4cfceb2a2dbf9c1b7bcd1aa38925c6a1a60 (patch)
tree164cdab141be8a9f56c74f3e98d4eb2c1d8d557d /static
parent3f28503102c9c1912885b565a7d90de358f43d83 (diff)
Add all files to queue.
Diffstat (limited to 'static')
-rw-r--r--static/index.html1
-rw-r--r--static/player.js13
-rw-r--r--static/style.css1
3 files changed, 15 insertions, 0 deletions
diff --git a/static/index.html b/static/index.html
index 23e2db6..6f24aba 100644
--- a/static/index.html
+++ b/static/index.html
@@ -18,6 +18,7 @@
<div id="hpanel">
<span>
<span class="list-header">Browse directory</span>
+ <a href="#" onclick="add_directory(); return false" id="add-dir">Add all</a>
<ul id="song-links"></ul>
</span>
<span>
diff --git a/static/player.js b/static/player.js
index d10080b..ab583ee 100644
--- a/static/player.js
+++ b/static/player.js
@@ -18,6 +18,7 @@ function MusicListing(type, path, name, cached) {
this.name = name ? name : path.split('/').pop();
this.a = document.createElement('a');
this.a.tag = path;
+ this.a.ml = this;
this.play = function() {
log('playing ' + path);
@@ -117,6 +118,18 @@ function list(root) {
xmlhttp.send();
}
+function add_directory() {
+ var songs = document.getElementById('song-links').getElementsByTagName('a');
+ for(var i = 0; i < songs.length; i++) {
+ var a = songs[i];
+ log(a);
+ var ml = a.ml;
+ log(ml);
+ if(ml.type && ml.type == 'file')
+ playlist.add(ml);
+ }
+}
+
var source = null;
function get_a(path) {
diff --git a/static/style.css b/static/style.css
index 25bcc4b..35319c0 100644
--- a/static/style.css
+++ b/static/style.css
@@ -13,3 +13,4 @@ div#hpanel span ul { list-style-type: none; padding-left: 0; margin-top: .5em; v
ul#playlist li a.playing { background-image: url('/static/icons/sound.png'); }
span.list-header { font-size: large; }
ul#song-links { width: 30em; overflow: auto; white-space: nowrap; resize: both; }
+a#add-dir { font-size: small; }