adrianliaw / meteor-blockly

Google Blockly In Meteor
4 stars 1 forks source link

Usage ? #4

Open jm4r7in opened 8 years ago

jm4r7in commented 8 years ago

Thanks for the package, but I can't manage to use it. Could you detail a bit the usage, please ? Thank you !

jm4r7in commented 8 years ago

Thanks Adrian for the package. Here is a basic usage :

In a template (called for example "blockly"), insert a div :

id="blocklyDiv" style="height: 480px; width: 600px;"

and

`

  <category name="Logic">
    <block type="logic_compare"></block>
    <block type="logic_operation"></block>
    <block type="logic_boolean"></block>
 </category>
</xml>`

Template.blockly.rendered = function(){ var workspace = Blockly.inject('blocklyDiv', {toolbox: document.getElementById('toolbox')}); };