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
50a1371f
Commit
50a1371f
authored
Mar 22, 2019
by
hsun1316
Committed by
Evan W. Patton
Mar 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add menu option to hide workspace controls
parent
4241d37c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
appinventor/blocklyeditor/src/msg/en/_messages.js
appinventor/blocklyeditor/src/msg/en/_messages.js
+2
-0
appinventor/blocklyeditor/src/workspace_svg.js
appinventor/blocklyeditor/src/workspace_svg.js
+19
-0
No files found.
appinventor/blocklyeditor/src/msg/en/_messages.js
View file @
50a1371f
...
@@ -44,6 +44,8 @@ Blockly.Msg.en.switch_language_to_english = {
...
@@ -44,6 +44,8 @@ Blockly.Msg.en.switch_language_to_english = {
Blockly
.
Msg
.
UNDO
=
'
Undo
'
;
Blockly
.
Msg
.
UNDO
=
'
Undo
'
;
Blockly
.
Msg
.
REDO
=
'
Redo
'
;
Blockly
.
Msg
.
REDO
=
'
Redo
'
;
Blockly
.
Msg
.
CLEAN_UP
=
'
Clean up Blocks
'
;
Blockly
.
Msg
.
CLEAN_UP
=
'
Clean up Blocks
'
;
Blockly
.
Msg
.
HIDE
=
'
Hide Workspace Controls
'
;
Blockly
.
Msg
.
SHOW
=
'
Show Workspace Controls
'
;
Blockly
.
Msg
.
DUPLICATE_BLOCK
=
'
Duplicate
'
;
Blockly
.
Msg
.
DUPLICATE_BLOCK
=
'
Duplicate
'
;
Blockly
.
Msg
.
REMOVE_COMMENT
=
'
Remove Comment
'
;
Blockly
.
Msg
.
REMOVE_COMMENT
=
'
Remove Comment
'
;
Blockly
.
Msg
.
ADD_COMMENT
=
'
Add Comment
'
;
Blockly
.
Msg
.
ADD_COMMENT
=
'
Add Comment
'
;
...
...
appinventor/blocklyeditor/src/workspace_svg.js
View file @
50a1371f
...
@@ -63,6 +63,12 @@ Blockly.WorkspaceSvg.prototype.blocksNeedingRendering = null;
...
@@ -63,6 +63,12 @@ Blockly.WorkspaceSvg.prototype.blocksNeedingRendering = null;
*/
*/
Blockly
.
WorkspaceSvg
.
prototype
.
latestClick
=
{
x
:
0
,
y
:
0
};
Blockly
.
WorkspaceSvg
.
prototype
.
latestClick
=
{
x
:
0
,
y
:
0
};
/**
* Whether the workspace elements are hidden
* @type {boolean}
*/
Blockly
.
WorkspaceSvg
.
prototype
.
chromeHidden
=
false
;
/**
/**
* Wrap the onMouseClick_ event to handle additional behaviors.
* Wrap the onMouseClick_ event to handle additional behaviors.
*/
*/
...
@@ -568,6 +574,19 @@ Blockly.WorkspaceSvg.prototype.customContextMenu = function(menuOptions) {
...
@@ -568,6 +574,19 @@ Blockly.WorkspaceSvg.prototype.customContextMenu = function(menuOptions) {
};
};
menuOptions
.
splice
(
3
,
0
,
exportOption
);
menuOptions
.
splice
(
3
,
0
,
exportOption
);
//Show or hide workspace SVG elements backpack, zoom, and trashcan
var
workspaceOption
=
{
enabled
:
true
};
workspaceOption
.
text
=
this
.
chromeHidden
?
Blockly
.
Msg
.
SHOW
:
Blockly
.
Msg
.
HIDE
;
var
displayStyle
=
this
.
chromeHidden
?
'
block
'
:
'
none
'
;
workspaceOption
.
callback
=
function
()
{
self
.
backpack_
.
svgGroup_
.
style
.
display
=
displayStyle
;
self
.
trashcan
.
svgGroup_
.
style
.
display
=
displayStyle
;
self
.
zoomControls_
.
svgGroup_
.
style
.
display
=
displayStyle
;
self
.
warningIndicator_
.
svgGroup_
.
style
.
display
=
displayStyle
;
self
.
chromeHidden
=
!
self
.
chromeHidden
;
};
menuOptions
.
push
(
workspaceOption
);
// Arrange blocks in row order.
// Arrange blocks in row order.
var
arrangeOptionH
=
{
enabled
:
(
Blockly
.
workspace_arranged_position
!==
Blockly
.
BLKS_HORIZONTAL
)};
var
arrangeOptionH
=
{
enabled
:
(
Blockly
.
workspace_arranged_position
!==
Blockly
.
BLKS_HORIZONTAL
)};
arrangeOptionH
.
text
=
Blockly
.
Msg
.
ARRANGE_H
;
arrangeOptionH
.
text
=
Blockly
.
Msg
.
ARRANGE_H
;
...
...
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