Then update the options struct in the playground to use your new toolbox:
var defaultOptions = {A previous step says this:
Now to start, create a file named custom_generator.js in the same folder as the playground. Include it with a script tag.
<script src="./custom_generator.js"></script>
Note: you must include your custom code after including the Blockly library.
I assume that the Blockly library is already included in advanced_playground.html by the line:
So, immediately following the boostrap.js line, I add the line:
When I do everything above, the advanced playground doesn’t change at all. I still see all the original available toolboxes. When I select a different toolbox (e.g., "simple") from the drop down menu in the right options pane, the toolbox changes in the workspace to whatever I’ve selected. I just never get the toolbox to update to the new, custom one. I can make other modifications to the html file, and changes show up in the browser. So, I know the right html file is being referenced. For example, I can update the list of toolboxes for the drop down menu to include the codelabToolbox, and the menu will change in the playground, but when I select the codelabToolbox, the fly out menu disappears until I select one of the original toolboxes from the drop down menu.
I'm not sure if my assumption of Blockly being included is correct, but when I look at the bootstrap.js file, the comments seem to say it brings in Blockly...and I don't know how else the advanced playground would have all the functionality it does without Blockly.
I'm not sure if I've missed including something I need to or have placed the include for the custom generator in the wrong place.
On Nov 4, 2022, at 3:04 PM, 'Maribeth Bottorff' via Blockly <blo...@googlegroups.com> wrote:
Hello,
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/8d8e80f2-226f-4c44-b1b7-a9250086dddbn%40googlegroups.com.