Skip to content

Extensions: implement drop-down menus #700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 13, 2017

Conversation

cwillisf
Copy link
Contributor

@cwillisf cwillisf commented Oct 7, 2017

Resolves

Resolves #689

Proposed Changes

This change implements basic drop-down menu support for extension blocks. Dynamic menus -- ones which collect menu items fresh each time the menu opens -- are not yet supported.

Since I was in the area, I also fixed Boolean inputs and added angle picker support.

Reason for Changes

This is another step toward implementing the whole extension spec.

Christopher Willis-Ford added 2 commits October 6, 2017 23:33
Also, add `ANGLE` argument type (like `NUMBER` but adds an angle picker)
Copy link
Contributor

@ericrosenbaum ericrosenbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

The menu field's color looks like it needs adjusting, but we can fix that later.

const menuId = this._makeExtensionMenuId(menuName, categoryInfo.id);

/** @TODO: support dynamic menus when 'menuItems' is a method name string (see extension spec) */
const options = menuItems.map(item => {

This comment was marked as abuse.

colour: categoryInfo.color1,
colourSecondary: categoryInfo.color2,
colourTertiary: categoryInfo.color3,
outputShape: ScratchBlocksConstants.OUTPUT_SHAPE_ROUND,

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

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.
@cwillisf cwillisf merged commit a8ae7bc into scratchfoundation:develop Oct 13, 2017
@cwillisf cwillisf deleted the extension-menus branch October 13, 2017 16:49
stefania11 pushed a commit to mitmedialab/cognimates-vm that referenced this pull request Mar 31, 2018
Changed existing string ids to use the convention `<repo>.<component>.<identifier>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extensions: drop-down menus
5 participants