mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Merge branch 'develop' into feature/connection_tests
This commit is contained in:
commit
f802899932
5 changed files with 168 additions and 11 deletions
19
tests/jsunit/horizontal_tests.html
Normal file
19
tests/jsunit/horizontal_tests.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Unit Tests for Horizontal Scratch-Blockly</title>
|
||||
<script src="../../blockly_uncompressed_horizontal.js"></script>
|
||||
<script>goog.require('goog.testing.jsunit');</script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="blockly_test.js"></script>
|
||||
<script src="block_test.js"></script>
|
||||
<script src="connection_test.js"></script>
|
||||
<script src="connection_db_test.js"></script>
|
||||
<script src="generator_test.js"></script>
|
||||
<script src="names_test.js"></script>
|
||||
<script src="workspace_test.js"></script>
|
||||
<script src="xml_test.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -2,18 +2,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Unit Tests for Blockly</title>
|
||||
<script src="../../blockly_uncompressed.js"></script>
|
||||
<script>goog.require('goog.testing.jsunit');</script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="blockly_test.js"></script>
|
||||
<script src="block_test.js"></script>
|
||||
<script src="connection_test.js"></script>
|
||||
<script src="connection_db_test.js"></script>
|
||||
<script src="generator_test.js"></script>
|
||||
<script src="names_test.js"></script>
|
||||
<script src="workspace_test.js"></script>
|
||||
<script src="xml_test.js"></script>
|
||||
<a href="./vertical_tests.html">Vertical tests</a>
|
||||
<a href="./horizontal_tests.html">Horizontal tests</a>
|
||||
</body>
|
||||
</html>
|
||||
|
|
19
tests/jsunit/vertical_tests.html
Normal file
19
tests/jsunit/vertical_tests.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Unit Tests for Vertical Scratch-Blockly</title>
|
||||
<script src="../../blockly_uncompressed_vertical.js"></script>
|
||||
<script>goog.require('goog.testing.jsunit');</script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="blockly_test.js"></script>
|
||||
<script src="block_test.js"></script>
|
||||
<script src="connection_test.js"></script>
|
||||
<script src="generator_test.js"></script>
|
||||
<script src="connection_db_test.js"></script>
|
||||
<script src="names_test.js"></script>
|
||||
<script src="workspace_test.js"></script>
|
||||
<script src="xml_test.js"></script>
|
||||
</body>
|
||||
</html>
|
BIN
tests/spec.png
Normal file
BIN
tests/spec.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 74 KiB |
128
tests/spectool.html
Normal file
128
tests/spectool.html
Normal file
|
@ -0,0 +1,128 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Spec tool</title>
|
||||
<script src="../blockly_uncompressed_horizontal.js"></script>
|
||||
<script src="../generators/javascript.js"></script>
|
||||
<script src="../generators/javascript/control.js"></script>
|
||||
<script src="../generators/javascript/looks.js"></script>
|
||||
<script src="../generators/javascript/math.js"></script>
|
||||
<script src="../generators/javascript/motion.js"></script>
|
||||
<script src="../generators/javascript/event.js"></script>
|
||||
<script src="../msg/messages.js"></script>
|
||||
<script src="../blocks/math.js"></script>
|
||||
<script src="../blocks/text.js"></script>
|
||||
<script src="../blocks_horizontal/control.js"></script>
|
||||
<script src="../blocks_horizontal/event.js"></script>
|
||||
<script src="../blocks_horizontal/looks.js"></script>
|
||||
<script src="../blocks_horizontal/motion.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
// Depending on the URL argument, render as LTR or RTL.
|
||||
var rtl = (document.location.search == '?rtl');
|
||||
var workspace = null;
|
||||
|
||||
function start() {
|
||||
var toolbox = document.getElementById('toolbox');
|
||||
workspace = Blockly.inject('blocklyDiv', {
|
||||
comments: false,
|
||||
disable: false,
|
||||
collapse: false,
|
||||
maxBlocks: Infinity,
|
||||
media: '../media/',
|
||||
readOnly: false,
|
||||
rtl: rtl,
|
||||
scrollbars: true,
|
||||
toolbox: toolbox,
|
||||
trashcan: true,
|
||||
horizontalLayout: true,
|
||||
toolboxPosition: 'start',
|
||||
zoom: {
|
||||
controls: true,
|
||||
wheel: false,
|
||||
startScale: 8.0,
|
||||
maxScale: 10,
|
||||
minScale: 0.25,
|
||||
scaleSpeed: 1.1
|
||||
},
|
||||
grid:
|
||||
{spacing: 4,
|
||||
length: 50,
|
||||
colour: '#ccc',
|
||||
snap: false},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
#blocklyDiv {
|
||||
float: right;
|
||||
height: 95%;
|
||||
width: 90%;
|
||||
}
|
||||
.blocklySvg {
|
||||
background-image: url(./spec.png) !important;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.blocklyWorkspace {
|
||||
opacity: .8;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="start()">
|
||||
|
||||
<div id="blocklyDiv"></div>
|
||||
|
||||
<xml id="toolbox" style="display: none">
|
||||
<category name="Looks">
|
||||
<block type="looks_say">
|
||||
<value name="MESSAGE">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Hey!</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
<category name="Events">
|
||||
<block type="event_whenflagclicked"></block>
|
||||
</category>
|
||||
<category name="Motion">
|
||||
<block type="motion_moveright"></block>
|
||||
</category>
|
||||
<!-- <block type="control_repeat"></block> -->
|
||||
<category name="Pants">
|
||||
<block type="control_forever"></block>
|
||||
<block type="control_repeat">
|
||||
<value name="TIMES">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
</xml>
|
||||
|
||||
<h1>Spec tool!</h1>
|
||||
|
||||
<script>
|
||||
if (rtl) {
|
||||
document.write('[ ← RTL. Switch to <A HREF="?ltr">LTR</A>. ]');
|
||||
} else {
|
||||
document.write('[ → LTR. Switch to <A HREF="?rtl">RTL</A>. ]');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue