You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,10 +78,10 @@ you will never need to make a new `ContextMenuRegistry`. Always use the singleto
78
78
79
79
Reload your web page and open a context menu on the workspace (right-click with a mouse, or press `Ctrl+Enter` (Windows) or `Command+Enter` (Mac) if you are navigating Blockly with the keyboard). You should see a new option labeled "Hello World" at the bottom of the context menu.
alt='A context menu. The last option says "Hello World".'
84
+
className="codelabImage"
85
+
/>
86
86
87
87
Next, drag a block onto the workspace and open a context menu on the block. You'll see "Hello World" at the bottom of the block's context menu. Finally, open a context menu on the workspace and create a comment, then open a context menu on the comment's header. "Hello World" should be at the bottom of the context menu.
alt="Screenshot of the toolbox and workspace built in this codelab. It contains blocks that implement the JSON spec, like member, object, lists, strings, and numbers."
@@ -162,10 +162,10 @@ Our `index.js` file already handles importing the toolbox and using it in Blockl
162
162
163
163
If the server is already running, refresh the page to see changes. Otherwise, run `npm start` to start the server. New blocks should now exist in the toolbox, like this:
164
164
165
-
<CodelabImage>
166
-
![Screenshot of toolbox showing the added blocks, including the new member and
167
-
object blocks, plus the built-in number, text, boolean, null, and list
alt="Screenshot of toolbox showing the added blocks, including the new member and object blocks, plus the built-in number, text, boolean, null, and list blocks."
168
+
className="codelabImage"
169
+
/>
170
170
171
171
The app is still trying to generate and run JavaScript for the workspace, instead of JSON. We will change that soon.
alt="The number block has an input for a user to type a number"
68
+
className="codelabImage"
69
+
/>
67
70
68
71
Like the `text` block, the `math_number` block can use `getFieldValue`. Unlike the text block, the function doesn't need to wrap it in additional quotation marks, because in the JSON code, it won't be a string.
69
72
@@ -80,10 +83,11 @@ jsonGenerator.forBlock['math_number'] = function (block) {
80
83
81
84
The `logic_boolean` block has a dropdown field named `BOOL`.
82
85
83
-
<CodelabImage>
84
-
![The boolean block lets the user select 'true' or 'false' from a dropdown
alt="The boolean block lets the user select 'true' or 'false' from a dropdown menu."
89
+
className="codelabImage"
90
+
/>
87
91
88
92
Calling `getFieldValue` on a dropdown field returns the value of the selected option, which may not be the same as the display text. In this case the dropdown has two possible values: `TRUE` and `FALSE`.
0 commit comments