Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update single-direction-scroll-demo xml to json #1769

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 62 additions & 30 deletions examples/single-direction-scroll-demo/index.html
Original file line number Diff line number Diff line change
@@ -1,68 +1,100 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Blockly Demo: Single-direction Scrolling</title>
<script src="./node_modules/blockly/blockly_compressed.js"></script>
<script src="./node_modules/blockly/blocks_compressed.js"></script>
<script src="./node_modules/blockly/msg/en.js"></script>
<style>
html, body {
html,
body {
height: 100%;
margin: 0;
}

.description {
flex: 0 1 auto;
}

.demo {
display: flex;
flex-flow: column;
height: 100%;
}

#blocklyDiv {
flex: 1 1 auto;
}
</style>
</head>

<body>
<div class="demo">
<p class="description">This is a simple demo of configuring single-direction scrollbars.</p>

<div id="blocklyDiv"></div>
</div>

<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display: none">
<block type="controls_if"></block>
<block type="logic_compare"></block>
<block type="controls_repeat_ext"></block>
<block type="math_number">
<field name="NUM">123</field>
</block>
<block type="math_arithmetic"></block>
<block type="text"></block>
<block type="text_print"></block>
</xml>

<script>
var toolbox = {
"kind": "flyoutToolbox",
"contents": [
{
"kind": "block",
"type": "controls_if"
},
{
"kind": "block",
"type": "logic_compare"
},
{
"kind": "block",
"type": "controls_repeat_ext"
},
{
"kind": "block",
"type": "math_number",
"fields": {
"NUM": 123
}
},
{
"kind": "block",
"type": "math_arithmetic"
},
{
"kind": "block",
"type": "text"
},
{
"kind": "block",
"type": "text_print"
}
]
};

var demoWorkspace = Blockly.inject('blocklyDiv',
{
media: './node_modules/blockly/media/',
toolbox: toolbox,
grid:
{
media: './node_modules/blockly/media/',
toolbox: document.getElementById('toolbox'),
grid:
{
spacing: 25,
length: 3,
colour: '#ccc',
snap: true
},
move: {
scrollbars: {
vertical: true,
horizontal: false
}
spacing: 25,
length: 3,
colour: '#ccc',
snap: true
},
move: {
scrollbars: {
vertical: true,
horizontal: false
}
});
}
});
</script>

</body>
</html>
</body>

</html>
Loading