Commit graph

1154 commits

Author SHA1 Message Date
Christopher Willis-Ford
ae878b2050 Simplify extension duplication prevention station
Since we will only have builtin extensions for a while, the
more-complicated, watchdog-based extension duplication prevention has
been replaced with one that treats the extension URL as equivalent to
the extension ID. This is true only for built-in extensions, so once we
start supporting third-party extensions we will likely need to bring
back the watchdog (commit e4381b4693) and
the more-complex duplication prevention (commit
670e51d335).

The code here should be treated as a last resort: ideally the GUI should
check if a particular extension is loaded (maybe by calling the
Extension Manager's new `isExtensionLoaded` method) and avoid calling
`loadExtensionURL` if it is.
2017-10-31 12:35:18 -07:00
Christopher Willis-Ford
670e51d335 Refuse to register second extension with same ID
If an extension attempts to register with the same ID as another
extension which has already registered, the new registration is refused.
If the extension is in a worker and no other extension is successfully
registered by that worker, the watchdog system will terminate the
"empty" worker.
2017-10-31 12:24:26 -07:00
Christopher Willis-Ford
e4381b4693 Add an init watchdog for extension workers
If an extension worker does not complete initialization in a reasonable
amount of time (currently 15 seconds) then the worker will be
terminated. A complete initialization includes registering an extension.
2017-10-31 11:28:56 -07:00
DD Liu
ceb47bd765 Merge pull request #718 from fsih/updateSvgStorage
Update storage when the SVG updates
2017-10-13 19:11:41 -04:00
Chris Willis-Ford
c4e79c9732 Merge pull request #713 from cwillisf/fix-extension-hats
Fix extension hats
2017-10-13 16:03:51 -07:00
DD
82efc42a13 Update storage when the SVG updates 2017-10-13 17:45:03 -04:00
Chris Willis-Ford
a8ae7bc5b4 Merge pull request #700 from cwillisf/extension-menus
Extensions: implement drop-down menus
2017-10-13 09:49:42 -07:00
Chris Willis-Ford
7051ccfd69 Merge pull request #687 from cwillisf/builtin-extensions
Builtin extensions
2017-10-13 09:48:56 -07:00
Christopher Willis-Ford
1a9e28bfc9 Small WeDo 2.0 fixups 2017-10-13 01:48:25 -07:00
Christopher Willis-Ford
96fa7315d5 Don't overwrite hat block's fields
Due to a typo (I believe) we were overwriting a horizontal hat block's
fields list when collecting hat block inputs. Now we collect inputs into
a temporary object in this case.
2017-10-13 01:46:35 -07:00
Paul Kaplan
c807f02e37 Merge pull request #703 from paulkaplan/fix-say-think-loop
️ Fix the infinite loop in say/think 
2017-10-12 08:08:17 -04:00
Paul Kaplan
4599a71dd7 Try to pin the bubbles within the left/right bounds 2017-10-11 16:34:50 -04:00
Paul Kaplan
b00a619e2d Only flip bubble if it would fit the other way 2017-10-11 16:27:51 -04:00
Christopher Willis-Ford
309f02542f Throw if extension tries to build a dynamic menu
Dynamic menus are not yet supported for extension menus, though they are
part of the extension spec. This change provides more thorough feedback
if an extension tries to register an unsupported dynamic menu.
2017-10-11 11:41:03 -07:00
Paul Kaplan
f09c4d0bb9 Merge pull request #691 from paulkaplan/say-think
Add say/think functionality to looks blocks
2017-10-11 14:24:10 -04:00
Paul Kaplan
fa2db053a7 Fix copy paste error on targetWasRemoved 2017-10-11 14:19:15 -04:00
Paul Kaplan
8ac348d931 Merge pull request #698 from paulkaplan/update-custom-procedures
Changing parsing of custom procedures for new style
2017-10-11 13:37:26 -04:00
Paul Kaplan
9af9eb1d92 Fix hide/show 2017-10-10 15:35:48 -04:00
Paul Kaplan
8d722b9073 Fix opcode, which isn't actually used in the code... 2017-10-10 15:10:03 -04:00
Paul Kaplan
e8c5bbbf80 Fix tests and make chain more resilient 2017-10-10 12:19:27 -04:00
Christopher Willis-Ford
2f9796c163 Fix escapeHtml error caused by rebase 2017-10-06 23:44:27 -07:00
Christopher Willis-Ford
67c788ec8d Extensions: fix Boolean inputs 2017-10-06 23:33:33 -07:00
Christopher Willis-Ford
c1681e54d5 Implement drop-down menus for extension blocks
Also, add `ANGLE` argument type (like `NUMBER` but adds an angle picker)
2017-10-06 23:33:33 -07:00
Paul Kaplan
b0870518a4 Changing parsing of custom procedures for new style 2017-10-06 16:26:19 -04:00
Christopher Willis-Ford
ef3feca385 Fix typo in WeDo 2.0 blocks metadata 2017-10-06 10:56:38 -07:00
Paul Kaplan
14600d7893 Update looks implementation 2017-10-06 13:43:07 -04:00
Christopher Willis-Ford
7297341c51 Fixups from code review
- Remove WeDo 2 extension from the runtime's default block packages list
- The WeDo 2.0 extension now calls its own `connect` method on startup

I also renamed `EXTENSION_NAME` to `EXTENSION_ID` for consistency with
the rest of the extension system.
2017-10-06 09:55:19 -07:00
Paul Kaplan
43d061227c WIP 2017-10-05 17:03:30 -04:00
Paul Kaplan
43a17bdaa8 Add say/think functionality to looks blocks 2017-10-05 11:16:27 -04:00
Christopher Willis-Ford
b6727a766f Fix pen tests 2017-10-04 16:07:50 -07:00
Christopher Willis-Ford
dd20e09774 Extensions: escape HTML entities in default values
This prevents generation of invalid XML due to characters like '<' or
'>' in fields' default values. Unfortunately the value comes back in its
escaped form, so there's still more work to be done.
2017-10-04 13:00:45 -07:00
Christopher Willis-Ford
e9aed49a05 Make loadExtensionURL handle built-in extensions
WeDo2 and Pen blocks have been converted to internal extensions, and can
now be loaded by giving `loadExtensionURL` the string 'pen' or 'wedo2'
instead of an actual URL.
2017-10-04 13:00:39 -07:00
Christopher Willis-Ford
6757fb6de9 Convert pen blocks into an "internal" extension 2017-10-04 12:54:30 -07:00
Paul Kaplan
e4830dfe51 Merge pull request #686 from paulkaplan/fix-extension-labels
Remove label generation for extensions
2017-10-04 15:37:06 -04:00
Paul Kaplan
0358d6c0c3 Remove label generation for extensions 2017-10-04 15:02:09 -04:00
Chris Willis-Ford
4836d1733d Merge pull request #684 from cwillisf/allow-workerless-extensions
Allow workerless extensions
2017-10-02 18:48:35 -04:00
Christopher Willis-Ford
99b868c0f0 Explain when it's OK to omit <field> element
Also, alphabetize the `ArgumentType` and `BlockType` enums.
2017-10-02 15:29:32 -07:00
Christopher Willis-Ford
772da24d9e Add integration test for a non-worker extension 2017-10-02 12:02:44 -07:00
Christopher Willis-Ford
06252e020b Extensions: add support for color-picker arguments 2017-09-27 00:02:53 -04:00
Christopher Willis-Ford
7a21d619bf Add a way to load an extension without a Worker
The new `_registerInternalExtension` method on the extension manager
will register an extension object (an object with a `getInfo()` method)
with the extension system without sandboxing the object in a Worker.
2017-09-27 00:01:47 -04:00
Chris Willis-Ford
6087b5346c Merge pull request #675 from cwillisf/feature/extensions
Feature/extensions
2017-09-14 13:34:18 -07:00
Paul Kaplan
0f04c99e67 Merge pull request #676 from paulkaplan/duplicate
Add sprite duplication method
2017-09-13 11:57:13 -04:00
Paul Kaplan
a885e7d619 Refactor error throwing 2017-09-12 10:16:26 -04:00
Paul Kaplan
4a7ba534c1 Fix linter 2017-09-11 15:15:30 -04:00
Eric Rosenbaum
b8bd77e394 Merge pull request #674 from ericrosenbaum/feature/pen-transparency
Add pen transparency blocks
2017-09-11 12:41:28 -04:00
Paul Kaplan
81370f7625 Refactor method exports to fix linting and CWF comment 2017-09-11 10:11:48 -04:00
Paul Kaplan
b68b874067 Add sprite duplication method 2017-09-07 11:51:21 -04:00
DD Liu
7f6ac3de35 Merge pull request #673 from fsih/updateRotationCenter
Update rotation center
2017-09-06 17:02:08 -04:00
Christopher Willis-Ford
635c7966eb Fix tests: don't require('scratch-blocks') 2017-09-06 01:24:24 -06:00
Christopher Willis-Ford
799d61ac98 Cleanup 2017-09-06 00:57:03 -06:00