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
11906b75
Commit
11906b75
authored
Nov 10, 2015
by
Troy McKinnon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve type annotations
parent
c7753d4e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
6 deletions
+9
-6
core/block.js
core/block.js
+7
-0
core/block_svg.js
core/block_svg.js
+1
-1
core/connection.js
core/connection.js
+1
-1
core/xml.js
core/xml.js
+0
-4
No files found.
core/block.js
View file @
11906b75
...
@@ -72,6 +72,13 @@ Blockly.Block.obtain = function(workspace, prototypeName) {
...
@@ -72,6 +72,13 @@ Blockly.Block.obtain = function(workspace, prototypeName) {
}
}
};
};
/**
* Optional text data that round-trips beween blocks and XML.
* Has no effect. May be used by 3rd parties for meta information.
* @type {?string}
*/
Blockly
.
Block
.
prototype
.
data
=
null
;
/**
/**
* Initialization for one block.
* Initialization for one block.
* @param {!Blockly.Workspace} workspace The new block's workspace.
* @param {!Blockly.Workspace} workspace The new block's workspace.
...
...
core/block_svg.js
View file @
11906b75
...
@@ -315,7 +315,7 @@ Blockly.BlockSvg.prototype.snapToGrid = function() {
...
@@ -315,7 +315,7 @@ Blockly.BlockSvg.prototype.snapToGrid = function() {
/**
/**
* Returns a bounding box describing the dimensions of this block
* Returns a bounding box describing the dimensions of this block
* and any blocks stacked below it.
* and any blocks stacked below it.
* @return {!
Object
} Object with height and width properties.
* @return {!
{height: number, width: number}
} Object with height and width properties.
*/
*/
Blockly
.
BlockSvg
.
prototype
.
getHeightWidth
=
function
()
{
Blockly
.
BlockSvg
.
prototype
.
getHeightWidth
=
function
()
{
var
height
=
this
.
height
;
var
height
=
this
.
height
;
...
...
core/connection.js
View file @
11906b75
...
@@ -493,7 +493,7 @@ Blockly.Connection.prototype.tighten_ = function() {
...
@@ -493,7 +493,7 @@ Blockly.Connection.prototype.tighten_ = function() {
* in the database and the current location (as a result of dragging).
* in the database and the current location (as a result of dragging).
* @param {number} dy Vertical offset between this connection's location
* @param {number} dy Vertical offset between this connection's location
* in the database and the current location (as a result of dragging).
* in the database and the current location (as a result of dragging).
* @return {!
Object
} Contains two properties: 'connection' which is either
* @return {!
{connection: ?Blockly.Connection, radius: number}
} Contains two properties: 'connection' which is either
* another connection or null, and 'radius' which is the distance.
* another connection or null, and 'radius' which is the distance.
*/
*/
Blockly
.
Connection
.
prototype
.
closest
=
function
(
maxLimit
,
dx
,
dy
)
{
Blockly
.
Connection
.
prototype
.
closest
=
function
(
maxLimit
,
dx
,
dy
)
{
...
...
core/xml.js
View file @
11906b75
...
@@ -99,8 +99,6 @@ Blockly.Xml.blockToDom_ = function(block) {
...
@@ -99,8 +99,6 @@ Blockly.Xml.blockToDom_ = function(block) {
}
}
if
(
block
.
data
)
{
if
(
block
.
data
)
{
// Optional text data that round-trips beween blocks and XML.
// Has no effect. May be used by 3rd parties for meta information.
var
dataElement
=
goog
.
dom
.
createDom
(
'
data
'
,
null
,
block
.
data
);
var
dataElement
=
goog
.
dom
.
createDom
(
'
data
'
,
null
,
block
.
data
);
element
.
appendChild
(
dataElement
);
element
.
appendChild
(
dataElement
);
}
}
...
@@ -428,8 +426,6 @@ Blockly.Xml.domToBlockHeadless_ =
...
@@ -428,8 +426,6 @@ Blockly.Xml.domToBlockHeadless_ =
}
}
break
;
break
;
case
'
data
'
:
case
'
data
'
:
// Optional text data that round-trips beween blocks and XML.
// Has no effect. May be used by 3rd parties for meta information.
block
.
data
=
xmlChild
.
textContent
;
block
.
data
=
xmlChild
.
textContent
;
break
;
break
;
case
'
title
'
:
case
'
title
'
:
...
...
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