Mercurial > code > home > repos > light9
changeset 1586:901767febb47
bind 'this' in U shorthand.
Ignore-this: 9bfa9a1a230bdc5157da07b3434c50c4
worked at runtime, failed during debugging
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Tue, 30 May 2017 08:39:05 +0000 |
parents | 17da56a3c8df |
children | 2c973af2b13e |
files | light9/web/live/live.coffee light9/web/paint/paint-elements.coffee light9/web/timeline/timeline.coffee |
diffstat | 3 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/web/live/live.coffee Tue May 30 08:37:25 2017 +0000 +++ b/light9/web/live/live.coffee Tue May 30 08:39:05 2017 +0000 @@ -71,7 +71,7 @@ uriName = @newEffectName.replace(/[^a-zA-Z0-9_]/g, '') return if not uriName.length - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) effectUri = U(":effect") + "/#{uriName}" ctx = U("http://light9.bigasterisk.com/show/dance2017/effect/#{uriName}") @@ -113,7 +113,7 @@ llc.clear() update: -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) @set('devices', []) for dc in _.sortBy(@graph.subjects(U('rdf:type'), U(':DeviceClass')))
--- a/light9/web/paint/paint-elements.coffee Tue May 30 08:37:25 2017 +0000 +++ b/light9/web/paint/paint-elements.coffee Tue May 30 08:39:05 2017 +0000 @@ -151,7 +151,7 @@ onSubj: (graph, @subj) -> graph.runHandler(@loadAttrs.bind(@), "loadAttrs #{@subj}") loadAttrs: -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) @attrs = [] for s in @graph.objects(U(@subj), U(':setting')) attr = @graph.uriValue(s, U(':deviceAttr'))
--- a/light9/web/timeline/timeline.coffee Tue May 30 08:37:25 2017 +0000 +++ b/light9/web/timeline/timeline.coffee Tue May 30 08:39:05 2017 +0000 @@ -279,7 +279,7 @@ setupDrop(@, @$.rows, root, @onDrop.bind(@)) onDrop: (effect, pos) -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) # we could probably accept some initial overrides right on the # effect uri, maybe as query params @@ -295,7 +295,7 @@ @makeNewNote(effect, dropTime) makeEffect: (uri) -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) effect = U(uri + '/effect') quad = (s, p, o) => {subject: s, predicate: p, object: o, graph: effect} @@ -322,7 +322,7 @@ return effect makeNewNote: (effect, dropTime) -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) quad = (s, p, o) => {subject: s, predicate: p, object: o, graph: @song} newNote = @graph.nextNumberedResource("#{@song}/n") @@ -379,7 +379,7 @@ onGraph: -> @graph.runHandler(@update.bind(@), "row notes #{@rowIndex}") update: (patch) -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) notesForThisRow = [] i = 0 @@ -473,7 +473,7 @@ updateDisplay: -> # update our note DOM and SVG elements based on the graph - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) yForV = (v) => @offsetTop + (1 - v) * @offsetHeight @@ -484,7 +484,7 @@ @updateStrengthCurveEtc(originTime, curve, yForV, effect) updateStrengthCurveEtc: (originTime, curve, yForV, effect) -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) [@pointUris, @worldPts] = getCurvePoints(@graph, curve, originTime) # (song time, value) curveWidth = => @@ -517,7 +517,7 @@ @makeCurveAdjusters(curveWidth, yForV, @worldPts) makeCurveAdjusters: (curveWidth, yForV, worldPts) -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) if true @adjusterIds[@uri+'/offset'] = true @@ -579,7 +579,7 @@ 'onColorScale(graph, uri, colorScale)' ] onColorScale: -> - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) if @colorScale == @colorScaleFromGraph return @@ -602,7 +602,7 @@ update: -> console.time('attrs update') - U = (x) -> @graph.Uri(x) + U = (x) => @graph.Uri(x) @effect = @graph.uriValue(@uri, U(':effectClass')) @effectLabel = @graph.stringValue(@effect, U('rdfs:label')) or (@effect.replace(/.*\//, '')) @noteLabel = @uri.replace(/.*\//, '')