Commit Graph
1520 Commits
Author SHA1 Message Date
Evelyn Eastmond d09c3f0418 MicroBit extension, Scratch Link first draft. (#1230)
* First microbit gui tests

* Fixed JSONRPC inheritance.  Renamed ScratchBLE/ScratchBT files.  Removed ScratchBT test code from Microbit extension.  Renamed addLine to log.

* Fixed log comments.  Removed addLine from Microbit.

* Adding auto-connect to Microbit at extension loading.  Adding hack for displayText block to Scratch-Link.

* Resolved merge conflicts and brought in latest microbit extension example code.

* Updated microbit write tests for displayText and displaySymbol blocks.  Some linting.

* Some linting and adding of BLE Characteristic consts.

* Linting fixes.

* Moving micro:bit device connection code all to the MicroBit class, decoupling Scratch3MicroBitBlocks from connection code.

* Removing old disconenct handlers from MicroBit class.  Moved service into new BLEUUID data structure.

* Renamed _write to _send.  Moved all BLE encoding concerns to the _send method.

* Using the util log.  Some linting.

* Added _read method to MicroBit class.  Renamed _send to _write.

* Some linting and formatting comments.

* First pass at peripheral chooser pattern for ScratchBLE.

* Testing characteristicDidChange events, and some changes to ScratchBLE on ready events.

* Refactoring work on PeripheralChooser and ScratchBLE.

* Some variable renaming and method signature stubs.

* Peripheral chooser method signatures.

* Moved base64 encoding/decoding to util.  Some method signature formatting.

* Adding test stubs for new util and io classes.

* Adding test stub for MicroBit extension.

* Clean up for PR.

* Clean up for PR.

* Final cleanup for PR.

* Removed logging to console.

* Adding 'btoa' and 'atob' node modules and using them in Base64Util.
2018-06-18 14:56:51 -04:00
kchadha da30abbfb5 Merge pull request #1240 from kchadha/block-comment-disappearing-bugfix
Add comment id to block when converting from XML to vm representation.
2018-06-15 17:36:48 -04:00
Karishma Chadha f3d49f75c8 Clean up comment serialization, add tests for new and old serialization (old is still valid, just more verbose). 2018-06-15 14:57:49 -04:00
Karishma Chadha 76b423e481 Make sure to set comment property of block when creating a new block via XML using the adapter. Update unit tests. 2018-06-15 13:58:03 -04:00
kchadha 29b79878bc Merge pull request #1236 from kchadha/comment-save-load
Comment Save & Load
2018-06-14 18:42:19 -04:00
kchadha 529d271186 Merge pull request #1235 from kchadha/xml-escape-comments
XML escape comment text.
2018-06-14 14:46:02 -04:00
Karishma Chadha e2eadbf603 Comment save and load. 2018-06-14 14:11:20 -04:00
Eric Rosenbaum 8c748cebb4 Merge pull request #1233 from ericrosenbaum/feature/extension-status-button
Add extension status button
2018-06-14 11:51:32 -04:00
Karishma Chadha 0d403d8e83 XML escape comment text. 2018-06-14 11:39:03 -04:00
Ray Schamp f5234c777a Merge pull request #1211 from mzgoddard/broadcast-and-wait-promise
yield a tick if broadcastandwait is waiting on threads waiting for a future tick
2018-06-13 15:58:37 -04:00
Eric Rosenbaum c2b262ba97 Add status button to microbit extension 2018-06-13 15:53:05 -04:00
Eric Rosenbaum 7d0c45546c Add extension status button XML 2018-06-13 15:52:51 -04:00
Paul Kaplan bd80e4262d Merge pull request #1231 from paulkaplan/reorder-tarrgets
Add top-level `reorderTarget` API to VM
2018-06-13 11:07:52 -04:00
Paul Kaplan 4b64df222a Hoist target list assignment to simplify code. 2018-06-13 10:09:22 -04:00
kchadha 3308a7c6a2 Merge pull request #1229 from kchadha/imported-comment-positioning-fix
Update position for comments imported from 2.0 projects after auto-positioning.
2018-06-13 09:51:45 -04:00
Paul Kaplan 0ec0ea6ef7 Add reorderTarget API to VM 2018-06-13 09:20:22 -04:00
kchadha b4891bb0d5 Merge pull request #1226 from towerofnix/costumename-vm
Implement "costume name" block
2018-06-12 18:50:46 -04:00
Florrie c24e34d4e3 Remove unused getCostumeName function 2018-06-12 19:32:29 -03:00
Florrie 24c6338302 Map costumeName -> costumenumbername [name]
...instead of mapping to a new obsolete/hidden block 'costumename'.
Thanks to @kchadha for helping with this!
2018-06-12 19:27:36 -03:00
Karishma Chadha 5086eced15 Position for block comments imported from 2.0 should be updated when receiving a create event from scratch-blocks. 2018-06-12 17:10:16 -04:00
Michael "Z" Goddard d161251a9b yield a thread loop or tick in event_broadcastandwait
- yield a thread loop or tick in looks_switchbackdroptoandwait

If all threads broadcastAndWait is watching are "waiting" for a future
frame, yield until the next tick so event_broadcastandwait also defers
to a future frame.
2018-06-12 10:02:28 -04:00
Paul Kaplan 418c3837c6 Merge pull request #1209 from technoboy10/bugfix/gh-1135-bubble-edge
Check that bubble bounds do not extend past stage boundaries
2018-06-11 12:14:53 -04:00
Connor Hudson 244ffb38c4 Merge pull request #1218 from technoboy10/bugfix/gh-1165-monitor-import
Fix importing hidden monitors from Scratch 2 projects
2018-06-11 10:27:45 -04:00
Eric Rosenbaum 78074ec575 Merge pull request #1222 from picklesrus/speech-extension-icons
Speech extension icons
2018-06-11 09:50:42 -04:00
Connor Hudson 38756e1022 Update code comments to address PR feedback 2018-06-11 08:37:25 -04:00
Florrie 404834018b Implement costume name block 2018-06-09 21:34:21 -03:00
picklesrus 97b8ec83bd Ignore lint for the icons 2018-06-08 14:45:13 -07:00
picklesrus 6184c3ba12 Replace icons with version downloaded from https://material.io/tools/icons/?style=baseline 2018-06-08 14:42:46 -07:00
Connor Hudson 78da15c09c Remove blocks.mode reference 2018-06-08 17:04:52 -04:00
Connor Hudson a6629628cd Use monitor show/hide monitor functions, remove incorrect block property references 2018-06-08 16:00:12 -04:00
Connor Hudson 0e394fc873 Add monitor show/hide functions, changed remove monitor to delete state 2018-06-08 15:59:35 -04:00
Eric Rosenbaum 173fb6127c Merge pull request #1214 from ericrosenbaum/feature/when-touching
Add when touching hat
2018-06-07 15:26:09 -04:00
Connor Hudson 2cb276c476 Consolidate some logic in requestAddMonitor and requestUpdateMonitor 2018-06-07 15:18:45 -04:00
kchadha 3a61cac384 Merge pull request #1217 from kchadha/comment-state-fixes
Comment state fixes
2018-06-07 14:31:43 -04:00
Eric Rosenbaum db7c56e08b Change function name and comment for clarity 2018-06-07 14:12:23 -04:00
Connor Hudson 99dc46ba80 Add x, y to changeBlock function again after change to merge logic 2018-06-07 11:27:10 -04:00
Connor Hudson 833c27ef21 Remove debug comments, tweak logic for monitor data merging 2018-06-07 11:24:55 -04:00
Karishma Chadha 6bc04c4bef Let comment change event handler multitask. 2018-06-07 11:04:03 -04:00
Paul Kaplan db3fca17bc Merge pull request #1204 from paulkaplan/reorder-apis
Add methods for reordering costumes and sounds
2018-06-07 10:54:15 -04:00
Ray Schamp 7de83bea07 Merge pull request #1215 from picklesrus/speech-extension-audiocontext
Add webkitAudioContext if AudioContext does not exist. This might fix…
2018-06-07 10:53:45 -04:00
Karishma Chadha 7b55d8e7ab Undo change that moves block comment relative to block move. 2018-06-07 10:18:34 -04:00
Connor Hudson 13bf932fbb Remove unnecessary arguments to requestAddMonitor 2018-06-07 10:11:15 -04:00
Karishma Chadha d99a082952 CommentChange events now store text changes in an object with property text, instead of just a string. 2018-06-07 10:09:38 -04:00
picklesrus 391f47d100 Add webkitAudioContext if AudioContext does not exist. This might fix the speech extension in safari, but it is tricky to tell since I am running into problems with permissions and localhost. 2018-06-06 16:49:46 -07:00
Paul Kaplan 28f425d53e Set costume directly, no updates are needed 2018-06-06 17:29:48 -04:00
Connor Hudson 77dda04228 Set visible: false instead of deleting state in requestRemoveMonitor
This potentially has performance implications, to be investigated later.
2018-06-06 17:14:09 -04:00
Eric Rosenbaum 1a72512a62 Moving touchingObject into rendered target 2018-06-06 16:34:58 -04:00
Connor Hudson 0d0543810f Properly capture all variable monitor values on add 2018-06-06 16:00:59 -04:00
Connor Hudson 18640d7ddc use mergeWith in requestAddMonitor, requestUpdateMonitor
So undefined values don't overwrite defined ones
2018-06-06 15:54:12 -04:00
Paul Kaplan bf2879ee0b Fix incorrect clamping 2018-06-06 15:01:02 -04:00