Commit 077e104d authored by carlosperate's avatar carlosperate

Merge upstream blockly commit up to '0478d308'

Blockly commit 0478d308
18th August 2015 "Trivial cleanup."
https://github.com/google/blockly/commit/0478d308a61e2f365836e3fb04946a698479e7d7
parents cff6e030 0478d308
......@@ -604,4 +604,3 @@ if (!goog.global['Blockly']) {
}
goog.global['Blockly']['getMainWorkspace'] = Blockly.getMainWorkspace;
goog.global['Blockly']['addChangeListener'] = Blockly.addChangeListener;
goog.global['Blockly']['removeChangeListener'] = Blockly.removeChangeListener;
......@@ -364,7 +364,7 @@ Blockly.Connection.prototype.highlight = function() {
Blockly.Connection.highlightedPath_ = Blockly.createSvgElement('path',
{'class': 'blocklyHighlightedConnectionPath',
'd': steps,
transform: 'translate(' + x + ', ' + y + ')'},
transform: 'translate(' + x + ',' + y + ')'},
this.sourceBlock_.getSvgRoot());
};
......@@ -391,7 +391,7 @@ Blockly.Connection.prototype.tighten_ = function() {
}
var xy = Blockly.getRelativeXY_(svgRoot);
block.getSvgRoot().setAttribute('transform',
'translate(' + (xy.x - dx) + ', ' + (xy.y - dy) + ')');
'translate(' + (xy.x - dx) + ',' + (xy.y - dy) + ')');
block.moveConnections_(-dx, -dy);
}
};
......
......@@ -77,7 +77,7 @@ Blockly.FieldAngle.prototype.setChangeHandler = function(handler) {
} else {
wrappedHandler = Blockly.FieldAngle.angleValidator;
}
Blockly.FieldAngle.superClass_.setChangeHandler(wrappedHandler);
Blockly.FieldAngle.superClass_.setChangeHandler.call(this, wrappedHandler);
};
/**
......@@ -162,8 +162,8 @@ Blockly.FieldAngle.prototype.showEditor_ = function() {
(a % 45 == 0 ? 10 : 5),
'y2': Blockly.FieldAngle.HALF,
'class': 'blocklyAngleMarks',
'transform': 'rotate(' + a + ', ' +
Blockly.FieldAngle.HALF + ', ' + Blockly.FieldAngle.HALF + ')'
'transform': 'rotate(' + a + ',' +
Blockly.FieldAngle.HALF + ',' + Blockly.FieldAngle.HALF + ')'
}, svg);
}
svg.style.marginLeft = (15 - Blockly.FieldAngle.RADIUS) + 'px';
......@@ -242,7 +242,7 @@ Blockly.FieldAngle.prototype.updateGraph_ = function() {
var angleRadians = goog.math.toRadians(Number(this.getText()));
if (isNaN(angleRadians)) {
this.gauge_.setAttribute('d',
'M ' + Blockly.FieldAngle.HALF + ', ' + Blockly.FieldAngle.HALF);
'M ' + Blockly.FieldAngle.HALF + ',' + Blockly.FieldAngle.HALF);
this.line_.setAttribute('x2', Blockly.FieldAngle.HALF);
this.line_.setAttribute('y2', Blockly.FieldAngle.HALF);
} else {
......@@ -252,7 +252,7 @@ Blockly.FieldAngle.prototype.updateGraph_ = function() {
-Blockly.FieldAngle.RADIUS;
var largeFlag = (angleRadians > Math.PI) ? 1 : 0;
this.gauge_.setAttribute('d',
'M ' + Blockly.FieldAngle.HALF + ', ' + Blockly.FieldAngle.HALF +
'M ' + Blockly.FieldAngle.HALF + ',' + Blockly.FieldAngle.HALF +
' h ' + Blockly.FieldAngle.RADIUS +
' A ' + Blockly.FieldAngle.RADIUS + ',' + Blockly.FieldAngle.RADIUS +
' 0 ' + largeFlag + ' 0 ' + x + ',' + y + ' z');
......
......@@ -75,7 +75,7 @@ Blockly.FieldVariable.prototype.setChangeHandler = function(handler) {
} else {
wrappedHandler = Blockly.FieldVariable.dropdownChange;
}
Blockly.FieldVariable.superClass_.setChangeHandler(wrappedHandler);
Blockly.FieldVariable.superClass_.setChangeHandler.call(this, wrappedHandler);
};
/**
......
......@@ -171,7 +171,7 @@ Blockly.Icon.prototype.renderIcon = function(cursorX) {
cursorX -= width;
}
this.iconGroup_.setAttribute('transform',
'translate(' + cursorX + ', ' + TOP_MARGIN + ')');
'translate(' + cursorX + ',' + TOP_MARGIN + ')');
this.computeIconLocation();
if (this.block_.RTL) {
cursorX -= Blockly.BlockSvg.SEP_SPACE_X;
......
......@@ -262,7 +262,7 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) {
this.yCoordinate = hostMetrics.absoluteTop + hostMetrics.viewHeight -
Blockly.Scrollbar.scrollbarThickness - 0.5;
this.svgGroup_.setAttribute('transform',
'translate(' + this.xCoordinate + ', ' + this.yCoordinate + ')');
'translate(' + this.xCoordinate + ',' + this.yCoordinate + ')');
this.svgBackground_.setAttribute('width', Math.max(0, outerLength));
this.svgKnob_.setAttribute('x', this.constrainKnob_(innerOffset));
} else {
......@@ -290,7 +290,7 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) {
}
this.yCoordinate = hostMetrics.absoluteTop + 0.5;
this.svgGroup_.setAttribute('transform',
'translate(' + this.xCoordinate + ', ' + this.yCoordinate + ')');
'translate(' + this.xCoordinate + ',' + this.yCoordinate + ')');
this.svgBackground_.setAttribute('height', Math.max(0, outerLength));
this.svgKnob_.setAttribute('y', this.constrainKnob_(innerOffset));
}
......
......@@ -41,20 +41,6 @@ Blockly.Trashcan = function(workspace) {
this.workspace_ = workspace;
};
/**
* URL of the sprite image.
* @type {string}
* @private
*/
Blockly.Trashcan.prototype.SPRITE_URL_ = 'media/sprites.png';
/**
* URL of the lid image.
* @type {string}
* @private
*/
Blockly.Trashcan.prototype.LID_URL_ = 'media/trashlid.png';
/**
* Width of both the trash can and lid images.
* @type {number}
......@@ -275,8 +261,8 @@ Blockly.Trashcan.prototype.animateLid_ = function() {
this.lidOpen_ = goog.math.clamp(this.lidOpen_, 0, 1);
var lidAngle = this.lidOpen_ * 45;
this.svgLid_.setAttribute('transform', 'rotate(' +
(this.workspace_.RTL ? -lidAngle : lidAngle) + ', ' +
(this.workspace_.RTL ? 4 : this.WIDTH_ - 4) + ', ' +
(this.workspace_.RTL ? -lidAngle : lidAngle) + ',' +
(this.workspace_.RTL ? 4 : this.WIDTH_ - 4) + ',' +
(this.LID_HEIGHT_ - 2) + ')');
var opacity = goog.math.lerp(0.4, 0.8, this.lidOpen_);
this.svgGroup_.style.opacity = opacity;
......
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