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
1ca2fdc8
Commit
1ca2fdc8
authored
Jul 14, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add classes to svg groups.
parent
af75752c
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
30 deletions
+37
-30
blockly_compressed.js
blockly_compressed.js
+7
-7
core/flyout.js
core/flyout.js
+3
-2
core/scrollbar.js
core/scrollbar.js
+4
-2
core/trashcan.js
core/trashcan.js
+12
-11
core/workspace_svg.js
core/workspace_svg.js
+9
-6
msg/js/hi.js
msg/js/hi.js
+1
-1
msg/js/lrc.js
msg/js/lrc.js
+1
-1
No files found.
blockly_compressed.js
View file @
1ca2fdc8
This diff is collapsed.
Click to expand it.
core/flyout.js
View file @
1ca2fdc8
...
...
@@ -115,10 +115,11 @@ Blockly.Flyout.prototype.createDom = function() {
/*
<g>
<path class="blocklyFlyoutBackground"/>
<g></g>
<g
class="blocklyFlyout"
></g>
</g>
*/
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{},
null
);
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{
'
class
'
:
'
blocklyFlyout
'
},
null
);
this
.
svgBackground_
=
Blockly
.
createSvgElement
(
'
path
'
,
{
'
class
'
:
'
blocklyFlyoutBackground
'
},
this
.
svgGroup_
);
this
.
svgGroup_
.
appendChild
(
this
.
workspace_
.
createDom
());
...
...
core/scrollbar.js
View file @
1ca2fdc8
...
...
@@ -305,12 +305,14 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) {
*/
Blockly
.
Scrollbar
.
prototype
.
createDom_
=
function
()
{
/* Create the following DOM:
<g>
<g
class="blocklyScrollbarHorizontal"
>
<rect class="blocklyScrollbarBackground" />
<rect class="blocklyScrollbarKnob" rx="8" ry="8" />
</g>
*/
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{},
null
);
var
className
=
'
blocklyScrollbar
'
+
(
this
.
horizontal_
?
'
Horizontal
'
:
'
Vertical
'
);
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{
'
class
'
:
className
},
null
);
this
.
svgBackground_
=
Blockly
.
createSvgElement
(
'
rect
'
,
{
'
class
'
:
'
blocklyScrollbarBackground
'
},
this
.
svgGroup_
);
var
radius
=
Math
.
floor
((
Blockly
.
Scrollbar
.
scrollbarThickness
-
5
)
/
2
);
...
...
core/trashcan.js
View file @
1ca2fdc8
...
...
@@ -151,23 +151,24 @@ Blockly.Trashcan.prototype.top_ = 0;
*/
Blockly
.
Trashcan
.
prototype
.
createDom
=
function
()
{
/* Here's the markup that will be generated:
<g>
<clippath id="blocklyTrashBodyClipPath">
<g
class="blocklyTrash"
>
<clippath id="blocklyTrashBodyClipPath
837493
">
<rect width="47" height="45" y="15"></rect>
</clippath>
<image width="64" height="92" y="-32" xlink:href="media/sprites.png"
clip-path="url(#blocklyTrashBodyClipPath)"></image>
<clippath id="blocklyTrashLidClipPath">
clip-path="url(#blocklyTrashBodyClipPath
837493
)"></image>
<clippath id="blocklyTrashLidClipPath
837493
">
<rect width="47" height="15"></rect>
</clippath>
<image width="84" height="92" y="-32" xlink:href="media/sprites.png"
clip-path="url(#blocklyTrashLidClipPath)"></image>
clip-path="url(#blocklyTrashLidClipPath
837493
)"></image>
</g>
*/
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{},
null
);
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{
'
class
'
:
'
blocklyTrash
'
},
null
);
var
rnd
=
String
(
Math
.
random
()).
substring
(
2
);
var
clip
=
Blockly
.
createSvgElement
(
'
clipPath
'
,
{
'
id
'
:
'
blocklyTrashBodyClipPath
'
},
{
'
id
'
:
'
blocklyTrashBodyClipPath
'
+
rnd
},
this
.
svgGroup_
);
Blockly
.
createSvgElement
(
'
rect
'
,
{
'
width
'
:
this
.
WIDTH_
,
'
height
'
:
this
.
BODY_HEIGHT_
,
...
...
@@ -175,19 +176,19 @@ Blockly.Trashcan.prototype.createDom = function() {
clip
);
var
body
=
Blockly
.
createSvgElement
(
'
image
'
,
{
'
width
'
:
Blockly
.
SPRITE
.
width
,
'
height
'
:
Blockly
.
SPRITE
.
height
,
'
y
'
:
-
32
,
'
clip-path
'
:
'
url(#blocklyTrashBodyClipPath)
'
},
'
clip-path
'
:
'
url(#blocklyTrashBodyClipPath
'
+
rnd
+
'
)
'
},
this
.
svgGroup_
);
body
.
setAttributeNS
(
'
http://www.w3.org/1999/xlink
'
,
'
xlink:href
'
,
this
.
workspace_
.
options
.
pathToMedia
+
Blockly
.
SPRITE
.
url
);
var
clip
=
Blockly
.
createSvgElement
(
'
clipPath
'
,
{
'
id
'
:
'
blocklyTrashLidClipPath
'
},
{
'
id
'
:
'
blocklyTrashLidClipPath
'
+
rnd
},
this
.
svgGroup_
);
Blockly
.
createSvgElement
(
'
rect
'
,
{
'
width
'
:
this
.
WIDTH_
,
'
height
'
:
this
.
LID_HEIGHT_
},
clip
);
this
.
svgLid_
=
Blockly
.
createSvgElement
(
'
image
'
,
{
'
width
'
:
Blockly
.
SPRITE
.
width
,
'
height
'
:
Blockly
.
SPRITE
.
height
,
'
y
'
:
-
32
,
'
clip-path
'
:
'
url(#blocklyTrashLidClipPath)
'
},
'
clip-path
'
:
'
url(#blocklyTrashLidClipPath
'
+
rnd
+
'
)
'
},
this
.
svgGroup_
);
this
.
svgLid_
.
setAttributeNS
(
'
http://www.w3.org/1999/xlink
'
,
'
xlink:href
'
,
this
.
workspace_
.
options
.
pathToMedia
+
Blockly
.
SPRITE
.
url
);
...
...
core/workspace_svg.js
View file @
1ca2fdc8
...
...
@@ -110,15 +110,16 @@ Blockly.WorkspaceSvg.prototype.scrollbar = null;
*/
Blockly
.
WorkspaceSvg
.
prototype
.
createDom
=
function
(
opt_backgroundClass
)
{
/*
<g>
<g
class="blocklyWorkspace"
>
<rect class="blocklyMainBackground" height="100%" width="100%"></rect>
[Trashcan and/or flyout may go here]
<g
></g> // Block canvas
<g
></g> // Bubble canvas
<g
class="blocklyBlockCanvas"></g>
<g
class="blocklyBubbleCanvas"></g>
[Scrollbars may go here]
</g>
*/
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{},
null
);
this
.
svgGroup_
=
Blockly
.
createSvgElement
(
'
g
'
,
{
'
class
'
:
'
blocklyWorkspace
'
},
null
);
if
(
opt_backgroundClass
)
{
this
.
svgBackground_
=
Blockly
.
createSvgElement
(
'
rect
'
,
{
'
height
'
:
'
100%
'
,
'
width
'
:
'
100%
'
,
...
...
@@ -128,8 +129,10 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) {
'
url(#
'
+
this
.
options
.
gridPattern
.
id
+
'
)
'
;
}
}
this
.
svgBlockCanvas_
=
Blockly
.
createSvgElement
(
'
g
'
,
{},
this
.
svgGroup_
);
this
.
svgBubbleCanvas_
=
Blockly
.
createSvgElement
(
'
g
'
,
{},
this
.
svgGroup_
);
this
.
svgBlockCanvas_
=
Blockly
.
createSvgElement
(
'
g
'
,
{
'
class
'
:
'
blocklyBlockCanvas
'
},
this
.
svgGroup_
);
this
.
svgBubbleCanvas_
=
Blockly
.
createSvgElement
(
'
g
'
,
{
'
class
'
:
'
blocklyBubbleCanvas
'
},
this
.
svgGroup_
);
if
(
this
.
options
.
hasTrashcan
)
{
this
.
addTrashcan_
();
}
...
...
msg/js/hi.js
View file @
1ca2fdc8
...
...
@@ -226,7 +226,7 @@ Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://en.wikipedia.org/wiki/Random_nu
Blockly
.
Msg
.
MATH_RANDOM_FLOAT_TITLE_RANDOM
=
"
रैन्डम अंश
"
;
Blockly
.
Msg
.
MATH_RANDOM_FLOAT_TOOLTIP
=
"
Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).
"
;
// untranslated
Blockly
.
Msg
.
MATH_RANDOM_INT_HELPURL
=
"
https://en.wikipedia.org/wiki/Random_number_generation
"
;
Blockly
.
Msg
.
MATH_RANDOM_INT_TITLE
=
"
%1 से %
2 तक रैन्डम पूर्णांक
"
;
Blockly
.
Msg
.
MATH_RANDOM_INT_TITLE
=
"
%1 से %2 तक रैन्डम पूर्णांक
"
;
Blockly
.
Msg
.
MATH_RANDOM_INT_TOOLTIP
=
"
Return a random integer between the two specified limits, inclusive.
"
;
// untranslated
Blockly
.
Msg
.
MATH_ROUND_HELPURL
=
"
https://en.wikipedia.org/wiki/Rounding
"
;
Blockly
.
Msg
.
MATH_ROUND_OPERATOR_ROUND
=
"
पूर्णांक बनाएँ
"
;
...
...
msg/js/lrc.js
View file @
1ca2fdc8
...
...
@@ -62,7 +62,7 @@ Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "تا تکرار کو";
Blockly
.
Msg
.
CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL
=
"
While a value is false, then do some statements.
"
;
// untranslated
Blockly
.
Msg
.
CONTROLS_WHILEUNTIL_TOOLTIP_WHILE
=
"
While a value is true, then do some statements.
"
;
// untranslated
Blockly
.
Msg
.
DELETE_BLOCK
=
"
پاکسا کردن برشت
"
;
Blockly
.
Msg
.
DELETE_X_BLOCKS
=
"
پاکسا کردن
1%
د برشتیا
"
;
Blockly
.
Msg
.
DELETE_X_BLOCKS
=
"
پاکسا کردن
%1
د برشتیا
"
;
Blockly
.
Msg
.
DISABLE_BLOCK
=
"
ناکشتگر کردن برشت
"
;
Blockly
.
Msg
.
DUPLICATE_BLOCK
=
"
کپی کردن
"
;
Blockly
.
Msg
.
ENABLE_BLOCK
=
"
کنشتگر کردن برشت
"
;
...
...
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