Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
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
appinventor-sources
Commits
80e1e9d1
Commit
80e1e9d1
authored
Apr 24, 2020
by
Beka Westberg
Committed by
Evan W. Patton
May 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate code in bump
parent
0d585f17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
27 deletions
+8
-27
appinventor/blocklyeditor/src/blocks/text.js
appinventor/blocklyeditor/src/blocks/text.js
+8
-18
appinventor/blocklyeditor/src/warningHandler.js
appinventor/blocklyeditor/src/warningHandler.js
+0
-9
No files found.
appinventor/blocklyeditor/src/blocks/text.js
View file @
80e1e9d1
...
...
@@ -35,11 +35,12 @@ Blockly.Blocks['text'] = {
typeblock
:
[{
translatedName
:
Blockly
.
Msg
.
LANG_CATEGORY_TEXT
}]
};
Blockly
.
Blocks
.
text
.
connectionCheck
=
function
(
myConnection
,
otherConnection
)
{
Blockly
.
Blocks
.
text
.
connectionCheck
=
function
(
myConnection
,
otherConnection
,
opt_value
)
{
var
block
=
myConnection
.
sourceBlock_
;
var
otherTypeArray
=
otherConnection
.
check_
;
var
shouldIgnoreError
=
Blockly
.
mainWorkspace
.
isLoading
;
var
value
=
block
.
getFieldValue
(
'
TEXT
'
);
var
value
=
opt_value
||
block
.
getFieldValue
(
'
TEXT
'
);
for
(
var
i
=
0
;
i
<
otherTypeArray
.
length
;
i
++
)
{
if
(
otherTypeArray
[
i
]
==
"
String
"
)
{
return
true
;
...
...
@@ -69,23 +70,12 @@ Blockly.Blocks.text.bumpBlockOnFinishEdit = function(finalValue) {
if
(
!
connection
)
{
return
;
}
if
(
!
isNaN
(
parseFloat
(
finalValue
)))
{
// Block is a number, so no matter where it lives it is valid.
return
;
// If the connections are no longer compatible.
if
(
!
Blockly
.
Blocks
.
text
.
connectionCheck
(
this
.
outputConnection
,
connection
,
finalValue
))
{
connection
.
disconnect
();
connection
.
sourceBlock_
.
bumpNeighbours_
();
}
var
typeArray
=
connection
.
check_
;
var
length
=
typeArray
.
length
;
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
type
=
typeArray
[
i
];
if
(
type
==
"
String
"
||
type
==
"
Key
"
)
{
// There is another valid type on the connection.
return
;
}
}
connection
.
disconnect
();
connection
.
sourceBlock_
.
bumpNeighbours_
();
}
Blockly
.
Blocks
[
'
text_join
'
]
=
{
...
...
appinventor/blocklyeditor/src/warningHandler.js
View file @
80e1e9d1
...
...
@@ -39,15 +39,6 @@ Blockly.WarningHandler.WarningState = {
ERROR
:
2
};
/**
* Regular expression for floating point numbers.
*
* @type {!RegExp}
* @const
*/
Blockly
.
WarningHandler
.
NUMBER_REGEX
=
new
RegExp
(
"
^[-+]?[0-9]*(
\\
.[0-9]+)?([eE][-+][0-9]+)?$
"
)
/**
* The currently selected index into the array of block IDs with warnings. If nothing has been
* selected (i.e., if we are not stepping through warnings), this should be -1 so that the next
...
...
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