Commit 107f417
Rework blocks (#258)
Implements a Blockly-like system of objects for blocks, scripts, and block attributes, and connects it to everything else. Fix a few other things in the process.
* rough beginnings of reworked block code
* add Attr constructor; transition from getOffset() to block.left() (etc.); rewrite json2html
* fix bug where sometimes blocks didn’t symbolically attach to parent
* bugfix: now you can add block to beginning of c-stack
* move some event listeners around, resolve #242 in the process
* fix duplicate functionality
* disable context menu on “body” element
* resolve error when rendering blank attributes
* start on file import/export
* bug fixes related to file import
* I got single-file export to work :D
* start fixing multiple html files
* fixed bugs in switching between multiple html files
* add CSS blocks and export
* finish file import
* make change described by @iamunknown2 (close #252)
* fix bug where imported files weren’t editable
* fix items sometimes reversing in order on drop (thanks @iamunknown2 for reporting)
* clean up coords code
* fix tutorial 2
* figured out the issues with CSS files
* limit context menu to blocks in script area
* fix issues with loose blocks not being JSON’d correctly
* rename a whole bunch of things
* add default blocks to new CSS files
* refactor dropdown code and add to rule block
* rename Attr to BlockAttribute to match other constructors’ snooty names
* remove old files
* move function blocksToJSON to block2json.js for obvious reasons
* remove default scriptingArea contents since they’re always generated programmatically
* bugfix: default blocks in new CSS files were marked inPalette
* clean up blocks2json a lil
* update zebra to use the new system
* tweaks
* switch from strings for block types to enum
* bug fix with enum
* remove a lot of old code and random nits
* remove duplicate code
* slightly simplify file import
* a naive attempt to clog potential memory leaks
* more attempt to plug memory leaks, p.s. this is miserable and I have no idea how to know if it works
* tpyo
* delEt aLL th1NGS
* everything is garbage
* bugfix that I don’t understand why it’s necessary but ok
* Made searchBar superimpose blocks (but not when they are held by the cursor) (#261)
* fix issue where tutorials scroll the page (resolves #254 and #259)1 parent f4f5290 commit 107f417
18 files changed
Lines changed: 1015 additions & 1806 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
| |||
190 | 187 | | |
191 | 188 | | |
192 | 189 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 190 | + | |
205 | 191 | | |
206 | 192 | | |
207 | 193 | | |
208 | 194 | | |
209 | 195 | | |
210 | | - | |
211 | 196 | | |
212 | | - | |
| 197 | + | |
213 | 198 | | |
214 | 199 | | |
215 | 200 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
| 554 | + | |
554 | 555 | | |
555 | 556 | | |
556 | 557 | | |
| |||
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
614 | | - | |
615 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
| |||
0 commit comments