Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
535b4202
Commit
535b4202
authored
Aug 24, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert 5 blocks to JSON.
No functional change.
parent
20820b58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
33 deletions
+52
-33
blocks/colour.js
blocks/colour.js
+21
-12
blocks/lists.js
blocks/lists.js
+7
-6
blocks/logic.js
blocks/logic.js
+24
-15
No files found.
blocks/colour.js
View file @
535b4202
...
@@ -40,12 +40,20 @@ Blockly.Blocks['colour_picker'] = {
...
@@ -40,12 +40,20 @@ Blockly.Blocks['colour_picker'] = {
* @this Blockly.Block
* @this Blockly.Block
*/
*/
init
:
function
()
{
init
:
function
()
{
this
.
setHelpUrl
(
Blockly
.
Msg
.
COLOUR_PICKER_HELPURL
);
this
.
jsonInit
({
this
.
setColour
(
Blockly
.
Blocks
.
colour
.
HUE
);
"
message0
"
:
"
%1
"
,
this
.
appendDummyInput
()
"
args0
"
:
[
.
appendField
(
new
Blockly
.
FieldColour
(
'
#ff0000
'
),
'
COLOUR
'
);
{
this
.
setOutput
(
true
,
'
Colour
'
);
"
type
"
:
"
field_colour
"
,
this
.
setTooltip
(
Blockly
.
Msg
.
COLOUR_PICKER_TOOLTIP
);
"
name
"
:
"
COLOUR
"
,
"
colour
"
:
"
#ff0000
"
}
],
"
output
"
:
"
Colour
"
,
"
colour
"
:
Blockly
.
Blocks
.
colour
.
HUE
,
"
tooltip
"
:
Blockly
.
Msg
.
COLOUR_PICKER_TOOLTIP
,
"
helpUrl
"
:
Blockly
.
Msg
.
COLOUR_PICKER_HELPURL
});
}
}
};
};
...
@@ -55,12 +63,13 @@ Blockly.Blocks['colour_random'] = {
...
@@ -55,12 +63,13 @@ Blockly.Blocks['colour_random'] = {
* @this Blockly.Block
* @this Blockly.Block
*/
*/
init
:
function
()
{
init
:
function
()
{
this
.
setHelpUrl
(
Blockly
.
Msg
.
COLOUR_RANDOM_HELPURL
);
this
.
jsonInit
({
this
.
setColour
(
Blockly
.
Blocks
.
colour
.
HUE
);
"
message0
"
:
Blockly
.
Msg
.
COLOUR_RANDOM_TITLE
,
this
.
appendDummyInput
()
"
output
"
:
"
Colour
"
,
.
appendField
(
Blockly
.
Msg
.
COLOUR_RANDOM_TITLE
);
"
colour
"
:
Blockly
.
Blocks
.
colour
.
HUE
,
this
.
setOutput
(
true
,
'
Colour
'
);
"
tooltip
"
:
Blockly
.
Msg
.
COLOUR_RANDOM_TOOLTIP
,
this
.
setTooltip
(
Blockly
.
Msg
.
COLOUR_RANDOM_TOOLTIP
);
"
helpUrl
"
:
Blockly
.
Msg
.
COLOUR_RANDOM_HELPURL
});
}
}
};
};
...
...
blocks/lists.js
View file @
535b4202
...
@@ -40,12 +40,13 @@ Blockly.Blocks['lists_create_empty'] = {
...
@@ -40,12 +40,13 @@ Blockly.Blocks['lists_create_empty'] = {
* @this Blockly.Block
* @this Blockly.Block
*/
*/
init
:
function
()
{
init
:
function
()
{
this
.
setHelpUrl
(
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_HELPURL
);
this
.
jsonInit
({
this
.
setColour
(
Blockly
.
Blocks
.
lists
.
HUE
);
"
message0
"
:
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_TITLE
,
this
.
setOutput
(
true
,
'
Array
'
);
"
output
"
:
"
Array
"
,
this
.
appendDummyInput
()
"
colour
"
:
Blockly
.
Blocks
.
lists
.
HUE
,
.
appendField
(
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_TITLE
);
"
tooltip
"
:
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_TOOLTIP
,
this
.
setTooltip
(
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_TOOLTIP
);
"
helpUrl
"
:
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_HELPURL
});
}
}
};
};
...
...
blocks/logic.js
View file @
535b4202
...
@@ -389,15 +389,23 @@ Blockly.Blocks['logic_boolean'] = {
...
@@ -389,15 +389,23 @@ Blockly.Blocks['logic_boolean'] = {
* @this Blockly.Block
* @this Blockly.Block
*/
*/
init
:
function
()
{
init
:
function
()
{
var
BOOLEANS
=
this
.
jsonInit
({
[[
Blockly
.
Msg
.
LOGIC_BOOLEAN_TRUE
,
'
TRUE
'
],
"
message0
"
:
"
%1
"
,
[
Blockly
.
Msg
.
LOGIC_BOOLEAN_FALSE
,
'
FALSE
'
]];
"
args0
"
:
[
this
.
setHelpUrl
(
Blockly
.
Msg
.
LOGIC_BOOLEAN_HELPURL
);
{
this
.
setColour
(
Blockly
.
Blocks
.
logic
.
HUE
);
"
type
"
:
"
field_dropdown
"
,
this
.
setOutput
(
true
,
'
Boolean
'
);
"
name
"
:
"
BOOL
"
,
this
.
appendDummyInput
()
"
options
"
:
[
.
appendField
(
new
Blockly
.
FieldDropdown
(
BOOLEANS
),
'
BOOL
'
);
[
Blockly
.
Msg
.
LOGIC_BOOLEAN_TRUE
,
"
TRUE
"
],
this
.
setTooltip
(
Blockly
.
Msg
.
LOGIC_BOOLEAN_TOOLTIP
);
[
Blockly
.
Msg
.
LOGIC_BOOLEAN_FALSE
,
"
FALSE
"
]
]
}
],
"
output
"
:
"
Boolean
"
,
"
colour
"
:
Blockly
.
Blocks
.
logic
.
HUE
,
"
tooltip
"
:
Blockly
.
Msg
.
LOGIC_BOOLEAN_TOOLTIP
,
"
helpUrl
"
:
Blockly
.
Msg
.
LOGIC_BOOLEAN_HELPURL
});
}
}
};
};
...
@@ -407,12 +415,13 @@ Blockly.Blocks['logic_null'] = {
...
@@ -407,12 +415,13 @@ Blockly.Blocks['logic_null'] = {
* @this Blockly.Block
* @this Blockly.Block
*/
*/
init
:
function
()
{
init
:
function
()
{
this
.
setHelpUrl
(
Blockly
.
Msg
.
LOGIC_NULL_HELPURL
);
this
.
jsonInit
({
this
.
setColour
(
Blockly
.
Blocks
.
logic
.
HUE
);
"
message0
"
:
Blockly
.
Msg
.
LOGIC_NULL
,
this
.
setOutput
(
true
);
"
output
"
:
null
,
this
.
appendDummyInput
()
"
colour
"
:
Blockly
.
Blocks
.
logic
.
HUE
,
.
appendField
(
Blockly
.
Msg
.
LOGIC_NULL
);
"
tooltip
"
:
Blockly
.
Msg
.
LOGIC_NULL_TOOLTIP
,
this
.
setTooltip
(
Blockly
.
Msg
.
LOGIC_NULL_TOOLTIP
);
"
helpUrl
"
:
Blockly
.
Msg
.
LOGIC_NULL_HELPURL
});
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment