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
d819db2a
Commit
d819db2a
authored
Jul 02, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint corrections.
parent
d1f6bdb1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
8 deletions
+16
-8
core/inject.js
core/inject.js
+1
-1
core/msg.js
core/msg.js
+4
-1
core/toolbox.js
core/toolbox.js
+3
-1
generators/php/lists.js
generators/php/lists.js
+3
-2
generators/php/loops.js
generators/php/loops.js
+2
-1
generators/php/text.js
generators/php/text.js
+3
-2
No files found.
core/inject.js
View file @
d819db2a
...
@@ -71,7 +71,7 @@ Blockly.inject = function(container, opt_options) {
...
@@ -71,7 +71,7 @@ Blockly.inject = function(container, opt_options) {
/**
/**
* Parse the provided toolbox tree into a consistent DOM format.
* Parse the provided toolbox tree into a consistent DOM format.
* @param {Node|string} tree DOM tree of blocks, or text representation of same.
* @param {Node|string} tree DOM tree of blocks, or text representation of same.
* @return {Node} DOM tree of blocks or null.
* @return {Node} DOM tree of blocks
,
or null.
* @private
* @private
*/
*/
Blockly
.
parseToolboxTree_
=
function
(
tree
)
{
Blockly
.
parseToolboxTree_
=
function
(
tree
)
{
...
...
core/msg.js
View file @
d819db2a
...
@@ -30,7 +30,10 @@
...
@@ -30,7 +30,10 @@
*/
*/
goog
.
provide
(
'
Blockly.Msg
'
);
goog
.
provide
(
'
Blockly.Msg
'
);
// Back up original getMsg function.
/**
* Back up original getMsg function.
* @type !Function
*/
goog
.
getMsgOrig
=
goog
.
getMsg
;
goog
.
getMsgOrig
=
goog
.
getMsg
;
/**
/**
...
...
core/toolbox.js
View file @
d819db2a
...
@@ -161,7 +161,8 @@ Blockly.Toolbox.prototype.position = function() {
...
@@ -161,7 +161,8 @@ Blockly.Toolbox.prototype.position = function() {
var
svgPosition
=
goog
.
style
.
getPageOffset
(
svg
);
var
svgPosition
=
goog
.
style
.
getPageOffset
(
svg
);
var
svgSize
=
Blockly
.
svgSize
(
svg
);
var
svgSize
=
Blockly
.
svgSize
(
svg
);
if
(
this
.
workspace_
.
RTL
)
{
if
(
this
.
workspace_
.
RTL
)
{
treeDiv
.
style
.
left
=
(
svgPosition
.
x
+
svgSize
.
width
-
treeDiv
.
offsetWidth
)
+
'
px
'
;
treeDiv
.
style
.
left
=
(
svgPosition
.
x
+
svgSize
.
width
-
treeDiv
.
offsetWidth
)
+
'
px
'
;
}
else
{
}
else
{
treeDiv
.
style
.
left
=
svgPosition
.
x
+
'
px
'
;
treeDiv
.
style
.
left
=
svgPosition
.
x
+
'
px
'
;
}
}
...
@@ -177,6 +178,7 @@ Blockly.Toolbox.prototype.position = function() {
...
@@ -177,6 +178,7 @@ Blockly.Toolbox.prototype.position = function() {
/**
/**
* Fill the toolbox with categories and blocks.
* Fill the toolbox with categories and blocks.
* @param {Node} newTree DOM tree of blocks, or null.
* @private
* @private
*/
*/
Blockly
.
Toolbox
.
prototype
.
populate_
=
function
(
newTree
)
{
Blockly
.
Toolbox
.
prototype
.
populate_
=
function
(
newTree
)
{
...
...
generators/php/lists.js
View file @
d819db2a
...
@@ -169,7 +169,8 @@ Blockly.PHP['lists_getIndex'] = function(block) {
...
@@ -169,7 +169,8 @@ Blockly.PHP['lists_getIndex'] = function(block) {
var
code
=
'
array_slice(
'
+
list
+
'
, -
'
+
at
+
'
, 1)[0]
'
;
var
code
=
'
array_slice(
'
+
list
+
'
, -
'
+
at
+
'
, 1)[0]
'
;
return
[
code
,
Blockly
.
PHP
.
ORDER_FUNCTION_CALL
];
return
[
code
,
Blockly
.
PHP
.
ORDER_FUNCTION_CALL
];
}
else
if
(
mode
==
'
GET_REMOVE
'
||
mode
==
'
REMOVE
'
)
{
}
else
if
(
mode
==
'
GET_REMOVE
'
||
mode
==
'
REMOVE
'
)
{
code
=
'
array_splice(
'
+
list
+
'
, count(
'
+
list
+
'
) -
'
+
at
+
'
, 1)[0]
'
;
code
=
'
array_splice(
'
+
list
+
'
, count(
'
+
list
+
'
) -
'
+
at
+
'
, 1)[0]
'
;
if
(
mode
==
'
GET_REMOVE
'
)
{
if
(
mode
==
'
GET_REMOVE
'
)
{
return
[
code
,
Blockly
.
PHP
.
ORDER_FUNCTION_CALL
];
return
[
code
,
Blockly
.
PHP
.
ORDER_FUNCTION_CALL
];
}
else
if
(
mode
==
'
REMOVE
'
)
{
}
else
if
(
mode
==
'
REMOVE
'
)
{
...
@@ -366,6 +367,6 @@ Blockly.PHP['lists_split'] = function(block) {
...
@@ -366,6 +367,6 @@ Blockly.PHP['lists_split'] = function(block) {
}
else
{
}
else
{
throw
'
Unknown mode:
'
+
mode
;
throw
'
Unknown mode:
'
+
mode
;
}
}
var
code
=
functionName
+
'
(
'
+
value_delim
+
'
,
'
+
value_input
+
'
)
'
;
var
code
=
functionName
+
'
(
'
+
value_delim
+
'
,
'
+
value_input
+
'
)
'
;
return
[
code
,
Blockly
.
PHP
.
ORDER_FUNCTION_CALL
];
return
[
code
,
Blockly
.
PHP
.
ORDER_FUNCTION_CALL
];
};
};
generators/php/loops.js
View file @
d819db2a
...
@@ -153,7 +153,8 @@ Blockly.PHP['controls_forEach'] = function(block) {
...
@@ -153,7 +153,8 @@ Blockly.PHP['controls_forEach'] = function(block) {
var
branch
=
Blockly
.
PHP
.
statementToCode
(
block
,
'
DO
'
);
var
branch
=
Blockly
.
PHP
.
statementToCode
(
block
,
'
DO
'
);
branch
=
Blockly
.
PHP
.
addLoopTrap
(
branch
,
block
.
id
);
branch
=
Blockly
.
PHP
.
addLoopTrap
(
branch
,
block
.
id
);
var
code
=
''
;
var
code
=
''
;
code
+=
'
foreach (
'
+
argument0
+
'
as
'
+
variable0
+
'
) {
\n
'
+
branch
+
'
}
\n
'
;
code
+=
'
foreach (
'
+
argument0
+
'
as
'
+
variable0
+
'
) {
\n
'
+
branch
+
'
}
\n
'
;
return
code
;
return
code
;
};
};
...
...
generators/php/text.js
View file @
d819db2a
...
@@ -97,9 +97,10 @@ Blockly.PHP['text_indexOf'] = function(block) {
...
@@ -97,9 +97,10 @@ Blockly.PHP['text_indexOf'] = function(block) {
var
code
=
operator
+
'
(
'
+
argument1
+
'
,
'
+
argument0
+
'
) + 1
'
;
var
code
=
operator
+
'
(
'
+
argument1
+
'
,
'
+
argument0
+
'
) + 1
'
;
var
functionName
=
Blockly
.
PHP
.
provideFunction_
(
var
functionName
=
Blockly
.
PHP
.
provideFunction_
(
block
.
getFieldValue
(
'
END
'
)
==
'
FIRST
'
?
'
text_indexOf
'
:
'
text_lastIndexOf
'
,
block
.
getFieldValue
(
'
END
'
)
==
'
FIRST
'
?
'
text_indexOf
'
:
'
text_lastIndexOf
'
,
[
'
function
'
+
Blockly
.
PHP
.
FUNCTION_NAME_PLACEHOLDER_
+
[
'
function
'
+
Blockly
.
PHP
.
FUNCTION_NAME_PLACEHOLDER_
+
'
($text, $search) {
'
,
'
($text, $search) {
'
,
'
$pos =
'
+
operator
+
'
($text, $search);
'
,
'
$pos =
'
+
operator
+
'
($text, $search);
'
,
'
return $pos === false ? 0 : $pos + 1;
'
,
'
return $pos === false ? 0 : $pos + 1;
'
,
'
}
'
]);
'
}
'
]);
...
...
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