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
bcebb077
Commit
bcebb077
authored
Jul 09, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow flights to be initially expanded in toolbox.
parent
24ffee62
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
48 deletions
+51
-48
blockly_compressed.js
blockly_compressed.js
+9
-9
core/toolbox.js
core/toolbox.js
+6
-3
core/workspace.js
core/workspace.js
+0
-31
core/workspace_svg.js
core/workspace_svg.js
+31
-0
msg/js/id.js
msg/js/id.js
+1
-1
msg/js/ja.js
msg/js/ja.js
+3
-3
msg/js/ru.js
msg/js/ru.js
+1
-1
No files found.
blockly_compressed.js
View file @
bcebb077
This diff is collapsed.
Click to expand it.
core/toolbox.js
View file @
bcebb077
...
...
@@ -195,9 +195,6 @@ Blockly.Toolbox.prototype.populate_ = function(newTree) {
case
'
CATEGORY
'
:
var
childOut
=
rootOut
.
createNode
(
childIn
.
getAttribute
(
'
name
'
));
childOut
.
blocks
=
[];
if
(
childIn
.
getAttribute
(
'
expanded
'
)
==
'
true
'
)
{
childOut
.
setExpanded
(
true
);
}
treeOut
.
add
(
childOut
);
var
custom
=
childIn
.
getAttribute
(
'
custom
'
);
if
(
custom
)
{
...
...
@@ -206,6 +203,12 @@ Blockly.Toolbox.prototype.populate_ = function(newTree) {
}
else
{
syncTrees
(
childIn
,
childOut
);
}
if
(
childIn
.
getAttribute
(
'
expanded
'
)
==
'
true
'
)
{
if
(
childOut
.
blocks
.
length
)
{
rootOut
.
setSelectedItem
(
childOut
);
}
childOut
.
setExpanded
(
true
);
}
break
;
case
'
SEP
'
:
treeOut
.
add
(
new
Blockly
.
Toolbox
.
TreeSeparator
());
...
...
core/workspace.js
View file @
bcebb077
...
...
@@ -184,36 +184,5 @@ Blockly.Workspace.prototype.fireChangeEvent = function() {
// NOP.
};
/**
* Modify the block tree on the existing toolbox.
* @param {Node|string} tree DOM tree of blocks, or text representation of same.
*/
Blockly
.
Workspace
.
prototype
.
updateToolbox
=
function
(
tree
)
{
tree
=
Blockly
.
parseToolboxTree_
(
tree
);
if
(
!
tree
)
{
if
(
this
.
options
.
languageTree
)
{
throw
'
Can
\'
t nullify an existing toolbox.
'
;
}
// No change (null to null).
return
;
}
if
(
!
this
.
options
.
languageTree
)
{
throw
'
Existing toolbox is null. Can
\'
t create new toolbox.
'
;
}
if
(
this
.
options
.
hasCategories
)
{
if
(
!
this
.
toolbox_
)
{
throw
'
Existing toolbox has no categories. Can
\'
t change mode.
'
;
}
this
.
options
.
languageTree
=
tree
;
this
.
toolbox_
.
populate_
(
tree
);
}
else
{
if
(
!
this
.
flyout_
)
{
throw
'
Existing toolbox has categories. Can
\'
t change mode.
'
;
}
this
.
options
.
languageTree
=
tree
;
this
.
flyout_
.
show
(
tree
.
childNodes
);
}
};
// Export symbols that would otherwise be renamed by Closure compiler.
Blockly
.
Workspace
.
prototype
[
'
clear
'
]
=
Blockly
.
Workspace
.
prototype
.
clear
;
core/workspace_svg.js
View file @
bcebb077
...
...
@@ -655,6 +655,37 @@ Blockly.WorkspaceSvg.prototype.playAudio = function(name, opt_volume) {
}
};
/**
* Modify the block tree on the existing toolbox.
* @param {Node|string} tree DOM tree of blocks, or text representation of same.
*/
Blockly
.
WorkspaceSvg
.
prototype
.
updateToolbox
=
function
(
tree
)
{
tree
=
Blockly
.
parseToolboxTree_
(
tree
);
if
(
!
tree
)
{
if
(
this
.
options
.
languageTree
)
{
throw
'
Can
\'
t nullify an existing toolbox.
'
;
}
// No change (null to null).
return
;
}
if
(
!
this
.
options
.
languageTree
)
{
throw
'
Existing toolbox is null. Can
\'
t create new toolbox.
'
;
}
if
(
this
.
options
.
hasCategories
)
{
if
(
!
this
.
toolbox_
)
{
throw
'
Existing toolbox has no categories. Can
\'
t change mode.
'
;
}
this
.
options
.
languageTree
=
tree
;
this
.
toolbox_
.
populate_
(
tree
);
}
else
{
if
(
!
this
.
flyout_
)
{
throw
'
Existing toolbox has categories. Can
\'
t change mode.
'
;
}
this
.
options
.
languageTree
=
tree
;
this
.
flyout_
.
show
(
tree
.
childNodes
);
}
};
/**
* When something in this workspace changes, call a function.
* @param {!Function} func Function to call.
...
...
msg/js/id.js
View file @
bcebb077
...
...
@@ -69,7 +69,7 @@ Blockly.Msg.ENABLE_BLOCK = "Aktifkan blok";
Blockly
.
Msg
.
EXPAND_ALL
=
"
Kembangkan blok-blok
"
;
Blockly
.
Msg
.
EXPAND_BLOCK
=
"
Kembangkan blok
"
;
Blockly
.
Msg
.
EXTERNAL_INPUTS
=
"
Input-input eksternal
"
;
Blockly
.
Msg
.
HELP
=
"
Tolong
"
;
Blockly
.
Msg
.
HELP
=
"
Bantuan
"
;
Blockly
.
Msg
.
INLINE_INPUTS
=
"
Input inline
"
;
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_HELPURL
=
"
https://github.com/google/blockly/wiki/Lists#create-empty-list
"
;
Blockly
.
Msg
.
LISTS_CREATE_EMPTY_TITLE
=
"
buat list kosong
"
;
...
...
msg/js/ja.js
View file @
bcebb077
...
...
@@ -142,8 +142,8 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "リスト内の指定さ
Blockly
.
Msg
.
LISTS_SET_INDEX_TOOLTIP_SET_LAST
=
"
リスト内の最後の項目を設定します。
"
;
Blockly
.
Msg
.
LISTS_SET_INDEX_TOOLTIP_SET_RANDOM
=
"
リスト内にランダムなアイテムを設定します。
"
;
Blockly
.
Msg
.
LISTS_SPLIT_HELPURL
=
"
https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists
"
;
// untranslated
Blockly
.
Msg
.
LISTS_SPLIT_LIST_FROM_TEXT
=
"
make list from text
"
;
// untranslated
Blockly
.
Msg
.
LISTS_SPLIT_TEXT_FROM_LIST
=
"
make text from list
"
;
// untranslated
Blockly
.
Msg
.
LISTS_SPLIT_LIST_FROM_TEXT
=
"
テキストからリストを作る
"
;
Blockly
.
Msg
.
LISTS_SPLIT_TEXT_FROM_LIST
=
"
リストからテキストを作る
"
;
Blockly
.
Msg
.
LISTS_SPLIT_TOOLTIP_JOIN
=
"
Join a list of texts into one text, separated by a delimiter.
"
;
// untranslated
Blockly
.
Msg
.
LISTS_SPLIT_TOOLTIP_SPLIT
=
"
Split text into a list of texts, breaking at each delimiter.
"
;
// untranslated
Blockly
.
Msg
.
LISTS_SPLIT_WITH_DELIMITER
=
"
with delimiter
"
;
// untranslated
...
...
@@ -257,7 +257,7 @@ Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "番号のarctangent を返すます";
Blockly
.
Msg
.
MATH_TRIG_TOOLTIP_COS
=
"
番号のcosineの次数を返す
"
;
Blockly
.
Msg
.
MATH_TRIG_TOOLTIP_SIN
=
"
番号のsineの次数を返す
"
;
Blockly
.
Msg
.
MATH_TRIG_TOOLTIP_TAN
=
"
番号のtangentの次数を返す
"
;
Blockly
.
Msg
.
ME
=
"
Me
"
;
// untranslated
Blockly
.
Msg
.
ME
=
"
私に
"
;
Blockly
.
Msg
.
NEW_VARIABLE
=
"
新しい変数
"
;
Blockly
.
Msg
.
NEW_VARIABLE_TITLE
=
"
新しい変数の、名前
"
;
Blockly
.
Msg
.
ORDINAL_NUMBER_SUFFIX
=
""
;
...
...
msg/js/ru.js
View file @
bcebb077
...
...
@@ -55,7 +55,7 @@ Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Если первое условие ист
Blockly
.
Msg
.
CONTROLS_REPEAT_HELPURL
=
"
https://ru.wikipedia.org/wiki/Цикл_(программирование)
"
;
Blockly
.
Msg
.
CONTROLS_REPEAT_INPUT_DO
=
"
выполнить
"
;
Blockly
.
Msg
.
CONTROLS_REPEAT_TITLE
=
"
повторить %1 раз
"
;
Blockly
.
Msg
.
CONTROLS_REPEAT_TOOLTIP
=
"
Выполняет команды несколько раз.
"
;
Blockly
.
Msg
.
CONTROLS_REPEAT_TOOLTIP
=
"
Выполняет
некоторые
команды несколько раз.
"
;
Blockly
.
Msg
.
CONTROLS_WHILEUNTIL_HELPURL
=
"
https://github.com/google/blockly/wiki/Loops#repeat
"
;
// untranslated
Blockly
.
Msg
.
CONTROLS_WHILEUNTIL_OPERATOR_UNTIL
=
"
повторять, пока не
"
;
Blockly
.
Msg
.
CONTROLS_WHILEUNTIL_OPERATOR_WHILE
=
"
повторять, пока
"
;
...
...
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