In HTML
<button class="mode-maker mdl-button" id="edit">Edit</button>
'edit'
is
the id of the Edit button.
In main.js is '#edit':
document.querySelector('#edit').addEventListener('click', enableEditMode);
Clicking the Edit button will go to the "enableEditMode" function.
1) The '#' concatenated to 'edit' appears to represent the Edit button. Is
'#' a Blockly standard?
------------------------------------------------------
Inside the "enableEditMode" function is this:
document.body.setAttribute('mode', 'edit');
In the HTML
The "maker" is a "<div class"
which contains the
"<div class" of every colored button.
2) The "setAttribute" appears to connect the Edit button to the 9 colored buttons. This is a Blockly standard?
------------------------------------------------------
I started modifying "custom-toolbox-codelab\complete-code" folder HTML file by converting the code from XML to JSON. The "custom-toolbox-codelab\complete-code"
folder
has been renamed to a "Learn Blockly" folder to shorten the folder name.
As the numerous lines of my code mask my questions, I've uploaded the
"Learn Blockly" folder / files (zipped) to my website -> "
https://temp.foxping.com/". The zipped file name is "Learn Blockly.7z". Downloading this zip file will make it easier to understand my questions.
The revised code uses JSON instead of XML. The JSON code in the HTML is:
<body>
<div id="blocklyDiv"></div>
<script> var toolbox =
{
This JSON code does not have any "<div class" code.
3) What code changes need to made to implement the code examples in "getting-started-codelab\complete-code" described at the beginning of this post?
------------------------------------------------------
Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~