# HG changeset patch # User Drew Perttula # Date 1496218819 0 # Node ID 21a52ce16954e59c86da98f4839a1f8e3fe7bf08 # Parent 9b46e38e2b0fc9227d237bb6e5655d71a78fc9a3 new effects2.html polymer port Ignore-this: 2edbfa5954a7592c1ddc77ec8c22e5d diff -r 9b46e38e2b0f -r 21a52ce16954 light9/subserver/effects.coffee --- a/light9/subserver/effects.coffee Wed May 31 05:29:41 2017 +0000 +++ b/light9/subserver/effects.coffee Wed May 31 08:20:19 2017 +0000 @@ -51,6 +51,8 @@ url: '/effectEval/songEffects' data: {drop: e.uri, event: 'end', note: lastMomentaryNote} }) + + reconnectingWebSocket "../effectsUpdates", (msg) -> diff -r 9b46e38e2b0f -r 21a52ce16954 light9/subserver/effects.jade --- a/light9/subserver/effects.jade Wed May 31 05:29:41 2017 +0000 +++ b/light9/subserver/effects.jade Wed May 31 08:20:19 2017 +0000 @@ -3,6 +3,11 @@ head title effects link(rel='stylesheet', href='/style.css') + style. + .headerRow { + display: flex; + justify-content: space-between; + } body #status starting... h1 Effects @@ -25,12 +30,19 @@ div(data-bind="foreach: classes") div.resource.effectClass - h2 - | Effect class - | - a(data-bind="attr: {href: uri}, text: label") - button(data-bind="click: $root.addToCurrentSong") Add to current song - button(data-bind="event: { mousedown: $root.addMomentary, mouseup: $root.addMomentaryUp }") Add momentary + div.headerRow + span + h2 + | Effect class + | + resource-display(data-bind="attr: {uri: uri, graph: graph}") + a(data-bind="attr: {href: uri}, text: label") + button(data-bind="click: $root.onRename") Rename + span.rightTools + button(data-bind="click: $root.addToCurrentSong") Add to current song + button(data-bind="event: { mousedown: $root.addMomentary, mouseup: $root.addMomentaryUp }") Add momentary + div.rename + input div code(data-bind="text: code") diff -r 9b46e38e2b0f -r 21a52ce16954 light9/subserver/effects2.coffee --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/light9/subserver/effects2.coffee Wed May 31 08:20:19 2017 +0000 @@ -0,0 +1,34 @@ +Polymer + is: "light9-effects" + properties: + graph: {type: Object} + effectClasses: { type: Array } + ready: -> + @graph.runHandler(@getClasses.bind(@)) + + getClasses: -> + U = (x) => @graph.Uri(x) + @effectClasses = _.sortBy(@graph.subjects(U('rdf:type'), U(':Effect'))) + +Polymer + is: "light9-effect-class" + properties: + graph: {type: Object} + uri: {type: String} + + onAdd: -> + @$.songEffects.body = {drop: @uri} + @$.songEffects.generateRequest() + + onMomentaryPress: -> + @$.songEffects.body = {drop: @uri, event: 'start'} + @lastPress = @$.songEffects.generateRequest() + @lastPress.completes.then (request) => + @lastMomentaryNote = request.response.note + + onMomentaryRelease: -> + return unless @lastMomentaryNote + @$.songEffects.body = {drop: @uri, note: @lastMomentaryNote} + @lastMomentaryNote = null + @$.songEffects.generateRequest() + \ No newline at end of file diff -r 9b46e38e2b0f -r 21a52ce16954 light9/subserver/effects2.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/light9/subserver/effects2.html Wed May 31 08:20:19 2017 +0000 @@ -0,0 +1,61 @@ + + + + subserver effects2 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9b46e38e2b0f -r 21a52ce16954 light9/web/edit-choice.html --- a/light9/web/edit-choice.html Wed May 31 05:29:41 2017 +0000 +++ b/light9/web/edit-choice.html Wed May 31 08:20:19 2017 +0000 @@ -16,10 +16,12 @@ padding: 3px; display: inline-block; } +
- {{label}} + + {{label}}
diff -r 9b46e38e2b0f -r 21a52ce16954 light9/web/paint/paint-report-elements.html --- a/light9/web/paint/paint-report-elements.html Wed May 31 05:29:41 2017 +0000 +++ b/light9/web/paint/paint-report-elements.html Wed May 31 08:20:19 2017 +0000 @@ -11,9 +11,14 @@ #breakdown { position: relative; } #sources { display: flex; } #solution { display: flex; margin-top: 80px; } - #connectors { position: absolute; width: 100%; height: 100%; } + #connectors { position: absolute; width: 100%; height: 100%; z-index: -1; } #connectors path { stroke: #615c54; stroke-width: 3px; } - + + [draggable=true]:hover { + box-shadow: 0 0 20px yellow; + } + +
diff -r 9b46e38e2b0f -r 21a52ce16954 light9/web/resource-display.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/light9/web/resource-display.html Wed May 31 08:20:19 2017 +0000 @@ -0,0 +1,32 @@ + + + + + + diff -r 9b46e38e2b0f -r 21a52ce16954 light9/web/style.css --- a/light9/web/style.css Wed May 31 05:29:41 2017 +0000 +++ b/light9/web/style.css Wed May 31 08:20:19 2017 +0000 @@ -199,4 +199,4 @@ table.borders td, table.borders th { border: 1px solid #4a4a4a; padding: 2px 8px; -} \ No newline at end of file +}