Rev 302 | Rev 324 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 302 | Rev 318 | ||
---|---|---|---|
Line 349... | Line 349... | ||
349 | 349 | ||
350 | <script> |
350 | <script> |
351 | 351 | ||
352 | document.getElementById('file-input').addEventListener('change', readSingleFile, false); |
352 | document.getElementById('file-input').addEventListener('change', readSingleFile, false); |
353 | 353 | ||
354 | // var toolbox = document.getElementById("toolbox"); |
- | |
355 | var toolbox = loadDoc("toolbox.xml"); |
354 | var toolbox = loadDoc("toolbox.xml"); |
356 | 355 | ||
357 | var options = { |
356 | var options = { |
358 | toolbox : toolbox, |
357 | toolbox : toolbox, |
359 | collapse : true, |
358 | collapse : true, |
Line 381... | Line 380... | ||
381 | length: 3, |
380 | length: 3, |
382 | colour: '#ccc', |
381 | colour: '#ccc', |
383 | snap: true} |
382 | snap: true} |
384 | }; |
383 | }; |
385 | 384 | ||
386 | /* Inject your workspace */ |
- | |
387 | var workspace = Blockly.inject('blocklyDiv', options); |
385 | var workspace = Blockly.inject('blocklyDiv', options); |
388 | 386 | ||
389 | /* Load Workspace Blocks from XML to workspace. Remove all code below if no blocks to load */ |
- | |
390 | - | ||
391 | /* TODO: Change workspace blocks XML ID if necessary. Can export workspace blocks XML from Workspace Factory. */ |
- | |
392 | //var workspaceBlocks = document.getElementById("workspaceBlocks"); |
- | |
393 | /* Load blocks to workspace. */ |
- | |
394 | // Blockly.Xml.domToWorkspace(workspaceBlocks, workspace); |
- | |
395 | - | ||
396 | <?php |
387 | <?php |
397 | 388 | ||
398 | if (isset($_GET["decay"])){ |
389 | if (isset($_GET["decay"])){ |
399 | $decay = $_GET["decay"]; |
390 | $decay = $_GET["decay"]; |
400 | } else { |
391 | } else { |
401 | $decay = "data/sample.blab2"; |
392 | $decay = "data/sample.blab2"; |
402 | } |
393 | } |
403 | // echo "var workspaceBlocks = loadDoc( \"$decay\");" |
394 | // echo "var workspaceBlocks = loadDoc( \"$decay\");" |
404 | /* Load blocks to workspace. */ |
395 | /* Load blocks to workspace. */ |
405 | echo "displayContents( loadDoc( \"$decay\"));" |
396 | echo "displayContents( loadDoc( \"$decay\"));" |
406 | 397 | ||
407 | ?> |
398 | ?> |
408 | 399 | ||
409 | //displayContents(workspaceBlocks); |
400 | //displayContents(workspaceBlocks); |
- | 401 | </script> |
|
- | 402 | <div id="drawing"></div> |
|
410 | 403 | <?php |
|
- | 404 | $hostname = gethostname(); |
|
- | 405 | if ($hostname != "belle2.ijs.si") { |
|
- | 406 | echo "<a href='update.php'>Update code from the central server</a>"; |
|
411 | 407 | } |
|
412 | 408 | ?> |
|
413 | </script> |
- | |
414 | <div id="drawing"></div> |
- | |
415 | </body> |
409 | </body> |
416 | <a href="update.php">Update code</a> |
- | |
417 | </html> |
410 | </html> |