Commit 678239c8 authored by Nicco Kunzmann's avatar Nicco Kunzmann

Merge branch 'master' of https://github.com/google/blockly into fixed_german_typo

parents 5ef7f381 afda263f
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -427,5 +427,36 @@ Blockly.Blocks['logic_ternary'] = {
.appendField(Blockly.Msg.LOGIC_TERNARY_IF_FALSE);
this.setOutput(true);
this.setTooltip(Blockly.Msg.LOGIC_TERNARY_TOOLTIP);
this.prevParentConnection_ = null;
},
/**
* Called whenever anything on the workspace changes.
* Prevent mismatched types.
* @this Blockly.Block
*/
onchange: function() {
if (!this.workspace) {
// Block has been deleted.
return;
}
var blockA = this.getInputTargetBlock('THEN');
var blockB = this.getInputTargetBlock('ELSE');
var parentConnection = this.outputConnection.targetConnection;
// Kick blocks that existed prior to this change if they don't match.
if ((blockA || blockB) && parentConnection) {
for (var i = 0; i < 2; i++) {
var block = (i == 1) ? blockA : blockB;
if (block && !block.outputConnection.checkType_(parentConnection)) {
if (parentConnection === this.prevParentConnection_) {
this.setParent(null);
parentConnection.sourceBlock_.bumpNeighbours_();
} else {
block.setParent(null);
block.bumpNeighbours_();
}
}
}
}
this.prevParentConnection_ = parentConnection;
}
};
......@@ -53,7 +53,8 @@ Blockly.Blocks.logic_operation={init:function(){var a=[[Blockly.Msg.LOGIC_OPERAT
OR:Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR}[a]})}};Blockly.Blocks.logic_negate={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_NEGATE_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.interpolateMsg(Blockly.Msg.LOGIC_NEGATE_TITLE,["BOOL","Boolean",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT);this.setTooltip(Blockly.Msg.LOGIC_NEGATE_TOOLTIP)}};
Blockly.Blocks.logic_boolean={init:function(){var a=[[Blockly.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Blockly.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setHelpUrl(Blockly.Msg.LOGIC_BOOLEAN_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendDummyInput().appendField(new Blockly.FieldDropdown(a),"BOOL");this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP)}};
Blockly.Blocks.logic_null={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_NULL_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0);this.appendDummyInput().appendField(Blockly.Msg.LOGIC_NULL);this.setTooltip(Blockly.Msg.LOGIC_NULL_TOOLTIP)}};
Blockly.Blocks.logic_ternary={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_TERNARY_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.appendValueInput("IF").setCheck("Boolean").appendField(Blockly.Msg.LOGIC_TERNARY_CONDITION);this.appendValueInput("THEN").appendField(Blockly.Msg.LOGIC_TERNARY_IF_TRUE);this.appendValueInput("ELSE").appendField(Blockly.Msg.LOGIC_TERNARY_IF_FALSE);this.setOutput(!0);this.setTooltip(Blockly.Msg.LOGIC_TERNARY_TOOLTIP)}};
Blockly.Blocks.logic_ternary={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_TERNARY_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.appendValueInput("IF").setCheck("Boolean").appendField(Blockly.Msg.LOGIC_TERNARY_CONDITION);this.appendValueInput("THEN").appendField(Blockly.Msg.LOGIC_TERNARY_IF_TRUE);this.appendValueInput("ELSE").appendField(Blockly.Msg.LOGIC_TERNARY_IF_FALSE);this.setOutput(!0);this.setTooltip(Blockly.Msg.LOGIC_TERNARY_TOOLTIP);this.prevParentConnection_=null},onchange:function(){if(this.workspace){var a=
this.getInputTargetBlock("THEN"),b=this.getInputTargetBlock("ELSE"),c=this.outputConnection.targetConnection;if((a||b)&&c)for(var d=0;2>d;d++){var e=1==d?a:b;e&&!e.outputConnection.checkType_(c)&&(c===this.prevParentConnection_?(this.setParent(null),c.sourceBlock_.bumpNeighbours_()):(e.setParent(null),e.bumpNeighbours_()))}this.prevParentConnection_=c}}};
// Copyright 2012 Google Inc. Apache License 2.0
Blockly.Blocks.loops={};Blockly.Blocks.loops.HUE=120;
Blockly.Blocks.controls_repeat={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_REPEAT_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new Blockly.FieldTextInput("10",Blockly.FieldTextInput.nonnegativeIntegerValidator),"TIMES").appendField(Blockly.Msg.CONTROLS_REPEAT_TITLE_TIMES);this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO);this.setPreviousStatement(!0);this.setNextStatement(!0);
......
......@@ -589,7 +589,10 @@ Blockly.removeAllRanges = function() {
if (getSelection()) {
setTimeout(function() {
try {
getSelection().removeAllRanges();
var selection = getSelection();
if (!selection.isCollapsed) {
selection.removeAllRanges();
}
} catch (e) {
// MSIE throws 'error 800a025e' here.
}
......
......@@ -39,10 +39,15 @@ goog.require('goog.userAgent');
*/
Blockly.Comment = function(block) {
Blockly.Comment.superClass_.constructor.call(this, block);
this.createIcon_();
this.createIcon();
};
goog.inherits(Blockly.Comment, Blockly.Icon);
/**
* Icon in base64 format.
* @private
*/
Blockly.Comment.prototype.png_ = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAANyAAADcgBffIlqAAAAAd0SU1FB98DGgAnBf0Xj5sAAAIBSURBVDjLjZO9SxxRFMXPrFkWl2UFYSOIRtF210YtAiH/gGATRNZFgo19IBaB9Ipgk3SiEoKQgI19JIVgGaOIgpWJEAV1kZk3b1ad0V+KRYIzk5ALh1ecc88978tRSgHPg0Bjvq/BbFalMNR5oaBv+bzWHMfZjOudWPOg6+pDva6elRXlt7fVcnYmPX4sDQ3pdmpKQXu7frS16aXjON8T06OIMWOwtRp3jgNSEpkMTE5y5/v4UcSLePxnroutVNKb4xgYANfFAk/vDbLG8Gtk5P8M7jE6CsZwDDwSMLm5iYmLlpbg4ABOTmBjA4aHk0ZbWxigposLvlarScH5OSwvw9oaABwdJTW1GtTrfJHnUe/uTgqKxeZaKEAUgTEQP/CeHvA8LhRFhLlc+r6zWVhfbyaZn0/yuRxEEaGCAK9USjdZWGgarK5CS0uS7+gAa3EzjYaOy2WlludJi4vSzIx0e5vky2Xp6ko/M4WCPleruk4zsVa6vJSur9OHTEzoqljUJwEdQYDf25uMe3jY3E5fX5Lr7wdr8YGSJCkIeL23h9/a+lA4Pg7T039u6h75POzv4wcBrx5Ec11Wd3bwOzv//VK7umB3F991+Zj2/R1reWstdnaWm3L5YXOlAnNz3FiLbTR4Azj6WwFPjOG953EahoT1On4YEnoep8bwDuiO9/wG1sM4kG8A4fUAAAAASUVORK5CYII=';
/**
* Comment text (if bubble is not visible).
......@@ -62,28 +67,6 @@ Blockly.Comment.prototype.width_ = 160;
*/
Blockly.Comment.prototype.height_ = 80;
/**
* Create the icon on the block.
* @private
*/
Blockly.Comment.prototype.createIcon_ = function() {
Blockly.Icon.prototype.createIcon_.call(this);
/* Here's the markup that will be generated:
<circle class="blocklyIconShield" r="8" cx="8" cy="8"/>
<text class="blocklyIconMark" x="8" y="13">?</text>
*/
var iconShield = Blockly.createSvgElement('circle',
{'class': 'blocklyIconShield',
'r': Blockly.Icon.RADIUS,
'cx': Blockly.Icon.RADIUS,
'cy': Blockly.Icon.RADIUS}, this.iconGroup_);
this.iconMark_ = Blockly.createSvgElement('text',
{'class': 'blocklyIconMark',
'x': Blockly.Icon.RADIUS,
'y': 2 * Blockly.Icon.RADIUS - 3}, this.iconGroup_);
this.iconMark_.appendChild(document.createTextNode('?'));
};
/**
* Create the editor for the comment's bubble.
* @return {!Element} The top-level node of the editor.
......
......@@ -272,13 +272,9 @@ Blockly.Css.CONTENT = [
' stroke-width: 1px;',
'}',
'.blocklyIconGroup:hover>.blocklyIconShield {',
' fill: #00f;',
' stroke: #fff;',
'}',
'.blocklyIconGroup:hover>.blocklyIconMark {',
' fill: #fff;',
'.blocklyIconGroup:not(:hover),',
'.blocklyIconGroupReadonly {',
' opacity: .6;',
'}',
'.blocklyIconMark {',
......
......@@ -39,9 +39,15 @@ Blockly.Icon = function(block) {
};
/**
* Radius of icons.
* Icon in base64 format.
* @private
*/
Blockly.Icon.prototype.png_ = '';
/**
* Height and width of icons.
*/
Blockly.Icon.RADIUS = 8;
Blockly.Icon.prototype.SIZE = 17;
/**
* Bubble UI (if visible).
......@@ -64,17 +70,25 @@ Blockly.Icon.prototype.iconY_ = 0;
/**
* Create the icon on the block.
* @private
*/
Blockly.Icon.prototype.createIcon_ = function() {
Blockly.Icon.prototype.createIcon = function() {
if (this.iconGroup_) {
// Icon already exists.
return;
}
/* Here's the markup that will be generated:
<g class="blocklyIconGroup"></g>
<g class="blocklyIconGroup">
<image width="17" height="17"
xlink:href="data:image/png;base64,iVBOR..."></image>
</g>
*/
this.iconGroup_ = Blockly.createSvgElement('g', {}, null);
this.iconGroup_ = Blockly.createSvgElement('g',
{'class': 'blocklyIconGroup'}, null);
var img = Blockly.createSvgElement('image',
{'width': this.SIZE, 'height': this.SIZE},
this.iconGroup_);
img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', this.png_);
this.block_.getSvgRoot().appendChild(this.iconGroup_);
Blockly.bindEvent_(this.iconGroup_, 'mouseup', this, this.iconClick_);
this.updateEditable();
......@@ -96,12 +110,12 @@ Blockly.Icon.prototype.dispose = function() {
* Add or remove the UI indicating if this icon may be clicked or not.
*/
Blockly.Icon.prototype.updateEditable = function() {
if (!this.block_.isInFlyout) {
if (this.block_.isInFlyout || !this.block_.isEditable()) {
Blockly.addClass_(/** @type {!Element} */ (this.iconGroup_),
'blocklyIconGroup');
'blocklyIconGroupReadonly');
} else {
Blockly.removeClass_(/** @type {!Element} */ (this.iconGroup_),
'blocklyIconGroup');
'blocklyIconGroupReadonly');
}
};
......@@ -147,9 +161,9 @@ Blockly.Icon.prototype.renderIcon = function(cursorX) {
this.iconGroup_.setAttribute('display', 'block');
var TOP_MARGIN = 5;
var diameter = 2 * Blockly.Icon.RADIUS;
var width = this.SIZE;
if (Blockly.RTL) {
cursorX -= diameter;
cursorX -= width;
}
this.iconGroup_.setAttribute('transform',
'translate(' + cursorX + ', ' + TOP_MARGIN + ')');
......@@ -157,7 +171,7 @@ Blockly.Icon.prototype.renderIcon = function(cursorX) {
if (Blockly.RTL) {
cursorX -= Blockly.BlockSvg.SEP_SPACE_X;
} else {
cursorX += diameter + Blockly.BlockSvg.SEP_SPACE_X;
cursorX += width + Blockly.BlockSvg.SEP_SPACE_X;
}
return cursorX;
};
......@@ -183,8 +197,8 @@ Blockly.Icon.prototype.computeIconLocation = function() {
// Find coordinates for the centre of the icon and update the arrow.
var blockXY = this.block_.getRelativeToSurfaceXY();
var iconXY = Blockly.getRelativeXY_(this.iconGroup_);
var newX = blockXY.x + iconXY.x + Blockly.Icon.RADIUS;
var newY = blockXY.y + iconXY.y + Blockly.Icon.RADIUS;
var newX = blockXY.x + iconXY.x + this.SIZE / 2;
var newY = blockXY.y + iconXY.y + this.SIZE / 2;
if (newX !== this.iconX_ || newY !== this.iconY_) {
this.setIconLocation(newX, newY);
}
......
......@@ -243,25 +243,6 @@ Blockly.createDom_ = function(container) {
Blockly.createSvgElement('feComposite',
{'in': 'SourceGraphic', 'in2': 'specOut', 'operator': 'arithmetic',
'k1': 0, 'k2': 1, 'k3': 1, 'k4': 0}, filter);
/*
<filter id="blocklyTrashcanShadowFilter">
<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>
<feOffset in="blur" dx="1" dy="1" result="offsetBlur"/>
<feMerge>
<feMergeNode in="offsetBlur"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
*/
filter = Blockly.createSvgElement('filter',
{'id': 'blocklyTrashcanShadowFilter'}, defs);
Blockly.createSvgElement('feGaussianBlur',
{'in': 'SourceAlpha', 'stdDeviation': 2, 'result': 'blur'}, filter);
Blockly.createSvgElement('feOffset',
{'in': 'blur', 'dx': 1, 'dy': 1, 'result': 'offsetBlur'}, filter);
feMerge = Blockly.createSvgElement('feMerge', {}, filter);
Blockly.createSvgElement('feMergeNode', {'in': 'offsetBlur'}, feMerge);
Blockly.createSvgElement('feMergeNode', {'in': 'SourceGraphic'}, feMerge);
/*
<filter id="blocklyShadowFilter">
<feGaussianBlur stdDeviation="2"/>
......
......@@ -46,6 +46,12 @@ Blockly.Mutator = function(quarkNames) {
};
goog.inherits(Blockly.Mutator, Blockly.Icon);
/**
* Icon in base64 format.
* @private
*/
Blockly.Mutator.prototype.png_ = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAANyAAADcgBffIlqAAAAAd0SU1FB98DGhULOIajyb8AAAHMSURBVDjLnZS9SiRBFIXP/CQ9iIHgPoGBTo8vIAaivoKaKJr6DLuxYqKYKIqRgSCMrblmIxqsICgOmAriziIiRXWjYPdnUDvT2+PMsOyBoop7qk71vedWS5KAkrWsGUMjSYjpgSQhNoZGFLEKeGoKGMNttUpULkOhAFL3USiA70MQEBnDDeDJWtaqVaJeB7uNICAKQ1ZkDI1yufOm+XnY2YHl5c6874MxPClJiDulkMvBxYWrw/095POdU0sS4hxALqcWtreloSGpVJLGxtL49bX0+Ci9vUkzM2kcXGFbypUKxHHLBXZ3YW4ONjfh4yN1aGIiPQOQEenrg6MjR+zvZz99Y8PFT09hYCArktdfsFY6PHTr83NlUKu5+eREennJchmR/n5pYcGtJyezG6em3Dw7Kw0OZrlMOr6f1gTg4ACWlmBvz9WoifHxbDpf3Flfd+54njQ9ncYvL6WHB+n9XVpcbHOnW59IUKu5m+p11zftfLHo+qRorZ6Hh/Xt7k5fsLUl1evS1dWfG9swMiJZq9+KIlaD4P/eztkZNgz5LsAzhpvjY6JK5d9e8eioE3h95SdQbDrkhSErxvArjkl6/U/imMQYnsKQH02BT7vbZZfVOiWhAAAAAElFTkSuQmCC';
/**
* Width of workspace.
* @private
......@@ -58,33 +64,6 @@ Blockly.Mutator.prototype.workspaceWidth_ = 0;
*/
Blockly.Mutator.prototype.workspaceHeight_ = 0;
/**
* Create the icon on the block.
*/
Blockly.Mutator.prototype.createIcon = function() {
if (this.iconMark_) {
// Icon already exists.
return;
}
Blockly.Icon.prototype.createIcon_.call(this);
/* Here's the markup that will be generated:
<rect class="blocklyIconShield" width="16" height="16" rx="4" ry="4"/>
<text class="blocklyIconMark" x="8" y="12">★</text>
*/
var quantum = Blockly.Icon.RADIUS / 2;
var iconShield = Blockly.createSvgElement('rect',
{'class': 'blocklyIconShield',
'width': 4 * quantum,
'height': 4 * quantum,
'rx': quantum,
'ry': quantum}, this.iconGroup_);
this.iconMark_ = Blockly.createSvgElement('text',
{'class': 'blocklyIconMark',
'x': Blockly.Icon.RADIUS,
'y': 2 * Blockly.Icon.RADIUS - 4}, this.iconGroup_);
this.iconMark_.appendChild(document.createTextNode('\u2605'));
};
/**
* Clicking on the icon toggles if the mutator bubble is visible.
* Disable if block is uneditable.
......@@ -136,8 +115,8 @@ Blockly.Mutator.prototype.updateEditable = function() {
// Close any mutator bubble. Icon is not clickable.
this.setVisible(false);
if (this.iconGroup_) {
Blockly.removeClass_(/** @type {!Element} */ (this.iconGroup_),
'blocklyIconGroup');
Blockly.addClass_(/** @type {!Element} */ (this.iconGroup_),
'blocklyIconGroupReadonly');
}
}
};
......
......@@ -283,7 +283,7 @@ Blockly.Toolbox.TreeControl.prototype.handleTouchEvent_ = function(e) {
/**
* Creates a new tree node using a custom tree node.
* @param {string=} html The HTML content of the node label.
* @param {string=} opt_html The HTML content of the node label.
* @return {!goog.ui.tree.TreeNode} The new item.
* @override
*/
......@@ -349,7 +349,7 @@ goog.inherits(Blockly.Toolbox.TreeNode, goog.ui.tree.TreeNode);
* @return {!goog.html.SafeHtml} The source for the icon.
* @override
*/
goog.ui.tree.BaseNode.prototype.getExpandIconSafeHtml = function() {
Blockly.Toolbox.TreeNode.prototype.getExpandIconSafeHtml = function() {
return goog.html.SafeHtml.create('span');
};
......
......@@ -150,18 +150,21 @@ Blockly.Trashcan.prototype.top_ = 0;
* @return {!Element} The trash can's SVG group.
*/
Blockly.Trashcan.prototype.createDom = function() {
/*
<g filter="url(#blocklyTrashcanShadowFilter)">
/* Here's the markup that will be generated:
<g>
<clippath id="blocklyTrashBodyClipPath">
<rect width="47" height="45" y="15"></rect>
</clippath>
<image width="64" height="92" y="15" href="media/trashbody.png"
<image width="64" height="92" y="-32" xlink:href="media/sprites.png"
clip-path="url(#blocklyTrashBodyClipPath)"></image>
<image width="47" height="15" href="media/trashlid.png"></image>
<clippath id="blocklyTrashLidClipPath">
<rect width="47" height="15"></rect>
</clippath>
<image width="84" height="92" y="-32" xlink:href="media/sprites.png"
clip-path="url(#blocklyTrashLidClipPath)"></image>
</g>
*/
this.svgGroup_ = Blockly.createSvgElement('g',
{'filter': 'url(#blocklyTrashcanShadowFilter)'}, null);
this.svgGroup_ = Blockly.createSvgElement('g', {}, null);
var clip = Blockly.createSvgElement('clipPath',
{'id': 'blocklyTrashBodyClipPath'},
......@@ -278,7 +281,7 @@ Blockly.Trashcan.prototype.animateLid_ = function() {
(Blockly.RTL ? -lidAngle : lidAngle) + ', ' +
(Blockly.RTL ? 4 : this.WIDTH_ - 4) + ', ' +
(this.LID_HEIGHT_ - 2) + ')');
var opacity = goog.math.lerp(0.2, 0.4, this.lidOpen_);
var opacity = goog.math.lerp(0.4, 0.8, this.lidOpen_);
this.svgGroup_.style.opacity = opacity;
if (this.lidOpen_ > 0 && this.lidOpen_ < 1) {
this.lidTask_ = goog.Timer.callOnce(this.animateLid_, 20, this);
......
......@@ -38,10 +38,15 @@ goog.require('Blockly.Icon');
*/
Blockly.Warning = function(block) {
Blockly.Warning.superClass_.constructor.call(this, block);
this.createIcon_();
this.createIcon();
};
goog.inherits(Blockly.Warning, Blockly.Icon);
/**
* Icon in base64 format.
* @private
*/
Blockly.Warning.prototype.png_ = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAANyAAADcgBffIlqAAAAAd0SU1FB98DGgApDBpIGrEAAAGfSURBVDjLnZM9S2NREIbfc2P8AF27BXshpIzK5g9ssUj8C2tnYyUoiBGSyk4sbCLs1vkRgoW1jYWFICwsMV2Se3JPboLe+FhcNCZcjXFgOMzHeec9M2ekDwTIAEUgo68IsOQczdNTIudoAksTg/g+5+UyDxKUyzz4PueTsvhZr+NmZkCC6Wmo1QiAX58FmLKWf4VCDPCiGxtgLf+B9FiQXo+9y0ucBIUCnJ3B+noMdHGBC0P2xrH4HoYEmUx8qVQCgMPD2F5ehjDEjTbZe2s4p5NKRenb2+Qid3dSpaK0tTp+j8VKq0VncXHQh2IxZrK/P/AtLECjQQf4McQEMNbq786O5qwdANfr8Xl/P/AFgbS7qzlr9Qcwr4EoYvPmBud5wxPJ5+HqCtbWhv3GwPU1Lor4/fKMeedo5vPDiRKsrsLWFuRyybFOhxbwTd0upWqVcDQpaTqjWq0SdruU5PvUkiol/ZNRzeXA96mp3aaRzSYnjdNsFtptGiYI2PY8HaVSmu33xWf3K5WS6ffVe3rSgXnzT+YlpSfY00djjJOkZ/wpr41bQMIsAAAAAElFTkSuQmCC';
/**
* Create the text for the warning's bubble.
......@@ -71,28 +76,6 @@ Blockly.Warning.textToDom_ = function(text) {
*/
Blockly.Warning.prototype.text_ = '';
/**
* Create the icon on the block.
* @private
*/
Blockly.Warning.prototype.createIcon_ = function() {
Blockly.Icon.prototype.createIcon_.call(this);
/* Here's the markup that will be generated:
<path class="blocklyIconShield" d="..."/>
<text class="blocklyIconMark" x="8" y="13">!</text>
*/
var iconShield = Blockly.createSvgElement('path',
{'class': 'blocklyIconShield',
'd': 'M 2,15 Q -1,15 0.5,12 L 6.5,1.7 Q 8,-1 9.5,1.7 L 15.5,12 ' +
'Q 17,15 14,15 z'},
this.iconGroup_);
this.iconMark_ = Blockly.createSvgElement('text',
{'class': 'blocklyIconMark',
'x': Blockly.Icon.RADIUS,
'y': 2 * Blockly.Icon.RADIUS - 3}, this.iconGroup_);
this.iconMark_.appendChild(document.createTextNode('!'));
};
/**
* Show or hide the warning bubble.
* @param {boolean} visible True if the bubble should be visible.
......
......@@ -97,7 +97,7 @@ Blockly.WorkspaceSvg.prototype.scrollbar = null;
/**
* Create the trash can elements.
* @param {?string} backgroundClass Either 'blocklyMainBackground' or
* @param {string=} opt_backgroundClass Either 'blocklyMainBackground' or
* 'blocklyMutatorBackground'.
* @return {!Element} The workspace's SVG group.
*/
......
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="57px" height="17px">
<style type="text/css">
#background {
fill: none;
}
.shield {
fill: #00f;
stroke: #fff;
stroke-width: 1px;
}
.mark {
fill: #fff;
font-family: sans-serif;
font-size: 9pt;
font-weight: bold;
text-anchor: middle;
}
#gear {
fill:#fff;
}
</style>
<rect id="background" width="57" height="17" x="0" y="0" />
<g transform="translate(0.5, 0.5)">
<g class="comment" transform="translate(0, 0)">
<circle class="shield" r="8" cx="8" cy="8" />
<text class="mark" x="8" y="12.75">?</text>
</g>
<g class="mutator" transform="translate(20, 0)">
<rect class="shield" width="16" height="16" rx="4" ry="4" />
<path id="gear" transform="scale(.6, .6) translate(2.9, 2.8)"
d="M4.105,9.36C4.04,9.731,4,10.11,4,10.5s0.04,0.77,0.105,1.14l-1.534,1.129l-0.183,0.683l1.5,2.598
l0.684,0.184l1.738-0.762c0.581,0.49,1.25,0.875,1.979,1.138L8.5,18.5L9,19h3l0.5-0.499l0.211-1.896
c0.727-0.264,1.394-0.648,1.975-1.137l1.744,0.764l0.682-0.184l1.5-2.598l-0.184-0.684l-1.534-1.129C16.96,11.269,17,10.889,17,10.5
s-0.04-0.769-0.106-1.139l1.534-1.129l0.184-0.684l-1.5-2.598L16.43,4.768l-1.744,0.764c-0.58-0.488-1.248-0.873-1.975-1.137
L12.5,2.499L12,2H9L8.5,2.5L8.29,4.392C7.561,4.654,6.892,5.04,6.311,5.529L4.572,4.768L3.889,4.951L2.39,7.549L2.57,8.231
L4.105,9.36z M6.85,10.5c0-2.016,1.635-3.65,3.65-3.65s3.65,1.635,3.65,3.65s-1.635,3.65-3.65,3.65S6.85,12.516,6.85,10.5z"/>
</g>
<g class="warning" transform="translate(40, 0)">
<path class="shield" d="M 2,15 Q -1,15 0.5,12 L 6.5,1.7 Q 8,-1 9.5,1.7 L 15.5,12 Q 17,15 14,15 z" />
<text class="mark" x="8" y="13">!</text>
</g>
</g>
</svg>
media/sprites.png

1.02 KB | W: | H:

media/sprites.png

1.1 KB | W: | H:

media/sprites.png
media/sprites.png
media/sprites.png
media/sprites.png
  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64px" height="92px">
<style type="text/css">
#background {
fill: none;
}
.arrows {
fill: #000;
stroke: none;
}
.selected .arrows {
fill: #fff;
}
.checkmark {
fill: #000;
font-family: sans-serif;
font-size: 10pt;
text-anchor: middle;
}
.trash {
fill: #888;
}
</style>
<rect id="background" width="64" height="92" x="0" y="0" />
<g>
<path class="arrows" d="M 13,1.5 13,14.5 1.74,8 z" />
<path class="arrows" d="M 17.5,3 30.5,3 24,14.26 z" />
<path class="arrows" d="M 35,1.5 35,14.5 46.26,8 z" />
</g>
<g class="selected" transform="translate(0, 16)">
<path class="arrows" d="M 13,1.5 13,14.5 1.74,8 z" />
<path class="arrows" d="M 17.5,3 30.5,3 24,14.26 z" />
<path class="arrows" d="M 35,1.5 35,14.5 46.26,8 z" />
</g>
<text class="checkmark" x="55.5" y="28">&#10003;</text>
<g class="trash">
<path d="M 2,41 v 6 h 42 v -6 h -10.5 l -3,-3 h -15 l -3,3 z" />
<rect width="36" height="20" x="5" y="50" />
<rect width="36" height="42" x="5" y="50" rx="4" ry="4" />
</g>
</svg>
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