Changeset - 3ffadb9f00cd
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 7 years ago 2018-06-08 05:52:52
drewp@bigasterisk.com
forgot a 2018
Ignore-this: b1dbaaf9ac317601ec0e9006907204a1
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/web/live/live.coffee
Show inline comments
 
@@ -140,49 +140,49 @@ coffeeElementSetup(class Light9LiveDevic
 
    for lc in @shadowRoot.querySelectorAll("light9-live-control")
 
      lc.clear()
 
    
 
)
 

	
 
class GraphToControls
 
  # More efficient bridge between liveControl widgets and graph edits,
 
  # as opposed to letting each widget scan the graph and push lots of
 
  # tiny patches to it.
 
  constructor: (@graph) ->
 

	
 
    # Registered graphValueChanged funcs, by dev+attr
 
    @onChanged = {}
 

	
 
    # The settings we're showing (or would like to but the widget
 
    # isn't registered yet):
 
    # dev+attr : {setting: Uri, onChangeFunc: f, jsValue: str_or_float}
 
    @settings = new Map()
 

	
 
    @effect = null
 

	
 
  ctxForEffect: (effect) ->
 
    @graph.Uri(effect.value.replace(
 
      "light9.bigasterisk.com/effect",
 
      "light9.bigasterisk.com/show/dance2017/effect"))
 
      "light9.bigasterisk.com/show/dance2018/effect"))
 
      
 
  setEffect: (effect) ->
 
    @clearSettings()
 
    @effect = effect
 
    @ctx = @ctxForEffect(@effect)
 
    # are these going to pile up? consider @graph.triggerHandler('GTC sync')
 
    @graph.runHandler(@syncFromGraph.bind(@), 'GraphToControls sync')
 

	
 
  newEffect: ->
 
    # wrong- this should be our editor's scratch effect, promoted to a
 
    # real one when you name it.
 
    U = (x) => @graph.Uri(x)
 
    effect = @graph.nextNumberedResource(U('http://light9.bigasterisk.com/effect/effect'))
 
    ctx = @ctxForEffect(effect)
 
    quad = (s, p, o) => @graph.Quad(s, p, o, ctx)
 

	
 
    addQuads = [
 
      quad(effect, U('rdf:type'), U(':Effect'))
 
      quad(effect, U('rdfs:label'), @graph.Literal(effect.value.replace(/.*\//, "")))
 
      quad(effect, U(':publishAttr'), U(':strength'))
 
    ]
 
    patch = {addQuads: addQuads, delQuads: []}
 
    log('init new effect', patch)
 
    @graph.applyAndSendPatch(patch)
0 comments (0 inline, 0 general)