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
68dbb716
Commit
68dbb716
authored
Jul 13, 2015
by
Troy McKinnon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding missing type documentation to public fields
parent
daa7145e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
3 deletions
+24
-3
core/block.js
core/block.js
+15
-1
core/connection.js
core/connection.js
+2
-0
core/field.js
core/field.js
+1
-1
core/field_dropdown.js
core/field_dropdown.js
+1
-1
core/input.js
core/input.js
+5
-0
No files found.
core/block.js
View file @
68dbb716
...
@@ -90,14 +90,23 @@ Blockly.Block.prototype.initialize = function(workspace, prototypeName) {
...
@@ -90,14 +90,23 @@ Blockly.Block.prototype.initialize = function(workspace, prototypeName) {
* @param {string} prototypeName The typename of the block.
* @param {string} prototypeName The typename of the block.
*/
*/
Blockly
.
Block
.
prototype
.
fill
=
function
(
workspace
,
prototypeName
)
{
Blockly
.
Block
.
prototype
.
fill
=
function
(
workspace
,
prototypeName
)
{
/** @type {?Blockly.Connection} */
this
.
outputConnection
=
null
;
this
.
outputConnection
=
null
;
/** @type {?Blockly.Connection} */
this
.
nextConnection
=
null
;
this
.
nextConnection
=
null
;
/** @type {?Blockly.Connection} */
this
.
previousConnection
=
null
;
this
.
previousConnection
=
null
;
/** @type {Blockly.Input[]} */
this
.
inputList
=
[];
this
.
inputList
=
[];
/** @type {?boolean} */
this
.
inputsInline
=
undefined
;
this
.
inputsInline
=
undefined
;
/** @type {boolean} */
this
.
rendered
=
false
;
this
.
rendered
=
false
;
/** @type {boolean} */
this
.
disabled
=
false
;
this
.
disabled
=
false
;
/** @type {(string|Function|object)} */
this
.
tooltip
=
''
;
this
.
tooltip
=
''
;
/** @type {boolean} */
this
.
contextMenu
=
true
;
this
.
contextMenu
=
true
;
this
.
parentBlock_
=
null
;
this
.
parentBlock_
=
null
;
...
@@ -107,16 +116,21 @@ Blockly.Block.prototype.fill = function(workspace, prototypeName) {
...
@@ -107,16 +116,21 @@ Blockly.Block.prototype.fill = function(workspace, prototypeName) {
this
.
editable_
=
true
;
this
.
editable_
=
true
;
this
.
collapsed_
=
false
;
this
.
collapsed_
=
false
;
/** @type {?(string|Blockly.Comment)} */
this
.
comment
=
null
;
this
.
comment
=
null
;
this
.
xy_
=
new
goog
.
math
.
Coordinate
(
0
,
0
);
this
.
xy_
=
new
goog
.
math
.
Coordinate
(
0
,
0
);
/** @type {Blockly.Workspace} */
this
.
workspace
=
workspace
;
this
.
workspace
=
workspace
;
/** @type {boolean} */
this
.
isInFlyout
=
workspace
.
isFlyout
;
this
.
isInFlyout
=
workspace
.
isFlyout
;
/** @type {boolean} */
this
.
RTL
=
workspace
.
RTL
;
this
.
RTL
=
workspace
.
RTL
;
// Copy the type-specific functions and data from the prototype.
// Copy the type-specific functions and data from the prototype.
if
(
prototypeName
)
{
if
(
prototypeName
)
{
/** @type {?string} */
this
.
type
=
prototypeName
;
this
.
type
=
prototypeName
;
var
prototype
=
Blockly
.
Blocks
[
prototypeName
];
var
prototype
=
Blockly
.
Blocks
[
prototypeName
];
goog
.
asserts
.
assertObject
(
prototype
,
goog
.
asserts
.
assertObject
(
prototype
,
...
@@ -1186,7 +1200,7 @@ Blockly.Block.prototype.removeInput = function(name, opt_quiet) {
...
@@ -1186,7 +1200,7 @@ Blockly.Block.prototype.removeInput = function(name, opt_quiet) {
/**
/**
* Fetches the named input object.
* Fetches the named input object.
* @param {string} name The name of the input.
* @param {string} name The name of the input.
* @return {
Objec
t} The input object, or null of the input does not exist.
* @return {
?Blockly.Inpu
t} The input object, or null of the input does not exist.
*/
*/
Blockly
.
Block
.
prototype
.
getInput
=
function
(
name
)
{
Blockly
.
Block
.
prototype
.
getInput
=
function
(
name
)
{
for
(
var
i
=
0
,
input
;
input
=
this
.
inputList
[
i
];
i
++
)
{
for
(
var
i
=
0
,
input
;
input
=
this
.
inputList
[
i
];
i
++
)
{
...
...
core/connection.js
View file @
68dbb716
...
@@ -38,7 +38,9 @@ goog.require('goog.dom');
...
@@ -38,7 +38,9 @@ goog.require('goog.dom');
*/
*/
Blockly
.
Connection
=
function
(
source
,
type
)
{
Blockly
.
Connection
=
function
(
source
,
type
)
{
this
.
sourceBlock_
=
source
;
this
.
sourceBlock_
=
source
;
/** @type {?Blockly.Connection} */
this
.
targetConnection
=
null
;
this
.
targetConnection
=
null
;
/** @type {number} */
this
.
type
=
type
;
this
.
type
=
type
;
this
.
x_
=
0
;
this
.
x_
=
0
;
this
.
y_
=
0
;
this
.
y_
=
0
;
...
...
core/field.js
View file @
68dbb716
...
@@ -180,7 +180,7 @@ Blockly.Field.prototype.setVisible = function(visible) {
...
@@ -180,7 +180,7 @@ Blockly.Field.prototype.setVisible = function(visible) {
/**
/**
* Sets a new change handler for editable fields.
* Sets a new change handler for editable fields.
* @param {Function} handler New change handler, or null.
* @param {
?
Function} handler New change handler, or null.
*/
*/
Blockly
.
Field
.
prototype
.
setChangeHandler
=
function
(
handler
)
{
Blockly
.
Field
.
prototype
.
setChangeHandler
=
function
(
handler
)
{
this
.
changeHandler_
=
handler
;
this
.
changeHandler_
=
handler
;
...
...
core/field_dropdown.js
View file @
68dbb716
...
@@ -39,7 +39,7 @@ goog.require('goog.userAgent');
...
@@ -39,7 +39,7 @@ goog.require('goog.userAgent');
/**
/**
* Class for an editable dropdown field.
* Class for an editable dropdown field.
* @param {(!Array.<
string
>|!Function)} menuGenerator An array of options
* @param {(!Array.<
!Array.<string>
>|!Function)} menuGenerator An array of options
* for a dropdown list, or a function which generates these options.
* for a dropdown list, or a function which generates these options.
* @param {Function} opt_changeHandler A function that is executed when a new
* @param {Function} opt_changeHandler A function that is executed when a new
* option is selected, with the newly selected value as its sole argument.
* option is selected, with the newly selected value as its sole argument.
...
...
core/input.js
View file @
68dbb716
...
@@ -43,11 +43,16 @@ goog.require('goog.asserts');
...
@@ -43,11 +43,16 @@ goog.require('goog.asserts');
* @constructor
* @constructor
*/
*/
Blockly
.
Input
=
function
(
type
,
name
,
block
,
connection
)
{
Blockly
.
Input
=
function
(
type
,
name
,
block
,
connection
)
{
/** @type {number} */
this
.
type
=
type
;
this
.
type
=
type
;
/** @type {string} */
this
.
name
=
name
;
this
.
name
=
name
;
this
.
sourceBlock_
=
block
;
this
.
sourceBlock_
=
block
;
/** @type {Blockly.Connection} */
this
.
connection
=
connection
;
this
.
connection
=
connection
;
/** @type {Blockly.Field[]} */
this
.
fieldRow
=
[];
this
.
fieldRow
=
[];
/** @type {number} */
this
.
align
=
Blockly
.
ALIGN_LEFT
;
this
.
align
=
Blockly
.
ALIGN_LEFT
;
this
.
visible_
=
true
;
this
.
visible_
=
true
;
...
...
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