Changeset - 6b535f723a45
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 8 years ago 2017-06-11 00:23:00
drewp@bigasterisk.com
fix effect resources in notes
Ignore-this: 9ad7cbd26bdbaa558206b84b405f2fb3
3 files changed with 4 insertions and 22 deletions:
0 comments (0 inline, 0 general)
light9/web/edit-choice.coffee
Show inline comments
 
@@ -41,30 +41,16 @@ window.setupDrop = (senseElem, highlight
 

	
 
Polymer
 
    is: "edit-choice",
 
    properties:
 
        graph: {type: Object, notify: true},
 
        uri: {type: String, notify: true},
 
        label: {type: String, notify: true}
 

	
 
    observers: [
 
      'gotGraph(graph, uri)'
 
      ]
 

	
 
    ready: ->
 
      @uri = null
 
      setupDrop @$.box, @$.box, null, (uri) =>
 
        @uri=uri
 
        @updateLabel()
 

	
 
    gotGraph: ->
 
      @graph.runHandler(@updateLabel.bind(@), "edit-choice #{@uri}")
 
        
 
    updateLabel: ->
 
      @label = try
 
          @graph.stringValue(@uri, RDFS + 'label')
 
        catch
 
          @uri
 

	
 
    unlink: ->
 
      @uri = null
 

	
light9/web/timeline/timeline-elements.html
Show inline comments
 
@@ -240,12 +240,13 @@
 
    </style>
 
    <light9-timeline-note-inline-attrs rect="{{inlineRect}}"
 
                                       graph="{{graph}}"
 
                                       selection="{{selection}}"
 
                                       song="{{song}}"
 
                                       uri="{{uri}}"
 
                                       effect="{{effect}}"
 
    >
 
    </light9-timeline-note-inline-attrs>
 
  </template>
 
</dom-module>
 

	
 
<!-- All the adjusters you can edit or select. Tells a light9-adjusters-canvas how to draw them. Probabaly doesn't need to be an element.
 
@@ -279,13 +280,13 @@
 
         z-index: 2;
 
     }
 
    </style>
 
    <div id="top" style$="left: [[rect.left]]px; top: [[rect.top]]px; width: [[rect.width]]px; height: [[rect.height]]px; display: [[rect.display]]">
 
      <div>note [[noteLabel]] <button on-click="onDel">del</button></div>
 
      <table>
 
        <tr><th>effect:</th><td><edit-choice uri="{{effect}}" label="{{effectLabel}}"></edit-choice></td></tr>
 
        <tr><th>effect:</th><td><edit-choice graph="{{graph}}" uri="{{effect}}"></edit-choice></td></tr>
 
        <tr><th>colorScale:</th><td>
 
          <light9-color-picker color="{{colorScale}}"></light9-color-picker>
 
        </td></tr>
 
      </table>
 
    </div>
 
  </template>
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -397,19 +397,19 @@ Polymer
 
    zoomInX: { type: Object, notify: true }
 
    noteUris: { type: Array, notify: true }
 
    rowIndex: { type: Object, notify: true }
 
    selection: { type: Object, notify: true }
 
  observers: [
 
    'onGraph(graph, dia, setAdjuster, song, zoomInX)'
 
    'observedUpdate(song, rowIndex)'
 
    'observedUpdate(graph, song, rowIndex)'
 
    'onZoom(zoomInX)'
 
    ]
 
  onGraph: ->
 
    @graph.runHandler(@update.bind(@), "row notes #{@rowIndex}")
 

	
 
  observedUpdate: (song, rowIndex) ->
 
  observedUpdate: (graph, song, rowIndex) ->
 
    @update() # old behavior
 
    #@graph.runHandler(@update.bind(@), "row notes #{@rowIndex}")
 

	
 
  update: (patch) ->
 
    U = (x) => @graph.Uri(x)
 

	
 
@@ -629,13 +629,12 @@ Polymer
 
  properties:
 
    graph: { type: Object, notify: true }
 
    song: { type: String, notify: true }
 
    uri: { type: String, notify: true }  # the Note
 
    rect: { type: Object, notify: true }
 
    effect: { type: String, notify: true }
 
    effectLabel: { type: String, notify: true }
 
    colorScale: { type: String, notify: true }
 
    noteLabel: { type: String, notify: true }
 
    selection: { type: Object, notify: true }
 
  observers: [
 
    'addHandler(graph, uri)'
 
    'onColorScale(graph, uri, colorScale)'
 
@@ -676,16 +675,12 @@ Polymer
 
    @graph.runHandler(@update.bind(@), "update inline attrs #{@uri}")
 
    
 
  update: ->
 
    #console.time('attrs update')
 
    U = (x) => @graph.Uri(x)
 
    @effect = @graph.uriValue(@uri, U(':effectClass'))
 
    try
 
      @effectLabel = @graph.stringValue(@effect, U('rdfs:label'))
 
    catch
 
      @effectLabel = @effect.replace(/.*\//, '')
 
    @noteLabel = @uri.replace(/.*\//, '')
 

	
 
    existingColorScaleSetting = null
 
    for setting in @graph.objects(@uri, U(':setting'))
 
      ea = @graph.uriValue(setting, U(':effectAttr'))
 
      value = @graph.stringValue(setting, U(':value'))
0 comments (0 inline, 0 general)