Skip to content

Commit

Permalink
[patch] Do not load 3rd party resources
Browse files Browse the repository at this point in the history
We loaded images and sounds from
https://blockly-demo.appspot.com/static/media/. With the GPDR in mind,
it is better to host everything yourself.
  • Loading branch information
schra committed Apr 25, 2021
1 parent ed58dcf commit 697435c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ yarn-debug.log*
yarn-error.log*

.idea.*

public/media/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "blockly"]
path = blockly
url = https://github.com/google/blockly
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

## Installation

In the project directory, run `npm install`
In the project directory, copy the media/ folder once like this: `cp -r blockly/media/ public/media`. Then run `npm install`.

## Build

Assume we want to deploy the site to the path "/girlsday", then you can do:

```
PUBLIC_URL="/girlsday" npm run build
cp -r blockly/media/ public/media
```

You can find the files to deploy in the build/ folder.
Expand Down
1 change: 1 addition & 0 deletions blockly
Submodule blockly added at 3fe56b
4 changes: 3 additions & 1 deletion src/tasks/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ export default function Task(props) {
<Col xs={7}>
<Row style={{height: "80vh"}}>
<BlocklyComponent ref={workspaceRef}
readOnly={false} trashcan={true}
readOnly={false}
trashcan={true}
media={process.env.PUBLIC_URL + "/media/"}
move={{
scrollbars: true,
drag: true,
Expand Down

0 comments on commit 697435c

Please sign in to comment.