diff --git a/.gitignore b/.gitignore index 5d8778ca..60cf8fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ css/transitions.css css/embed-shell.css cornfield/config/runtime.json cornfield/config/versions.json -docs css/embed.css templates/basic/style.css templates/assets/plugins/wikipedia/popcorn.wikipedia.css diff --git a/docs/UML/butter.dashboard.graphml b/docs/UML/butter.dashboard.graphml new file mode 100755 index 00000000..16cd7c55 --- /dev/null +++ b/docs/UML/butter.dashboard.graphml @@ -0,0 +1,358 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + USER + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + get dashboard URL + + + + + + + + + + + + + + + + View dashboard + + + + + + + + + + + + + + + + Dashboard page + + + + + + + + + + + + + + + + + + + + + CORNFIELD + + + + + + + + + + Folder 2 + + + + + + + + + + + + + + + + + + + Dashboard route in app.js + + + + + + + + + + Folder 3 + + + + + + + + + + + + + + + + userProjects.push(sanitized(name)) + + + + + + + + + + + + + + + + User.findAllProjects + + + + + + + + + + + + + + + + [JADE templating] +Performs its own +HTML Entity sanitization. + + + + + + + + + + + + + + + + for each "doc" in "docs" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + res.render(userProjects) + + + + + + + + + + + + + + + + + + app.js // get('/dashboard') + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + docs = all user projects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/UML/butter.remix.graphml b/docs/UML/butter.remix.graphml new file mode 100755 index 00000000..78e834f8 --- /dev/null +++ b/docs/UML/butter.remix.graphml @@ -0,0 +1,910 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + CORNFIELD + + + + + + + + + + Folder 2 + + + + + + + + + + + + + + + + + + + Remix route in index.js + + + + + + + + + + Folder 3 + + + + + + + + + + + + + + + + project = stringified JSON from DB + + + + + + + + + + + + + + + + projectJSON = sanitizedHTMLinJSON(project.data) + + + + + + + + + + + + + + + + User.findById +(finds a project, not a user) + + + + + + + + + + + + + + + + (further administrative value parsing) + + + + + + + + + + + + + + + + + + index.js // app.get('api/remix') + + + + + + + + + + + + + + + + /templates/basic/index.html + + + + + + + + + + + + + + + + + + + + + USER + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + src/embed.js // remixClick() + + + + + + + + + + + + + + + + window.open( [remix URL] ) + + + + + + + + + + + + + + + + page loads butter.js + + + + + + + + + + + + + + + + build page from JSON reply + + + + + + + + + + + + + + + + Press remix + + + + + + + + + + + + + + + + butter loads config.js + + + + + + + + + + + + + + + + config.js loads main.js + + + + + + + + + + + + + + + + main.js // loadForSavedDataURL + + + + + + + + + + + + + + + + main.js // attemptDataLoad + + + + + + + + + + + + + + + + main.js // doImport + + + + + + + + + + + + + + + + project.import() +--> +project.js // _this.import + + + + + + + + + + + + + + + + reconstitute sanitized project name + + + + + + + + + + + + + + + + for each media track + + + + + + + + + + + + + + + + useProject() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _this.dispatch( "ready", _this ); +(_this is a Butter instance) + + + + + + + + + + + + + + + + target injection + + + + + + + + + + + + + + + + media.json = mediaData + + + + + + + + + + + + + + + + project.js // new Media() + + + + + + + + + + + + + + + + this.sanitizeTrackEventData(...) + + + + + + + + + + + + + + + + newTrack.addTrackEvent(...) + + + + + + + + + + + + + + + + newTrack = new Track() + + + + + + + + + + + + + + + + for each track event + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if find succeeded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XHR(remixURL) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JSON object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/UML/butter.save.graphml b/docs/UML/butter.save.graphml new file mode 100755 index 00000000..5467852e --- /dev/null +++ b/docs/UML/butter.save.graphml @@ -0,0 +1,801 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + CORNFIELD + + + + + + + + + + Folder 2 + + + + + + + + + + + + + + + + index.js // +app.post('api/publish/:id?') + + + + + + + + + + + + + + + + + + + + Publication route in app.js + + + + + + + + + + Folder 3 + + + + + + + + + + + + + + + + + project = stringified JSON from DB + + + + + + + + + + + + + + + + + projectData = sanitizedHTMLinJSON(project.data) + + + + + + + + + + + + + + + + + popcornString = flat HTML source code + + + + + + + + + + + + + + + + + writeEmbed( { ... popcornString ...} ) + + + + + + + + + + + + + + + + + writeEmbedShell(...) + + + + + + + + + + + + + + + + + finished() + + + + + + + + + + + + + + + + + User.findProject + + + + + + + + + + + + + + + + + [JADE templating] +Performs its own +HTML Entity sanitization. + + + + + + + + + + + + + + + + + [JADE templating] +Performs its own +HTML Entity sanitization. + + + + + + + + + + + + + + + + + + index.js // +app.post('api/project/:id?') + + + + + + + + + + + + + + + + User.createProject +User.updateProject + + + + + + + + + + + + + + + + user.js +Project object +save project data to DB + + + + + + + + + + + + + + + + This only saves the +timeline data as +stringified JSON + + + + + + + + + + + + + + + + + + + + + + + + + + USER + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + + + + + + + + + Save project + + + + + + + + + + + + + + + + + + + + + + + + butter.cornfield.save(stringified data) + + + + + + + + + + + + + + + + + src/ui/header.js // saveProject() + + + + + + + + + + + + + + + + + src/ui/header.js // prepare() +VIA UserData.authenticationRequired + + + + + + + + + + + + + + + + + src/ui/userdata.js // save() + + + + + + + + + + + + + + + + + butter.project.save() +calling +src/core/project.js // +_this.save(_this.data) + + + + + + + + + + + + + + + + + butter.cornfield.publish(project id) + + + + + + + + + + + + + + + + + + + Amazon S3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if save succeeded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if find succeeded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if write succeeded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + response +formed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/UML/images/butter.dashboard.jpg b/docs/UML/images/butter.dashboard.jpg new file mode 100755 index 00000000..38194d53 Binary files /dev/null and b/docs/UML/images/butter.dashboard.jpg differ diff --git a/docs/UML/images/butter.dashboard.svg b/docs/UML/images/butter.dashboard.svg new file mode 100755 index 00000000..e01f64ab --- /dev/null +++ b/docs/UML/images/butter.dashboard.svg @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CORNFIELD + + + + + + + + Dashboard route in app.js + + + + + + userProjects.push(sanitized(name)) + + + + + User.findAllProjects + + + + + [JADE templating] + Performs its own + HTML Entity sanitization. + + + + + for each "doc" in "docs" + + + + + + + + + res.render(userProjects) + + + + + app.js // get('/dashboard') + + + + + docs = all user projects + + + + + + + + + + + + + USER + + + + + + get dashboard URL + + + + + View dashboard + + + + + Dashboard page + + + + + + + + + + + diff --git a/docs/UML/images/butter.remix.jpg b/docs/UML/images/butter.remix.jpg new file mode 100755 index 00000000..a9cb94d5 Binary files /dev/null and b/docs/UML/images/butter.remix.jpg differ diff --git a/docs/UML/images/butter.remix.svg b/docs/UML/images/butter.remix.svg new file mode 100755 index 00000000..baddd07d --- /dev/null +++ b/docs/UML/images/butter.remix.svg @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CORNFIELD + + + + + + + + Remix route in index.js + + + + + + project = stringified JSON from DB + + + + + projectJSON = sanitizedHTMLinJSON(project.data) + + + + + User.findById + (finds a project, not a user) + + + + + (further administrative value parsing) + + + + + index.js // app.get('api/remix') + + + + + /templates/basic/index.html + + + + + + + if find succeeded + + + + + + + + + + + USER + + + + + + src/embed.js // remixClick() + + + + + window.open( [remix URL] ) + + + + + page loads butter.js + + + + + build page from JSON reply + + + + + Press remix + + + + + butter loads config.js + + + + + config.js loads main.js + + + + + main.js // loadForSavedDataURL + + + + + main.js // attemptDataLoad + + + + + main.js // doImport + + + + + project.import() + --> + project.js // _this.import + + + + + reconstitute sanitized project name + + + + + for each media track + + + + + useProject() + + + + + + + + + _this.dispatch( "ready", _this ); + (_this is a Butter instance) + + + + + target injection + + + + + media.json = mediaData + + + + + project.js // new Media() + + + + + this.sanitizeTrackEventData(...) + + + + + newTrack.addTrackEvent(...) + + + + + newTrack = new Track() + + + + + for each track event + + + + + + + + + + + + + + + JSON object + + + + + + + + + XHR(remixURL) + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/UML/images/butter.save.jpg b/docs/UML/images/butter.save.jpg new file mode 100755 index 00000000..5fd9bac1 Binary files /dev/null and b/docs/UML/images/butter.save.jpg differ diff --git a/docs/UML/images/butter.save.svg b/docs/UML/images/butter.save.svg new file mode 100755 index 00000000..e83563b4 --- /dev/null +++ b/docs/UML/images/butter.save.svg @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + USER + + + + + + Save project + + + + + butter.cornfield.save(stringified data) + + + + + src/ui/header.js // saveProject() + + + + + src/ui/header.js // prepare() + VIA UserData.authenticationRequired + + + + + src/ui/userdata.js // save() + + + + + butter.project.save() + calling + src/core/project.js // + _this.save(_this.data) + + + + + butter.cornfield.publish(project id) + + + + + + + + + + + + + + + if save succeeded + + + + + + + CORNFIELD + + + + + + + + Publication route in app.js + + + + + + project = stringified JSON from DB + + + + + projectData = sanitizedHTMLinJSON(project.data) + + + + + popcornString = flat HTML source code + + + + + writeEmbed( { ... popcornString ...} ) + + + + + writeEmbedShell(...) + + + + + finished() + + + + + User.findProject + + + + + [JADE templating] + Performs its own + HTML Entity sanitization. + + + + + [JADE templating] + Performs its own + HTML Entity sanitization. + + + + + index.js // + app.post('api/publish/:id?') + + + + + index.js // + app.post('api/project/:id?') + + + + + User.createProject + User.updateProject + + + + + user.js + Project object + save project data to DB + + + + + + + + + This only saves the + timeline data as + stringified JSON + + + + + Amazon S3 + + + + + + + + + + + if write succeeded + + + + + if find succeeded + + + + + + + response + formed + + + + + + + + + + + + + + + + +