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
5aed33b6
Commit
5aed33b6
authored
Nov 24, 2014
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add separators to toolbox.
parent
1235c1e8
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
13 deletions
+46
-13
blockly_compressed.js
blockly_compressed.js
+14
-12
core/css.js
core/css.js
+6
-0
core/toolbox.js
core/toolbox.js
+24
-1
demos/toolbox/index.html
demos/toolbox/index.html
+1
-0
tests/playground.html
tests/playground.html
+1
-0
No files found.
blockly_compressed.js
View file @
5aed33b6
This diff is collapsed.
Click to expand it.
core/css.js
View file @
5aed33b6
...
...
@@ -346,6 +346,12 @@ Blockly.Css.CONTENT = [
'
background-color: #e4e4e4;
'
,
'
}
'
,
'
.blocklyTreeSeparator {
'
,
'
height: 0px;
'
,
'
border-bottom: solid #e5e5e5 1px;
'
,
'
margin: 5px 0;
'
,
'
}
'
,
'
.blocklyTreeIcon {
'
,
'
height: 16px;
'
,
'
width: 16px;
'
,
...
...
core/toolbox.js
View file @
5aed33b6
...
...
@@ -172,6 +172,8 @@ Blockly.Toolbox.populate_ = function() {
}
else
{
syncTrees
(
childIn
,
childOut
);
}
}
else
if
(
name
==
'
HR
'
)
{
treeOut
.
add
(
new
Blockly
.
Toolbox
.
TreeSeparator
());
}
else
if
(
name
==
'
BLOCK
'
)
{
treeOut
.
blocks
.
push
(
childIn
);
}
...
...
@@ -273,7 +275,7 @@ Blockly.Toolbox.TreeControl.prototype.setSelectedItem = function(node) {
};
/**
* A
n
single node in the tree, customized for Blockly's UI.
* A single node in the tree, customized for Blockly's UI.
* @param {!goog.html.SafeHtml} html The HTML content of the node label.
* @param {Object=} opt_config The configuration for the tree. See
* goog.ui.tree.TreeControl.DefaultConfig. If not specified, a default config
...
...
@@ -331,3 +333,24 @@ Blockly.Toolbox.TreeNode.prototype.onMouseDown = function(e) {
Blockly
.
Toolbox
.
TreeNode
.
prototype
.
onDoubleClick_
=
function
(
e
)
{
// NOP.
};
/**
* A blank separator node in the tree.
* @constructor
* @extends {Blockly.Toolbox.TreeNode}
*/
Blockly
.
Toolbox
.
TreeSeparator
=
function
()
{
Blockly
.
Toolbox
.
TreeNode
.
call
(
this
,
''
,
Blockly
.
Toolbox
.
TreeSeparator
.
CONFIG_
);
};
goog
.
inherits
(
Blockly
.
Toolbox
.
TreeSeparator
,
Blockly
.
Toolbox
.
TreeNode
);
/**
* Configuration constants for tree separator.
* @type {Object.<string,*>}
* @const
* @private
*/
Blockly
.
Toolbox
.
TreeSeparator
.
CONFIG_
=
{
cssTreeRow
:
'
blocklyTreeSeparator
'
};
demos/toolbox/index.html
View file @
5aed33b6
...
...
@@ -138,6 +138,7 @@
</category>
<category
name=
"Variables"
custom=
"VARIABLE"
></category>
<category
name=
"Functions"
custom=
"PROCEDURE"
></category>
<hr>
<category
name=
"Library"
>
<category
name=
"Randomize"
>
<block
type=
"procedures_defnoreturn"
>
...
...
tests/playground.html
View file @
5aed33b6
...
...
@@ -352,6 +352,7 @@ h1 {
</value>
</block>
</category>
<hr>
<category
name=
"Variables"
custom=
"VARIABLE"
></category>
<category
name=
"Functions"
custom=
"PROCEDURE"
></category>
</xml>
...
...
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