Trivial cleanup.

This commit is contained in:
Neil Fraser
2015-08-18 11:34:22 -07:00
parent 6d8bae4836
commit 0478d308a6
6 changed files with 11 additions and 26 deletions

View File

@@ -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;

View File

@@ -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);
}
};

View File

@@ -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');

View File

@@ -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;

View File

@@ -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));
}

View File

@@ -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;