# HG changeset patch # User Drew Perttula # Date 2015-06-10 06:36:08 # Node ID ad90eb1f54931625004b625aa2f303e2375ba174 # Parent e644d8f10c040972cbeae669e8040cd423e214d3 port effecteval root page from knockout to polymer Ignore-this: eba2dfccbe9a81418b4abfe521b81d01 diff --git a/bin/effecteval b/bin/effecteval --- a/bin/effecteval +++ b/bin/effecteval @@ -308,9 +308,8 @@ class App(object): (r'/()', SFH, {'path': 'light9/effecteval', 'default_filename': 'index.html'}), (r'/effect', EffectEdit), - (r'/(websocket\.js)', SFH, {'path': 'light9/rdfdb/web/'}), (r'/effect\.js', StaticCoffee, {'src': 'light9/effecteval/effect.coffee'}), - (r'/index\.js', StaticCoffee, {'src': 'light9/effecteval/index.coffee'}), + (r'/(effect-components\.html)', SFH, {'path': 'light9/effecteval'}), (r'/effectUpdates', EffectUpdates), (r'/code', Code), (r'/songEffectsUpdates', SongEffectsUpdates), diff --git a/light9/effecteval/effect-components.html b/light9/effecteval/effect-components.html new file mode 100644 --- /dev/null +++ b/light9/effecteval/effect-components.html @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + diff --git a/light9/effecteval/index.coffee b/light9/effecteval/index.coffee deleted file mode 100644 --- a/light9/effecteval/index.coffee +++ /dev/null @@ -1,42 +0,0 @@ -model = - songs: ko.observableArray([]) - -model.dragover = (obj, event) -> - event.preventDefault() - event.originalEvent.dataTransfer.dropEffect = 'copy' - -model.drop = (uri, event) -> - event.preventDefault() - dropped(uri, event.originalEvent.dataTransfer.getData('text/uri-list')) - -model.focusSong = (song) -> - window.location.search = '?song=' + song.uri - -dropped = (songTargetUri, dropUri) -> - $.post('songEffects', {uri: songTargetUri, drop: dropUri}) - -deleteEffect = (uri) -> - $.ajax - type: 'DELETE' - url: 'effect?' + $.param({uri: uri}) - console.log("del", uri) - -reconnectingWebSocket "songEffectsUpdates", (msg) -> - for s in msg.songs - for e in s.effects - do (e) -> - e.deleteEffect = -> deleteEffect(e.uri) - - - m = window.location.search.match(/song=(http[^&]+)/) - if m - model.songs((s for s in msg.songs when s.uri == m[1])) - else - model.songs(msg.songs) - -ko.applyBindings(model) - - # there's a shorter unpack thing - #writeBack = ko.computed -> - # console.log('sendback' ,{code: model.code()}) - \ No newline at end of file diff --git a/light9/effecteval/index.html b/light9/effecteval/index.html --- a/light9/effecteval/index.html +++ b/light9/effecteval/index.html @@ -4,6 +4,7 @@ effecteval +
starting...
@@ -11,22 +12,6 @@

Effect instances

View all songs
- - - - - +