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
f737b3ea
Commit
f737b3ea
authored
Jul 13, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #127 from trodi/master
adding missing type documentation to public fields
parents
64bd9d49
68dbb716
Changes
5
Show 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 @
f737b3ea
...
...
@@ -90,14 +90,23 @@ Blockly.Block.prototype.initialize = function(workspace, prototypeName) {
* @param {string} prototypeName The typename of the block.
*/
Blockly
.
Block
.
prototype
.
fill
=
function
(
workspace
,
prototypeName
)
{
/** @type {?Blockly.Connection} */
this
.
outputConnection
=
null
;
/** @type {?Blockly.Connection} */
this
.
nextConnection
=
null
;
/** @type {?Blockly.Connection} */
this
.
previousConnection
=
null
;
/** @type {Blockly.Input[]} */
this
.
inputList
=
[];
/** @type {?boolean} */
this
.
inputsInline
=
undefined
;
/** @type {boolean} */
this
.
rendered
=
false
;
/** @type {boolean} */
this
.
disabled
=
false
;
/** @type {(string|Function|object)} */
this
.
tooltip
=
''
;
/** @type {boolean} */
this
.
contextMenu
=
true
;
this
.
parentBlock_
=
null
;
...
...
@@ -107,16 +116,21 @@ Blockly.Block.prototype.fill = function(workspace, prototypeName) {
this
.
editable_
=
true
;
this
.
collapsed_
=
false
;
/** @type {?(string|Blockly.Comment)} */
this
.
comment
=
null
;
this
.
xy_
=
new
goog
.
math
.
Coordinate
(
0
,
0
);
/** @type {Blockly.Workspace} */
this
.
workspace
=
workspace
;
/** @type {boolean} */
this
.
isInFlyout
=
workspace
.
isFlyout
;
/** @type {boolean} */
this
.
RTL
=
workspace
.
RTL
;
// Copy the type-specific functions and data from the prototype.
if
(
prototypeName
)
{
/** @type {?string} */
this
.
type
=
prototypeName
;
var
prototype
=
Blockly
.
Blocks
[
prototypeName
];
goog
.
asserts
.
assertObject
(
prototype
,
...
...
@@ -1186,7 +1200,7 @@ Blockly.Block.prototype.removeInput = function(name, opt_quiet) {
/**
* Fetches the named input object.
* @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
)
{
for
(
var
i
=
0
,
input
;
input
=
this
.
inputList
[
i
];
i
++
)
{
...
...
core/connection.js
View file @
f737b3ea
...
...
@@ -38,7 +38,9 @@ goog.require('goog.dom');
*/
Blockly
.
Connection
=
function
(
source
,
type
)
{
this
.
sourceBlock_
=
source
;
/** @type {?Blockly.Connection} */
this
.
targetConnection
=
null
;
/** @type {number} */
this
.
type
=
type
;
this
.
x_
=
0
;
this
.
y_
=
0
;
...
...
core/field.js
View file @
f737b3ea
...
...
@@ -180,7 +180,7 @@ Blockly.Field.prototype.setVisible = function(visible) {
/**
* 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
)
{
this
.
changeHandler_
=
handler
;
...
...
core/field_dropdown.js
View file @
f737b3ea
...
...
@@ -39,7 +39,7 @@ goog.require('goog.userAgent');
/**
* 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.
* @param {Function} opt_changeHandler A function that is executed when a new
* option is selected, with the newly selected value as its sole argument.
...
...
core/input.js
View file @
f737b3ea
...
...
@@ -43,11 +43,16 @@ goog.require('goog.asserts');
* @constructor
*/
Blockly
.
Input
=
function
(
type
,
name
,
block
,
connection
)
{
/** @type {number} */
this
.
type
=
type
;
/** @type {string} */
this
.
name
=
name
;
this
.
sourceBlock_
=
block
;
/** @type {Blockly.Connection} */
this
.
connection
=
connection
;
/** @type {Blockly.Field[]} */
this
.
fieldRow
=
[];
/** @type {number} */
this
.
align
=
Blockly
.
ALIGN_LEFT
;
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