From 61afce46ed888ef4411d759f9d49315925f3ca9a Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Thu, 1 Jun 2017 00:08:11 -0400 Subject: [PATCH 01/35] Server can serve individual assets from projects (fixes #212, fixes #219) --- server/controllers/project.controller.js | 26 ++++++++++++++++++++++++ server/routes/server.routes.js | 5 +++++ 2 files changed, 31 insertions(+) diff --git a/server/controllers/project.controller.js b/server/controllers/project.controller.js index 84b2afa1..9dae16b5 100644 --- a/server/controllers/project.controller.js +++ b/server/controllers/project.controller.js @@ -123,6 +123,32 @@ export function deleteProject(req, res) { }); } +export function getProjectAsset(req, res) { + Project.findById(req.params.project_id) + .populate('user', 'username') + .exec((err, project) => { + if (err) { + return res.status(404).send({ message: 'Project with that id does not exist' }); + } + + var assetURL = null; + var seekFilename = req.params.asset_path; + project.files.forEach((file) => { + if(file.name === seekFilename) { + assetURL = file.url; + } + }); + + if(!assetURL) { + return res.status(404).send({ message: 'Asset does not exist' }); + } else { + request({ method: 'GET', url: assetURL, encoding: null }, (err, response, body) => { + res.send(body); + }); + } + }); +} + export function getProjects(req, res) { if (req.user) { Project.find({ user: req.user._id }) // eslint-disable-line no-underscore-dangle diff --git a/server/routes/server.routes.js b/server/routes/server.routes.js index 1b69dbda..d4f9f6cb 100644 --- a/server/routes/server.routes.js +++ b/server/routes/server.routes.js @@ -2,6 +2,7 @@ import { Router } from 'express'; import { renderIndex } from '../views/index'; import { get404Sketch } from '../views/404Page'; import { userExists } from '../controllers/user.controller'; +import { getProjectAsset } from '../controllers/project.controller'; const router = new Router(); @@ -24,6 +25,10 @@ router.route('/:username/sketches/:project_id').get((req, res) => { res.send(renderIndex()); }); +router.route('/:username/sketches/:project_id/:asset_path').get((req, res) => { + getProjectAsset(req,res); +}); + // router.route('/full/:project_id').get((req, res) => { // res.send(renderIndex()); // }); From 396fc701c7e18bc28900ecc53e6f0d9dd7e73e02 Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Mon, 12 Jun 2017 13:49:45 -0400 Subject: [PATCH 02/35] Fix issue with serving assets inside folders --- client/modules/IDE/components/PreviewFrame.jsx | 5 +++-- server/controllers/project.controller.js | 4 +++- server/routes/server.routes.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index 33af7507..55c79e7b 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -249,7 +249,8 @@ class PreviewFrame extends React.Component { let jsFileStrings = content.match(STRING_REGEX); jsFileStrings = jsFileStrings || []; jsFileStrings.forEach((jsFileString) => { - if (jsFileString.match(MEDIA_FILE_REGEX)) { + console.log(this.props.setBlobUrl); + /* if (jsFileString.match(MEDIA_FILE_REGEX)) { const filePath = jsFileString.substr(1, jsFileString.length - 2); const resolvedFile = resolvePathToFile(filePath, files); if (resolvedFile) { @@ -262,7 +263,7 @@ class PreviewFrame extends React.Component { newContent = newContent.replace(filePath, blobURL); } } - } + }*/ }); newContent = loopProtect(newContent); return newContent; diff --git a/server/controllers/project.controller.js b/server/controllers/project.controller.js index 9dae16b5..baa20df9 100644 --- a/server/controllers/project.controller.js +++ b/server/controllers/project.controller.js @@ -132,7 +132,9 @@ export function getProjectAsset(req, res) { } var assetURL = null; - var seekFilename = req.params.asset_path; + var seekPath = req.params[0]; // req.params.asset_path; + var seekPathSplit = seekPath.split('/'); + var seekFilename = seekPathSplit[seekPathSplit.length-1]; project.files.forEach((file) => { if(file.name === seekFilename) { assetURL = file.url; diff --git a/server/routes/server.routes.js b/server/routes/server.routes.js index d4f9f6cb..d5c6064e 100644 --- a/server/routes/server.routes.js +++ b/server/routes/server.routes.js @@ -25,7 +25,7 @@ router.route('/:username/sketches/:project_id').get((req, res) => { res.send(renderIndex()); }); -router.route('/:username/sketches/:project_id/:asset_path').get((req, res) => { +router.route('/:username/sketches/:project_id/*').get((req, res) => { getProjectAsset(req,res); }); From 87de91016bc1d9066bbfa18ac4671e6257cb0241 Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Mon, 17 Jul 2017 16:07:59 -0400 Subject: [PATCH 03/35] Code folding (#382) --- client/modules/IDE/components/Editor.jsx | 10 +++++++++- client/styles/components/_editor.scss | 22 ++++++++++++++++++++++ webpack.config.dev.js | 4 ++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index 585f3772..f7940d4b 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -7,9 +7,15 @@ import 'codemirror/addon/lint/lint'; import 'codemirror/addon/lint/javascript-lint'; import 'codemirror/addon/lint/css-lint'; import 'codemirror/addon/lint/html-lint'; +import 'codemirror/addon/fold/brace-fold'; +import 'codemirror/addon/fold/comment-fold'; +import 'codemirror/addon/fold/foldcode'; +import 'codemirror/addon/fold/foldgutter'; +import 'codemirror/addon/fold/indent-fold'; import 'codemirror/addon/comment/comment'; import 'codemirror/keymap/sublime'; import 'codemirror/addon/search/jump-to-line'; +import 'codemirror/addon/fold/foldgutter.css'; import { JSHINT } from 'jshint'; import { CSSLint } from 'csslint'; import { HTMLHint } from 'htmlhint'; @@ -49,7 +55,8 @@ class Editor extends React.Component { inputStyle: 'contenteditable', lineWrapping: false, fixedGutter: false, - gutters: ['CodeMirror-lint-markers'], + foldGutter: true, + gutters: [/* 'CodeMirror-lint-markers', 'CodeMirror-linenumbers', */'CodeMirror-foldgutter'], keyMap: 'sublime', lint: { onUpdateLinting: debounce((annotations) => { @@ -71,6 +78,7 @@ class Editor extends React.Component { } }); + this._cm.setOption('extraKeys', { 'Cmd-Enter': () => null, 'Shift-Cmd-Enter': () => null, diff --git a/client/styles/components/_editor.scss b/client/styles/components/_editor.scss index ad455a00..cf2a744b 100644 --- a/client/styles/components/_editor.scss +++ b/client/styles/components/_editor.scss @@ -27,6 +27,18 @@ padding-left: #{5 / $base-font-size}rem; } +.CodeMirror-activeline-background { + background-color: rgba(0,0,0,0.025) !important; +} +.CodeMirror-linebackground { + +} + +.line-runtime-error { + background-color: #ffaaaa !important; + border-radius: 5px; +} + .CodeMirror-gutter-wrapper { right: 100%; top: 0; @@ -80,6 +92,16 @@ width: #{48 / $base-font-size}rem; } +.CodeMirror-guttermarker-subtle { + +} +.CodeMirror-foldgutter-folded { + +} +.CodeMirror-foldgutter-open { + +} + .editor-holder { height: calc(100% - #{29 / $base-font-size}rem); width: 100%; diff --git a/webpack.config.dev.js b/webpack.config.dev.js index acb9f5e0..5f5e2626 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -56,6 +56,10 @@ module.exports = { test: /\.scss$/, loaders: ['style', 'css', 'sass'] }, + { + test: /\.css$/, + loader: "style-loader!css-loader" + }, { test: /\.(svg|mp3)$/, loader: 'file' From 9647372c9ea9846033ff867202192fc8b700ca4a Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Mon, 17 Jul 2017 16:15:33 -0400 Subject: [PATCH 04/35] Remove unnecessary CSS --- client/styles/components/_editor.scss | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/client/styles/components/_editor.scss b/client/styles/components/_editor.scss index cf2a744b..ad455a00 100644 --- a/client/styles/components/_editor.scss +++ b/client/styles/components/_editor.scss @@ -27,18 +27,6 @@ padding-left: #{5 / $base-font-size}rem; } -.CodeMirror-activeline-background { - background-color: rgba(0,0,0,0.025) !important; -} -.CodeMirror-linebackground { - -} - -.line-runtime-error { - background-color: #ffaaaa !important; - border-radius: 5px; -} - .CodeMirror-gutter-wrapper { right: 100%; top: 0; @@ -92,16 +80,6 @@ width: #{48 / $base-font-size}rem; } -.CodeMirror-guttermarker-subtle { - -} -.CodeMirror-foldgutter-folded { - -} -.CodeMirror-foldgutter-open { - -} - .editor-holder { height: calc(100% - #{29 / $base-font-size}rem); width: 100%; From 683b71830396dd76bc505a3542234970bf511a63 Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Tue, 18 Jul 2017 15:57:40 -0400 Subject: [PATCH 05/35] Fix CSS loader + Improve visual for code folding --- client/modules/IDE/components/Editor.jsx | 4 ++-- client/styles/vendors/_codemirror.scss | 28 ++++++++++++++++++++++++ static/p5-interceptor | 2 +- webpack.config.dev.js | 4 ---- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index f7940d4b..e9d21d65 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -15,7 +15,6 @@ import 'codemirror/addon/fold/indent-fold'; import 'codemirror/addon/comment/comment'; import 'codemirror/keymap/sublime'; import 'codemirror/addon/search/jump-to-line'; -import 'codemirror/addon/fold/foldgutter.css'; import { JSHINT } from 'jshint'; import { CSSLint } from 'csslint'; import { HTMLHint } from 'htmlhint'; @@ -56,7 +55,8 @@ class Editor extends React.Component { lineWrapping: false, fixedGutter: false, foldGutter: true, - gutters: [/* 'CodeMirror-lint-markers', 'CodeMirror-linenumbers', */'CodeMirror-foldgutter'], + foldOptions: { widget: '\u2026' }, + gutters: ['CodeMirror-foldgutter'], keyMap: 'sublime', lint: { onUpdateLinting: debounce((annotations) => { diff --git a/client/styles/vendors/_codemirror.scss b/client/styles/vendors/_codemirror.scss index 1cf66a9f..593db885 100644 --- a/client/styles/vendors/_codemirror.scss +++ b/client/styles/vendors/_codemirror.scss @@ -336,3 +336,31 @@ div.CodeMirror-dragcursors { /* Help users use markselection to safely style text background */ span.CodeMirror-selectedtext { background: none; } + +/* CODE FOLDING (FOLDGUTTER.JS) */ + +.CodeMirror-foldmarker { + color: #FFF; + background-color: rgba(237, 34, 93, 0.42); + border-radius: 3px; + font-weight: bold; + font-family: arial; + line-height: .3; + cursor: pointer; +} +.CodeMirror-foldgutter { + width: 2.7em; +} +.CodeMirror-foldgutter-open, +.CodeMirror-foldgutter-folded { + cursor: pointer; + padding-bottom: 0.4em; + text-align: right; + line-height: 1.0; +} +.CodeMirror-foldgutter-open:after { + content: "\25BE"; +} +.CodeMirror-foldgutter-folded:after { + content: "\25B8"; +} diff --git a/static/p5-interceptor b/static/p5-interceptor index 344fedf8..0958be54 160000 --- a/static/p5-interceptor +++ b/static/p5-interceptor @@ -1 +1 @@ -Subproject commit 344fedf8d868c62adc571bf4212c6bea3cd20247 +Subproject commit 0958be54482722821159cd3e07777988ee349f37 diff --git a/webpack.config.dev.js b/webpack.config.dev.js index 5f5e2626..acb9f5e0 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -56,10 +56,6 @@ module.exports = { test: /\.scss$/, loaders: ['style', 'css', 'sass'] }, - { - test: /\.css$/, - loader: "style-loader!css-loader" - }, { test: /\.(svg|mp3)$/, loader: 'file' From b194a2456460f8bb79c4c165e497a7ddc6559df4 Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Wed, 26 Jul 2017 14:04:24 -0400 Subject: [PATCH 06/35] Re-enable serving text files as blobs + Remove comments --- client/modules/IDE/components/PreviewFrame.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index 55c79e7b..33af7507 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -249,8 +249,7 @@ class PreviewFrame extends React.Component { let jsFileStrings = content.match(STRING_REGEX); jsFileStrings = jsFileStrings || []; jsFileStrings.forEach((jsFileString) => { - console.log(this.props.setBlobUrl); - /* if (jsFileString.match(MEDIA_FILE_REGEX)) { + if (jsFileString.match(MEDIA_FILE_REGEX)) { const filePath = jsFileString.substr(1, jsFileString.length - 2); const resolvedFile = resolvePathToFile(filePath, files); if (resolvedFile) { @@ -263,7 +262,7 @@ class PreviewFrame extends React.Component { newContent = newContent.replace(filePath, blobURL); } } - }*/ + } }); newContent = loopProtect(newContent); return newContent; From 14d77cac0b5c77558752361b6ecdd0f5e8cc0b3c Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Wed, 26 Jul 2017 14:16:50 -0400 Subject: [PATCH 07/35] Style for folded region looking better --- client/styles/vendors/_codemirror.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/styles/vendors/_codemirror.scss b/client/styles/vendors/_codemirror.scss index 593db885..8938568c 100644 --- a/client/styles/vendors/_codemirror.scss +++ b/client/styles/vendors/_codemirror.scss @@ -340,13 +340,15 @@ span.CodeMirror-selectedtext { background: none; } /* CODE FOLDING (FOLDGUTTER.JS) */ .CodeMirror-foldmarker { + text-shadow: -1px 0 #ed225d, 0 1px #ed225d, 1px 0 #ed225d, 0 -1px #ed225d; color: #FFF; - background-color: rgba(237, 34, 93, 0.42); - border-radius: 3px; + /* background-color: rgba(237, 34, 93, 0.42); */ + /* border-radius: 3px; */ font-weight: bold; font-family: arial; line-height: .3; cursor: pointer; + opacity: 0.75; } .CodeMirror-foldgutter { width: 2.7em; From fcb89e2c2b092efcb2e693c3bf796e27c4f7c928 Mon Sep 17 00:00:00 2001 From: Saumya Balodi Date: Fri, 4 Aug 2017 02:39:25 +0530 Subject: [PATCH 08/35] Issue211 (#409) * Update Repository * Syntaxt Highlighting for dark and light themes --- .../components/_p5-dark-codemirror-theme.scss | 8 +++++--- .../components/_p5-light-codemirror-theme.scss | 15 ++++++++------- static/p5-interceptor | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/client/styles/components/_p5-dark-codemirror-theme.scss b/client/styles/components/_p5-dark-codemirror-theme.scss index 863855e3..e727b03f 100644 --- a/client/styles/components/_p5-dark-codemirror-theme.scss +++ b/client/styles/components/_p5-dark-codemirror-theme.scss @@ -21,6 +21,8 @@ $p5-dark-white: #FDFDFD; $p5-dark-orange: #EE9900; $p5-dark-lightgray: #E0D7D1; $p5-dark-darkgray: #666666; +$p5-dark-green: #58a10b; +$p5-dark-goldbrown: #b58317; $p5-dark-gutter: #f4f4f4; $p5-dark-number: #b5b5b5; @@ -41,7 +43,7 @@ $p5-dark-activeline: rgb(207, 207, 207); } .cm-s-p5-dark .cm-string { - color: $p5-dark-lightblue; + color: $p5-dark-green; } .cm-s-p5-dark .cm-string-2 { @@ -49,11 +51,11 @@ $p5-dark-activeline: rgb(207, 207, 207); } .cm-s-p5-dark .cm-number { - color: $p5-dark-pink; + color: $p5-dark-white; } .cm-s-p5-dark .cm-keyword { - color: $p5-light-green; + color: $p5-dark-goldbrown; } .cm-s-p5-dark .cm-variable { diff --git a/client/styles/components/_p5-light-codemirror-theme.scss b/client/styles/components/_p5-light-codemirror-theme.scss index b22edf26..0a5fcd78 100644 --- a/client/styles/components/_p5-light-codemirror-theme.scss +++ b/client/styles/components/_p5-light-codemirror-theme.scss @@ -12,7 +12,7 @@ $p5-light-lightbrown: #A67F59; $p5-light-brown: #704F21; -$p5-light-black: #333; +$p5-light-black: #333333; $p5-light-pink: #D9328F; $p5-light-gray: #A0A0A0; $p5-light-lightblue: #00A1D3; @@ -21,6 +21,7 @@ $p5-light-white: #FDFDFD; $p5-light-orange: #EE9900; $p5-light-lightgray: #E0D7D1; $p5-light-darkgray: #666666; +$p5-light-green: #58a10b; $p5-light-gutter: #f4f4f4; $p5-light-number: #b5b5b5; @@ -37,11 +38,11 @@ $p5-light-activeline: rgb(207, 207, 207); } .cm-s-p5-light .cm-def { - color: $p5-light-darkblue; + color: $p5-light-lightblue; } .cm-s-p5-light .cm-string { - color: $p5-light-lightblue; + color: $p5-light-green; } .cm-s-p5-light .cm-string-2 { @@ -49,7 +50,7 @@ $p5-light-activeline: rgb(207, 207, 207); } .cm-s-p5-light .cm-number { - color: $p5-light-pink; + color: $p5-light-black; } .cm-s-p5-light .cm-keyword { @@ -60,7 +61,7 @@ $p5-light-activeline: rgb(207, 207, 207); color: $p5-light-lightblue; } -.cm-s-p5-light .cm-variable-2 { +.cm-s-p5-light .cm-variable2 { color: $p5-light-black; } @@ -114,14 +115,14 @@ $p5-light-activeline: rgb(207, 207, 207); } .cm-s-p5-light .cm-attribute { - color: $p5-light-lightblue; + color: $p5-light-black; } .cm-s-p5-light .cm-p5-function { color: $p5-light-darkblue; + font-weight: bold; } .cm-s-p5-light .cm-p5-variable { color: $p5-light-pink; - font-weight: bold; } diff --git a/static/p5-interceptor b/static/p5-interceptor index 0958be54..a1c12672 160000 --- a/static/p5-interceptor +++ b/static/p5-interceptor @@ -1 +1 @@ -Subproject commit 0958be54482722821159cd3e07777988ee349f37 +Subproject commit a1c126721ac667f7750ec181c8ccf363f2658d8b From 1897ccdef2f80822edfc9db2e7b6bc187cce2037 Mon Sep 17 00:00:00 2001 From: Zach Rispoli Date: Thu, 3 Aug 2017 17:27:01 -0400 Subject: [PATCH 09/35] Change setting so that decomment library preserves spaces (#411) * Change setting so that decomment preserves spaces * Fix trailing spaces --- client/modules/IDE/components/PreviewFrame.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index 314090c7..27725fb6 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -280,7 +280,10 @@ class PreviewFrame extends React.Component { } } }); - newContent = decomment(newContent, { ignore: /noprotect/g }); + newContent = decomment(newContent, { + ignore: /noprotect/g, + space: true + }); newContent = loopProtect(newContent); return newContent; } From cfd6bf75b20842a7fa05a40c7cd65ff8c4796bfa Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Tue, 29 Aug 2017 16:22:55 -0400 Subject: [PATCH 10/35] update p5 interceptor --- static/p5-interceptor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/p5-interceptor b/static/p5-interceptor index a1c12672..0958be54 160000 --- a/static/p5-interceptor +++ b/static/p5-interceptor @@ -1 +1 @@ -Subproject commit a1c126721ac667f7750ec181c8ccf363f2658d8b +Subproject commit 0958be54482722821159cd3e07777988ee349f37 From 677aa5865bfbd190fed053dd101183303699cf43 Mon Sep 17 00:00:00 2001 From: Joey Lee Date: Tue, 5 Sep 2017 23:54:41 +0200 Subject: [PATCH 11/35] replaced () with {} to fix implicit return error (#434) --- client/modules/IDE/pages/IDEView.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index ca6d22d3..e32c6e5f 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -300,8 +300,8 @@ class IDEView extends React.Component { (this.overlay.style.display = 'block')} - onDragFinished={() => (this.overlay.style.display = 'none')} + onChange={() => { this.overlay.style.display = 'block'; }} + onDragFinished={() => { this.overlay.style.display = 'none'; }} > Date: Wed, 6 Sep 2017 11:55:09 -0400 Subject: [PATCH 12/35] Accessibility (#436) * add p5 interceptor submodule * update package * remoce interceptor * update interceptor; * merge scripts * change postinstall script * refactor interceptor files * remove merge conflicts * change source files * add registry class * provide seperate outputs for text and grid * switch textOutput to boolean * make both modules usable together * update interceptor for safari * fix grid label * add sound output as well * change file strucure * change constants * change input lables * switch submodule branch * change variable name * change grid to table * remove role from table elements * switch submodule branch * change aria albels * revert submodule branch to master --- client/modules/IDE/components/GridOutput.jsx | 8 ++++---- static/p5-interceptor | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/modules/IDE/components/GridOutput.jsx b/client/modules/IDE/components/GridOutput.jsx index f1e855d9..3f7dcd1b 100644 --- a/client/modules/IDE/components/GridOutput.jsx +++ b/client/modules/IDE/components/GridOutput.jsx @@ -10,24 +10,24 @@ class GridOutput extends React.Component { id="gridOutput-content" ref={(element) => { this.GridOutputModal = element; }} > -

Grid Output

+

table Output

diff --git a/static/p5-interceptor b/static/p5-interceptor index 0958be54..442e266e 160000 --- a/static/p5-interceptor +++ b/static/p5-interceptor @@ -1 +1 @@ -Subproject commit 0958be54482722821159cd3e07777988ee349f37 +Subproject commit 442e266e7103ccad2046a64b88e399bdbd771b6e From 40fd0f9debef4d2fadbd4243bcb9eff992561743 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Wed, 6 Sep 2017 11:56:32 -0400 Subject: [PATCH 13/35] update p5-interceptor --- static/p5-interceptor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/p5-interceptor b/static/p5-interceptor index 442e266e..51087283 160000 --- a/static/p5-interceptor +++ b/static/p5-interceptor @@ -1 +1 @@ -Subproject commit 442e266e7103ccad2046a64b88e399bdbd771b6e +Subproject commit 51087283c090ab1f1f0f733a01fdf46ef1382544 From 4ea9f96d3f7cdd11f3cc9e56b15373d239b88b3b Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Thu, 14 Sep 2017 14:32:43 -0400 Subject: [PATCH 14/35] fix #430 --- client/modules/IDE/components/Editor.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index 0d365c97..ebf0c119 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -78,7 +78,8 @@ class Editor extends React.Component { options: { 'asi': true, 'eqeqeq': false, - '-W041': false + '-W041': false, + 'esversion': 6 } } }); From 9eede0f728b618c2e32b630183fe930bb1f911e4 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Thu, 14 Sep 2017 14:51:36 -0400 Subject: [PATCH 15/35] fix #429 --- client/modules/App/components/Overlay.jsx | 5 +- client/modules/IDE/components/HTTPSModal.jsx | 24 ++++++++ client/modules/IDE/components/HelpModal.jsx | 61 -------------------- client/modules/IDE/pages/IDEView.jsx | 12 ++-- 4 files changed, 33 insertions(+), 69 deletions(-) create mode 100644 client/modules/IDE/components/HTTPSModal.jsx delete mode 100644 client/modules/IDE/components/HelpModal.jsx diff --git a/client/modules/App/components/Overlay.jsx b/client/modules/App/components/Overlay.jsx index 8951df64..aa016950 100644 --- a/client/modules/App/components/Overlay.jsx +++ b/client/modules/App/components/Overlay.jsx @@ -57,14 +57,15 @@ Overlay.propTypes = { closeOverlay: PropTypes.func, title: PropTypes.string, ariaLabel: PropTypes.string, - previousPath: PropTypes.string.isRequired + previousPath: PropTypes.string }; Overlay.defaultProps = { children: null, title: 'Modal', closeOverlay: null, - ariaLabel: 'modal' + ariaLabel: 'modal', + previousPath: '/' }; export default Overlay; diff --git a/client/modules/IDE/components/HTTPSModal.jsx b/client/modules/IDE/components/HTTPSModal.jsx new file mode 100644 index 00000000..6240dd51 --- /dev/null +++ b/client/modules/IDE/components/HTTPSModal.jsx @@ -0,0 +1,24 @@ +import React from 'react'; + +function HTTPSModal() { + return ( +
+
+
+

Use the checkbox to choose whether this sketch should be loaded using HTTPS or HTTP.

+

You should choose HTTPS if you need to:

+
    +
  • access a webcam or microphone
  • +
  • access an API served over HTTPS
  • +
+

Choose HTTP if you need to:

+
    +
  • access an API served over HTTP
  • +
+
+
+
+ ); +} + +export default HTTPSModal; diff --git a/client/modules/IDE/components/HelpModal.jsx b/client/modules/IDE/components/HelpModal.jsx deleted file mode 100644 index df0adf24..00000000 --- a/client/modules/IDE/components/HelpModal.jsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, { PropTypes } from 'react'; -import InlineSVG from 'react-inlinesvg'; - -const exitUrl = require('../../../images/exit.svg'); - -const helpContent = { - serveSecure: { - title: 'Serve over HTTPS', - body: ( -
-

Use the checkbox to choose whether this sketch should be loaded using HTTPS or HTTP.

-

You should choose HTTPS if you need to:

-
    -
  • access a webcam or microphone
  • -
  • access an API served over HTTPS
  • -
-

Choose HTTP if you need to:

-
    -
  • access an API served over HTTP
  • -
-
- ) - } -}; - -const fallbackContent = { - title: 'No content for this topic', - body: null, -}; - -class HelpModal extends React.Component { - componentDidMount() { - this.shareModal.focus(); - } - render() { - const content = helpContent[this.props.type] == null ? - fallbackContent : - helpContent[this.props.type]; - - return ( -
{ this.shareModal = element; }} tabIndex="0"> -
-

{content.title}

- -
-
- {content.body} -
-
- ); - } -} - -HelpModal.propTypes = { - type: PropTypes.string.isRequired, - closeModal: PropTypes.func.isRequired, -}; - -export default HelpModal; diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index e32c6e5f..3929f8e5 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -15,7 +15,7 @@ import NewFolderModal from '../components/NewFolderModal'; import ShareModal from '../components/ShareModal'; import KeyboardShortcutModal from '../components/KeyboardShortcutModal'; import ErrorModal from '../components/ErrorModal'; -import HelpModal from '../components/HelpModal'; +import HTTPSModal from '../components/HTTPSModal'; import Nav from '../../../components/Nav'; import Console from '../components/Console'; import Toast from '../components/Toast'; @@ -516,11 +516,11 @@ class IDEView extends React.Component { {(() => { // eslint-disable-line if (this.props.ide.helpType) { return ( - - + + ); } From fd26279fed690f6dd0f2d2181a0afe16a9ff1992 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 17 Jul 2017 17:09:46 -0400 Subject: [PATCH 16/35] start to restyle nav --- client/components/Nav.jsx | 94 ++++++++++++++++++++++++++ client/images/down-filled-triangle.svg | 10 +++ client/images/p5js-logo-small.svg | 20 ++++++ client/styles/components/_nav.scss | 13 ++-- 4 files changed, 132 insertions(+), 5 deletions(-) create mode 100644 client/images/down-filled-triangle.svg create mode 100644 client/images/p5js-logo-small.svg diff --git a/client/components/Nav.jsx b/client/components/Nav.jsx index 0a861e97..5b4aebcf 100644 --- a/client/components/Nav.jsx +++ b/client/components/Nav.jsx @@ -1,11 +1,105 @@ import React, { PropTypes } from 'react'; import { Link } from 'react-router'; +import InlineSVG from 'react-inlinesvg'; + +const triangleUrl = require('../images/down-filled-triangle.svg'); +const logoUrl = require('../images/p5js-logo-small.svg'); class Nav extends React.PureComponent { render() { return (