chore(demos): delete more duplicated demos (#6067)
* chore(demos): delete headless demo * chore(demos): delete mirror demo * chore(demos): delete resizable demo * chore(demos): delete rtl demo * chore(demos): delete toolbox demo * chore(demos): delete link to old accessibility experiment * chore(demos): delete keyboard nav demo * chore(demos): Update text on demo index page to poitn to blockly-samples
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Refresh" content="0; url=https://github.com/google/blockly-experimental">
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<p>This demo has moved to a <a href="https://github.com/google/blockly-experimental">new repository</a>.</p>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,120 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Headless</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../python_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
height: 20em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Headless</h1>
|
||||
|
||||
<p>This is a simple demo of generating Python code from XML with no graphics.
|
||||
This might be useful for server-side code generation.</p>
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width:50%">
|
||||
<textarea id="xml_input">
|
||||
<xml xmlns="https://developers.google.com/blockly/xml">
|
||||
<block type="controls_if" inline="false" x="20" y="20">
|
||||
<mutation else="1"></mutation>
|
||||
<value name="IF0">
|
||||
<block type="logic_compare" inline="true">
|
||||
<field name="OP">EQ</field>
|
||||
<value name="A">
|
||||
<block type="math_arithmetic" inline="true">
|
||||
<field name="OP">MULTIPLY</field>
|
||||
<value name="A">
|
||||
<block type="math_number">
|
||||
<field name="NUM">6</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="B">
|
||||
<block type="math_number">
|
||||
<field name="NUM">7</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
<value name="B">
|
||||
<block type="math_number">
|
||||
<field name="NUM">42</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
<statement name="DO0">
|
||||
<block type="text_print" inline="false">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT">Don't panic</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</statement>
|
||||
<statement name="ELSE">
|
||||
<block type="text_print" inline="false">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT">Panic</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</statement>
|
||||
</block>
|
||||
</xml>
|
||||
</textarea>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td style="width:50%">
|
||||
<textarea id="code_output" readonly></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center">
|
||||
<button onclick="generate()">Generate Python ⤴</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function generate() {
|
||||
// Parse the XML into a tree.
|
||||
var xmlText = document.getElementById('xml_input').value;
|
||||
try {
|
||||
var xml = Blockly.Xml.textToDom(xmlText);
|
||||
} catch (e) {
|
||||
alert(e);
|
||||
return;
|
||||
}
|
||||
// Create a headless workspace.
|
||||
var demoWorkspace = new Blockly.Workspace();
|
||||
Blockly.Xml.domToWorkspace(xml, demoWorkspace);
|
||||
var code = Blockly.Python.workspaceToCode(demoWorkspace);
|
||||
document.getElementById('code_output').value = code;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -24,58 +24,10 @@
|
||||
<body>
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> > Demos</h1>
|
||||
|
||||
<p>These demos are intended for developers who want to integrate Blockly with
|
||||
their own applications.</p>
|
||||
<p>Check out the <a href="https://google.github.io/blockly-samples/">Blockly samples page</a> for a comprehensive list of demos for developers who want to integrate Blockly into their own applications.</p>
|
||||
<p>The demos on this page combine Blockly features and AppEngine storage.</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="resizable/index.html">
|
||||
<img src="resizable/icon.png" height=80 width=100>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div><a href="resizable/index.html">Resizable Blockly</a></div>
|
||||
<div>Inject Blockly into a page as a resizable element.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="toolbox/index.html">
|
||||
<img src="toolbox/icon.png" height=80 width=100>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div><a href="toolbox/index.html">Defining the Toolbox</a></div>
|
||||
<div>Organize blocks into categories for the user.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="headless/index.html">
|
||||
<img src="headless/icon.png" height=80 width=100>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div><a href="headless/index.html">Headless</a></div>
|
||||
<div>Generate code from XML without graphics.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="rtl/index.html">
|
||||
<img src="rtl/icon.png" height=80 width=100>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div><a href="rtl/index.html">RTL</a></div>
|
||||
<div>See what Blockly looks like in right-to-left mode (for Arabic and Hebrew).</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="storage/index.html">
|
||||
@@ -88,30 +40,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="mirror/index.html">
|
||||
<img src="mirror/icon.png" height=80 width=100>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div><a href="mirror/index.html">Mirrored Blockly</a></div>
|
||||
<div>Two Blockly instances connected as leader-follower.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="accessible/index.html">
|
||||
<img src="accessible/icon.png" height=80 width=100>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div><a href="accessible/index.html">Accessible Blockly</a></div>
|
||||
<div>Version of Blockly accessible to screen readers.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="code/index.html">
|
||||
@@ -135,17 +63,6 @@
|
||||
<div>Build custom blocks and setup a toolbox using Blockly.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="keyboard_nav/index.html">
|
||||
<img src="keyboard_nav/icon.png" height=80 width=150>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div><a href="keyboard_nav/index.html">Keyboard Navigation</a></div>
|
||||
<div>Demos keyboard navigation.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,8 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Redirecting...</title>
|
||||
<meta http-equiv="refresh" content="0;URL='https://google.github.io/blockly-samples/plugins/keyboard-navigation/test/'"/>
|
||||
</head>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,81 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Mirrored Blockly</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Mirrored Blockly</h1>
|
||||
|
||||
<p>This is a simple demo of a primary Blockly instance that controls a secondary Blockly instance with events.
|
||||
Open the JavaScript console to see the event passing.</p>
|
||||
|
||||
<p>→ More info on <a href="https://developers.google.com/blockly/guides/configure/web/events">events</a>…</p>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<div id="primaryDiv" style="height: 480px; width: 600px;"></div>
|
||||
</td>
|
||||
<td>
|
||||
<div id="secondaryDiv" style="height: 480px; width: 430px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<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>
|
||||
<block type="variables_get"><field name="VAR">i</field></block>
|
||||
<block type="variables_get"><field name="VAR">j</field></block>
|
||||
<block type="variables_get"><field name="VAR">k</field></block>
|
||||
</xml>
|
||||
|
||||
<script>
|
||||
// Inject primary workspace.
|
||||
var primaryWorkspace = Blockly.inject('primaryDiv',
|
||||
{media: '../../media/',
|
||||
toolbox: document.getElementById('toolbox')});
|
||||
// Inject secondary workspace.
|
||||
var secondaryWorkspace = Blockly.inject('secondaryDiv',
|
||||
{media: '../../media/',
|
||||
readOnly: true});
|
||||
// Listen to events on primary workspace.
|
||||
primaryWorkspace.addChangeListener(mirrorEvent);
|
||||
|
||||
function mirrorEvent(primaryEvent) {
|
||||
if (primaryEvent instanceof Blockly.Events.Ui) {
|
||||
return; // Don't mirror UI events.
|
||||
}
|
||||
// Convert event to JSON. This could then be transmitted across the net.
|
||||
var json = primaryEvent.toJson();
|
||||
console.log(json);
|
||||
// Convert JSON back into an event, then execute it.
|
||||
var secondaryEvent = Blockly.Events.fromJson(json, secondaryWorkspace);
|
||||
secondaryEvent.run(true);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -1,52 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Resizable Blockly (Part 1)</title>
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
table {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
#blocklyArea {
|
||||
height: 99%;
|
||||
background: #fc9;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Resizable Blockly (Part 1)</h1>
|
||||
|
||||
<p>The first step in creating a resizable Blockly workspace is to use
|
||||
CSS or tables to create an area for it.
|
||||
Next, <a href="overlay.html">inject Blockly</a> over that area.</p>
|
||||
|
||||
<p>→ More info on <a href="https://developers.google.com/blockly/guides/configure/web/resizable">injecting resizable Blockly</a>…</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="blocklyArea">
|
||||
Blockly will be positioned here.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,96 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Resizable Blockly (Part 2)</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
table {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
#blocklyArea {
|
||||
height: 99%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Resizable Blockly (Part 2)</h1>
|
||||
|
||||
<p>
|
||||
Once an <a href="index.html">area is defined</a>, Blockly can be
|
||||
injected and positioned over the area.
|
||||
A resize handler keeps it in position as the page changes.
|
||||
</p>
|
||||
|
||||
<p>→ More info on <a href="https://developers.google.com/blockly/guides/configure/web/resizable">injecting resizable Blockly</a>…</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="blocklyArea">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="blocklyDiv" style="position: absolute"></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 blocklyArea = document.getElementById('blocklyArea');
|
||||
var blocklyDiv = document.getElementById('blocklyDiv');
|
||||
var demoWorkspace = Blockly.inject(blocklyDiv,
|
||||
{media: '../../media/',
|
||||
toolbox: document.getElementById('toolbox')});
|
||||
var onresize = function(e) {
|
||||
// Compute the absolute coordinates and dimensions of blocklyArea.
|
||||
var element = blocklyArea;
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
do {
|
||||
x += element.offsetLeft;
|
||||
y += element.offsetTop;
|
||||
element = element.offsetParent;
|
||||
} while (element);
|
||||
// Position blocklyDiv over blocklyArea.
|
||||
blocklyDiv.style.left = x + 'px';
|
||||
blocklyDiv.style.top = y + 'px';
|
||||
blocklyDiv.style.width = blocklyArea.offsetWidth + 'px';
|
||||
blocklyDiv.style.height = blocklyArea.offsetHeight + 'px';
|
||||
Blockly.svgResize(demoWorkspace);
|
||||
};
|
||||
window.addEventListener('resize', onresize, false);
|
||||
onresize();
|
||||
Blockly.svgResize(demoWorkspace);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,210 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<title>Blockly Demo: RTL</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../msg/js/ar.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
#blocklyDiv {
|
||||
height: 600px;
|
||||
width: 800px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function init() {
|
||||
var demoWorkspace = Blockly.inject('blocklyDiv',
|
||||
{media: '../../media/',
|
||||
rtl: true,
|
||||
toolbox: document.getElementById('toolbox')});
|
||||
Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'),
|
||||
demoWorkspace);
|
||||
//window.onbeforeunload = function() {
|
||||
// return 'Leaving this page will result in the loss of your work.';
|
||||
//};
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Right-to-Left</h1>
|
||||
|
||||
<div id="blocklyDiv"></div>
|
||||
|
||||
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display: none">
|
||||
<category name="منطق" colour="%{BKY_LOGIC_HUE}">
|
||||
<block type="controls_if"></block>
|
||||
<block type="logic_compare"></block>
|
||||
<block type="logic_operation"></block>
|
||||
<block type="logic_negate"></block>
|
||||
<block type="logic_boolean"></block>
|
||||
<block type="logic_null"></block>
|
||||
<block type="logic_ternary"></block>
|
||||
</category>
|
||||
<category name="الحلقات" colour="%{BKY_LOOPS_HUE}">
|
||||
<block type="controls_repeat_ext">
|
||||
<value name="TIMES">
|
||||
<block type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="controls_whileUntil"></block>
|
||||
<block type="controls_for">
|
||||
<value name="FROM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="BY">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="controls_forEach"></block>
|
||||
<block type="controls_flow_statements"></block>
|
||||
</category>
|
||||
<category name="رياضيات" colour="%{BKY_MATH_HUE}">
|
||||
<block type="math_number">
|
||||
<field name="NUM">123</field>
|
||||
</block>
|
||||
<block type="math_arithmetic"></block>
|
||||
<block type="math_single"></block>
|
||||
<block type="math_trig"></block>
|
||||
<block type="math_constant"></block>
|
||||
<block type="math_number_property"></block>
|
||||
<block type="math_round"></block>
|
||||
<block type="math_on_list"></block>
|
||||
<block type="math_modulo"></block>
|
||||
<block type="math_constrain">
|
||||
<value name="LOW">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="HIGH">
|
||||
<block type="math_number">
|
||||
<field name="NUM">100</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="math_random_int">
|
||||
<value name="FROM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="math_number">
|
||||
<field name="NUM">100</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="math_random_float"></block>
|
||||
<block type="math_atan2"></block>
|
||||
</category>
|
||||
<category name="نص" colour="%{BKY_TEXTS_HUE}">
|
||||
<block type="text"></block>
|
||||
<block type="text_join"></block>
|
||||
<block type="text_append">
|
||||
<value name="TEXT">
|
||||
<block type="text"></block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="text_length"></block>
|
||||
<block type="text_isEmpty"></block>
|
||||
<block type="text_indexOf"></block>
|
||||
<block type="text_charAt"></block>
|
||||
<block type="text_changeCase"></block>
|
||||
<block type="text_trim"></block>
|
||||
<block type="text_print"></block>
|
||||
<block type="text_prompt_ext">
|
||||
<value name="TEXT">
|
||||
<block type="text"></block>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
<category name="قوائم" colour="%{BKY_LISTS_HUE}">
|
||||
<block type="lists_create_empty"></block>
|
||||
<block type="lists_create_with"></block>
|
||||
<block type="lists_repeat">
|
||||
<value name="NUM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">5</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="lists_length"></block>
|
||||
<block type="lists_isEmpty"></block>
|
||||
<block type="lists_indexOf"></block>
|
||||
<block type="lists_getIndex"></block>
|
||||
<block type="lists_setIndex"></block>
|
||||
</category>
|
||||
<category name="لون" colour="%{BKY_COLOUR_HUE}">
|
||||
<block type="colour_picker"></block>
|
||||
<block type="colour_rgb"></block>
|
||||
<block type="colour_blend"></block>
|
||||
</category>
|
||||
<sep></sep>
|
||||
<category name="متغيرات" custom="VARIABLE" colour="%{BKY_VARIABLES_HUE}">
|
||||
</category>
|
||||
<category name="إجراءات" custom="PROCEDURE" colour="%{BKY_PROCEDURES_HUE}">
|
||||
</category>
|
||||
</xml>
|
||||
|
||||
<xml xmlns="https://developers.google.com/blockly/xml" id="startBlocks" style="display: none">
|
||||
<block type="controls_if" inline="false" x="50" y="50">
|
||||
<value name="IF0">
|
||||
<block type="logic_compare" inline="true">
|
||||
<field name="OP">LT</field>
|
||||
<value name="A">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">x</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="B">
|
||||
<block type="math_number">
|
||||
<field name="NUM">256</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
<statement name="DO0">
|
||||
<block type="variables_set" inline="false">
|
||||
<field name="VAR">x</field>
|
||||
<value name="VALUE">
|
||||
<block type="math_number">
|
||||
<field name="NUM">0</field>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="text_print" inline="false">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT">أكثر من لعبة</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</statement>
|
||||
</block>
|
||||
</xml>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
@@ -1,349 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Toolbox</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Toolbox</h1>
|
||||
|
||||
<p>This is a demo of a complex category structure for the toolbox.</p>
|
||||
|
||||
<p>→ More info on the <a href="https://developers.google.com/blockly/guides/configure/web/toolbox">Toolbox</a>…</p>
|
||||
|
||||
<div id="blocklyDiv" style="height: 600px; width: 800px;"></div>
|
||||
|
||||
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display: none">
|
||||
<category name="Logic" colour="%{BKY_LOGIC_HUE}">
|
||||
<category name="If">
|
||||
<block type="controls_if"></block>
|
||||
<block type="controls_if">
|
||||
<mutation else="1"></mutation>
|
||||
</block>
|
||||
<block type="controls_if">
|
||||
<mutation elseif="1" else="1"></mutation>
|
||||
</block>
|
||||
</category>
|
||||
<category name="Boolean" colour="%{BKY_LOGIC_HUE}">
|
||||
<block type="logic_compare"></block>
|
||||
<block type="logic_operation"></block>
|
||||
<block type="logic_negate"></block>
|
||||
<block type="logic_boolean"></block>
|
||||
<block type="logic_null"></block>
|
||||
<block type="logic_ternary"></block>
|
||||
</category>
|
||||
</category>
|
||||
<category name="Loops" colour="%{BKY_LOOPS_HUE}">
|
||||
<block type="controls_repeat_ext">
|
||||
<value name="TIMES">
|
||||
<block type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="controls_whileUntil"></block>
|
||||
<block type="controls_for">
|
||||
<field name="VAR">i</field>
|
||||
<value name="FROM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="BY">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="controls_forEach"></block>
|
||||
<block type="controls_flow_statements"></block>
|
||||
</category>
|
||||
<category name="Math" colour="%{BKY_MATH_HUE}">
|
||||
<block type="math_number">
|
||||
<field name="NUM">123</field>
|
||||
</block>
|
||||
<block type="math_arithmetic"></block>
|
||||
<block type="math_single"></block>
|
||||
<block type="math_trig"></block>
|
||||
<block type="math_constant"></block>
|
||||
<block type="math_number_property"></block>
|
||||
<block type="math_round"></block>
|
||||
<block type="math_on_list"></block>
|
||||
<block type="math_modulo"></block>
|
||||
<block type="math_constrain">
|
||||
<value name="LOW">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="HIGH">
|
||||
<block type="math_number">
|
||||
<field name="NUM">100</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="math_random_int">
|
||||
<value name="FROM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="math_number">
|
||||
<field name="NUM">100</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="math_random_float"></block>
|
||||
<block type="math_atan2"></block>
|
||||
</category>
|
||||
<category name="Lists" colour="%{BKY_LISTS_HUE}">
|
||||
<block type="lists_create_empty"></block>
|
||||
<block type="lists_create_with"></block>
|
||||
<block type="lists_repeat">
|
||||
<value name="NUM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">5</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="lists_length"></block>
|
||||
<block type="lists_isEmpty"></block>
|
||||
<block type="lists_indexOf"></block>
|
||||
<block type="lists_getIndex"></block>
|
||||
<block type="lists_setIndex"></block>
|
||||
</category>
|
||||
<sep></sep>
|
||||
<category name="Variables" custom="VARIABLE" colour="%{BKY_VARIABLES_HUE}">
|
||||
</category>
|
||||
<category name="Functions" custom="PROCEDURE" colour="%{BKY_PROCEDURES_HUE}">
|
||||
</category>
|
||||
<sep></sep>
|
||||
<category name="Library" expanded="true">
|
||||
<category name="Randomize">
|
||||
<block type="procedures_defnoreturn">
|
||||
<mutation>
|
||||
<arg name="list"></arg>
|
||||
</mutation>
|
||||
<field name="NAME">randomize</field>
|
||||
<statement name="STACK">
|
||||
<block type="controls_for" inline="true">
|
||||
<field name="VAR">x</field>
|
||||
<value name="FROM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="lists_length" inline="false">
|
||||
<value name="VALUE">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">list</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
<value name="BY">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<statement name="DO">
|
||||
<block type="variables_set" inline="false">
|
||||
<field name="VAR">y</field>
|
||||
<value name="VALUE">
|
||||
<block type="math_random_int" inline="true">
|
||||
<value name="FROM">
|
||||
<block type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="lists_length" inline="false">
|
||||
<value name="VALUE">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">list</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="variables_set" inline="false">
|
||||
<field name="VAR">temp</field>
|
||||
<value name="VALUE">
|
||||
<block type="lists_getIndex" inline="true">
|
||||
<mutation statement="false" at="true"></mutation>
|
||||
<field name="MODE">GET</field>
|
||||
<field name="WHERE">FROM_START</field>
|
||||
<value name="AT">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">y</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="VALUE">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">list</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="lists_setIndex" inline="false">
|
||||
<value name="AT">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">y</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="LIST">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">list</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="lists_getIndex" inline="true">
|
||||
<mutation statement="false" at="true"></mutation>
|
||||
<field name="MODE">GET</field>
|
||||
<field name="WHERE">FROM_START</field>
|
||||
<value name="AT">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">x</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="VALUE">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">list</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="lists_setIndex" inline="false">
|
||||
<value name="AT">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">x</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="LIST">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">list</field>
|
||||
</block>
|
||||
</value>
|
||||
<value name="TO">
|
||||
<block type="variables_get">
|
||||
<field name="VAR">temp</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</statement>
|
||||
</block>
|
||||
</statement>
|
||||
</block>
|
||||
</category>
|
||||
<category name="Jabberwocky">
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT">'Twas brillig, and the slithy toves</field>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT"> Did gyre and gimble in the wabe:</field>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT">All mimsy were the borogroves,</field>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT"> And the mome raths outgrabe.</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT">"Beware the Jabberwock, my son!</field>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT"> The jaws that bite, the claws that catch!</field>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT">Beware the Jubjub bird, and shun</field>
|
||||
</block>
|
||||
</value>
|
||||
<next>
|
||||
<block type="text_print">
|
||||
<value name="TEXT">
|
||||
<block type="text">
|
||||
<field name="TEXT"> The frumious Bandersnatch!"</field>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</next>
|
||||
</block>
|
||||
</category>
|
||||
</category>
|
||||
</xml>
|
||||
|
||||
<script>
|
||||
var demoWorkspace = Blockly.inject('blocklyDiv',
|
||||
{media: '../../media/',
|
||||
toolbox: document.getElementById('toolbox')});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||