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
1b43699a
Commit
1b43699a
authored
Sep 12, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use prototypes for Connection properties.
parent
58db7735
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
core/connection.js
core/connection.js
+34
-5
No files found.
core/connection.js
View file @
1b43699a
...
@@ -39,18 +39,47 @@ goog.require('goog.dom');
...
@@ -39,18 +39,47 @@ goog.require('goog.dom');
Blockly
.
Connection
=
function
(
source
,
type
)
{
Blockly
.
Connection
=
function
(
source
,
type
)
{
/** @type {!Blockly.Block} */
/** @type {!Blockly.Block} */
this
.
sourceBlock_
=
source
;
this
.
sourceBlock_
=
source
;
/** @type {Blockly.Connection} */
this
.
targetConnection
=
null
;
/** @type {number} */
/** @type {number} */
this
.
type
=
type
;
this
.
type
=
type
;
this
.
x_
=
0
;
this
.
y_
=
0
;
// Shortcut for the databases for this connection's workspace.
// Shortcut for the databases for this connection's workspace.
this
.
dbList_
=
source
.
workspace
.
connectionDBList
;
this
.
dbList_
=
source
.
workspace
.
connectionDBList
;
this
.
hidden_
=
!
this
.
dbList_
;
this
.
hidden_
=
!
this
.
dbList_
;
this
.
inDB_
=
false
;
};
};
/**
* Connection this connection connects to. Null if not connected.
* @type {Blockly.Connection}
*/
Blockly
.
Connection
.
prototype
.
targetConnection
=
null
;
/**
* List of compatible value types. Null if all types are compatible.
* @private
* @type {Array}
*/
Blockly
.
Connection
.
prototype
.
check_
=
null
;
/**
* Horizontal location of this connection.
* @private
* @type {number}
*/
Blockly
.
Connection
.
prototype
.
x_
=
0
;
/**
* Vertical location of this connection.
* @private
* @type {number}
*/
Blockly
.
Connection
.
prototype
.
y_
=
0
;
/**
* Has this connection been added to the connection database?
* @private
* @type {boolean}
*/
Blockly
.
Connection
.
prototype
.
inDB_
=
false
;
/**
/**
* Sever all links to this connection (not including from the source object).
* Sever all links to this connection (not including from the source object).
*/
*/
...
...
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