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
7339fbf7
Unverified
Commit
7339fbf7
authored
May 07, 2020
by
Beka Westberg
Committed by
GitHub
May 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve "Do It" comments (#2181)
parent
80e1e9d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
+13
-17
appinventor/blocklyeditor/src/msg/en/_messages.js
appinventor/blocklyeditor/src/msg/en/_messages.js
+1
-0
appinventor/blocklyeditor/src/replmgr.js
appinventor/blocklyeditor/src/replmgr.js
+12
-17
No files found.
appinventor/blocklyeditor/src/msg/en/_messages.js
View file @
7339fbf7
...
...
@@ -1623,6 +1623,7 @@ Blockly.Msg.en.switch_language_to_english = {
// Blocklyeditor.js
Blockly
.
Msg
.
GENERATE_YAIL
=
"
Generate Yail
"
;
Blockly
.
Msg
.
DO_IT
=
"
Do It
"
;
Blockly
.
Msg
.
DO_IT_RESULT
=
"
Do It Result:
"
;
Blockly
.
Msg
.
DO_IT_DISCONNECTED
=
'
Do It (Companion not connected)
'
;
Blockly
.
Msg
.
CLEAR_DO_IT_ERROR
=
"
Clear Error
"
;
Blockly
.
Msg
.
CAN_NOT_DO_IT
=
"
Cannot Do it
"
;
...
...
appinventor/blocklyeditor/src/replmgr.js
View file @
7339fbf7
...
...
@@ -1115,27 +1115,22 @@ Blockly.ReplMgr.processRetvals = function(responses) {
};
Blockly
.
ReplMgr
.
setDoitResult
=
function
(
block
,
value
)
{
var
patt
=
/Do It Result:.*
?\n
---
\n
/m
;
var
comment
=
""
;
var
result
=
'
Do It Result:
'
+
value
+
'
\n
---
\n
'
;
var
oldPatt
=
/Do It Result:.*
?\n
---
\n
/m
;
var
patt
=
new
RegExp
(
Blockly
.
Msg
.
DO_IT_RESULT
+
'
.*?
\n
---
\n
'
);
var
result
=
Blockly
.
Msg
.
DO_IT_RESULT
+
'
'
+
value
+
'
\n
---
\n
'
;
var
text
=
""
;
if
(
block
.
comment
)
{
comment
=
block
.
comment
.
getText
(
);
text
=
block
.
comment
.
getText
().
replace
(
oldPatt
,
''
);
}
if
(
!
comment
)
{
comment
=
result
;
if
(
!
text
)
{
text
=
result
;
}
else
if
(
patt
.
test
(
text
))
{
// Already a result there.
text
=
text
.
replace
(
patt
,
result
);
}
else
{
if
(
patt
.
test
(
comment
))
{
// Already a doit there!
comment
=
comment
.
replace
(
patt
,
result
);
}
else
{
comment
=
result
+
comment
;
}
}
// If we don't set visible to false, the comment
// doesn't always change when it should...
if
(
block
.
comment
)
{
block
.
comment
.
setVisible
(
false
);
text
=
result
+
text
;
}
block
.
setCommentText
(
commen
t
);
block
.
setCommentText
(
tex
t
);
block
.
comment
.
setVisible
(
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