net.loadAnimations(x, init) net.loadAssemblage(x, assName, init)
exquis.init is called with all the loaded animations as argument exquis.init creates an exquis object and calls makeEditor(exquis)
loads animationCode from uri with requirejs sets canvasAnim.animationName TODO compute the animation name from the url instead of taking an argument
converts codeString to data uri TODO converting the codeString to data uri is now the job of canvasAnim.setCodeString delete this method
creates an evaluateCode method to be called at the next iteration
you have typed something TODO the editor should know CanvasAnim, but should not access exquis. canvasAnim is given to the editor by editorController.loadCodeString(canvasAnim)
returns the code as a string in whatever original language it was written in reads it from its own cache if present (use a data uri) or else loads it from the store with originalUrl and calls setCodeString
- loads the code as text (codeString) from the url TODO put this in canvasAnim.getSourceCodeString
- puts the codeString in the editor
you click the button to load a new animation DONE pickanimation is no longer on the editor, we’re moving that button
Blockly code is something else than javascript, xml I think. We want a blockly animation editor that generates javascript and gives it to the canvas anim The xml of the currently edited animation should be stored somewhere when we edit another animation When we want to save the xml it should be persisted by the store. When exquis loads an xml animation, it asks a blockly object to translate it. The type of code could be specified in a comment at the beginning of the file, or in any other way <!–blockly–> ;clojure
exquis.init creates cells from uris defined in assemblage, calls makeCanvasAnimation which creates a canvasAnim object with methods
getSourceCode which either gets the code from
- the animation’s source attribute (for blockly)
- the cache if it is there
- the originalUrl (as text)
addCodeStringToEvaluate(codeString)
which creates an evaluateCode method that replaces the current animation by what the codeString returns when executed, and store the code in the attribute codeCacheUri. The evaluateCode function will be called in the next execution of the main draw function. Afterwards it is deleted.
To see the code, you need to open the control panel and click on the editor tab. This calls editorController.updateWithCanvasAnim which calls canvasAnim.getSourceCode and puts the code in the editor with setEditorContent.
When the code is changed in the editor view, it calls editorController.onCodeChange which calls canvasAnim.addCodeStringToEvaluate