Commit d819db2a authored by Neil Fraser's avatar Neil Fraser

Lint corrections.

parent d1f6bdb1
...@@ -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) {
......
...@@ -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;
/** /**
......
...@@ -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) {
......
...@@ -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];
}; };
...@@ -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;
}; };
......
...@@ -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;',
'}']); '}']);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment