changeset 1162:487f0877b7c6

EE can now limit to showing just one song Ignore-this: 3cad996b470fd9fc2e56524eaf13f87d
author drewp@bigasterisk.com
date Sun, 15 Jun 2014 00:33:51 +0000
parents c99096504c79
children 9973d4623928
files light9/effecteval/index.coffee light9/effecteval/index.html static/style.css
diffstat 3 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/light9/effecteval/index.coffee	Sun Jun 15 00:20:48 2014 +0000
+++ b/light9/effecteval/index.coffee	Sun Jun 15 00:33:51 2014 +0000
@@ -9,6 +9,9 @@
   event.preventDefault()
   dropped(uri, event.originalEvent.dataTransfer.getData('text/uri-list'))
 
+model.focusSong = (song) ->
+  window.location.search = '?song=' + song.uri
+
 dropped = (songTargetUri, dropUri) ->
   $.post('songEffects', {uri: songTargetUri, drop: dropUri})
 
@@ -24,7 +27,12 @@
       do (e) ->
         e.deleteEffect = -> deleteEffect(e.uri)
 
-  model.songs(msg.songs)
+
+  m = window.location.search.match(/song=(http[^&]+)/)
+  if m
+    model.songs((s for s in msg.songs when s.uri == m[1]))
+  else
+    model.songs(msg.songs)
   
 ko.applyBindings(model)
 
--- a/light9/effecteval/index.html	Sun Jun 15 00:20:48 2014 +0000
+++ b/light9/effecteval/index.html	Sun Jun 15 00:33:51 2014 +0000
@@ -7,11 +7,12 @@
   </head>
   <body>
     <div><a href="stats">/stats</a></div>
-    <h1>All effect instances</h1>
+    <h1>Effect instances</h1>
+    <div><a href=".">View all songs</a></div>
     <!-- subscribe to a query of all effects and their songs -->
-    <ul data-bind="foreach: songs" class="twoColList">
+    <ul data-bind="foreach: songs">
       <li>
-        <a class="song" data-bind="attr: {href: uri}">Song <span data-bind="text: label"></span></a>
+        <a class="song" data-bind="attr: {href: uri}, click: $root.focusSong">Song <span data-bind="text: label"></span></a>
         <ul>
           <!-- ko foreach: effects -->
           <li>
--- a/static/style.css	Sun Jun 15 00:20:48 2014 +0000
+++ b/static/style.css	Sun Jun 15 00:33:51 2014 +0000
@@ -61,11 +61,14 @@
 }
 
 .dropTarget {
-    padding: 5px;
+    padding: 10px 5px;
     border: 2px dashed gray;
     font-style: italic;
     color: rgb(78, 90, 107);
 }
+.dropTarget:hover {
+    background: #1F1F0D;
+}
 .twoColList {
     -webkit-column-width: 24em;
 }