# HG changeset patch # User Drew Perttula # Date 2017-05-31 08:20:19 # Node ID 21a52ce16954e59c86da98f4839a1f8e3fe7bf08 # Parent 9b46e38e2b0fc9227d237bb6e5655d71a78fc9a3 new effects2.html polymer port Ignore-this: 2edbfa5954a7592c1ddc77ec8c22e5d diff --git a/light9/subserver/effects.coffee b/light9/subserver/effects.coffee --- a/light9/subserver/effects.coffee +++ b/light9/subserver/effects.coffee @@ -51,6 +51,8 @@ model.addMomentaryUp = (e) -> url: '/effectEval/songEffects' data: {drop: e.uri, event: 'end', note: lastMomentaryNote} }) + + reconnectingWebSocket "../effectsUpdates", (msg) -> diff --git a/light9/subserver/effects.jade b/light9/subserver/effects.jade --- a/light9/subserver/effects.jade +++ b/light9/subserver/effects.jade @@ -3,6 +3,11 @@ html 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 @@ html 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 --git a/light9/subserver/effects2.coffee b/light9/subserver/effects2.coffee new file mode 100644 --- /dev/null +++ b/light9/subserver/effects2.coffee @@ -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 --git a/light9/subserver/effects2.html b/light9/subserver/effects2.html new file mode 100644 --- /dev/null +++ b/light9/subserver/effects2.html @@ -0,0 +1,61 @@ + + + + subserver effects2 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/light9/web/edit-choice.html b/light9/web/edit-choice.html --- a/light9/web/edit-choice.html +++ b/light9/web/edit-choice.html @@ -16,10 +16,12 @@ padding: 3px; display: inline-block; } +
- {{label}} + + {{label}}
diff --git a/light9/web/paint/paint-report-elements.html b/light9/web/paint/paint-report-elements.html --- a/light9/web/paint/paint-report-elements.html +++ b/light9/web/paint/paint-report-elements.html @@ -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 --git a/light9/web/resource-display.html b/light9/web/resource-display.html new file mode 100644 --- /dev/null +++ b/light9/web/resource-display.html @@ -0,0 +1,32 @@ + + + + + + diff --git a/light9/web/style.css b/light9/web/style.css --- a/light9/web/style.css +++ b/light9/web/style.css @@ -199,4 +199,4 @@ table { table.borders td, table.borders th { border: 1px solid #4a4a4a; padding: 2px 8px; -} \ No newline at end of file +}