File "scratchblocks.html"

Full path: /usr/home/mndrn/domains/mndrn.ru/public_html/block-hill/blockly/tests/rendering/zelos/scratchblocks/scratchblocks.html
File size: 1.84 KiB (1880 bytes)
MIME-type: text/html
Charset: utf-8

Download   Open   Back

<html>

<head>
  <script type="text/javascript"
    src="https://unpkg.com/[email protected]/blockly_compressed_vertical.js"></script>
  <script type="text/javascript"
    src="https://unpkg.com/[email protected]/blocks_compressed_vertical.js"></script>
  <script type="text/javascript"
    src="https://unpkg.com/[email protected]/msg/messages.js"></script>
  <script type="text/javascript" src="../../../playgrounds/screenshot.js"></script>
</head>

<body>
  <div id="blocklyDiv"></div>
  <script>
    var blocklyDiv = document.getElementById('blocklyDiv');
    var workspace;
    window.addEventListener('message', function (msg) {
      var data = msg.data;
      if (data.type !== 'post') {
        return;
      }
      var xml = data.xml;
      try {
        if (workspace) {
          workspace.dispose();
          blocklyDiv.innerHTML = '';
        }
      } catch { }

      workspace = Blockly.inject(blocklyDiv, {
        move: {
          scrollbars: true,
          drag: true,
          wheel: false,
        },
        zoom: {
          wheel: true,
          startScale: 2,
        },
        media: 'https://unpkg.com/[email protected]/media/'
      });

      Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(xml), workspace);

      function postChange() {
        try {
          var topBlock = workspace.getTopBlocks()[0];
          workspaceToSvg_(workspace, function (datauri) {
            window.parent.postMessage({
              type: 'svg',
              from: 'scratchblocks',
              text: datauri
            }, '*');
          });
        } catch { }
      }

      workspace.addChangeListener(function (e) {
        if (e.type != 'ui') {
          postChange();
        }
      });

      postChange();
    });
  </script>
</body>

</html>

PHP File Manager