Skip to content

Latest commit

 

History

History
executable file
·
74 lines (60 loc) · 3.34 KB

doc.org

File metadata and controls

executable file
·
74 lines (60 loc) · 3.34 KB

bootstrap mechanism

main.js calls net.loadAnimations with exquis.init as argument

net.loadAnimations(x, init) net.loadAssemblage(x, assName, init)

gets assemblage json (2d array of names)

net.loadJsons2d(animNames : creates jsonAnimations

returns 2d array of Animation.json where {animation: { setup: string, draw:string}, name: string}

init(x, assName, jsonAnimations: 2dArray of Animation.json)

init creates attributes of the global exquis (x) object

cells

animate

exquis.init is called with all the loaded animations as argument exquis.init creates an exquis object and calls makeEditor(exquis)

ev.loadJsAnimOnCanvasAnim DELETED

loads animationCode from uri with requirejs sets canvasAnim.animationName TODO compute the animation name from the url instead of taking an argument

evileval.evalAnimation DELETED

converts codeString to data uri TODO converting the codeString to data uri is now the job of canvasAnim.setCodeString delete this method

exquis.canvasAnim.addCodeStringToEvaluate

creates an evaluateCode method to be called at the next iteration

editorController.textAreaController.onCodeChange

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)

exquis.canvasAnim.getSourceCodeString

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

editorController.textAreaController.updateWithCanvasAnim (if ! match data:)
  • loads the code as text (codeString) from the url TODO put this in canvasAnim.getSourceCodeString
  • puts the codeString in the editor
give the canvasAnim object to the editor.the editor calls canvasAnim.getCodeString,a new component: the store different implementations of the store would save the animation in different places. The original url of the animation is independent of the store because we want exquis to be able to just display animations from any url. The store needs to know where to save an animation based on its url. Currently the original url is replaced by a data uri when it is first edited, because it’s only used to load the code. We need to keep it in order to save it.canvasAnim.originalUrl .codeUri originalUrl is the address from where the animation is first loaded codeUri is a data uri that contains the code being edited
editorController…load…pickanimation

you click the button to load a new animation DONE pickanimation is no longer on the editor, we’re moving that button

net.loadAssemblage

net.findAndLoadAssemblage

main

blockly

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