Skip to content

Commit

Permalink
Merge google/develop, recompile (scratchfoundation#617)
Browse files Browse the repository at this point in the history
* Check result of window.confirm before deleting variables.

* Create CONTRIBUTING.md

* Localisation updates from https://translatewiki.net.

* Cherrypick fixes made directly to master back into develop (scratchfoundation#619)

* Check result of window.confirm before deleting variables.

* Create CONTRIBUTING.md

* rebuild

* Localisation updates from https://translatewiki.net.

* Minor wording change.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Simplify the handling of the active desc for a toolbox without categories.

* Remove tables from the HTML. Move the toolbar buttons to the end so that they don't impede switching between the toolbox and workspace.

* When cutting or copying a block, do not include blocks joined to it.

* Add shadow to flyout buttons.

* Move 'create new group' button to the bottom of each toolbox block, and remove other buttons if there is nothing in the workspace.

* Add keyboard shortcuts for cut, copy and paste operations.

* Remove clipboard buttons to simplify UI.

* Prevent setting a number value to NaN. Select the field value on entry to an input field. State the contents of the input field when describing the field.

* Add aria-level and aria-selected attrs to dropdowns.

* routine recompile

* Update demo to latest interpreter.

* Move 'move to marked spot' button to the top of the block options list.

* Fix incorrect aria-levels in toolbox tree component.

* Add new fields to toolbarButtonConfig.

* Recompile

* Remove CONTRIBUTING
  • Loading branch information
tmickel authored Sep 22, 2016
1 parent a9c9f92 commit a6f34ae
Show file tree
Hide file tree
Showing 10 changed files with 1,140 additions and 442 deletions.
38 changes: 20 additions & 18 deletions blockly_compressed_horizontal.js

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions blockly_compressed_vertical.js

Large diffs are not rendered by default.

370 changes: 174 additions & 196 deletions blockly_uncompressed_horizontal.js

Large diffs are not rendered by default.

370 changes: 174 additions & 196 deletions blockly_uncompressed_vertical.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blocks_compressed_vertical.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions core/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,15 @@ Blockly.Css.CONTENT = [

'.blocklyFlyoutButton {',
'fill: #888;',
'cursor: default',
'cursor: default;',
'}',

'.blocklyFlyoutButtonShadow {',
'fill: #666;',
'}',

'.blocklyFlyoutButton:hover {',
'fill: #ccc;',
'fill: #aaa;',
'}',

/*
Expand Down
21 changes: 14 additions & 7 deletions core/flyout_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Blockly.FlyoutButton = function(workspace, targetWorkspace, text) {
this.text_ = text;

/**
* @type {goog.math.Coordinate}
* @type {!goog.math.Coordinate}
* @private
*/
this.position_ = new goog.math.Coordinate(0, 0);
Expand Down Expand Up @@ -89,10 +89,14 @@ Blockly.FlyoutButton.prototype.createDom = function() {
this.svgGroup_ = Blockly.createSvgElement('g',
{'class': 'blocklyFlyoutButton'}, this.workspace_.getCanvas());

// Rect with rounded corners.
// Shadow rectangle (light source does not mirror in RTL).
var shadow = Blockly.createSvgElement('rect',
{'class': 'blocklyFlyoutButtonShadow',
'rx': 4, 'ry': 4, 'x': 1, 'y': 1},
this.svgGroup_);
// Background rectangle.
var rect = Blockly.createSvgElement('rect',
{'rx': 4, 'ry': 4,
'height': 0, 'width': 0},
{'class': 'blocklyFlyoutButtonBackground', 'rx': 4, 'ry': 4},
this.svgGroup_);

var svgText = Blockly.createSvgElement('text',
Expand All @@ -102,8 +106,10 @@ Blockly.FlyoutButton.prototype.createDom = function() {

this.width = svgText.getComputedTextLength() +
2 * Blockly.FlyoutButton.MARGIN;
this.height = 20; // Can't compute it :(
this.height = 20; // Can't compute it :(

shadow.setAttribute('width', this.width);
shadow.setAttribute('height', this.height);
rect.setAttribute('width', this.width);
rect.setAttribute('height', this.height);

Expand All @@ -124,10 +130,11 @@ Blockly.FlyoutButton.prototype.show = function() {

/**
* Update svg attributes to match internal state.
* @private
*/
Blockly.FlyoutButton.prototype.updateTransform_ = function() {
this.svgGroup_.setAttribute('transform', 'translate(' + this.position_.x +
',' + this.position_.y + ')');
this.svgGroup_.setAttribute('transform',
'translate(' + this.position_.x + ',' + this.position_.y + ')');
};

/**
Expand Down
5 changes: 4 additions & 1 deletion core/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,12 @@ Blockly.Workspace.prototype.deleteVariable = function(name) {
return;
}
}
window.confirm(
var ok = window.confirm(
Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace('%1', uses.length).
replace('%2', name));
if (!ok) {
return;
}
}

Blockly.Events.setGroup(true);
Expand Down
Loading

0 comments on commit a6f34ae

Please sign in to comment.