diff --git a/.gitignore b/.gitignore index 00504a0a9..53eebc859 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ npm-debug.log .project *.pyc *.komodoproject +/nbproject/private/ \ No newline at end of file diff --git a/blockly_compressed.js b/blockly_compressed.js index 1582fdd20..d505bc991 100644 --- a/blockly_compressed.js +++ b/blockly_compressed.js @@ -864,7 +864,7 @@ Blockly.Workspace.prototype.undo=function(a){var b=a?this.redoStack_:this.undoSt Blockly.Workspace.prototype.addChangeListener=function(a){this.listeners_.push(a);return a};Blockly.Workspace.prototype.removeChangeListener=function(a){a=this.listeners_.indexOf(a);-1!=a&&this.listeners_.splice(a,1)};Blockly.Workspace.prototype.fireChangeListener=function(a){a.recordUndo&&(this.undoStack_.push(a),this.redoStack_.length=0,this.undoStack_.length>this.MAX_UNDO&&this.undoStack_.unshift());for(var b=0,c;c=this.listeners_[b];b++)c(a)}; Blockly.Workspace.prototype.getBlockById=function(a){return this.blockDB_[a]||null};Blockly.Workspace.WorkspaceDB_=Object.create(null);Blockly.Workspace.getById=function(a){return Blockly.Workspace.WorkspaceDB_[a]||null};Blockly.Workspace.prototype.clear=Blockly.Workspace.prototype.clear;Blockly.Workspace.prototype.clearUndo=Blockly.Workspace.prototype.clearUndo;Blockly.Workspace.prototype.addChangeListener=Blockly.Workspace.prototype.addChangeListener; Blockly.Workspace.prototype.removeChangeListener=Blockly.Workspace.prototype.removeChangeListener;Blockly.Bubble=function(a,b,c,d,e,f){this.workspace_=a;this.content_=b;this.shape_=c;c=Blockly.Bubble.ARROW_ANGLE;this.workspace_.RTL&&(c=-c);this.arrow_radians_=goog.math.toRadians(c);a.getBubbleCanvas().appendChild(this.createDom_(b,!(!e||!f)));this.setAnchorLocation(d);e&&f||(b=this.content_.getBBox(),e=b.width+2*Blockly.Bubble.BORDER_WIDTH,f=b.height+2*Blockly.Bubble.BORDER_WIDTH);this.setBubbleSize(e,f);this.positionBubble_();this.renderArrow_();this.rendered_=!0;a.options.readOnly||(Blockly.bindEvent_(this.bubbleBack_, -"mousedown",this,this.bubbleMouseDown_),this.resizeGroup_&&Blockly.bindEvent_(this.resizeGroup_,"mousedown",this,this.resizeMouseDown_))};Blockly.Bubble.BORDER_WIDTH=6;Blockly.Bubble.ARROW_THICKNESS=10;Blockly.Bubble.ARROW_ANGLE=20;Blockly.Bubble.ARROW_BEND=4;Blockly.Bubble.ANCHOR_RADIUS=8;Blockly.Bubble.onMouseUpWrapper_=null;Blockly.Bubble.onMouseMoveWrapper_=null; +"mousedown",this,this.bubbleMouseDown_),this.resizeGroup_&&Blockly.bindEvent_(this.resizeGroup_,"mousedown",this,this.resizeMouseDown_))};Blockly.Bubble.BORDER_WIDTH=6;Blockly.Bubble.ARROW_THICKNESS=10;Blockly.Bubble.ARROW_ANGLE=20;Blockly.Bubble.ARROW_BEND=4;Blockly.Bubble.ANCHOR_RADIUS=8;Blockly.Bubble.onMouseUpWrapper_=null;Blockly.Bubble.onMouseMoveWrapper_=null;Blockly.Bubble.prototype.resizeCallback_=null; Blockly.Bubble.unbindDragEvents_=function(){Blockly.Bubble.onMouseUpWrapper_&&(Blockly.unbindEvent_(Blockly.Bubble.onMouseUpWrapper_),Blockly.Bubble.onMouseUpWrapper_=null);Blockly.Bubble.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.Bubble.onMouseMoveWrapper_),Blockly.Bubble.onMouseMoveWrapper_=null)};Blockly.Bubble.prototype.rendered_=!1;Blockly.Bubble.prototype.anchorXY_=null;Blockly.Bubble.prototype.relativeLeft_=0;Blockly.Bubble.prototype.relativeTop_=0;Blockly.Bubble.prototype.width_=0; Blockly.Bubble.prototype.height_=0;Blockly.Bubble.prototype.autoLayout_=!0; Blockly.Bubble.prototype.createDom_=function(a,b){this.bubbleGroup_=Blockly.createSvgElement("g",{},null);var c={filter:"url(#"+this.workspace_.options.embossFilterId+")"};-1!=goog.userAgent.getUserAgentString().indexOf("JavaFX")&&(c={});c=Blockly.createSvgElement("g",c,this.bubbleGroup_);this.bubbleArrow_=Blockly.createSvgElement("path",{},c);this.bubbleBack_=Blockly.createSvgElement("rect",{"class":"blocklyDraggable",x:0,y:0,rx:Blockly.Bubble.BORDER_WIDTH,ry:Blockly.Bubble.BORDER_WIDTH},c);b?(this.resizeGroup_= @@ -873,13 +873,13 @@ return this.bubbleGroup_}; Blockly.Bubble.prototype.bubbleMouseDown_=function(a){this.promote_();Blockly.Bubble.unbindDragEvents_();Blockly.isRightButton(a)?a.stopPropagation():Blockly.isTargetInput_(a)||(Blockly.Css.setCursor(Blockly.Css.Cursor.CLOSED),this.workspace_.startDrag(a,new goog.math.Coordinate(this.workspace_.RTL?-this.relativeLeft_:this.relativeLeft_,this.relativeTop_)),Blockly.Bubble.onMouseUpWrapper_=Blockly.bindEvent_(document,"mouseup",this,Blockly.Bubble.unbindDragEvents_),Blockly.Bubble.onMouseMoveWrapper_=Blockly.bindEvent_(document, "mousemove",this,this.bubbleMouseMove_),Blockly.hideChaff(),a.stopPropagation())};Blockly.Bubble.prototype.bubbleMouseMove_=function(a){this.autoLayout_=!1;a=this.workspace_.moveDrag(a);this.relativeLeft_=this.workspace_.RTL?-a.x:a.x;this.relativeTop_=a.y;this.positionBubble_();this.renderArrow_()}; Blockly.Bubble.prototype.resizeMouseDown_=function(a){this.promote_();Blockly.Bubble.unbindDragEvents_();Blockly.isRightButton(a)||(Blockly.Css.setCursor(Blockly.Css.Cursor.CLOSED),this.workspace_.startDrag(a,new goog.math.Coordinate(this.workspace_.RTL?-this.width_:this.width_,this.height_)),Blockly.Bubble.onMouseUpWrapper_=Blockly.bindEvent_(document,"mouseup",this,Blockly.Bubble.unbindDragEvents_),Blockly.Bubble.onMouseMoveWrapper_=Blockly.bindEvent_(document,"mousemove",this,this.resizeMouseMove_), -Blockly.hideChaff());a.stopPropagation()};Blockly.Bubble.prototype.resizeMouseMove_=function(a){this.autoLayout_=!1;a=this.workspace_.moveDrag(a);this.setBubbleSize(this.workspace_.RTL?-a.x:a.x,a.y);this.workspace_.RTL&&this.positionBubble_()};Blockly.Bubble.prototype.registerResizeEvent=function(a,b){Blockly.bindEvent_(this.bubbleGroup_,"resize",a,b)};Blockly.Bubble.prototype.promote_=function(){this.bubbleGroup_.parentNode.appendChild(this.bubbleGroup_)}; +Blockly.hideChaff());a.stopPropagation()};Blockly.Bubble.prototype.resizeMouseMove_=function(a){this.autoLayout_=!1;a=this.workspace_.moveDrag(a);this.setBubbleSize(this.workspace_.RTL?-a.x:a.x,a.y);this.workspace_.RTL&&this.positionBubble_()};Blockly.Bubble.prototype.registerResizeEvent=function(a){this.resizeCallback_=a};Blockly.Bubble.prototype.promote_=function(){this.bubbleGroup_.parentNode.appendChild(this.bubbleGroup_)}; Blockly.Bubble.prototype.setAnchorLocation=function(a){this.anchorXY_=a;this.rendered_&&this.positionBubble_()}; Blockly.Bubble.prototype.layoutBubble_=function(){var a=-this.width_/4,b=-this.height_-Blockly.BlockSvg.MIN_BLOCK_Y,c=this.workspace_.getMetrics();c.viewWidth/=this.workspace_.scale;c.viewLeft/=this.workspace_.scale;var d=this.anchorXY_.x;this.workspace_.RTL?d-c.viewLeft-a-this.width_c.viewWidth&&(a=d-c.viewLeft-c.viewWidth):d+ae&&(g=2*Math.PI-g);var h=g+Math.PI/2;h>2*Math.PI&&(h-=2*Math.PI);var k=Math.sin(h),l=Math.cos(h),q=this.getBubbleSize(),h=(q.width+q.height)/Blockly.Bubble.ARROW_THICKNESS,h=Math.min(h,q.width,q.height)/2,q=1-Blockly.Bubble.ANCHOR_RADIUS/f,d=b+ q*d,e=c+q*e,q=b+h*l,m=c+h*k,b=b-h*l,c=c-h*k,k=g+this.arrow_radians_;k>2*Math.PI&&(k-=2*Math.PI);g=Math.sin(k)*f/Blockly.Bubble.ARROW_BEND;f=Math.cos(k)*f/Blockly.Bubble.ARROW_BEND;a.push("M"+q+","+m);a.push("C"+(q+f)+","+(m+g)+" "+d+","+e+" "+d+","+e);a.push("C"+d+","+e+" "+(b+f)+","+(c+g)+" "+b+","+c)}a.push("z");this.bubbleArrow_.setAttribute("d",a.join(" "))};Blockly.Bubble.prototype.setColour=function(a){this.bubbleBack_.setAttribute("fill",a);this.bubbleArrow_.setAttribute("fill",a)}; Blockly.Bubble.prototype.dispose=function(){Blockly.Bubble.unbindDragEvents_();goog.dom.removeNode(this.bubbleGroup_);this.shape_=this.content_=this.workspace_=this.resizeGroup_=this.bubbleBack_=this.bubbleArrow_=this.bubbleGroup_=null};Blockly.Icon=function(a){this.block_=a};Blockly.Icon.prototype.collapseHidden=!0;Blockly.Icon.prototype.SIZE=17;Blockly.Icon.prototype.bubble_=null;Blockly.Icon.prototype.iconXY_=null;Blockly.Icon.prototype.createIcon=function(){this.iconGroup_||(this.iconGroup_=Blockly.createSvgElement("g",{"class":"blocklyIconGroup"},null),this.drawIcon_(this.iconGroup_),this.block_.getSvgRoot().appendChild(this.iconGroup_),Blockly.bindEvent_(this.iconGroup_,"mouseup",this,this.iconClick_),this.updateEditable())}; @@ -890,38 +890,31 @@ Blockly.Icon.prototype.setIconLocation=function(a){this.iconXY_=a;this.isVisible // Copyright 2011 Google Inc. Apache License 2.0 Blockly.Comment=function(a){Blockly.Comment.superClass_.constructor.call(this,a);this.createIcon()};goog.inherits(Blockly.Comment,Blockly.Icon);Blockly.Comment.prototype.text_="";Blockly.Comment.prototype.width_=160;Blockly.Comment.prototype.height_=80; Blockly.Comment.prototype.drawIcon_=function(a){Blockly.createSvgElement("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);Blockly.createSvgElement("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405 0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25 -1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);Blockly.createSvgElement("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)}; -Blockly.Comment.prototype.createEditor_=function(){this.foreignObject_=Blockly.createSvgElement("foreignObject",{x:Blockly.Bubble.BORDER_WIDTH,y:Blockly.Bubble.BORDER_WIDTH},null);var a=document.createElementNS(Blockly.HTML_NS,"body");a.setAttribute("xmlns",Blockly.HTML_NS);a.className="blocklyMinimalBody";this.textarea_=document.createElementNS(Blockly.HTML_NS,"textarea");this.textarea_.className="blocklyCommentTextarea";this.textarea_.setAttribute("dir",this.block_.RTL?"RTL":"LTR");a.appendChild(this.textarea_); -this.foreignObject_.appendChild(a);Blockly.bindEvent_(this.textarea_,"mouseup",this,this.textareaFocus_);Blockly.bindEvent_(this.textarea_,"wheel",this,function(a){a.stopPropagation()});Blockly.bindEvent_(this.textarea_,"change",this,function(a){this.text_!=this.textarea_.value&&(Blockly.Events.fire(new Blockly.Events.Change(this.block_,"comment",null,this.text_,this.textarea_.value)),this.text_=this.textarea_.value)});return this.foreignObject_}; -Blockly.Comment.prototype.updateEditable=function(){this.isVisible()&&(this.setVisible(!1),this.setVisible(!0));Blockly.Icon.prototype.updateEditable.call(this)};Blockly.Comment.prototype.resizeBubble_=function(){var a=this.bubble_.getBubbleSize(),b=2*Blockly.Bubble.BORDER_WIDTH;this.foreignObject_.setAttribute("width",a.width-b);this.foreignObject_.setAttribute("height",a.height-b);this.textarea_.style.width=a.width-b-4+"px";this.textarea_.style.height=a.height-b-4+"px"}; -Blockly.Comment.prototype.setVisible=function(a){if(a!=this.isVisible())if(Blockly.Events.fire(new Blockly.Events.Ui(this.block_,"commentOpen",!a,a)),!this.block_.isEditable()&&!this.textarea_||goog.userAgent.IE)Blockly.Warning.prototype.setVisible.call(this,a);else{var b=this.getText(),c=this.getBubbleSize();a?(this.bubble_=new Blockly.Bubble(this.block_.workspace,this.createEditor_(),this.block_.svgPath_,this.iconXY_,this.width_,this.height_),this.bubble_.registerResizeEvent(this,this.resizeBubble_), +Blockly.Comment.prototype.createEditor_=function(){this.foreignObject_=Blockly.createSvgElement("foreignObject",{x:Blockly.Bubble.BORDER_WIDTH,y:Blockly.Bubble.BORDER_WIDTH},null);var a=document.createElementNS(Blockly.HTML_NS,"body");a.setAttribute("xmlns",Blockly.HTML_NS);a.className="blocklyMinimalBody";var b=document.createElementNS(Blockly.HTML_NS,"textarea");b.className="blocklyCommentTextarea";b.setAttribute("dir",this.block_.RTL?"RTL":"LTR");a.appendChild(b);this.textarea_=b;this.foreignObject_.appendChild(a); +Blockly.bindEvent_(b,"mouseup",this,this.textareaFocus_);Blockly.bindEvent_(b,"wheel",this,function(a){a.stopPropagation()});Blockly.bindEvent_(b,"change",this,function(a){this.text_!=b.value&&(Blockly.Events.fire(new Blockly.Events.Change(this.block_,"comment",null,this.text_,b.value)),this.text_=b.value)});setTimeout(function(){b.focus()},0);return this.foreignObject_};Blockly.Comment.prototype.updateEditable=function(){this.isVisible()&&(this.setVisible(!1),this.setVisible(!0));Blockly.Icon.prototype.updateEditable.call(this)}; +Blockly.Comment.prototype.resizeBubble_=function(){if(this.isVisible()){var a=this.bubble_.getBubbleSize(),b=2*Blockly.Bubble.BORDER_WIDTH;this.foreignObject_.setAttribute("width",a.width-b);this.foreignObject_.setAttribute("height",a.height-b);this.textarea_.style.width=a.width-b-4+"px";this.textarea_.style.height=a.height-b-4+"px"}}; +Blockly.Comment.prototype.setVisible=function(a){if(a!=this.isVisible())if(Blockly.Events.fire(new Blockly.Events.Ui(this.block_,"commentOpen",!a,a)),!this.block_.isEditable()&&!this.textarea_||goog.userAgent.IE)Blockly.Warning.prototype.setVisible.call(this,a);else{var b=this.getText(),c=this.getBubbleSize();a?(this.bubble_=new Blockly.Bubble(this.block_.workspace,this.createEditor_(),this.block_.svgPath_,this.iconXY_,this.width_,this.height_),this.bubble_.registerResizeEvent(this.resizeBubble_.bind(this)), this.updateColour()):(this.bubble_.dispose(),this.foreignObject_=this.textarea_=this.bubble_=null);this.setText(b);this.setBubbleSize(c.width,c.height)}};Blockly.Comment.prototype.textareaFocus_=function(a){this.bubble_.promote_();this.textarea_.focus()};Blockly.Comment.prototype.getBubbleSize=function(){return this.isVisible()?this.bubble_.getBubbleSize():{width:this.width_,height:this.height_}}; Blockly.Comment.prototype.setBubbleSize=function(a,b){this.textarea_?this.bubble_.setBubbleSize(a,b):(this.width_=a,this.height_=b)};Blockly.Comment.prototype.getText=function(){return this.textarea_?this.textarea_.value:this.text_};Blockly.Comment.prototype.setText=function(a){this.text_!=a&&(Blockly.Events.fire(new Blockly.Events.Change(this.block_,"comment",null,this.text_,a)),this.text_=a);this.textarea_&&(this.textarea_.value=a)}; Blockly.Comment.prototype.dispose=function(){Blockly.Events.isEnabled()&&this.setText("");this.block_.comment=null;Blockly.Icon.prototype.dispose.call(this)};Blockly.Connection=function(a,b){this.sourceBlock_=a;this.type=b;a.workspace.connectionDBList&&(this.db_=a.workspace.connectionDBList[b],this.dbOpposite_=a.workspace.connectionDBList[Blockly.OPPOSITE_TYPE[b]],this.hidden_=!this.db_)};Blockly.Connection.CAN_CONNECT=0;Blockly.Connection.REASON_SELF_CONNECTION=1;Blockly.Connection.REASON_WRONG_TYPE=2;Blockly.Connection.REASON_TARGET_NULL=3;Blockly.Connection.REASON_CHECKS_FAILED=4;Blockly.Connection.REASON_DIFFERENT_WORKSPACES=5; -Blockly.Connection.connect_=function(a,b){var c=a.getSourceBlock(),d=b.getSourceBlock();b.isConnected()&&b.disconnect();if(a.isConnected()){var e=a.targetBlock(),f=a.getShadowDom();a.setShadowDom(null);if(e.isShadow())f=Blockly.Xml.blockToDom(e),e.dispose(),e=null;else if(a.type==Blockly.INPUT_VALUE){if(!e.outputConnection)throw"Orphan block does not have an output connection.";var g=Blockly.Connection.lastConnectionInRow_(d,e);g&&(e.outputConnection.connect(g),e=null)}else if(a.type==Blockly.NEXT_STATEMENT){if(!e.previousConnection)throw"Orphan block does not have a previous connection."; -for(g=d;g.nextConnection;)if(g.nextConnection.isConnected())g=g.getNextBlock();else{e.previousConnection.checkType_(g.nextConnection)&&(g.nextConnection.connect(e.previousConnection),e=null);break}}if(e&&(a.disconnect(),Blockly.Events.recordUndo)){var h=Blockly.Events.getGroup();setTimeout(function(){e.workspace&&!e.getParent()&&(Blockly.Events.setGroup(h),e.outputConnection?e.outputConnection.bumpAwayFrom_(a):e.previousConnection&&e.previousConnection.bumpAwayFrom_(a),Blockly.Events.setGroup(!1))}, -Blockly.BUMP_DELAY)}a.setShadowDom(f)}var k;Blockly.Events.isEnabled()&&(k=new Blockly.Events.Move(d));Blockly.Connection.connectReciprocally_(a,b);d.setParent(c);k&&(k.recordNew(),Blockly.Events.fire(k));c.rendered&&c.updateDisabled();d.rendered&&d.updateDisabled();c.rendered&&d.rendered&&(a.type==Blockly.NEXT_STATEMENT||a.type==Blockly.PREVIOUS_STATEMENT?d.render():c.render())};Blockly.Connection.prototype.targetConnection=null;Blockly.Connection.prototype.check_=null; -Blockly.Connection.prototype.shadowDom_=null;Blockly.Connection.prototype.x_=0;Blockly.Connection.prototype.y_=0;Blockly.Connection.prototype.inDB_=!1;Blockly.Connection.prototype.db_=null;Blockly.Connection.prototype.dbOpposite_=null;Blockly.Connection.prototype.hidden_=null; +Blockly.Connection.prototype.targetConnection=null;Blockly.Connection.prototype.check_=null;Blockly.Connection.prototype.shadowDom_=null;Blockly.Connection.prototype.x_=0;Blockly.Connection.prototype.y_=0;Blockly.Connection.prototype.inDB_=!1;Blockly.Connection.prototype.db_=null;Blockly.Connection.prototype.dbOpposite_=null;Blockly.Connection.prototype.hidden_=null; +Blockly.Connection.prototype.connect_=function(a){var b=this,c=b.getSourceBlock(),d=a.getSourceBlock();a.isConnected()&&a.disconnect();if(b.isConnected()){var e=b.targetBlock(),f=b.getShadowDom();b.setShadowDom(null);if(e.isShadow())f=Blockly.Xml.blockToDom(e),e.dispose(),e=null;else if(b.type==Blockly.INPUT_VALUE){if(!e.outputConnection)throw"Orphan block does not have an output connection.";var g=Blockly.Connection.lastConnectionInRow_(d,e);g&&(e.outputConnection.connect(g),e=null)}else if(b.type== +Blockly.NEXT_STATEMENT){if(!e.previousConnection)throw"Orphan block does not have a previous connection.";for(g=d;g.nextConnection;)if(g.nextConnection.isConnected())g=g.getNextBlock();else{e.previousConnection.checkType_(g.nextConnection)&&(g.nextConnection.connect(e.previousConnection),e=null);break}}if(e&&(b.disconnect(),Blockly.Events.recordUndo)){var h=Blockly.Events.getGroup();setTimeout(function(){e.workspace&&!e.getParent()&&(Blockly.Events.setGroup(h),e.outputConnection?e.outputConnection.bumpAwayFrom_(b): +e.previousConnection&&e.previousConnection.bumpAwayFrom_(b),Blockly.Events.setGroup(!1))},Blockly.BUMP_DELAY)}b.setShadowDom(f)}var k;Blockly.Events.isEnabled()&&(k=new Blockly.Events.Move(d));Blockly.Connection.connectReciprocally_(b,a);d.setParent(c);k&&(k.recordNew(),Blockly.Events.fire(k))}; Blockly.Connection.prototype.dispose=function(){if(this.isConnected())throw"Disconnect connection before disposing of it.";this.inDB_&&this.db_.removeConnection_(this);Blockly.highlightedConnection_==this&&(Blockly.highlightedConnection_=null);Blockly.localConnection_==this&&(Blockly.localConnection_=null);this.dbOpposite_=this.db_=null};Blockly.Connection.prototype.getSourceBlock=function(){return this.sourceBlock_}; -Blockly.Connection.prototype.isSuperior=function(){return this.type==Blockly.INPUT_VALUE||this.type==Blockly.NEXT_STATEMENT};Blockly.Connection.prototype.isConnected=function(){return!!this.targetConnection};Blockly.Connection.prototype.distanceFrom=function(a){var b=this.x_-a.x_;a=this.y_-a.y_;return Math.sqrt(b*b+a*a)}; +Blockly.Connection.prototype.isSuperior=function(){return this.type==Blockly.INPUT_VALUE||this.type==Blockly.NEXT_STATEMENT};Blockly.Connection.prototype.isConnected=function(){return!!this.targetConnection}; Blockly.Connection.prototype.canConnectWithReason_=function(a){if(a){if(this.sourceBlock_&&a.getSourceBlock()==this.sourceBlock_)return Blockly.Connection.REASON_SELF_CONNECTION;if(a.type!=Blockly.OPPOSITE_TYPE[this.type])return Blockly.Connection.REASON_WRONG_TYPE;if(this.sourceBlock_&&a.getSourceBlock()&&this.sourceBlock_.workspace!==a.getSourceBlock().workspace)return Blockly.Connection.REASON_DIFFERENT_WORKSPACES;if(!this.checkType_(a))return Blockly.Connection.REASON_CHECKS_FAILED}else return Blockly.Connection.REASON_TARGET_NULL; return Blockly.Connection.CAN_CONNECT}; Blockly.Connection.prototype.checkConnection_=function(a){switch(this.canConnectWithReason_(a)){case Blockly.Connection.CAN_CONNECT:break;case Blockly.Connection.REASON_SELF_CONNECTION:throw"Attempted to connect a block to itself.";case Blockly.Connection.REASON_DIFFERENT_WORKSPACES:throw"Blocks not on same workspace.";case Blockly.Connection.REASON_WRONG_TYPE:throw"Attempt to connect incompatible types.";case Blockly.Connection.REASON_TARGET_NULL:throw"Target connection is null.";case Blockly.Connection.REASON_CHECKS_FAILED:throw"Connection checks failed."; default:throw"Unknown connection failure: this should never happen!";}}; -Blockly.Connection.prototype.isConnectionAllowed=function(a,b){if(this.distanceFrom(a)>b)return!1;var c=this.canConnectWithReason_(a);if(c!=Blockly.Connection.CAN_CONNECT&&c!=Blockly.Connection.REASON_MUST_DISCONNECT)return!1;if(a.type==Blockly.OUTPUT_VALUE||a.type==Blockly.PREVIOUS_STATEMENT)if(a.isConnected()||this.isConnected())return!1;if(a.type==Blockly.INPUT_VALUE&&a.isConnected()&&!a.targetBlock().isMovable()&&!a.targetBlock().isShadow()||this.type==Blockly.PREVIOUS_STATEMENT&&a.isConnected()&& -!this.sourceBlock_.nextConnection)return!1;var c=a.getSourceBlock(),d=this.sourceBlock_;if(c&&d){do{if(d==c)return!1;c=c.getParent()}while(c)}return!0};Blockly.Connection.prototype.connect=function(a){this.targetConnection!=a&&(this.checkConnection_(a),this.isSuperior()?Blockly.Connection.connect_(this,a):Blockly.Connection.connect_(a,this))};Blockly.Connection.connectReciprocally_=function(a,b){goog.asserts.assert(a&&b,"Cannot connect null connections.");a.targetConnection=b;b.targetConnection=a}; +Blockly.Connection.prototype.isConnectionAllowed=function(a){var b=this.canConnectWithReason_(a);if(b!=Blockly.Connection.CAN_CONNECT&&b!=Blockly.Connection.REASON_MUST_DISCONNECT)return!1;if(a.type==Blockly.OUTPUT_VALUE||a.type==Blockly.PREVIOUS_STATEMENT)if(a.isConnected()||this.isConnected())return!1;if(a.type==Blockly.INPUT_VALUE&&a.isConnected()&&!a.targetBlock().isMovable()&&!a.targetBlock().isShadow()||this.type==Blockly.PREVIOUS_STATEMENT&&a.isConnected()&&!this.sourceBlock_.nextConnection)return!1; +a=a.getSourceBlock();b=this.sourceBlock_;if(a&&b){do{if(b==a)return!1;a=a.getParent()}while(a)}return!0};Blockly.Connection.prototype.connect=function(a){this.targetConnection!=a&&(this.checkConnection_(a),this.isSuperior()?this.connect_(a):a.connect_(this))};Blockly.Connection.connectReciprocally_=function(a,b){goog.asserts.assert(a&&b,"Cannot connect null connections.");a.targetConnection=b;b.targetConnection=a}; Blockly.Connection.singleConnection_=function(a,b){for(var c=!1,d=0;d=this.length)return-1;for(var c=a.y_,d=b;0<=d&&this[d].y_==c;){if(this[d]==a)return d;d--}for(;ba.y_)c=d;else{b=d;break}}return b};Blockly.ConnectionDB.prototype.removeConnection_=function(a){if(!a.inDB_)throw"Connection not in database.";var b=this.findConnection(a);if(-1==b)throw"Unable to find connection in connectionDB.";a.inDB_=!1;this.splice(b,1)}; -Blockly.ConnectionDB.prototype.getNeighbours=function(a,b){function c(a){var c=e-d[a].x_,g=f-d[a].y_;Math.sqrt(c*c+g*g)<=b&&l.push(d[a]);return g=c+d&&(e+=f);this.svgKnob_.setAttribute(this.horizontal_?"x":"y",this.constrainKnob_(e)); -this.onScroll_()}a.stopPropagation()}; -Blockly.Scrollbar.prototype.onMouseDownKnob_=function(a){this.onMouseUpKnob_();Blockly.isRightButton(a)||(Blockly.setPageSelectable(!1),this.startDragKnob=parseFloat(this.svgKnob_.getAttribute(this.horizontal_?"x":"y")),this.startDragMouse=this.horizontal_?a.clientX:a.clientY,Blockly.Scrollbar.onMouseUpWrapper_=Blockly.bindEvent_(document,"mouseup",this,this.onMouseUpKnob_),Blockly.Scrollbar.onMouseMoveWrapper_=Blockly.bindEvent_(document,"mousemove",this,this.onMouseMoveKnob_));a.stopPropagation()}; +Blockly.Scrollbar.prototype.onMouseDownBar_=function(a){this.onMouseUpKnob_();if(Blockly.isRightButton(a))a.stopPropagation();else{var b=Blockly.mouseToSvg(a,this.workspace_.getParentSvg()),b=this.horizontal_?b.x:b.y,c=Blockly.getSvgXY_(this.svgKnob_,this.workspace_),c=this.horizontal_?c.x:c.y,d=parseFloat(this.svgKnob_.getAttribute(this.horizontal_?"width":"height")),e=parseFloat(this.svgKnob_.getAttribute(this.horizontal_?"x":"y")),f=.95*d;b<=c?e-=f:b>=c+d&&(e+=f);this.svgKnob_.setAttribute(this.horizontal_? +"x":"y",this.constrainKnob_(e));this.onScroll_();a.stopPropagation();a.preventDefault()}}; +Blockly.Scrollbar.prototype.onMouseDownKnob_=function(a){this.onMouseUpKnob_();Blockly.isRightButton(a)?a.stopPropagation():(this.startDragKnob=parseFloat(this.svgKnob_.getAttribute(this.horizontal_?"x":"y")),this.startDragMouse=this.horizontal_?a.clientX:a.clientY,Blockly.Scrollbar.onMouseUpWrapper_=Blockly.bindEvent_(document,"mouseup",this,this.onMouseUpKnob_),Blockly.Scrollbar.onMouseMoveWrapper_=Blockly.bindEvent_(document,"mousemove",this,this.onMouseMoveKnob_),a.stopPropagation(),a.preventDefault())}; Blockly.Scrollbar.prototype.onMouseMoveKnob_=function(a){this.svgKnob_.setAttribute(this.horizontal_?"x":"y",this.constrainKnob_(this.startDragKnob+((this.horizontal_?a.clientX:a.clientY)-this.startDragMouse)));this.onScroll_()}; -Blockly.Scrollbar.prototype.onMouseUpKnob_=function(){Blockly.setPageSelectable(!0);Blockly.hideChaff(!0);Blockly.Scrollbar.onMouseUpWrapper_&&(Blockly.unbindEvent_(Blockly.Scrollbar.onMouseUpWrapper_),Blockly.Scrollbar.onMouseUpWrapper_=null);Blockly.Scrollbar.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.Scrollbar.onMouseMoveWrapper_),Blockly.Scrollbar.onMouseMoveWrapper_=null)}; +Blockly.Scrollbar.prototype.onMouseUpKnob_=function(){Blockly.hideChaff(!0);Blockly.Scrollbar.onMouseUpWrapper_&&(Blockly.unbindEvent_(Blockly.Scrollbar.onMouseUpWrapper_),Blockly.Scrollbar.onMouseUpWrapper_=null);Blockly.Scrollbar.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.Scrollbar.onMouseMoveWrapper_),Blockly.Scrollbar.onMouseMoveWrapper_=null)}; Blockly.Scrollbar.prototype.constrainKnob_=function(a){if(0>=a||isNaN(a))a=0;else{var b=this.horizontal_?"width":"height",c=parseFloat(this.svgBackground_.getAttribute(b)),b=parseFloat(this.svgKnob_.getAttribute(b));a=Math.min(a,c-b)}return a}; Blockly.Scrollbar.prototype.onScroll_=function(){var a=parseFloat(this.svgKnob_.getAttribute(this.horizontal_?"x":"y")),b=parseFloat(this.svgBackground_.getAttribute(this.horizontal_?"width":"height")),a=a/b;if(isNaN(a)||!b)a=0;b={};this.horizontal_?b.x=a:b.y=a;this.workspace_.setMetrics(b)};Blockly.Scrollbar.prototype.set=function(a){a=this.constrainKnob_(a*this.ratio_);this.svgKnob_.setAttribute(this.horizontal_?"x":"y",a);this.onScroll_()}; Blockly.Scrollbar.insertAfter_=function(a,b){var c=b.nextSibling,d=b.parentNode;if(!d)throw"Reference node has no parent.";c?d.insertBefore(a,c):d.appendChild(a)};Blockly.Trashcan=function(a){this.workspace_=a};Blockly.Trashcan.prototype.WIDTH_=47;Blockly.Trashcan.prototype.BODY_HEIGHT_=44;Blockly.Trashcan.prototype.LID_HEIGHT_=16;Blockly.Trashcan.prototype.MARGIN_BOTTOM_=20;Blockly.Trashcan.prototype.MARGIN_SIDE_=20;Blockly.Trashcan.prototype.MARGIN_HOTSPOT_=10;Blockly.Trashcan.prototype.isOpen=!1;Blockly.Trashcan.prototype.svgGroup_=null;Blockly.Trashcan.prototype.svgLid_=null;Blockly.Trashcan.prototype.lidTask_=0;Blockly.Trashcan.prototype.lidOpen_=0; @@ -1000,7 +993,7 @@ Blockly.Xml.domToPrettyText=function(a){a=Blockly.Xml.domToText(a).split("<");fo Blockly.Xml.textToDom=function(a){a=(new DOMParser).parseFromString(a,"text/xml");if(!a||!a.firstChild||"xml"!=a.firstChild.nodeName.toLowerCase()||a.firstChild!==a.lastChild)throw"Blockly.Xml.textToDom did not obtain a valid XML tree.";return a.firstChild}; Blockly.Xml.domToWorkspace=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var d;b.RTL&&(d=b.getWidth());Blockly.Field.startCache();var c=a.childNodes.length,e=Blockly.Events.getGroup();e||Blockly.Events.setGroup(!0);for(var f=0;fb.bottomRight.x&&(b.bottomRight.x=d.bottomRight.x);d.topLeft.yb.bottomRight.y&&(b.bottomRight.y=d.bottomRight.y)}return{x:b.topLeft.x,y:b.topLeft.y,width:b.bottomRight.x- -b.topLeft.x,height:b.bottomRight.y-b.topLeft.y}};Blockly.WorkspaceSvg.prototype.cleanUp_=function(){Blockly.Events.setGroup(!0);for(var a=this.getTopBlocks(!0),b=0,c=0,d;d=a[c];c++){var e=d.getRelativeToSurfaceXY();d.moveBy(-e.x,b-e.y);d.snapToGrid();b=d.getRelativeToSurfaceXY().y+d.getHeightWidth().height+Blockly.BlockSvg.MIN_BLOCK_Y}Blockly.Events.setGroup(!1);Blockly.fireUiEvent(window,"resize")}; +b.topLeft.x,height:b.bottomRight.y-b.topLeft.y}};Blockly.WorkspaceSvg.prototype.cleanUp_=function(){Blockly.Events.setGroup(!0);for(var a=this.getTopBlocks(!0),b=0,c=0,d;d=a[c];c++){var e=d.getRelativeToSurfaceXY();d.moveBy(-e.x,b-e.y);d.snapToGrid();b=d.getRelativeToSurfaceXY().y+d.getHeightWidth().height+Blockly.BlockSvg.MIN_BLOCK_Y}Blockly.Events.setGroup(!1);Blockly.asyncSvgResize(this)}; Blockly.WorkspaceSvg.prototype.showContextMenu_=function(a){function b(a){if(a.isDeletable())m=m.concat(a.getDescendants());else{a=a.getChildren();for(var c=0;cm.length||window.confirm(Blockly.Msg.DELETE_ALL_BLOCKS.replace("%1",String(m.length))))&&c()}};d.push(g);Blockly.ContextMenu.show(a,d,this.RTL)}}; @@ -1088,9 +1081,9 @@ Blockly.Block.prototype.setHelpUrl=function(a){this.helpUrl=a};Blockly.Block.pro Blockly.Block.prototype.getField=function(a){for(var b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)if(e.name===a)return e;return null};Blockly.Block.prototype.getVars=function(){for(var a=[],b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)e instanceof Blockly.FieldVariable&&a.push(e.getValue());return a}; Blockly.Block.prototype.renameVar=function(a,b){for(var c=0,d;d=this.inputList[c];c++)for(var e=0,f;f=d.fieldRow[e];e++)f instanceof Blockly.FieldVariable&&Blockly.Names.equals(a,f.getValue())&&f.setValue(b)};Blockly.Block.prototype.getFieldValue=function(a){return(a=this.getField(a))?a.getValue():null};Blockly.Block.prototype.getTitleValue=function(a){console.warn("Deprecated call to getTitleValue, use getFieldValue instead.");return this.getFieldValue(a)}; Blockly.Block.prototype.setFieldValue=function(a,b){var c=this.getField(b);goog.asserts.assertObject(c,'Field "%s" not found.',b);c.setValue(a)};Blockly.Block.prototype.setTitleValue=function(a,b){console.warn("Deprecated call to setTitleValue, use setFieldValue instead.");this.setFieldValue(a,b)}; -Blockly.Block.prototype.setPreviousStatement=function(a,b){a?(void 0===b&&(b=null),this.previousConnection||(goog.asserts.assert(!this.outputConnection,"Remove output connection prior to adding previous connection."),this.previousConnection=new Blockly.Connection(this,Blockly.PREVIOUS_STATEMENT)),this.previousConnection.setCheck(b)):this.previousConnection&&(goog.asserts.assert(!this.previousConnection.isConnected(),"Must disconnect previous statement before removing connection."),this.previousConnection.dispose(), -this.previousConnection=null)};Blockly.Block.prototype.setNextStatement=function(a,b){a?(void 0===b&&(b=null),this.nextConnection||(this.nextConnection=new Blockly.Connection(this,Blockly.NEXT_STATEMENT)),this.nextConnection.setCheck(b)):this.nextConnection&&(goog.asserts.assert(!this.nextConnection.isConnected(),"Must disconnect next statement before removing connection."),this.nextConnection.dispose(),this.nextConnection=null)}; -Blockly.Block.prototype.setOutput=function(a,b){a?(void 0===b&&(b=null),this.outputConnection||(goog.asserts.assert(!this.previousConnection,"Remove previous connection prior to adding output connection."),this.outputConnection=new Blockly.Connection(this,Blockly.OUTPUT_VALUE)),this.outputConnection.setCheck(b)):this.outputConnection&&(goog.asserts.assert(!this.outputConnection.isConnected(),"Must disconnect output value before removing connection."),this.outputConnection.dispose(),this.outputConnection= +Blockly.Block.prototype.setPreviousStatement=function(a,b){a?(void 0===b&&(b=null),this.previousConnection||(goog.asserts.assert(!this.outputConnection,"Remove output connection prior to adding previous connection."),this.previousConnection=this.makeConnection_(Blockly.PREVIOUS_STATEMENT)),this.previousConnection.setCheck(b)):this.previousConnection&&(goog.asserts.assert(!this.previousConnection.isConnected(),"Must disconnect previous statement before removing connection."),this.previousConnection.dispose(), +this.previousConnection=null)};Blockly.Block.prototype.setNextStatement=function(a,b){a?(void 0===b&&(b=null),this.nextConnection||(this.nextConnection=this.makeConnection_(Blockly.NEXT_STATEMENT)),this.nextConnection.setCheck(b)):this.nextConnection&&(goog.asserts.assert(!this.nextConnection.isConnected(),"Must disconnect next statement before removing connection."),this.nextConnection.dispose(),this.nextConnection=null)}; +Blockly.Block.prototype.setOutput=function(a,b){a?(void 0===b&&(b=null),this.outputConnection||(goog.asserts.assert(!this.previousConnection,"Remove previous connection prior to adding output connection."),this.outputConnection=this.makeConnection_(Blockly.OUTPUT_VALUE)),this.outputConnection.setCheck(b)):this.outputConnection&&(goog.asserts.assert(!this.outputConnection.isConnected(),"Must disconnect output value before removing connection."),this.outputConnection.dispose(),this.outputConnection= null)};Blockly.Block.prototype.setInputsInline=function(a){this.inputsInline!=a&&(Blockly.Events.fire(new Blockly.Events.Change(this,"inline",null,this.inputsInline,a)),this.inputsInline=a)}; Blockly.Block.prototype.getInputsInline=function(){if(void 0!=this.inputsInline)return this.inputsInline;for(var a=1;a=b.height&&(k-=g.height);c?g.width>=a.clientX&&(e+=g.width):a.clientX+g.width>=b.width&&(e-=g.width);Blockly.WidgetDiv.position(e,k,b,f,c);d.setAllowAutoFocus(!0);setTimeout(function(){h.focus()},1);Blockly.ContextMenu.currentBlock=null}else Blockly.ContextMenu.hide()}; +Blockly.Block.prototype.getRelativeToSurfaceXY=function(){return this.xy_};Blockly.Block.prototype.moveBy=function(a,b){goog.asserts.assert(!this.parentBlock_,"Block has parent.");var c=new Blockly.Events.Move(this);this.xy_.translate(a,b);c.recordNew();Blockly.Events.fire(c)};Blockly.Block.prototype.makeConnection_=function(a){return new Blockly.Connection(this,a)};Blockly.ContextMenu={};Blockly.ContextMenu.currentBlock=null; +Blockly.ContextMenu.show=function(a,b,c){Blockly.WidgetDiv.show(Blockly.ContextMenu,c,null);if(b.length){var d=new goog.ui.Menu;d.setRightToLeft(c);for(var e=0,f;f=b[e];e++){var g=new goog.ui.MenuItem(f.text);g.setRightToLeft(c);d.addChild(g,!0);g.setEnabled(f.enabled);f.enabled&&goog.events.listen(g,goog.ui.Component.EventType.ACTION,f.callback)}goog.events.listen(d,goog.ui.Component.EventType.ACTION,Blockly.ContextMenu.hide);b=goog.dom.getViewportSize();e=goog.style.getViewportPageOffset(document); +d.render(Blockly.WidgetDiv.DIV);var h=d.getElement();Blockly.addClass_(h,"blocklyContextMenu");f=goog.style.getSize(h);var g=a.clientX+e.x,k=a.clientY+e.y;a.clientY+f.height>=b.height&&(k-=f.height);c?f.width>=a.clientX&&(g+=f.width):a.clientX+f.width>=b.width&&(g-=f.width);Blockly.WidgetDiv.position(g,k,b,e,c);d.setAllowAutoFocus(!0);setTimeout(function(){h.focus()},1);Blockly.ContextMenu.currentBlock=null}else Blockly.ContextMenu.hide()}; Blockly.ContextMenu.hide=function(){Blockly.WidgetDiv.hideIfOwner(Blockly.ContextMenu);Blockly.ContextMenu.currentBlock=null}; -Blockly.ContextMenu.callbackFactory=function(a,b){return function(){Blockly.Events.disable();var c=Blockly.Xml.domToBlock(b,a.workspace),d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-Blockly.SNAP_RADIUS:d.x+Blockly.SNAP_RADIUS;d.y+=2*Blockly.SNAP_RADIUS;c.moveBy(d.x,d.y);Blockly.Events.enable();Blockly.Events.isEnabled()&&!c.isShadow()&&Blockly.Events.fire(new Blockly.Events.Create(c));c.select()}};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.createSvgElement("g",{},null);this.svgPathDark_=Blockly.createSvgElement("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.svgGroup_);this.svgPath_=Blockly.createSvgElement("path",{"class":"blocklyPath"},this.svgGroup_);this.svgPathLight_=Blockly.createSvgElement("path",{"class":"blocklyPathLight"},this.svgGroup_);this.svgPath_.tooltip=this;this.rendered=!1;Blockly.Tooltip.bindMouseEvents(this.svgPath_);Blockly.BlockSvg.superClass_.constructor.call(this, +Blockly.ContextMenu.callbackFactory=function(a,b){return function(){Blockly.Events.disable();var c=Blockly.Xml.domToBlock(b,a.workspace),d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-Blockly.SNAP_RADIUS:d.x+Blockly.SNAP_RADIUS;d.y+=2*Blockly.SNAP_RADIUS;c.moveBy(d.x,d.y);Blockly.Events.enable();Blockly.Events.isEnabled()&&!c.isShadow()&&Blockly.Events.fire(new Blockly.Events.Create(c));c.select()}};Blockly.RenderedConnection=function(a,b){Blockly.RenderedConnection.superClass_.constructor.call(this,a,b)};goog.inherits(Blockly.RenderedConnection,Blockly.Connection);Blockly.RenderedConnection.prototype.distanceFrom=function(a){var b=this.x_-a.x_;a=this.y_-a.y_;return Math.sqrt(b*b+a*a)}; +Blockly.RenderedConnection.prototype.bumpAwayFrom_=function(a){if(Blockly.dragMode_==Blockly.DRAG_NONE){var b=this.sourceBlock_.getRootBlock();if(!b.isInFlyout){var c=!1;if(!b.isMovable()){b=a.getSourceBlock().getRootBlock();if(!b.isMovable())return;a=this;c=!0}b.getSvgRoot().parentNode.appendChild(b.getSvgRoot());var d=a.x_+Blockly.SNAP_RADIUS-this.x_;a=a.y_+Blockly.SNAP_RADIUS-this.y_;c&&(a=-a);b.RTL&&(d=-d);b.moveBy(d,a)}}}; +Blockly.RenderedConnection.prototype.moveTo=function(a,b){this.inDB_&&this.db_.removeConnection_(this);this.x_=a;this.y_=b;this.hidden_||this.db_.addConnection(this)};Blockly.RenderedConnection.prototype.moveBy=function(a,b){this.moveTo(this.x_+a,this.y_+b)}; +Blockly.RenderedConnection.prototype.tighten_=function(){var a=this.targetConnection.x_-this.x_,b=this.targetConnection.y_-this.y_;if(0!=a||0!=b){var c=this.targetBlock(),d=c.getSvgRoot();if(!d)throw"block is not rendered.";d=Blockly.getRelativeXY_(d);c.getSvgRoot().setAttribute("transform","translate("+(d.x-a)+","+(d.y-b)+")");c.moveConnections_(-a,-b)}};Blockly.RenderedConnection.prototype.closest=function(a,b,c){return this.dbOpposite_.searchForClosest(this,a,b,c)}; +Blockly.RenderedConnection.prototype.highlight=function(){var a;a=this.type==Blockly.INPUT_VALUE||this.type==Blockly.OUTPUT_VALUE?"m 0,0 "+Blockly.BlockSvg.TAB_PATH_DOWN+" v 5":"m -20,0 h 5 "+Blockly.BlockSvg.NOTCH_PATH_LEFT+" h 5";var b=this.sourceBlock_.getRelativeToSurfaceXY();Blockly.Connection.highlightedPath_=Blockly.createSvgElement("path",{"class":"blocklyHighlightedConnectionPath",d:a,transform:"translate("+(this.x_-b.x)+","+(this.y_-b.y)+")"+(this.sourceBlock_.RTL?" scale(-1 1)":"")},this.sourceBlock_.getSvgRoot())}; +Blockly.RenderedConnection.prototype.unhideAll=function(){this.setHidden(!1);var a=[];if(this.type!=Blockly.INPUT_VALUE&&this.type!=Blockly.NEXT_STATEMENT)return a;var b=this.targetBlock();if(b){var c;b.isCollapsed()?(c=[],b.outputConnection&&c.push(b.outputConnection),b.nextConnection&&c.push(b.nextConnection),b.previousConnection&&c.push(b.previousConnection)):c=b.getConnections_(!0);for(var d=0;db?!1:Blockly.RenderedConnection.superClass_.isConnectionAllowed.call(this,a)}; +Blockly.RenderedConnection.prototype.disconnectInternal_=function(a,b){Blockly.RenderedConnection.superClass_.disconnectInternal_.call(this,a,b);a.rendered&&a.render();b.rendered&&(b.updateDisabled(),b.render())}; +Blockly.RenderedConnection.prototype.respawnShadow_=function(){var a=this.getSourceBlock(),b=this.getShadowDom();if(a.workspace&&b&&Blockly.Events.recordUndo){b=Blockly.RenderedConnection.superClass_.respawnShadow_.call(this);if(!b)throw"Couldn't respawn the shadow block that should exist here.";b.initSvg();b.render(!1);a.rendered&&a.render()}};Blockly.RenderedConnection.prototype.neighbours_=function(a){return this.dbOpposite_.getNeighbours(this,a)}; +Blockly.RenderedConnection.prototype.connect_=function(a){Blockly.RenderedConnection.superClass_.connect_.call(this,a);var b=this.getSourceBlock();a=a.getSourceBlock();b.rendered&&b.updateDisabled();a.rendered&&a.updateDisabled();b.rendered&&a.rendered&&(this.type==Blockly.NEXT_STATEMENT||this.type==Blockly.PREVIOUS_STATEMENT?a.render():b.render())};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.createSvgElement("g",{},null);this.svgPathDark_=Blockly.createSvgElement("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.svgGroup_);this.svgPath_=Blockly.createSvgElement("path",{"class":"blocklyPath"},this.svgGroup_);this.svgPathLight_=Blockly.createSvgElement("path",{"class":"blocklyPathLight"},this.svgGroup_);this.svgPath_.tooltip=this;this.rendered=!1;Blockly.Tooltip.bindMouseEvents(this.svgPath_);Blockly.BlockSvg.superClass_.constructor.call(this, a,b,c)};goog.inherits(Blockly.BlockSvg,Blockly.Block);Blockly.BlockSvg.prototype.height=0;Blockly.BlockSvg.prototype.width=0;Blockly.BlockSvg.prototype.dragStartXY_=null;Blockly.BlockSvg.INLINE=-1; Blockly.BlockSvg.prototype.initSvg=function(){goog.asserts.assert(this.workspace.rendered,"Workspace is headless.");for(var a=0,b;b=this.inputList[a];a++)b.init();b=this.getIcons();for(a=0;athis.workspace.remainingCapacity()&&(d.enabled=!1);c.push(d);this.isEditable()&&!this.collapsed_&&this.workspace.options.comments&&(d={enabled:!goog.userAgent.IE},this.comment?(d.text=Blockly.Msg.REMOVE_COMMENT, d.callback=function(){b.setCommentText(null)}):(d.text=Blockly.Msg.ADD_COMMENT,d.callback=function(){b.setCommentText("")}),c.push(d));if(!this.collapsed_)for(d=1;d=a.clientX&&0==a.clientY&&0==a.button)){var b=this.getRelativeToSurfaceXY(),c=this.workspace.moveDrag(a);if(Blockly.dragMode_==Blockly.DRAG_STICKY&&goog.math.Coordinate.distance(b,c)*this.workspace.scale>Blockly.DRAG_RADIUS){Blockly.dragMode_=Blockly.DRAG_FREE;Blockly.longStop_();if(this.parentBlock_){this.unplug();var d=this.getSvgRoot();d.translate_="translate("+c.x+","+c.y+")";this.disconnectUiEffect()}this.setDragging_(!0)}if(Blockly.dragMode_== +Blockly.BlockSvg.prototype.onMouseMove_=function(a){if("mousemove"==a.type&&1>=a.clientX&&0==a.clientY&&0==a.button)a.stopPropagation();else{var b=this.getRelativeToSurfaceXY(),c=this.workspace.moveDrag(a);if(Blockly.dragMode_==Blockly.DRAG_STICKY&&goog.math.Coordinate.distance(b,c)*this.workspace.scale>Blockly.DRAG_RADIUS){Blockly.dragMode_=Blockly.DRAG_FREE;Blockly.longStop_();if(this.parentBlock_){this.unplug();var d=this.getSvgRoot();d.translate_="translate("+c.x+","+c.y+")";this.disconnectUiEffect()}this.setDragging_(!0)}if(Blockly.dragMode_== Blockly.DRAG_FREE){b=goog.math.Coordinate.difference(b,this.dragStartXY_);d=this.getSvgRoot();d.translate_="translate("+c.x+","+c.y+")";d.setAttribute("transform",d.translate_+d.skew_);for(c=0;c>>/g,Blockly.Css.mediaPath_),d=document.createElement("style");document.head.appendChild(d);c=document.createTextNode(c);d.appendChild(c);Blockly.Css.styleSheet_=d.sheet;Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN)}}; Blockly.Css.setCursor=function(a){if(Blockly.Css.currentCursor_!=a){Blockly.Css.currentCursor_=a;var b="url("+Blockly.Css.mediaPath_+"/"+a+".cur), auto",c=".blocklyDraggable {\n cursor: "+b+";\n}\n";Blockly.Css.styleSheet_.deleteRule(0);Blockly.Css.styleSheet_.insertRule(c,0);for(var c=document.getElementsByClassName("blocklyToolboxDiv"),d=0,e;e=c[d];d++)e.style.cursor=a==Blockly.Css.Cursor.DELETE?b:"";document.body.parentNode.style.cursor=a==Blockly.Css.Cursor.OPEN?"":b}}; -Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 999;","}",".blocklyNonSelectable {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;","-ms-user-select: none;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);","color: #000;","display: none;","font-family: sans-serif;", -"font-size: 9pt;","opacity: 0.9;","padding: 2px;","position: absolute;","z-index: 1000;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #888;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {","fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPath {","stroke: #fc3;", -"stroke-width: 3px;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyText {","cursor: default;","fill: #fff;","font-family: sans-serif;", -"font-size: 11pt;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {","fill: #fff;","fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {","fill: #000;","}",".blocklyEditableText:hover>rect {","stroke: #fff;","stroke-width: 2;","}",".blocklyBubbleText {","fill: #000;","}",".blocklySvg text {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {", -"display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyCommentTextarea {","background-color: #ffc;","border: 0;","margin: 0;","padding: 2px;","resize: none;", -"}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","font-family: sans-serif;","height: 100%;","margin: 0;","outline: none;","padding: 0 1px;","width: 100%","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarKnob {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarKnob,", -".blocklyScrollbarKnob:hover {","fill: #bbb;","}",".blocklyZoom>image {","opacity: .4;","}",".blocklyZoom>image:hover {","opacity: .6;","}",".blocklyZoom>image:active {","opacity: .8;","}",".blocklyFlyout .blocklyScrollbarKnob {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarKnob,",".blocklyFlyout .blocklyScrollbarKnob:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyAngleCircle {","stroke: #444;","stroke-width: 1;","fill: #ddd;", -"fill-opacity: .8;","}",".blocklyAngleMarks {","stroke: #444;","stroke-width: 1;","}",".blocklyAngleGauge {","fill: #f88;","fill-opacity: .8;","}",".blocklyAngleLine {","stroke: #f00;","stroke-width: 2;","stroke-linecap: round;","}",".blocklyContextMenu {","border-radius: 4px;","}",".blocklyDropdownMenu {","padding: 0 !important;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px !important;", -"}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {","height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {", -"border-bottom: solid #e5e5e5 1px;","height: 0px;","margin: 5px 0;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0px -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {","background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {", -"background-position: 0px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}",".blocklyWidgetDiv .goog-palette {","outline: none;","cursor: default;", -"}",".blocklyWidgetDiv .goog-palette-table {","border: 1px solid #666;","border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {","height: 13px;","width: 15px;","margin: 0;","border: 0;","text-align: center;","vertical-align: middle;","border-right: 1px solid #666;","font-size: 1px;","}",".blocklyWidgetDiv .goog-palette-colorswatch {","position: relative;","height: 13px;","width: 15px;","border: 1px solid #666;","}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {", -"border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {","border: 1px solid #000;","color: #fff;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;","border-color: #ccc #666 #666 #ccc;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem {", -"color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","padding: 4px 7em 4px 28px;","white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {","padding-left: 7em;","padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {","padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {","padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {", -"color: #000;","font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {","color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: 0.3;","-moz-opacity: 0.3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {","background-color: #d6e9f8;","border-color: #d6e9f8;", -"border-style: dotted;","border-width: 1px 0;","padding-bottom: 3px;","padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon {","background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,", -".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;","}",".blocklyWidgetDiv .goog-menuitem-accel {","color: #999;","direction: ltr;","left: auto;","padding: 0 6px;","position: absolute;","right: 0;","text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {","left: 0;","right: auto;","text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {","text-decoration: underline;", -"}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {","color: #999;","font-size: 12px;","padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {","border-top: 1px solid #ccc;","margin: 4px 0;","padding: 0;","}",""];Blockly.WidgetDiv={};Blockly.WidgetDiv.DIV=null;Blockly.WidgetDiv.owner_=null;Blockly.WidgetDiv.dispose_=null;Blockly.WidgetDiv.createDom=function(){Blockly.WidgetDiv.DIV||(Blockly.WidgetDiv.DIV=goog.dom.createDom("div","blocklyWidgetDiv"),document.body.appendChild(Blockly.WidgetDiv.DIV))}; +Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 999;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);","color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: 0.9;","padding: 2px;","position: absolute;","z-index: 1000;","}",".blocklyResizeSE {","cursor: se-resize;", +"fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #888;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {","fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {", +"fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyText {","cursor: default;","fill: #fff;","font-family: sans-serif;","font-size: 11pt;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {", +"fill: #fff;","fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {","fill: #000;","}",".blocklyEditableText:hover>rect {","stroke: #fff;","stroke-width: 2;","}",".blocklyBubbleText {","fill: #000;","}",".blocklySvg text {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;", +"}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyCommentTextarea {","background-color: #ffc;","border: 0;","margin: 0;","padding: 2px;","resize: none;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","font-family: sans-serif;","height: 100%;","margin: 0;","outline: none;", +"padding: 0 1px;","width: 100%","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarKnob {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarKnob,",".blocklyScrollbarKnob:hover {","fill: #bbb;","}",".blocklyZoom>image {","opacity: .4;","}",".blocklyZoom>image:hover {", +"opacity: .6;","}",".blocklyZoom>image:active {","opacity: .8;","}",".blocklyFlyout .blocklyScrollbarKnob {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarKnob,",".blocklyFlyout .blocklyScrollbarKnob:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyAngleCircle {","stroke: #444;","stroke-width: 1;","fill: #ddd;","fill-opacity: .8;","}",".blocklyAngleMarks {","stroke: #444;","stroke-width: 1;","}",".blocklyAngleGauge {","fill: #f88;", +"fill-opacity: .8;","}",".blocklyAngleLine {","stroke: #f00;","stroke-width: 2;","stroke-linecap: round;","}",".blocklyContextMenu {","border-radius: 4px;","}",".blocklyDropdownMenu {","padding: 0 !important;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px !important;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;", +"position: absolute;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {","height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0px;","margin: 5px 0;","}", +".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0px -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {","background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0px -17px;", +"}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}",".blocklyWidgetDiv .goog-palette {","outline: none;","cursor: default;","}",".blocklyWidgetDiv .goog-palette-table {", +"border: 1px solid #666;","border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {","height: 13px;","width: 15px;","margin: 0;","border: 0;","text-align: center;","vertical-align: middle;","border-right: 1px solid #666;","font-size: 1px;","}",".blocklyWidgetDiv .goog-palette-colorswatch {","position: relative;","height: 13px;","width: 15px;","border: 1px solid #666;","}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {","border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {", +"border: 1px solid #000;","color: #fff;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;","border-color: #ccc #666 #666 #ccc;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;", +"margin: 0;","padding: 4px 7em 4px 28px;","white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {","padding-left: 7em;","padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {","padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {","padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,", +".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {","color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: 0.3;","-moz-opacity: 0.3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {","background-color: #d6e9f8;","border-color: #d6e9f8;","border-style: dotted;","border-width: 1px 0;","padding-bottom: 3px;","padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,", +".blocklyWidgetDiv .goog-menuitem-icon {","background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;", +"}",".blocklyWidgetDiv .goog-menuitem-accel {","color: #999;","direction: ltr;","left: auto;","padding: 0 6px;","position: absolute;","right: 0;","text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {","left: 0;","right: auto;","text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {","text-decoration: underline;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {","color: #999;","font-size: 12px;","padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {", +"border-top: 1px solid #ccc;","margin: 4px 0;","padding: 0;","}",""];Blockly.WidgetDiv={};Blockly.WidgetDiv.DIV=null;Blockly.WidgetDiv.owner_=null;Blockly.WidgetDiv.dispose_=null;Blockly.WidgetDiv.createDom=function(){Blockly.WidgetDiv.DIV||(Blockly.WidgetDiv.DIV=goog.dom.createDom("div","blocklyWidgetDiv"),document.body.appendChild(Blockly.WidgetDiv.DIV))}; Blockly.WidgetDiv.show=function(a,b,c){Blockly.WidgetDiv.hide();Blockly.WidgetDiv.owner_=a;Blockly.WidgetDiv.dispose_=c;a=goog.style.getViewportPageOffset(document);Blockly.WidgetDiv.DIV.style.top=a.y+"px";Blockly.WidgetDiv.DIV.style.direction=b?"rtl":"ltr";Blockly.WidgetDiv.DIV.style.display="block"}; Blockly.WidgetDiv.hide=function(){Blockly.WidgetDiv.owner_&&(Blockly.WidgetDiv.owner_=null,Blockly.WidgetDiv.DIV.style.display="none",Blockly.WidgetDiv.DIV.style.left="",Blockly.WidgetDiv.DIV.style.top="",Blockly.WidgetDiv.DIV.style.height="",Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_(),Blockly.WidgetDiv.dispose_=null,goog.dom.removeChildren(Blockly.WidgetDiv.DIV))};Blockly.WidgetDiv.isVisible=function(){return!!Blockly.WidgetDiv.owner_}; Blockly.WidgetDiv.hideIfOwner=function(a){Blockly.WidgetDiv.owner_==a&&Blockly.WidgetDiv.hide()};Blockly.WidgetDiv.position=function(a,b,c,d,e){bc.width+d.x&&(a=c.width+d.x):aa.viewHeight+f||a.contentLeft<(b.RTL?a.viewLeft:e)||a.contentLeft+a.contentWidth>(b.RTL?a.viewWidth:a.viewWidth+e))for(var g=c.getTopBlocks(!1),h=0,k;k=g[h];h++){var l=k.getRelativeToSurfaceXY(),q=k.getHeightWidth(),m=f+25-q.height-l.y;0m&&k.moveBy(0,m);m=25+e-l.x-(b.RTL?0:q.width);0m&&k.moveBy(m,0)}}});Blockly.svgResize(c);Blockly.WidgetDiv.createDom();Blockly.Tooltip.createDom(); +f||a.contentTop+a.contentHeight>a.viewHeight+f||a.contentLeft<(b.RTL?a.viewLeft:e)||a.contentLeft+a.contentWidth>(b.RTL?a.viewWidth:a.viewWidth+e))for(var g=c.getTopBlocks(!1),h=0,k;k=g[h];h++){var l=k.getRelativeToSurfaceXY(),q=k.getHeightWidth(),m=f+25-q.height-l.y;0m&&k.moveBy(0,m);m=25+e-l.x-(b.RTL?0:q.width);0l&&k.moveBy(l,0)}}});Blockly.svgResize(c);Blockly.WidgetDiv.createDom();Blockly.Tooltip.createDom(); return c}; -Blockly.init_=function(a){var b=a.options,c=a.getParentSvg();Blockly.bindEvent_(c,"contextmenu",null,function(a){Blockly.isTargetInput_(a)||a.preventDefault()});Blockly.bindEvent_(window,"resize",null,function(){Blockly.svgResize(a)});Blockly.inject.bindDocumentEvents_();b.languageTree&&(a.toolbox_?a.toolbox_.init(a):a.flyout_&&(a.flyout_.init(a),a.flyout_.show(b.languageTree.childNodes),a.scrollX=a.flyout_.width_,b.RTL&&(a.scrollX*=-1),a.translate(a.scrollX,0)));b.hasScrollbars&&(a.scrollbar=new Blockly.ScrollbarPair(a), -a.scrollbar.resize());b.hasSounds&&Blockly.inject.loadSounds_(b.pathToMedia,a)}; -Blockly.inject.bindDocumentEvents_=function(){Blockly.documentEventsBound_||(Blockly.bindEvent_(document,"keydown",null,Blockly.onKeyDown_),Blockly.bindEvent_(document,"touchend",null,Blockly.longStop_),Blockly.bindEvent_(document,"touchcancel",null,Blockly.longStop_),document.addEventListener("mouseup",Blockly.onMouseUp_,!1),goog.userAgent.IPAD&&Blockly.bindEvent_(window,"orientationchange",document,function(){Blockly.fireUiEvent(window,"resize")}));Blockly.documentEventsBound_=!0}; +Blockly.init_=function(a){var b=a.options,c=a.getParentSvg();Blockly.bindEvent_(c,"contextmenu",null,function(a){Blockly.isTargetInput_(a)||a.preventDefault()});Blockly.bindEvent_(window,"resize",null,function(){Blockly.hideChaff(!0);Blockly.asyncSvgResize(a)});Blockly.inject.bindDocumentEvents_();b.languageTree&&(a.toolbox_?a.toolbox_.init(a):a.flyout_&&(a.flyout_.init(a),a.flyout_.show(b.languageTree.childNodes),a.scrollX=a.flyout_.width_,b.RTL&&(a.scrollX*=-1),a.translate(a.scrollX,0)));b.hasScrollbars&& +(a.scrollbar=new Blockly.ScrollbarPair(a),a.scrollbar.resize());b.hasSounds&&Blockly.inject.loadSounds_(b.pathToMedia,a)}; +Blockly.inject.bindDocumentEvents_=function(){Blockly.documentEventsBound_||(Blockly.bindEvent_(document,"keydown",null,Blockly.onKeyDown_),Blockly.bindEvent_(document,"touchend",null,Blockly.longStop_),Blockly.bindEvent_(document,"touchcancel",null,Blockly.longStop_),document.addEventListener("mouseup",Blockly.onMouseUp_,!1),goog.userAgent.IPAD&&Blockly.bindEvent_(window,"orientationchange",document,function(){Blockly.asyncSvgResize()}));Blockly.documentEventsBound_=!0}; Blockly.inject.loadSounds_=function(a,b){b.loadAudio_([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");b.loadAudio_([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");b.loadAudio_([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");var c=[],d=function(){for(;c.length;)Blockly.unbindEvent_(c.pop());b.preloadAudio_()};c.push(Blockly.bindEvent_(document,"mousemove",null,d));c.push(Blockly.bindEvent_(document,"touchstart",null,d))}; Blockly.updateToolbox=function(a){console.warn("Deprecated call to Blockly.updateToolbox, use workspace.updateToolbox instead.");Blockly.getMainWorkspace().updateToolbox(a)};Blockly.utils={};Blockly.addClass_=function(a,b){var c=a.getAttribute("class")||"";-1==(" "+c+" ").indexOf(" "+b+" ")&&(c&&(c+=" "),a.setAttribute("class",c+b))};Blockly.removeClass_=function(a,b){var c=a.getAttribute("class");if(-1!=(" "+c+" ").indexOf(" "+b+" ")){for(var c=c.split(/\s+/),d=0;d=g?(c=2,e=g,(g=d.join(""))&&b.push(g),d.length=0):(d.push("%",g),c=0):2==c&&("0"<=g&&"9">=g?e+=g:(b.push(parseInt(e,10)),f--,c=0))}(g=d.join(""))&&b.push(g);return b};Blockly.genUid=function(){for(var a=Blockly.genUid.soup_.length,b=[],c=0;20>c;c++)b[c]=Blockly.genUid.soup_.charAt(Math.random()*a);return b.join("")}; Blockly.genUid.soup_="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";var CLOSURE_DEFINES={"goog.DEBUG":!1};Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.highlightedConnection_=null;Blockly.localConnection_=null;Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.dragMode_=Blockly.DRAG_NONE;Blockly.onTouchUpWrapper_=null;Blockly.hueToRgb=function(a){return goog.color.hsvToHex(a,Blockly.HSV_SATURATION,255*Blockly.HSV_VALUE)};Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}}; -Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=b.parentNode;if(c){var d=c.offsetWidth,c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}}; -Blockly.onMouseUp_=function(a){a=Blockly.getMainWorkspace();Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);a.isScrolling=!1;Blockly.setPageSelectable(!0);Blockly.onTouchUpWrapper_&&(Blockly.unbindEvent_(Blockly.onTouchUpWrapper_),Blockly.onTouchUpWrapper_=null);Blockly.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.onMouseMoveWrapper_),Blockly.onMouseMoveWrapper_=null)}; +Blockly.asyncSvgResize=function(a){Blockly.svgResizePending_||(a||(a=Blockly.getMainWorkspace()),Blockly.svgResizePending_=!0,setTimeout(function(){Blockly.svgResize(a)},0))};Blockly.svgResizePending_=!1; +Blockly.svgResize=function(a){for(Blockly.svgResizePending_=!1;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=b.parentNode;if(c){var d=c.offsetWidth,c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}}; +Blockly.onMouseUp_=function(a){a=Blockly.getMainWorkspace();Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);a.isScrolling=!1;Blockly.onTouchUpWrapper_&&(Blockly.unbindEvent_(Blockly.onTouchUpWrapper_),Blockly.onTouchUpWrapper_=null);Blockly.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.onMouseMoveWrapper_),Blockly.onMouseMoveWrapper_=null)}; Blockly.onMouseMove_=function(a){if(!(a.touches&&2<=a.touches.length)){var b=Blockly.getMainWorkspace();if(b.isScrolling){var c=a.clientX-b.startDragMouseX,d=a.clientY-b.startDragMouseY,e=b.startDragMetrics,f=b.startScrollX+c,g=b.startScrollY+d,f=Math.min(f,-e.contentLeft),g=Math.min(g,-e.contentTop),f=Math.max(f,e.viewWidth-e.contentLeft-e.contentWidth),g=Math.max(g,e.viewHeight-e.contentTop-e.contentHeight);b.scrollbar.set(-f-e.contentLeft,-g-e.contentTop);Math.sqrt(c*c+d*d)>Blockly.DRAG_RADIUS&& -Blockly.longStop_();a.stopPropagation()}}}; +Blockly.longStop_();a.stopPropagation();a.preventDefault()}}}; Blockly.onKeyDown_=function(a){if(!Blockly.mainWorkspace.options.readOnly&&!Blockly.isTargetInput_(a)){var b=!1;if(27==a.keyCode)Blockly.hideChaff();else if(8==a.keyCode||46==a.keyCode)a.preventDefault(),Blockly.selected&&Blockly.selected.isDeletable()&&(b=!0);else if(a.altKey||a.ctrlKey||a.metaKey)Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(67==a.keyCode?(Blockly.hideChaff(),Blockly.copy_(Blockly.selected)):88==a.keyCode&&(Blockly.copy_(Blockly.selected),b=!0)), 86==a.keyCode?Blockly.clipboardXml_&&Blockly.clipboardSource_.paste(Blockly.clipboardXml_):90==a.keyCode&&(Blockly.hideChaff(),Blockly.mainWorkspace.undo(a.shiftKey));b&&(Blockly.Events.setGroup(!0),Blockly.hideChaff(),Blockly.selected.dispose(Blockly.dragMode_!=Blockly.DRAG_FREE,!0),Blockly.highlightedConnection_&&(Blockly.highlightedConnection_.unhighlight(),Blockly.highlightedConnection_=null),Blockly.Events.setGroup(!1))}};Blockly.terminateDrag_=function(){Blockly.BlockSvg.terminateDrag_();Blockly.Flyout.terminateDrag_()}; Blockly.longPid_=0;Blockly.longStart_=function(a,b){Blockly.longStop_();Blockly.longPid_=setTimeout(function(){a.button=2;b.onMouseDown_(a)},Blockly.LONGPRESS)};Blockly.longStop_=function(){Blockly.longPid_&&(clearTimeout(Blockly.longPid_),Blockly.longPid_=0)}; diff --git a/blockly_uncompressed.js b/blockly_uncompressed.js index 4d1dc517b..62cdc99f7 100644 --- a/blockly_uncompressed.js +++ b/blockly_uncompressed.js @@ -40,8 +40,8 @@ window.BLOCKLY_BOOT = function() { } goog.addDependency("../../../" + dir + "/core/block.js", ['Blockly.Block'], ['Blockly.Blocks', 'Blockly.Comment', 'Blockly.Connection', 'Blockly.Input', 'Blockly.Mutator', 'Blockly.Warning', 'Blockly.Workspace', 'Blockly.Xml', 'goog.array', 'goog.asserts', 'goog.math.Coordinate', 'goog.string']); goog.addDependency("../../../" + dir + "/core/block_render_svg.js", ['Blockly.BlockSvg.render'], ['Blockly.BlockSvg']); -goog.addDependency("../../../" + dir + "/core/block_svg.js", ['Blockly.BlockSvg'], ['Blockly.Block', 'Blockly.ContextMenu', 'goog.Timer', 'goog.asserts', 'goog.dom', 'goog.math.Coordinate', 'goog.userAgent']); -goog.addDependency("../../../" + dir + "/core/blockly.js", ['Blockly'], ['Blockly.BlockSvg.render', 'Blockly.Events', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Generator', 'Blockly.Msg', 'Blockly.Procedures', 'Blockly.Toolbox', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.constants', 'Blockly.inject', 'Blockly.utils', 'goog.color', 'goog.userAgent']); +goog.addDependency("../../../" + dir + "/core/block_svg.js", ['Blockly.BlockSvg'], ['Blockly.Block', 'Blockly.ContextMenu', 'Blockly.RenderedConnection', 'goog.Timer', 'goog.asserts', 'goog.dom', 'goog.math.Coordinate', 'goog.userAgent']); +goog.addDependency("../../../" + dir + "/core/blockly.js", ['Blockly'], ['Blockly.BlockSvg.render', 'Blockly.Events', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldTextInput', 'Blockly.FieldNumber', 'Blockly.FieldVariable', 'Blockly.Generator', 'Blockly.Msg', 'Blockly.Procedures', 'Blockly.Toolbox', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.constants', 'Blockly.inject', 'Blockly.utils', 'goog.color', 'goog.userAgent']); goog.addDependency("../../../" + dir + "/core/blocks.js", ['Blockly.Blocks'], []); goog.addDependency("../../../" + dir + "/core/bubble.js", ['Blockly.Bubble'], ['Blockly.Workspace', 'goog.dom', 'goog.math', 'goog.math.Coordinate', 'goog.userAgent']); goog.addDependency("../../../" + dir + "/core/comment.js", ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Icon', 'goog.userAgent']); @@ -59,6 +59,7 @@ goog.addDependency("../../../" + dir + "/core/field_date.js", ['Blockly.FieldDat goog.addDependency("../../../" + dir + "/core/field_dropdown.js", ['Blockly.FieldDropdown'], ['Blockly.Field', 'goog.dom', 'goog.events', 'goog.style', 'goog.ui.Menu', 'goog.ui.MenuItem', 'goog.userAgent']); goog.addDependency("../../../" + dir + "/core/field_image.js", ['Blockly.FieldImage'], ['Blockly.Field', 'goog.dom', 'goog.math.Size', 'goog.userAgent']); goog.addDependency("../../../" + dir + "/core/field_label.js", ['Blockly.FieldLabel'], ['Blockly.Field', 'Blockly.Tooltip', 'goog.dom', 'goog.math.Size']); +goog.addDependency("../../../" + dir + "/core/field_number.js", ['Blockly.FieldNumber'], ['Blockly.FieldTextInput']); goog.addDependency("../../../" + dir + "/core/field_textinput.js", ['Blockly.FieldTextInput'], ['Blockly.Field', 'Blockly.Msg', 'goog.asserts', 'goog.dom', 'goog.userAgent']); goog.addDependency("../../../" + dir + "/core/field_variable.js", ['Blockly.FieldVariable'], ['Blockly.FieldDropdown', 'Blockly.Msg', 'Blockly.Variables', 'goog.string']); goog.addDependency("../../../" + dir + "/core/flyout.js", ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.Comment', 'Blockly.Events', 'Blockly.WorkspaceSvg', 'goog.dom', 'goog.events', 'goog.math.Rect', 'goog.userAgent']); @@ -71,6 +72,7 @@ goog.addDependency("../../../" + dir + "/core/mutator.js", ['Blockly.Mutator'], goog.addDependency("../../../" + dir + "/core/names.js", ['Blockly.Names'], []); goog.addDependency("../../../" + dir + "/core/options.js", ['Blockly.Options'], []); goog.addDependency("../../../" + dir + "/core/procedures.js", ['Blockly.Procedures'], ['Blockly.Field', 'Blockly.Names', 'Blockly.Workspace']); +goog.addDependency("../../../" + dir + "/core/rendered_connection.js", ['Blockly.RenderedConnection'], ['Blockly.Connection']); goog.addDependency("../../../" + dir + "/core/scrollbar.js", ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['goog.dom', 'goog.events']); goog.addDependency("../../../" + dir + "/core/toolbox.js", ['Blockly.Toolbox'], ['Blockly.Flyout', 'goog.dom', 'goog.events', 'goog.events.BrowserFeature', 'goog.html.SafeHtml', 'goog.math.Rect', 'goog.style', 'goog.ui.tree.TreeControl', 'goog.ui.tree.TreeNode']); goog.addDependency("../../../" + dir + "/core/tooltip.js", ['Blockly.Tooltip'], ['goog.dom']); @@ -214,7 +216,7 @@ goog.addDependency("debug/debug.js", ['goog.debug'], ['goog.array', 'goog.html.S goog.addDependency("debug/debug_test.js", ['goog.debugTest'], ['goog.debug', 'goog.html.SafeHtml', 'goog.structs.Set', 'goog.testing.jsunit']); goog.addDependency("debug/debugwindow.js", ['goog.debug.DebugWindow'], ['goog.debug.HtmlFormatter', 'goog.debug.LogManager', 'goog.debug.Logger', 'goog.dom.safe', 'goog.html.SafeHtml', 'goog.html.SafeStyleSheet', 'goog.string.Const', 'goog.structs.CircularBuffer', 'goog.userAgent']); goog.addDependency("debug/debugwindow_test.js", ['goog.debug.DebugWindowTest'], ['goog.debug.DebugWindow', 'goog.testing.jsunit']); -goog.addDependency("debug/divconsole.js", ['goog.debug.DivConsole'], ['goog.debug.HtmlFormatter', 'goog.debug.LogManager', 'goog.dom.TagName', 'goog.dom.safe', 'goog.html.SafeHtml', 'goog.style']); +goog.addDependency("debug/divconsole.js", ['goog.debug.DivConsole'], ['goog.debug.HtmlFormatter', 'goog.debug.LogManager', 'goog.dom.TagName', 'goog.dom.safe', 'goog.html.SafeHtml', 'goog.html.SafeStyleSheet', 'goog.string.Const', 'goog.style']); goog.addDependency("debug/enhanceerror_test.js", ['goog.debugEnhanceErrorTest'], ['goog.debug', 'goog.testing.jsunit']); goog.addDependency("debug/entrypointregistry.js", ['goog.debug.EntryPointMonitor', 'goog.debug.entryPointRegistry'], ['goog.asserts']); goog.addDependency("debug/entrypointregistry_test.js", ['goog.debug.entryPointRegistryTest'], ['goog.debug.ErrorHandler', 'goog.debug.entryPointRegistry', 'goog.testing.jsunit']); @@ -742,6 +744,8 @@ goog.addDependency("labs/useragent/platform_test.js", ['goog.labs.userAgent.plat goog.addDependency("labs/useragent/test_agents.js", ['goog.labs.userAgent.testAgents'], []); goog.addDependency("labs/useragent/util.js", ['goog.labs.userAgent.util'], ['goog.string']); goog.addDependency("labs/useragent/util_test.js", ['goog.labs.userAgent.utilTest'], ['goog.functions', 'goog.labs.userAgent.testAgents', 'goog.labs.userAgent.util', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit']); +goog.addDependency("labs/useragent/verifier.js", ['goog.labs.useragent.verifier'], []); +goog.addDependency("labs/useragent/verifier_test.js", [], []); goog.addDependency("locale/countries.js", ['goog.locale.countries'], []); goog.addDependency("locale/countrylanguagenames_test.js", ['goog.locale.countryLanguageNamesTest'], ['goog.locale', 'goog.testing.jsunit']); goog.addDependency("locale/defaultlocalenameconstants.js", ['goog.locale.defaultLocaleNameConstants'], []); @@ -912,7 +916,7 @@ goog.addDependency("net/streams/streamfactory.js", ['goog.net.streams.createXhrN goog.addDependency("net/streams/streamparser.js", ['goog.net.streams.StreamParser'], []); goog.addDependency("net/streams/xhrnodereadablestream.js", ['goog.net.streams.XhrNodeReadableStream'], ['goog.array', 'goog.log', 'goog.net.streams.NodeReadableStream', 'goog.net.streams.XhrStreamReader']); goog.addDependency("net/streams/xhrnodereadablestream_test.js", ['goog.net.streams.XhrNodeReadableStreamTest'], ['goog.net.streams.NodeReadableStream', 'goog.net.streams.XhrNodeReadableStream', 'goog.net.streams.XhrStreamReader', 'goog.testing.PropertyReplacer', 'goog.testing.asserts', 'goog.testing.jsunit']); -goog.addDependency("net/streams/xhrstreamreader.js", ['goog.net.streams.XhrStreamReader'], ['goog.events.EventHandler', 'goog.log', 'goog.net.ErrorCode', 'goog.net.EventType', 'goog.net.HttpStatus', 'goog.net.XhrIo', 'goog.net.XmlHttp', 'goog.net.streams.JsonStreamParser', 'goog.userAgent']); +goog.addDependency("net/streams/xhrstreamreader.js", ['goog.net.streams.XhrStreamReader'], ['goog.events.EventHandler', 'goog.log', 'goog.net.ErrorCode', 'goog.net.EventType', 'goog.net.HttpStatus', 'goog.net.XhrIo', 'goog.net.XmlHttp', 'goog.net.streams.JsonStreamParser', 'goog.net.streams.PbStreamParser', 'goog.userAgent']); goog.addDependency("net/streams/xhrstreamreader_test.js", ['goog.net.streams.XhrStreamReaderTest'], ['goog.net.ErrorCode', 'goog.net.XmlHttp', 'goog.net.streams.XhrStreamReader', 'goog.testing.asserts', 'goog.testing.jsunit', 'goog.testing.net.XhrIo']); goog.addDependency("net/testdata/jsloader_test1.js", ['goog.net.testdata.jsloader_test1'], []); goog.addDependency("net/testdata/jsloader_test2.js", ['goog.net.testdata.jsloader_test2'], []); @@ -1128,7 +1132,7 @@ goog.addDependency("testing/mock_test.js", ['goog.testing.MockTest'], ['goog.arr goog.addDependency("testing/mockclassfactory.js", ['goog.testing.MockClassFactory', 'goog.testing.MockClassRecord'], ['goog.array', 'goog.object', 'goog.testing.LooseMock', 'goog.testing.StrictMock', 'goog.testing.TestCase', 'goog.testing.mockmatchers']); goog.addDependency("testing/mockclassfactory_test.js", ['fake.BaseClass', 'fake.ChildClass', 'goog.testing.MockClassFactoryTest'], ['goog.testing', 'goog.testing.MockClassFactory', 'goog.testing.jsunit']); goog.addDependency("testing/mockclock.js", ['goog.testing.MockClock'], ['goog.Disposable', 'goog.async.run', 'goog.testing.PropertyReplacer', 'goog.testing.events', 'goog.testing.events.Event']); -goog.addDependency("testing/mockclock_test.js", ['goog.testing.MockClockTest'], ['goog.Promise', 'goog.Timer', 'goog.async.run', 'goog.events', 'goog.functions', 'goog.testing.MockClock', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit', 'goog.testing.recordFunction']); +goog.addDependency("testing/mockclock_test.js", ['goog.testing.MockClockTest'], ['goog.Promise', 'goog.Timer', 'goog.events', 'goog.functions', 'goog.testing.MockClock', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit', 'goog.testing.recordFunction']); goog.addDependency("testing/mockcontrol.js", ['goog.testing.MockControl'], ['goog.array', 'goog.testing', 'goog.testing.LooseMock', 'goog.testing.StrictMock']); goog.addDependency("testing/mockcontrol_test.js", ['goog.testing.MockControlTest'], ['goog.testing.Mock', 'goog.testing.MockControl', 'goog.testing.jsunit']); goog.addDependency("testing/mockinterface.js", ['goog.testing.MockInterface'], []); @@ -1610,6 +1614,7 @@ goog.require('Blockly.FieldDate'); goog.require('Blockly.FieldDropdown'); goog.require('Blockly.FieldImage'); goog.require('Blockly.FieldLabel'); +goog.require('Blockly.FieldNumber'); goog.require('Blockly.FieldTextInput'); goog.require('Blockly.FieldVariable'); goog.require('Blockly.Flyout'); @@ -1621,6 +1626,7 @@ goog.require('Blockly.Mutator'); goog.require('Blockly.Names'); goog.require('Blockly.Options'); goog.require('Blockly.Procedures'); +goog.require('Blockly.RenderedConnection'); goog.require('Blockly.Scrollbar'); goog.require('Blockly.ScrollbarPair'); goog.require('Blockly.Toolbox'); diff --git a/blocks/colour.js b/blocks/colour.js index e425612dd..ceb9efc5b 100644 --- a/blocks/colour.js +++ b/blocks/colour.js @@ -58,7 +58,8 @@ Blockly.Blocks['colour_picker'] = { // Colour block is trivial. Use tooltip of parent block if it exists. this.setTooltip(function() { var parent = thisBlock.getParent(); - return (parent && parent.tooltip) || Blockly.Msg.COLOUR_PICKER_TOOLTIP; + return (parent && parent.getInputsInline() && parent.tooltip) || + Blockly.Msg.COLOUR_PICKER_TOOLTIP; }); } }; diff --git a/blocks/lists.js b/blocks/lists.js index c32728cac..4895dd256 100644 --- a/blocks/lists.js +++ b/blocks/lists.js @@ -643,6 +643,46 @@ Blockly.Blocks['lists_getSublist'] = { } }; +Blockly.Blocks['lists_sort'] = { + /** + * Block for sorting a list. + * @this Blockly.Block + */ + init: function() { + this.jsonInit({ + "message0": Blockly.Msg.LISTS_SORT_TITLE, + "args0": [ + { + "type": "field_dropdown", + "name": "TYPE", + "options": [ + [Blockly.Msg.LISTS_SORT_TYPE_NUMERIC, "NUMERIC"], + [Blockly.Msg.LISTS_SORT_TYPE_TEXT, "TEXT"], + [Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE, "IGNORE_CASE"] + ] + }, + { + "type": "field_dropdown", + "name": "DIRECTION", + "options": [ + [Blockly.Msg.LISTS_SORT_ORDER_ASCENDING, "1"], + [Blockly.Msg.LISTS_SORT_ORDER_DESCENDING, "-1"] + ] + }, + { + "type": "input_value", + "name": "LIST", + "check": "Array" + } + ], + "output": "Array", + "colour": Blockly.Blocks.lists.HUE, + "tooltip": Blockly.Msg.LISTS_SORT_TOOLTIP, + "helpUrl": Blockly.Msg.LISTS_SORT_HELPURL + }); + } +}; + Blockly.Blocks['lists_split'] = { /** * Block for splitting text into a list, or joining a list into text. diff --git a/blocks/loops.js b/blocks/loops.js index 033466f20..d9d8cbfcd 100644 --- a/blocks/loops.js +++ b/blocks/loops.js @@ -71,7 +71,7 @@ Blockly.Blocks['controls_repeat'] = { "message0": Blockly.Msg.CONTROLS_REPEAT_TITLE, "args0": [ { - "type": "field_input", + "type": "field_number", "name": "TIMES", "text": "10" } diff --git a/blocks/math.js b/blocks/math.js index 0350048c8..311d9875b 100644 --- a/blocks/math.js +++ b/blocks/math.js @@ -43,7 +43,7 @@ Blockly.Blocks['math_number'] = { this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL); this.setColour(Blockly.Blocks.math.HUE); this.appendDummyInput() - .appendField(new Blockly.FieldTextInput('0', + .appendField(new Blockly.FieldNumber('0', Blockly.FieldTextInput.numberValidator), 'NUM'); this.setOutput(true, 'Number'); // Assign 'this' to a variable for use in the tooltip closure below. @@ -51,7 +51,8 @@ Blockly.Blocks['math_number'] = { // Number block is trivial. Use tooltip of parent block if it exists. this.setTooltip(function() { var parent = thisBlock.getParent(); - return (parent && parent.tooltip) || Blockly.Msg.MATH_NUMBER_TOOLTIP; + return (parent && parent.getInputsInline() && parent.tooltip) || + Blockly.Msg.MATH_NUMBER_TOOLTIP; }); } }; diff --git a/blocks/text.js b/blocks/text.js index 96ca1cc71..88eb329f9 100644 --- a/blocks/text.js +++ b/blocks/text.js @@ -52,7 +52,8 @@ Blockly.Blocks['text'] = { // Text block is trivial. Use tooltip of parent block if it exists. this.setTooltip(function() { var parent = thisBlock.getParent(); - return (parent && parent.tooltip) || Blockly.Msg.TEXT_TEXT_TOOLTIP; + return (parent && parent.getInputsInline() && parent.tooltip) || + Blockly.Msg.TEXT_TEXT_TOOLTIP; }); }, /** diff --git a/blocks_compressed.js b/blocks_compressed.js index 8edc23d0a..2e9b0b2d8 100644 --- a/blocks_compressed.js +++ b/blocks_compressed.js @@ -3,7 +3,7 @@ // Copyright 2012 Google Inc. Apache License 2.0 -Blockly.Blocks.colour={};Blockly.Blocks.colour.HUE=20;Blockly.Blocks.colour_picker={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",colour:Blockly.Blocks.colour.HUE,helpUrl:Blockly.Msg.COLOUR_PICKER_HELPURL});var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.tooltip||Blockly.Msg.COLOUR_PICKER_TOOLTIP})}}; +Blockly.Blocks.colour={};Blockly.Blocks.colour.HUE=20;Blockly.Blocks.colour_picker={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",colour:Blockly.Blocks.colour.HUE,helpUrl:Blockly.Msg.COLOUR_PICKER_HELPURL});var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.COLOUR_PICKER_TOOLTIP})}}; Blockly.Blocks.colour_random={init:function(){this.jsonInit({message0:Blockly.Msg.COLOUR_RANDOM_TITLE,output:"Colour",colour:Blockly.Blocks.colour.HUE,tooltip:Blockly.Msg.COLOUR_RANDOM_TOOLTIP,helpUrl:Blockly.Msg.COLOUR_RANDOM_HELPURL})}}; Blockly.Blocks.colour_rgb={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_RGB_HELPURL);this.setColour(Blockly.Blocks.colour.HUE);this.appendValueInput("RED").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_TITLE).appendField(Blockly.Msg.COLOUR_RGB_RED);this.appendValueInput("GREEN").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_GREEN);this.appendValueInput("BLUE").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_BLUE); this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_RGB_TOOLTIP)}}; @@ -32,6 +32,8 @@ Blockly.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[Blockly. this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT1").type== Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)): this.appendDummyInput("AT"+a);var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var e="FROM_START"==c||"FROM_END"==c;if(e!=b){var f=this.sourceBlock_;f.updateAt_(a,e);f.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"));Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}}; +Blockly.Blocks.lists_sort={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[Blockly.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[Blockly.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[Blockly.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[Blockly.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",colour:Blockly.Blocks.lists.HUE, +tooltip:Blockly.Msg.LISTS_SORT_TOOLTIP,helpUrl:Blockly.Msg.LISTS_SORT_HELPURL})}}; Blockly.Blocks.lists_split={init:function(){var a=this,b=new Blockly.FieldDropdown([[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(b){a.updateType_(b)});this.setHelpUrl(Blockly.Msg.LISTS_SPLIT_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("INPUT").setCheck("String").appendField(b,"MODE");this.appendValueInput("DELIM").setCheck("String").appendField(Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0); this.setOutput(!0,"Array");this.setTooltip(function(){var b=a.getFieldValue("MODE");if("SPLIT"==b)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT;if("JOIN"==b)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN;throw"Unknown mode: "+b;})},updateType_:function(a){"SPLIT"==a?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("mode", this.getFieldValue("MODE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("mode"))}};Blockly.Blocks.logic={};Blockly.Blocks.logic.HUE=210; @@ -53,7 +55,7 @@ Blockly.Blocks.logic_boolean={init:function(){this.jsonInit({message0:"%1",args0 Blockly.Blocks.logic_null={init:function(){this.jsonInit({message0:Blockly.Msg.LOGIC_NULL,output:null,colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.LOGIC_NULL_TOOLTIP,helpUrl:Blockly.Msg.LOGIC_NULL_HELPURL})}}; 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(a){var b= this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),d=this.outputConnection.targetConnection;if((b||c)&&d)for(var e=0;2>e;e++){var f=1==e?b:c;f&&!f.outputConnection.checkType_(d)&&(Blockly.Events.setGroup(a.group),d===this.prevParentConnection_?(this.unplug(),d.getSourceBlock().bumpNeighbours_()):(f.unplug(),f.bumpNeighbours_()),Blockly.Events.setGroup(!1))}this.prevParentConnection_=d}};Blockly.Blocks.loops={};Blockly.Blocks.loops.HUE=120;Blockly.Blocks.controls_repeat_ext={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES",check:"Number"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,tooltip:Blockly.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.CONTROLS_REPEAT_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)}}; -Blockly.Blocks.controls_repeat={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"field_input",name:"TIMES",text:"10"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,tooltip:Blockly.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.CONTROLS_REPEAT_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO);this.getField("TIMES").setValidator(Blockly.FieldTextInput.nonnegativeIntegerValidator)}}; +Blockly.Blocks.controls_repeat={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"field_number",name:"TIMES",text:"10"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,tooltip:Blockly.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.CONTROLS_REPEAT_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO);this.getField("TIMES").setValidator(Blockly.FieldTextInput.nonnegativeIntegerValidator)}}; Blockly.Blocks.controls_whileUntil={init:function(){var a=[[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]];this.setHelpUrl(Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendValueInput("BOOL").setCheck("Boolean").appendField(new Blockly.FieldDropdown(a),"MODE");this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO);this.setPreviousStatement(!0);this.setNextStatement(!0); var b=this;this.setTooltip(function(){var a=b.getFieldValue("MODE");return{WHILE:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[a]})}}; Blockly.Blocks.controls_for={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_FOR_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,helpUrl:Blockly.Msg.CONTROLS_FOR_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOR_INPUT_DO); @@ -61,7 +63,7 @@ var a=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOR_TOOLTIP.re Blockly.Blocks.controls_forEach={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_FOREACH_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,helpUrl:Blockly.Msg.CONTROLS_FOREACH_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_DO);var a=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOREACH_TOOLTIP.replace("%1", a.getFieldValue("VAR"))})},customContextMenu:Blockly.Blocks.controls_for.customContextMenu}; Blockly.Blocks.controls_flow_statements={init:function(){var a=[[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];this.setHelpUrl(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown(a),"FLOW");this.setPreviousStatement(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("FLOW");return{BREAK:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK, -CONTINUE:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[a]})},onchange:function(a){a=!1;var b=this;do{if(-1!=this.LOOP_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?this.setWarningText(null):this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING)},LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"]};Blockly.Blocks.math={};Blockly.Blocks.math.HUE=230;Blockly.Blocks.math_number={init:function(){this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.appendDummyInput().appendField(new Blockly.FieldTextInput("0",Blockly.FieldTextInput.numberValidator),"NUM");this.setOutput(!0,"Number");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.tooltip||Blockly.Msg.MATH_NUMBER_TOOLTIP})}}; +CONTINUE:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[a]})},onchange:function(a){a=!1;var b=this;do{if(-1!=this.LOOP_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?this.setWarningText(null):this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING)},LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"]};Blockly.Blocks.math={};Blockly.Blocks.math.HUE=230;Blockly.Blocks.math_number={init:function(){this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.appendDummyInput().appendField(new Blockly.FieldNumber("0",Blockly.FieldTextInput.numberValidator),"NUM");this.setOutput(!0,"Number");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.MATH_NUMBER_TOOLTIP})}}; Blockly.Blocks.math_arithmetic={init:function(){this.jsonInit({message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_ADDITION_SYMBOL,"ADD"],[Blockly.Msg.MATH_SUBTRACTION_SYMBOL,"MINUS"],[Blockly.Msg.MATH_MULTIPLICATION_SYMBOL,"MULTIPLY"],[Blockly.Msg.MATH_DIVISION_SYMBOL,"DIVIDE"],[Blockly.Msg.MATH_POWER_SYMBOL,"POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE, helpUrl:Blockly.Msg.MATH_ARITHMETIC_HELPURL});var a=this;this.setTooltip(function(){var b=a.getFieldValue("OP");return{ADD:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[b]})}}; Blockly.Blocks.math_single={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_SINGLE_OP_ROOT,"ROOT"],[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE,"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_SINGLE_HELPURL});var a=this;this.setTooltip(function(){var b=a.getFieldValue("OP");return{ROOT:Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT, @@ -107,7 +109,7 @@ updateShape_:Blockly.Blocks.procedures_callnoreturn.updateShape_,mutationToDom:B Blockly.Blocks.procedures_ifreturn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_IFRETURN_HELPURL);this.hasReturnValue_=!0}, mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("value",Number(this.hasReturnValue_));return a},domToMutation:function(a){this.hasReturnValue_=1==a.getAttribute("value");this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(a){a=!1;var b=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?("procedures_defnoreturn"==b.type&& this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=b.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(Blockly.Msg.PROCEDURES_IFRETURN_WARNING)},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]};Blockly.Blocks.texts={};Blockly.Blocks.texts.HUE=160; -Blockly.Blocks.text={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.tooltip||Blockly.Msg.TEXT_TEXT_TOOLTIP})},newQuote_:function(a){return new Blockly.FieldImage(a==this.RTL?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==": +Blockly.Blocks.text={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.TEXT_TEXT_TOOLTIP})},newQuote_:function(a){return new Blockly.FieldImage(a==this.RTL?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",12,12,'"')}}; Blockly.Blocks.text_join={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_JOIN_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.itemCount_=2;this.updateShape_();this.setOutput(!0,"String");this.setMutator(new Blockly.Mutator(["text_create_join_item"]));this.setTooltip(Blockly.Msg.TEXT_JOIN_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10); this.updateShape_()},decompose:function(a){var b=a.newBlock("text_create_join_container");b.initSvg();for(var c=b.getInput("STACK").connection,d=0;d} */ + + /** + * @type {!Array.} + * @private + */ this.childBlocks_ = []; - /** @type {boolean} */ + + /** + * @type {boolean} + * @private + */ this.deletable_ = true; - /** @type {boolean} */ + + /** + * @type {boolean} + * @private + */ this.movable_ = true; - /** @type {boolean} */ + + /** + * @type {boolean} + * @private + */ this.editable_ = true; - /** @type {boolean} */ + + /** + * @type {boolean} + * @private + */ this.isShadow_ = false; - /** @type {boolean} */ + + /** + * @type {boolean} + * @private + */ this.collapsed_ = false; /** @type {string|Blockly.Comment} */ this.comment = null; - /** @type {!goog.math.Coordinate} */ + /** + * @type {!goog.math.Coordinate} + * @private + */ this.xy_ = new goog.math.Coordinate(0, 0); /** @type {!Blockly.Workspace} */ @@ -717,7 +747,7 @@ Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) { goog.asserts.assert(!this.outputConnection, 'Remove output connection prior to adding previous connection.'); this.previousConnection = - new Blockly.Connection(this, Blockly.PREVIOUS_STATEMENT); + this.makeConnection_(Blockly.PREVIOUS_STATEMENT); } this.previousConnection.setCheck(opt_check); } else { @@ -742,8 +772,7 @@ Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) { opt_check = null; } if (!this.nextConnection) { - this.nextConnection = - new Blockly.Connection(this, Blockly.NEXT_STATEMENT); + this.nextConnection = this.makeConnection_(Blockly.NEXT_STATEMENT); } this.nextConnection.setCheck(opt_check); } else { @@ -771,8 +800,7 @@ Blockly.Block.prototype.setOutput = function(newBoolean, opt_check) { if (!this.outputConnection) { goog.asserts.assert(!this.previousConnection, 'Remove previous connection prior to adding output connection.'); - this.outputConnection = - new Blockly.Connection(this, Blockly.OUTPUT_VALUE); + this.outputConnection = this.makeConnection_(Blockly.OUTPUT_VALUE); } this.outputConnection.setCheck(opt_check); } else { @@ -1020,11 +1048,11 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) { // Add last dummy input if needed. if (elements.length && (typeof elements[elements.length - 1] == 'string' || elements[elements.length - 1]['type'].indexOf('field_') == 0)) { - var input = {type: 'input_dummy'}; + var dummyInput = {type: 'input_dummy'}; if (lastDummyAlign) { - input['align'] = lastDummyAlign; + dummyInput['align'] = lastDummyAlign; } - elements.push(input); + elements.push(dummyInput); } // Lookup of alignment constants. var alignmentLookup = { @@ -1082,6 +1110,9 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) { field = new Blockly.FieldImage(element['src'], element['width'], element['height'], element['alt']); break; + case 'field_number': + field = new Blockly.FieldNumber(element['text']); + break; case 'field_date': if (Blockly.FieldDate) { field = new Blockly.FieldDate(element['date']); @@ -1126,7 +1157,7 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) { Blockly.Block.prototype.appendInput_ = function(type, name) { var connection = null; if (type == Blockly.INPUT_VALUE || type == Blockly.NEXT_STATEMENT) { - connection = new Blockly.Connection(this, type); + connection = this.makeConnection_(type); } var input = new Blockly.Input(type, name, this, connection); // Append input to list. @@ -1303,3 +1334,13 @@ Blockly.Block.prototype.moveBy = function(dx, dy) { event.recordNew(); Blockly.Events.fire(event); }; + +/** + * Create a connection of the specified type. + * @param {number} type The type of the connection to create. + * @return {!Blockly.Connection} A new connection of the specified type. + * @private + */ +Blockly.Block.prototype.makeConnection_ = function(type) { + return new Blockly.Connection(this, type); +}; diff --git a/core/block_render_svg.js b/core/block_render_svg.js index b077d8197..7535db4a6 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -287,7 +287,7 @@ Blockly.BlockSvg.prototype.render = function(opt_bubble) { parentBlock.render(true); } else { // Top-most block. Fire an event to allow scrollbars to resize. - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(this.workspace); } } Blockly.Field.stopCache(); diff --git a/core/block_svg.js b/core/block_svg.js index c58eade11..db55c5a60 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -28,6 +28,7 @@ goog.provide('Blockly.BlockSvg'); goog.require('Blockly.Block'); goog.require('Blockly.ContextMenu'); +goog.require('Blockly.RenderedConnection'); goog.require('goog.Timer'); goog.require('goog.asserts'); goog.require('goog.dom'); @@ -48,16 +49,31 @@ goog.require('goog.userAgent'); */ Blockly.BlockSvg = function(workspace, prototypeName, opt_id) { // Create core elements for the block. - /** @type {SVGElement} */ + /** + * @type {SVGElement} + * @private + */ this.svgGroup_ = Blockly.createSvgElement('g', {}, null); - /** @type {SVGElement} */ + + /** + * @type {SVGElement} + * @private + */ this.svgPathDark_ = Blockly.createSvgElement('path', {'class': 'blocklyPathDark', 'transform': 'translate(1,1)'}, this.svgGroup_); - /** @type {SVGElement} */ + + /** + * @type {SVGElement} + * @private + */ this.svgPath_ = Blockly.createSvgElement('path', {'class': 'blocklyPath'}, this.svgGroup_); - /** @type {SVGElement} */ + + /** + * @type {SVGElement} + * @private + */ this.svgPathLight_ = Blockly.createSvgElement('path', {'class': 'blocklyPathLight'}, this.svgGroup_); this.svgPath_.tooltip = this; @@ -148,7 +164,6 @@ Blockly.BlockSvg.prototype.select = function() { Blockly.Events.fire(event); Blockly.selected = this; this.addSelect(); - Blockly.fireUiEvent(this.workspace.getCanvas(), 'blocklySelectChange'); }; /** @@ -163,7 +178,6 @@ Blockly.BlockSvg.prototype.unselect = function() { Blockly.Events.fire(event); Blockly.selected = null; this.removeSelect(); - Blockly.fireUiEvent(this.workspace.getCanvas(), 'blocklySelectChange'); }; /** @@ -259,7 +273,7 @@ Blockly.BlockSvg.terminateDrag_ = function() { Blockly.Events.setGroup(false); }, Blockly.BUMP_DELAY); // Fire an event to allow scrollbars to resize. - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(this.workspace); } } Blockly.dragMode_ = Blockly.DRAG_NONE; @@ -367,7 +381,8 @@ Blockly.BlockSvg.prototype.snapToGrid = function() { /** * Returns a bounding box describing the dimensions of this block * and any blocks stacked below it. - * @return {!{height: number, width: number}} Object with height and width properties. + * @return {!{height: number, width: number}} Object with height and width + * properties. */ Blockly.BlockSvg.prototype.getHeightWidth = function() { var height = this.height; @@ -386,10 +401,10 @@ Blockly.BlockSvg.prototype.getHeightWidth = function() { }; /** - * Returns the coordinates of a bounding box describing the dimensions of this block - * and any blocks stacked below it. + * Returns the coordinates of a bounding box describing the dimensions of this + * block and any blocks stacked below it. * @return {!{topLeft: goog.math.Coordinate, bottomRight: goog.math.Coordinate}} - * Object with top left and bottom right coordinates of the bounding box. + * Object with top left and bottom right coordinates of the bounding box. */ Blockly.BlockSvg.prototype.getBoundingRectangle = function() { var blockXY = this.getRelativeToSurfaceXY(this); @@ -399,10 +414,12 @@ Blockly.BlockSvg.prototype.getBoundingRectangle = function() { var bottomRight; if (this.RTL) { // Width has the tab built into it already so subtract it here. - topLeft = new goog.math.Coordinate(blockXY.x - (blockBounds.width - tab), blockXY.y); + topLeft = new goog.math.Coordinate(blockXY.x - (blockBounds.width - tab), + blockXY.y); // Add the width of the tab/puzzle piece knob to the x coordinate // since X is the corner of the rectangle, not the whole puzzle piece. - bottomRight = new goog.math.Coordinate(blockXY.x + tab, blockXY.y + blockBounds.height); + bottomRight = new goog.math.Coordinate(blockXY.x + tab, + blockXY.y + blockBounds.height); } else { // Subtract the width of the tab/puzzle piece knob to the x coordinate // since X is the corner of the rectangle, not the whole puzzle piece. @@ -513,7 +530,6 @@ Blockly.BlockSvg.prototype.onMouseDown_ = function(e) { e.stopPropagation(); return; } - Blockly.setPageSelectable(false); this.workspace.markFocused(); // Update Blockly's knowledge of its own location. Blockly.svgResize(this.workspace); @@ -558,6 +574,7 @@ Blockly.BlockSvg.prototype.onMouseDown_ = function(e) { } // This event has been handled. No need to bubble up to the document. e.stopPropagation(); + e.preventDefault(); }; /** @@ -573,7 +590,6 @@ Blockly.BlockSvg.prototype.onMouseUp_ = function(e) { Blockly.Events.fire( new Blockly.Events.Ui(this, 'click', undefined, undefined)); } - Blockly.setPageSelectable(true); Blockly.terminateDrag_(); if (Blockly.selected && Blockly.highlightedConnection_) { // Connect two blocks together. @@ -599,7 +615,7 @@ Blockly.BlockSvg.prototype.onMouseUp_ = function(e) { // Dropping a block on the trash can will usually cause the workspace to // resize to contain the newly positioned block. Force a second resize // now that the block has been deleted. - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(this.workspace); } if (Blockly.highlightedConnection_) { Blockly.highlightedConnection_.unhighlight(); @@ -894,6 +910,7 @@ Blockly.BlockSvg.prototype.onMouseMove_ = function(e) { } // This event has been handled. No need to bubble up to the document. e.stopPropagation(); + e.preventDefault(); }; /** @@ -1573,3 +1590,13 @@ Blockly.BlockSvg.prototype.getConnections_ = function(all) { } return myConnections; }; + +/** + * Create a connection of the specified type. + * @param {number} type The type of the connection to create. + * @return {!Blockly.RenderedConnection} A new connection of the specified type. + * @private + */ +Blockly.BlockSvg.prototype.makeConnection_ = function(type) { + return new Blockly.RenderedConnection(this, type); +}; diff --git a/core/blockly.js b/core/blockly.js index dc51f2b83..ae0b0bda2 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -38,6 +38,7 @@ goog.require('Blockly.FieldColour'); goog.require('Blockly.FieldDropdown'); goog.require('Blockly.FieldImage'); goog.require('Blockly.FieldTextInput'); +goog.require('Blockly.FieldNumber'); goog.require('Blockly.FieldVariable'); goog.require('Blockly.Generator'); goog.require('Blockly.Msg'); @@ -132,12 +133,37 @@ Blockly.svgSize = function(svg) { height: svg.cachedHeight_}; }; +/** + * Schedule a call to the resize handler. Groups of simultaneous events (e.g. + * a tree of blocks being deleted) are merged into one call. + * @param {Blockly.WorkspaceSvg} workspace Any workspace in the SVG. + */ +Blockly.asyncSvgResize = function(workspace) { + if (Blockly.svgResizePending_) { + return; + } + if (!workspace) { + workspace = Blockly.getMainWorkspace(); + } + Blockly.svgResizePending_ = true; + setTimeout(function() {Blockly.svgResize(workspace);}, 0); +}; + +/** + * Flag indicating a resize event is scheduled. + * Used to fire only one resize after multiple changes. + * @type {boolean} + * @private + */ +Blockly.svgResizePending_ = false; + /** * Size the SVG image to completely fill its container. * Record the height/width of the SVG image. * @param {!Blockly.WorkspaceSvg} workspace Any workspace in the SVG. */ Blockly.svgResize = function(workspace) { + Blockly.svgResizePending_ = false; var mainWorkspace = workspace; while (mainWorkspace.options.parentWorkspace) { mainWorkspace = mainWorkspace.options.parentWorkspace; @@ -145,7 +171,7 @@ Blockly.svgResize = function(workspace) { var svg = mainWorkspace.getParentSvg(); var div = svg.parentNode; if (!div) { - // Workspace deteted, or something. + // Workspace deleted, or something. return; } var width = div.offsetWidth; @@ -170,7 +196,6 @@ Blockly.onMouseUp_ = function(e) { var workspace = Blockly.getMainWorkspace(); Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN); workspace.isScrolling = false; - Blockly.setPageSelectable(true); // Unbind the touch event if it exists. if (Blockly.onTouchUpWrapper_) { Blockly.unbindEvent_(Blockly.onTouchUpWrapper_); @@ -213,6 +238,7 @@ Blockly.onMouseMove_ = function(e) { Blockly.longStop_(); } e.stopPropagation(); + e.preventDefault(); } }; diff --git a/core/bubble.js b/core/bubble.js index 379b9b1b1..d4c1e2719 100644 --- a/core/bubble.js +++ b/core/bubble.js @@ -123,6 +123,12 @@ Blockly.Bubble.onMouseUpWrapper_ = null; */ Blockly.Bubble.onMouseMoveWrapper_ = null; +/** + * Function to call on resize of bubble. + * @type {Function} + */ +Blockly.Bubble.prototype.resizeCallback_ = null; + /** * Stop binding to the global mouseup and mousemove events. * @private @@ -336,11 +342,10 @@ Blockly.Bubble.prototype.resizeMouseMove_ = function(e) { /** * Register a function as a callback event for when the bubble is resized. - * @param {Object} thisObject The value of 'this' in the callback. * @param {!Function} callback The function to call on resize. */ -Blockly.Bubble.prototype.registerResizeEvent = function(thisObject, callback) { - Blockly.bindEvent_(this.bubbleGroup_, 'resize', thisObject, callback); +Blockly.Bubble.prototype.registerResizeEvent = function(callback) { + this.resizeCallback_ = callback; }; /** @@ -467,8 +472,10 @@ Blockly.Bubble.prototype.setBubbleSize = function(width, height) { this.positionBubble_(); this.renderArrow_(); } - // Fire an event to allow the contents to resize. - Blockly.fireUiEvent(this.bubbleGroup_, 'resize'); + // Allow the contents to resize. + if (this.resizeCallback_) { + this.resizeCallback_(); + } }; /** diff --git a/core/comment.js b/core/comment.js index d1e4363bf..2121530c0 100644 --- a/core/comment.js +++ b/core/comment.js @@ -106,24 +106,27 @@ Blockly.Comment.prototype.createEditor_ = function() { var body = document.createElementNS(Blockly.HTML_NS, 'body'); body.setAttribute('xmlns', Blockly.HTML_NS); body.className = 'blocklyMinimalBody'; - this.textarea_ = document.createElementNS(Blockly.HTML_NS, 'textarea'); - this.textarea_.className = 'blocklyCommentTextarea'; - this.textarea_.setAttribute('dir', this.block_.RTL ? 'RTL' : 'LTR'); - body.appendChild(this.textarea_); + var textarea = document.createElementNS(Blockly.HTML_NS, 'textarea'); + textarea.className = 'blocklyCommentTextarea'; + textarea.setAttribute('dir', this.block_.RTL ? 'RTL' : 'LTR'); + body.appendChild(textarea); + this.textarea_ = textarea; this.foreignObject_.appendChild(body); - Blockly.bindEvent_(this.textarea_, 'mouseup', this, this.textareaFocus_); + Blockly.bindEvent_(textarea, 'mouseup', this, this.textareaFocus_); // Don't zoom with mousewheel. - Blockly.bindEvent_(this.textarea_, 'wheel', this, function(e) { + Blockly.bindEvent_(textarea, 'wheel', this, function(e) { e.stopPropagation(); }); - Blockly.bindEvent_(this.textarea_, 'change', this, function(e) { - if (this.text_ != this.textarea_.value) { + Blockly.bindEvent_(textarea, 'change', this, function(e) { + if (this.text_ != textarea.value) { Blockly.Events.fire(new Blockly.Events.Change( - this.block_, 'comment', null, this.text_, this.textarea_.value)); - this.text_ = this.textarea_.value; + this.block_, 'comment', null, this.text_, textarea.value)); + this.text_ = textarea.value; } }); - + setTimeout(function() { + textarea.focus(); + }, 0); return this.foreignObject_; }; @@ -147,12 +150,14 @@ Blockly.Comment.prototype.updateEditable = function() { * @private */ Blockly.Comment.prototype.resizeBubble_ = function() { - var size = this.bubble_.getBubbleSize(); - var doubleBorderWidth = 2 * Blockly.Bubble.BORDER_WIDTH; - this.foreignObject_.setAttribute('width', size.width - doubleBorderWidth); - this.foreignObject_.setAttribute('height', size.height - doubleBorderWidth); - this.textarea_.style.width = (size.width - doubleBorderWidth - 4) + 'px'; - this.textarea_.style.height = (size.height - doubleBorderWidth - 4) + 'px'; + if (this.isVisible()) { + var size = this.bubble_.getBubbleSize(); + var doubleBorderWidth = 2 * Blockly.Bubble.BORDER_WIDTH; + this.foreignObject_.setAttribute('width', size.width - doubleBorderWidth); + this.foreignObject_.setAttribute('height', size.height - doubleBorderWidth); + this.textarea_.style.width = (size.width - doubleBorderWidth - 4) + 'px'; + this.textarea_.style.height = (size.height - doubleBorderWidth - 4) + 'px'; + } }; /** @@ -183,7 +188,7 @@ Blockly.Comment.prototype.setVisible = function(visible) { /** @type {!Blockly.WorkspaceSvg} */ (this.block_.workspace), this.createEditor_(), this.block_.svgPath_, this.iconXY_, this.width_, this.height_); - this.bubble_.registerResizeEvent(this, this.resizeBubble_); + this.bubble_.registerResizeEvent(this.resizeBubble_.bind(this)); this.updateColour(); } else { // Dispose of the bubble. diff --git a/core/connection.js b/core/connection.js index 25adcf49d..84c35dd93 100644 --- a/core/connection.js +++ b/core/connection.js @@ -37,7 +37,10 @@ goog.require('goog.dom'); * @constructor */ Blockly.Connection = function(source, type) { - /** @type {!Blockly.Block} */ + /** + * @type {!Blockly.Block} + * @private + */ this.sourceBlock_ = source; /** @type {number} */ this.type = type; @@ -61,12 +64,76 @@ Blockly.Connection.REASON_CHECKS_FAILED = 4; Blockly.Connection.REASON_DIFFERENT_WORKSPACES = 5; /** - * Connect two connections together. - * @param {!Blockly.Connection} parentConnection Connection on superior block. + * Connection this connection connects to. Null if not connected. + * @type {Blockly.Connection} + */ +Blockly.Connection.prototype.targetConnection = null; + +/** + * List of compatible value types. Null if all types are compatible. + * @type {Array} + * @private + */ +Blockly.Connection.prototype.check_ = null; + +/** + * DOM representation of a shadow block, or null if none. + * @type {Element} + * @private + */ +Blockly.Connection.prototype.shadowDom_ = null; + +/** + * Horizontal location of this connection. + * @type {number} + * @private + */ +Blockly.Connection.prototype.x_ = 0; + +/** + * Vertical location of this connection. + * @type {number} + * @private + */ +Blockly.Connection.prototype.y_ = 0; + +/** + * Has this connection been added to the connection database? + * @type {boolean} + * @private + */ +Blockly.Connection.prototype.inDB_ = false; + +/** + * Connection database for connections of this type on the current workspace. + * @type {Blockly.ConnectionDB} + * @private + */ +Blockly.Connection.prototype.db_ = null; + +/** + * Connection database for connections compatible with this type on the + * current workspace. + * @type {Blockly.ConnectionDB} + * @private + */ +Blockly.Connection.prototype.dbOpposite_ = null; + +/** + * Whether this connections is hidden (not tracked in a database) or not. + * @type {boolean} + * @private + */ +Blockly.Connection.prototype.hidden_ = null; + +/** + * Connect two connections together. This is the connection on the superior + * block. * @param {!Blockly.Connection} childConnection Connection on inferior block. * @private */ -Blockly.Connection.connect_ = function(parentConnection, childConnection) { +Blockly.Connection.prototype.connect_ = function(childConnection) { + var parentConnection = this; var parentBlock = parentConnection.getSourceBlock(); var childBlock = childConnection.getSourceBlock(); // Disconnect any existing parent on the child connection. @@ -160,90 +227,8 @@ Blockly.Connection.connect_ = function(parentConnection, childConnection) { event.recordNew(); Blockly.Events.fire(event); } - - if (parentBlock.rendered) { - parentBlock.updateDisabled(); - } - if (childBlock.rendered) { - childBlock.updateDisabled(); - } - if (parentBlock.rendered && childBlock.rendered) { - if (parentConnection.type == Blockly.NEXT_STATEMENT || - parentConnection.type == Blockly.PREVIOUS_STATEMENT) { - // Child block may need to square off its corners if it is in a stack. - // Rendering a child will render its parent. - childBlock.render(); - } else { - // Child block does not change shape. Rendering the parent node will - // move its connected children into position. - parentBlock.render(); - } - } }; -/** - * Connection this connection connects to. Null if not connected. - * @type {Blockly.Connection} - */ -Blockly.Connection.prototype.targetConnection = null; - -/** - * List of compatible value types. Null if all types are compatible. - * @type {Array} - * @private - */ -Blockly.Connection.prototype.check_ = null; - -/** - * DOM representation of a shadow block, or null if none. - * @type {Element} - * @private - */ -Blockly.Connection.prototype.shadowDom_ = null; - -/** - * Horizontal location of this connection. - * @type {number} - * @private - */ -Blockly.Connection.prototype.x_ = 0; - -/** - * Vertical location of this connection. - * @type {number} - * @private - */ -Blockly.Connection.prototype.y_ = 0; - -/** - * Has this connection been added to the connection database? - * @type {boolean} - * @private - */ -Blockly.Connection.prototype.inDB_ = false; - -/** - * Connection database for connections of this type on the current workspace. - * @type {Blockly.ConnectionDB} - * @private - */ -Blockly.Connection.prototype.db_ = null; - -/** - * Connection database for connections compatible with this type on the - * current workspace. - * @type {Blockly.ConnectionDB} - * @private - */ -Blockly.Connection.prototype.dbOpposite_ = null; - -/** - * Whether this connections is hidden (not tracked in a database) or not. - * @type {boolean} - * @private - */ -Blockly.Connection.prototype.hidden_ = null; - /** * Sever all links to this connection (not including from the source object). */ @@ -289,18 +274,6 @@ Blockly.Connection.prototype.isConnected = function() { return !!this.targetConnection; }; -/** - * Returns the distance between this connection and another connection. - * @param {!Blockly.Connection} otherConnection The other connection to measure - * the distance to. - * @return {number} The distance between connections. - */ -Blockly.Connection.prototype.distanceFrom = function(otherConnection) { - var xDiff = this.x_ - otherConnection.x_; - var yDiff = this.y_ - otherConnection.y_; - return Math.sqrt(xDiff * xDiff + yDiff * yDiff); -}; - /** * Checks whether the current connection can connect with the target * connection. @@ -356,15 +329,9 @@ Blockly.Connection.prototype.checkConnection_ = function(target) { /** * Check if the two connections can be dragged to connect to each other. * @param {!Blockly.Connection} candidate A nearby connection to check. - * @param {number} maxRadius The maximum radius allowed for connections. * @return {boolean} True if the connection is allowed, false otherwise. */ -Blockly.Connection.prototype.isConnectionAllowed = function(candidate, - maxRadius) { - if (this.distanceFrom(candidate) > maxRadius) { - return false; - } - +Blockly.Connection.prototype.isConnectionAllowed = function(candidate) { // Type checking. var canConnect = this.canConnectWithReason_(candidate); if (canConnect != Blockly.Connection.CAN_CONNECT && @@ -425,13 +392,12 @@ Blockly.Connection.prototype.connect = function(otherConnection) { } this.checkConnection_(otherConnection); // Determine which block is superior (higher in the source stack). - var parentBlock, childBlock; if (this.isSuperior()) { // Superior block. - Blockly.Connection.connect_(this, otherConnection); + this.connect_(otherConnection); } else { // Inferior block. - Blockly.Connection.connect_(otherConnection, this); + otherConnection.connect_(this); } }; @@ -518,11 +484,23 @@ Blockly.Connection.prototype.disconnect = function() { childBlock = this.sourceBlock_; parentConnection = otherConnection; } + this.disconnectInternal_(parentBlock, childBlock); + parentConnection.respawnShadow_(); +}; +/** + * Disconnect two blocks that are connected by this connection. + * @param {!Blockly.Block} parentBlock The superior block. + * @param {!Blockly.Block} childBlock The inferior block. + * @private + */ +Blockly.Connection.prototype.disconnectInternal_ = function(parentBlock, + childBlock) { var event; if (Blockly.Events.isEnabled()) { event = new Blockly.Events.Move(childBlock); } + var otherConnection = this.targetConnection; otherConnection.targetConnection = null; this.targetConnection = null; childBlock.setParent(null); @@ -530,33 +508,30 @@ Blockly.Connection.prototype.disconnect = function() { event.recordNew(); Blockly.Events.fire(event); } +}; - // Respawn the shadow block if there is one. - var shadow = parentConnection.getShadowDom(); +/** + * Respawn the shadow block if there was one connected to the this connection. + * @return {Blockly.Block} The newly spawned shadow block, or null if none was + * spawned. + * @private + */ +Blockly.Connection.prototype.respawnShadow_ = function() { + var parentBlock = this.getSourceBlock(); + var shadow = this.getShadowDom(); if (parentBlock.workspace && shadow && Blockly.Events.recordUndo) { var blockShadow = Blockly.Xml.domToBlock(shadow, parentBlock.workspace); if (blockShadow.outputConnection) { - parentConnection.connect(blockShadow.outputConnection); + this.connect(blockShadow.outputConnection); } else if (blockShadow.previousConnection) { - parentConnection.connect(blockShadow.previousConnection); + this.connect(blockShadow.previousConnection); } else { throw 'Child block does not have output or previous statement.'; } - if (blockShadow.initSvg) { - blockShadow.initSvg(); - } - blockShadow.render(false); - } - - // Rerender the parent so that it may reflow. - if (parentBlock.rendered) { - parentBlock.render(); - } - if (childBlock.rendered) { - childBlock.updateDisabled(); - childBlock.render(); + return blockShadow; } + return null; }; /** @@ -570,110 +545,6 @@ Blockly.Connection.prototype.targetBlock = function() { return null; }; -/** - * Move the block(s) belonging to the connection to a point where they don't - * visually interfere with the specified connection. - * @param {!Blockly.Connection} staticConnection The connection to move away - * from. - * @private - */ -Blockly.Connection.prototype.bumpAwayFrom_ = function(staticConnection) { - if (Blockly.dragMode_ != Blockly.DRAG_NONE) { - // Don't move blocks around while the user is doing the same. - return; - } - // Move the root block. - var rootBlock = this.sourceBlock_.getRootBlock(); - if (rootBlock.isInFlyout) { - // Don't move blocks around in a flyout. - return; - } - var reverse = false; - if (!rootBlock.isMovable()) { - // Can't bump an uneditable block away. - // Check to see if the other block is movable. - rootBlock = staticConnection.getSourceBlock().getRootBlock(); - if (!rootBlock.isMovable()) { - return; - } - // Swap the connections and move the 'static' connection instead. - staticConnection = this; - reverse = true; - } - // Raise it to the top for extra visibility. - rootBlock.getSvgRoot().parentNode.appendChild(rootBlock.getSvgRoot()); - var dx = (staticConnection.x_ + Blockly.SNAP_RADIUS) - this.x_; - var dy = (staticConnection.y_ + Blockly.SNAP_RADIUS) - this.y_; - if (reverse) { - // When reversing a bump due to an uneditable block, bump up. - dy = -dy; - } - if (rootBlock.RTL) { - dx = -dx; - } - rootBlock.moveBy(dx, dy); -}; - -/** - * Change the connection's coordinates. - * @param {number} x New absolute x coordinate. - * @param {number} y New absolute y coordinate. - */ -Blockly.Connection.prototype.moveTo = function(x, y) { - // Remove it from its old location in the database (if already present) - if (this.inDB_) { - this.db_.removeConnection_(this); - } - this.x_ = x; - this.y_ = y; - // Insert it into its new location in the database. - if (!this.hidden_) { - this.db_.addConnection(this); - } -}; - -/** - * Change the connection's coordinates. - * @param {number} dx Change to x coordinate. - * @param {number} dy Change to y coordinate. - */ -Blockly.Connection.prototype.moveBy = function(dx, dy) { - this.moveTo(this.x_ + dx, this.y_ + dy); -}; - -/** - * Move the blocks on either side of this connection right next to each other. - * @private - */ -Blockly.Connection.prototype.tighten_ = function() { - var dx = this.targetConnection.x_ - this.x_; - var dy = this.targetConnection.y_ - this.y_; - if (dx != 0 || dy != 0) { - var block = this.targetBlock(); - var svgRoot = block.getSvgRoot(); - if (!svgRoot) { - throw 'block is not rendered.'; - } - var xy = Blockly.getRelativeXY_(svgRoot); - block.getSvgRoot().setAttribute('transform', - 'translate(' + (xy.x - dx) + ',' + (xy.y - dy) + ')'); - block.moveConnections_(-dx, -dy); - } -}; - -/** - * Find the closest compatible connection to this connection. - * @param {number} maxLimit The maximum radius to another connection. - * @param {!goog.math.Coordinate} dxy Offset between this connection's location - * in the database and the current location (as a result of dragging). - * @return {!{connection: ?Blockly.Connection, radius: number}} Contains two - * properties:' connection' which is either another connection or null, - * and 'radius' which is the distance. - */ -Blockly.Connection.prototype.closest = function(maxLimit, dxy) { - return this.dbOpposite_.searchForClosest(this, maxLimit, dxy); -}; - /** * Is this connection compatible with another connection with respect to the * value type system. E.g. square_root("Hello") is not compatible. @@ -738,127 +609,3 @@ Blockly.Connection.prototype.setShadowDom = function(shadow) { Blockly.Connection.prototype.getShadowDom = function() { return this.shadowDom_; }; - -/** - * Find all nearby compatible connections to this connection. - * Type checking does not apply, since this function is used for bumping. - * @param {number} maxLimit The maximum radius to another connection. - * @return {!Array.} List of connections. - * @private - */ -Blockly.Connection.prototype.neighbours_ = function(maxLimit) { - return this.dbOpposite_.getNeighbours(this, maxLimit); -}; - -// Appearance or lack thereof. - -/** - * Set whether this connections is hidden (not tracked in a database) or not. - * @param {boolean} hidden True if connection is hidden. - */ -Blockly.Connection.prototype.setHidden = function(hidden) { - this.hidden_ = hidden; - if (hidden && this.inDB_) { - this.db_.removeConnection_(this); - } else if (!hidden && !this.inDB_) { - this.db_.addConnection(this); - } -}; - -/** - * Hide this connection, as well as all down-stream connections on any block - * attached to this connection. This happens when a block is collapsed. - * Also hides down-stream comments. - */ -Blockly.Connection.prototype.hideAll = function() { - this.setHidden(true); - if (this.isConnected()) { - var blocks = this.targetBlock().getDescendants(); - for (var b = 0; b < blocks.length; b++) { - var block = blocks[b]; - // Hide all connections of all children. - var connections = block.getConnections_(true); - for (var c = 0; c < connections.length; c++) { - connections[c].setHidden(true); - } - // Close all bubbles of all children. - var icons = block.getIcons(); - for (var i = 0; i < icons.length; i++) { - icons[i].setVisible(false); - } - } - } -}; - -/** - * Unhide this connection, as well as all down-stream connections on any block - * attached to this connection. This happens when a block is expanded. - * Also unhides down-stream comments. - * @return {!Array.} List of blocks to render. - */ -Blockly.Connection.prototype.unhideAll = function() { - this.setHidden(false); - // All blocks that need unhiding must be unhidden before any rendering takes - // place, since rendering requires knowing the dimensions of lower blocks. - // Also, since rendering a block renders all its parents, we only need to - // render the leaf nodes. - var renderList = []; - if (this.type != Blockly.INPUT_VALUE && this.type != Blockly.NEXT_STATEMENT) { - // Only spider down. - return renderList; - } - var block = this.targetBlock(); - if (block) { - var connections; - if (block.isCollapsed()) { - // This block should only be partially revealed since it is collapsed. - connections = []; - block.outputConnection && connections.push(block.outputConnection); - block.nextConnection && connections.push(block.nextConnection); - block.previousConnection && connections.push(block.previousConnection); - } else { - // Show all connections of this block. - connections = block.getConnections_(true); - } - for (var c = 0; c < connections.length; c++) { - renderList.push.apply(renderList, connections[c].unhideAll()); - } - if (!renderList.length) { - // Leaf block. - renderList[0] = block; - } - } - return renderList; -}; - -/** - * Add highlighting around this connection. - */ -Blockly.Connection.prototype.highlight = function() { - var steps; - if (this.type == Blockly.INPUT_VALUE || this.type == Blockly.OUTPUT_VALUE) { - var tabWidth = this.sourceBlock_.RTL ? -Blockly.BlockSvg.TAB_WIDTH : - Blockly.BlockSvg.TAB_WIDTH; - steps = 'm 0,0 ' + Blockly.BlockSvg.TAB_PATH_DOWN + ' v 5'; - - } else { - steps = 'm -20,0 h 5 ' + Blockly.BlockSvg.NOTCH_PATH_LEFT + ' h 5'; - } - var xy = this.sourceBlock_.getRelativeToSurfaceXY(); - var x = this.x_ - xy.x; - var y = this.y_ - xy.y; - Blockly.Connection.highlightedPath_ = Blockly.createSvgElement('path', - {'class': 'blocklyHighlightedConnectionPath', - 'd': steps, - transform: 'translate(' + x + ',' + y + ')' + - (this.sourceBlock_.RTL ? ' scale(-1 1)' : '')}, - this.sourceBlock_.getSvgRoot()); -}; - -/** - * Remove the highlighting around this connection. - */ -Blockly.Connection.prototype.unhighlight = function() { - goog.dom.removeNode(Blockly.Connection.highlightedPath_); - delete Blockly.Connection.highlightedPath_; -}; diff --git a/core/connection_db.js b/core/connection_db.js index f0b69f7f5..9d143e367 100644 --- a/core/connection_db.js +++ b/core/connection_db.js @@ -173,20 +173,7 @@ Blockly.ConnectionDB.prototype.getNeighbours = function(connection, maxRadius) { pointerMid = Math.floor((pointerMin + pointerMax) / 2); } - // Walk forward and back on the y axis looking for the closest x,y point. - pointerMin = pointerMid; - pointerMax = pointerMid; var neighbours = []; - var sourceBlock = connection.getSourceBlock(); - if (db.length) { - while (pointerMin >= 0 && checkConnection_(pointerMin)) { - pointerMin--; - } - do { - pointerMax++; - } while (pointerMax < db.length && checkConnection_(pointerMax)); - } - /** * Computes if the current connection is within the allowed radius of another * connection. @@ -204,6 +191,19 @@ Blockly.ConnectionDB.prototype.getNeighbours = function(connection, maxRadius) { } return dy < maxRadius; } + + // Walk forward and back on the y axis looking for the closest x,y point. + pointerMin = pointerMid; + pointerMax = pointerMid; + if (db.length) { + while (pointerMin >= 0 && checkConnection_(pointerMin)) { + pointerMin--; + } + do { + pointerMax++; + } while (pointerMax < db.length && checkConnection_(pointerMax)); + } + return neighbours; }; @@ -260,8 +260,8 @@ Blockly.ConnectionDB.prototype.searchForClosest = function(conn, maxRadius, while (pointerMin >= 0 && this.isInYRange_(pointerMin, conn.y_, maxRadius)) { temp = this[pointerMin]; if (conn.isConnectionAllowed(temp, bestRadius)) { - bestConnection = temp; - bestRadius = temp.distanceFrom(conn); + bestConnection = temp; + bestRadius = temp.distanceFrom(conn); } pointerMin--; } @@ -271,8 +271,8 @@ Blockly.ConnectionDB.prototype.searchForClosest = function(conn, maxRadius, maxRadius)) { temp = this[pointerMax]; if (conn.isConnectionAllowed(temp, bestRadius)) { - bestConnection = temp; - bestRadius = temp.distanceFrom(conn); + bestConnection = temp; + bestRadius = temp.distanceFrom(conn); } pointerMax++; } diff --git a/core/contextmenu.js b/core/contextmenu.js index 3a1fc6e95..ebd92df17 100644 --- a/core/contextmenu.js +++ b/core/contextmenu.js @@ -58,7 +58,7 @@ Blockly.ContextMenu.show = function(e, options, rtl) { */ var menu = new goog.ui.Menu(); menu.setRightToLeft(rtl); - for (var x = 0, option; option = options[x]; x++) { + for (var i = 0, option; option = options[i]; i++) { var menuItem = new goog.ui.MenuItem(option.text); menuItem.setRightToLeft(rtl); menu.addChild(menuItem, true); diff --git a/core/css.js b/core/css.js index 6c09b9422..ed9859f0e 100644 --- a/core/css.js +++ b/core/css.js @@ -143,13 +143,6 @@ Blockly.Css.CONTENT = [ 'z-index: 999;', '}', - '.blocklyNonSelectable {', - 'user-select: none;', - '-moz-user-select: none;', - '-webkit-user-select: none;', - '-ms-user-select: none;', - '}', - '.blocklyTooltipDiv {', 'background-color: #ffffc7;', 'border: 1px solid #ddc;', diff --git a/core/events.js b/core/events.js index 3de8bc5c3..bc4299e55 100644 --- a/core/events.js +++ b/core/events.js @@ -254,6 +254,7 @@ Blockly.Events.getDescendantIds_ = function(block) { * Decode the JSON into an event. * @param {!Object} json JSON representation. * @param {!Blockly.Workspace} workspace Target workspace for event. + * @return {!Blockly.Events.Abstract} The event represented by the JSON. */ Blockly.Events.fromJson = function(json, workspace) { var event; @@ -274,7 +275,7 @@ Blockly.Events.fromJson = function(json, workspace) { event = new Blockly.Events.Ui(null); break; default: - throw 'Unknown event type.' + throw 'Unknown event type.'; } event.fromJson(json); event.workspaceId = workspace.id; diff --git a/core/field.js b/core/field.js index 30078e0f3..305ecd6d6 100644 --- a/core/field.js +++ b/core/field.js @@ -450,7 +450,7 @@ Blockly.Field.prototype.setTooltip = function(newTip) { /** * Return the absolute coordinates of the top-left corner of this field. * The origin (0,0) is the top-left corner of the page body. - * @return {{!goog.math.Coordinate}} Object with .x and .y properties. + * @return {!goog.math.Coordinate} Object with .x and .y properties. * @private */ Blockly.Field.prototype.getAbsoluteXY_ = function() { diff --git a/core/field_angle.js b/core/field_angle.js index 09cbf8ee1..b5ca196ce 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -315,6 +315,6 @@ Blockly.FieldAngle.angleValidator = function(text) { n -= 360; } n = String(n); - } + } return n; }; diff --git a/core/field_number.js b/core/field_number.js new file mode 100644 index 000000000..eb92291bf --- /dev/null +++ b/core/field_number.js @@ -0,0 +1,45 @@ +/** + * @license + * Visual Blocks Editor + * + * Copyright 2016 Google Inc. + * https://developers.google.com/blockly/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Number input field + * @author fenichel@google.com (Rachel Fenichel) + */ +'use strict'; + +goog.provide('Blockly.FieldNumber'); + +goog.require('Blockly.FieldTextInput'); + +/** + * Class for an editable number field. + * @param {string} text The initial content of the field. + * @param {Function=} opt_validator An optional function that is called + * to validate any constraints on what the user entered. Takes the new + * text as an argument and returns either the accepted text, a replacement + * text, or null to abort the change. + * @extends {Blockly.FieldTextInput} + * @constructor + */ +Blockly.FieldNumber = function(text, opt_validator) { + Blockly.FieldNumber.superClass_.constructor.call(this, text, + opt_validator); +}; +goog.inherits(Blockly.FieldNumber, Blockly.FieldTextInput); diff --git a/core/flyout.js b/core/flyout.js index 82e1b76ba..e8a04c545 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -592,7 +592,7 @@ Blockly.Flyout.prototype.show = function(xmlList) { this.filterForCapacity_(); // Fire a resize event to update the flyout's scrollbar. - Blockly.fireUiEventNow(window, 'resize'); + Blockly.svgResize(this.workspace_); this.reflowWrapper_ = this.reflow.bind(this); this.workspace_.addChangeListener(this.reflowWrapper_); }; diff --git a/core/inject.js b/core/inject.js index d8f7903bf..419974c20 100644 --- a/core/inject.js +++ b/core/inject.js @@ -211,26 +211,27 @@ Blockly.createMainWorkspace_ = function(svg, options) { var blockXY = block.getRelativeToSurfaceXY(); var blockHW = block.getHeightWidth(); // Bump any block that's above the top back inside. - var overflow = edgeTop + MARGIN - blockHW.height - blockXY.y; - if (overflow > 0) { - block.moveBy(0, overflow); + var overflowTop = edgeTop + MARGIN - blockHW.height - blockXY.y; + if (overflowTop > 0) { + block.moveBy(0, overflowTop); } // Bump any block that's below the bottom back inside. - var overflow = edgeTop + metrics.viewHeight - MARGIN - blockXY.y; - if (overflow < 0) { - block.moveBy(0, overflow); + var overflowBottom = + edgeTop + metrics.viewHeight - MARGIN - blockXY.y; + if (overflowBottom < 0) { + block.moveBy(0, overflowBottom); } // Bump any block that's off the left back inside. - var overflow = MARGIN + edgeLeft - + var overflowLeft = MARGIN + edgeLeft - blockXY.x - (options.RTL ? 0 : blockHW.width); - if (overflow > 0) { - block.moveBy(overflow, 0); + if (overflowLeft > 0) { + block.moveBy(overflowLeft, 0); } // Bump any block that's off the right back inside. - var overflow = edgeLeft + metrics.viewWidth - MARGIN - + var overflowRight = edgeLeft + metrics.viewWidth - MARGIN - blockXY.x + (options.RTL ? blockHW.width : 0); - if (overflow < 0) { - block.moveBy(overflow, 0); + if (overflowRight < 0) { + block.moveBy(overflowRight, 0); } } } @@ -263,7 +264,10 @@ Blockly.init_ = function(mainWorkspace) { }); Blockly.bindEvent_(window, 'resize', null, - function() {Blockly.svgResize(mainWorkspace);}); + function() { + Blockly.hideChaff(true); + Blockly.asyncSvgResize(mainWorkspace); + }); Blockly.inject.bindDocumentEvents_(); @@ -317,7 +321,7 @@ Blockly.inject.bindDocumentEvents_ = function() { // Some iPad versions don't fire resize after portrait to landscape change. if (goog.userAgent.IPAD) { Blockly.bindEvent_(window, 'orientationchange', document, function() { - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(); }); } } diff --git a/core/input.js b/core/input.js index 8ca265586..27733a949 100644 --- a/core/input.js +++ b/core/input.js @@ -47,7 +47,10 @@ Blockly.Input = function(type, name, block, connection) { this.type = type; /** @type {string} */ this.name = name; - /** @type {!Blockly.Block} */ + /** + * @type {!Blockly.Block} + * @private + */ this.sourceBlock_ = block; /** @type {Blockly.Connection} */ this.connection = connection; diff --git a/core/rendered_connection.js b/core/rendered_connection.js new file mode 100644 index 000000000..9c3d90cfc --- /dev/null +++ b/core/rendered_connection.js @@ -0,0 +1,373 @@ +/** + * @license + * Visual Blocks Editor + * + * Copyright 2016 Google Inc. + * https://developers.google.com/blockly/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview Components for creating connections between blocks. + * @author fenichel@google.com (Rachel Fenichel) + */ +'use strict'; + +goog.provide('Blockly.RenderedConnection'); + +goog.require('Blockly.Connection'); + + +/** + * Class for a connection between blocks that may be rendered on screen. + * @param {!Blockly.Block} source The block establishing this connection. + * @param {number} type The type of the connection. + * @constructor + */ +Blockly.RenderedConnection = function(source, type) { + Blockly.RenderedConnection.superClass_.constructor.call(this, source, type); +}; +goog.inherits(Blockly.RenderedConnection, Blockly.Connection); + +/** + * Returns the distance between this connection and another connection. + * @param {!Blockly.Connection} otherConnection The other connection to measure + * the distance to. + * @return {number} The distance between connections. + */ +Blockly.RenderedConnection.prototype.distanceFrom = function(otherConnection) { + var xDiff = this.x_ - otherConnection.x_; + var yDiff = this.y_ - otherConnection.y_; + return Math.sqrt(xDiff * xDiff + yDiff * yDiff); +}; + +/** + * Move the block(s) belonging to the connection to a point where they don't + * visually interfere with the specified connection. + * @param {!Blockly.Connection} staticConnection The connection to move away + * from. + * @private + */ +Blockly.RenderedConnection.prototype.bumpAwayFrom_ = function(staticConnection) { + if (Blockly.dragMode_ != Blockly.DRAG_NONE) { + // Don't move blocks around while the user is doing the same. + return; + } + // Move the root block. + var rootBlock = this.sourceBlock_.getRootBlock(); + if (rootBlock.isInFlyout) { + // Don't move blocks around in a flyout. + return; + } + var reverse = false; + if (!rootBlock.isMovable()) { + // Can't bump an uneditable block away. + // Check to see if the other block is movable. + rootBlock = staticConnection.getSourceBlock().getRootBlock(); + if (!rootBlock.isMovable()) { + return; + } + // Swap the connections and move the 'static' connection instead. + staticConnection = this; + reverse = true; + } + // Raise it to the top for extra visibility. + rootBlock.getSvgRoot().parentNode.appendChild(rootBlock.getSvgRoot()); + var dx = (staticConnection.x_ + Blockly.SNAP_RADIUS) - this.x_; + var dy = (staticConnection.y_ + Blockly.SNAP_RADIUS) - this.y_; + if (reverse) { + // When reversing a bump due to an uneditable block, bump up. + dy = -dy; + } + if (rootBlock.RTL) { + dx = -dx; + } + rootBlock.moveBy(dx, dy); +}; + +/** + * Change the connection's coordinates. + * @param {number} x New absolute x coordinate. + * @param {number} y New absolute y coordinate. + */ +Blockly.RenderedConnection.prototype.moveTo = function(x, y) { + // Remove it from its old location in the database (if already present) + if (this.inDB_) { + this.db_.removeConnection_(this); + } + this.x_ = x; + this.y_ = y; + // Insert it into its new location in the database. + if (!this.hidden_) { + this.db_.addConnection(this); + } +}; + +/** + * Change the connection's coordinates. + * @param {number} dx Change to x coordinate. + * @param {number} dy Change to y coordinate. + */ +Blockly.RenderedConnection.prototype.moveBy = function(dx, dy) { + this.moveTo(this.x_ + dx, this.y_ + dy); +}; + +/** + * Move the blocks on either side of this connection right next to each other. + * @private + */ +Blockly.RenderedConnection.prototype.tighten_ = function() { + var dx = this.targetConnection.x_ - this.x_; + var dy = this.targetConnection.y_ - this.y_; + if (dx != 0 || dy != 0) { + var block = this.targetBlock(); + var svgRoot = block.getSvgRoot(); + if (!svgRoot) { + throw 'block is not rendered.'; + } + var xy = Blockly.getRelativeXY_(svgRoot); + block.getSvgRoot().setAttribute('transform', + 'translate(' + (xy.x - dx) + ',' + (xy.y - dy) + ')'); + block.moveConnections_(-dx, -dy); + } +}; + +/** + * Find the closest compatible connection to this connection. + * @param {number} maxLimit The maximum radius to another connection. + * @param {number} dx Horizontal offset between this connection's location + * in the database and the current location (as a result of dragging). + * @param {number} dy Vertical offset between this connection's location + * in the database and the current location (as a result of dragging). + * @return {!{connection: ?Blockly.Connection, radius: number}} Contains two + * properties: 'connection' which is either another connection or null, + * and 'radius' which is the distance. + */ +Blockly.RenderedConnection.prototype.closest = function(maxLimit, dx, dy) { + return this.dbOpposite_.searchForClosest(this, maxLimit, dx, dy); +}; + +/** + * Add highlighting around this connection. + */ +Blockly.RenderedConnection.prototype.highlight = function() { + var steps; + if (this.type == Blockly.INPUT_VALUE || this.type == Blockly.OUTPUT_VALUE) { + var tabWidth = this.sourceBlock_.RTL ? -Blockly.BlockSvg.TAB_WIDTH : + Blockly.BlockSvg.TAB_WIDTH; + steps = 'm 0,0 ' + Blockly.BlockSvg.TAB_PATH_DOWN + ' v 5'; + + } else { + steps = 'm -20,0 h 5 ' + Blockly.BlockSvg.NOTCH_PATH_LEFT + ' h 5'; + } + var xy = this.sourceBlock_.getRelativeToSurfaceXY(); + var x = this.x_ - xy.x; + var y = this.y_ - xy.y; + Blockly.Connection.highlightedPath_ = Blockly.createSvgElement('path', + {'class': 'blocklyHighlightedConnectionPath', + 'd': steps, + transform: 'translate(' + x + ',' + y + ')' + + (this.sourceBlock_.RTL ? ' scale(-1 1)' : '')}, + this.sourceBlock_.getSvgRoot()); +}; + +/** + * Unhide this connection, as well as all down-stream connections on any block + * attached to this connection. This happens when a block is expanded. + * Also unhides down-stream comments. + * @return {!Array.} List of blocks to render. + */ +Blockly.RenderedConnection.prototype.unhideAll = function() { + this.setHidden(false); + // All blocks that need unhiding must be unhidden before any rendering takes + // place, since rendering requires knowing the dimensions of lower blocks. + // Also, since rendering a block renders all its parents, we only need to + // render the leaf nodes. + var renderList = []; + if (this.type != Blockly.INPUT_VALUE && this.type != Blockly.NEXT_STATEMENT) { + // Only spider down. + return renderList; + } + var block = this.targetBlock(); + if (block) { + var connections; + if (block.isCollapsed()) { + // This block should only be partially revealed since it is collapsed. + connections = []; + block.outputConnection && connections.push(block.outputConnection); + block.nextConnection && connections.push(block.nextConnection); + block.previousConnection && connections.push(block.previousConnection); + } else { + // Show all connections of this block. + connections = block.getConnections_(true); + } + for (var c = 0; c < connections.length; c++) { + renderList.push.apply(renderList, connections[c].unhideAll()); + } + if (!renderList.length) { + // Leaf block. + renderList[0] = block; + } + } + return renderList; +}; + +/** + * Remove the highlighting around this connection. + */ +Blockly.RenderedConnection.prototype.unhighlight = function() { + goog.dom.removeNode(Blockly.Connection.highlightedPath_); + delete Blockly.Connection.highlightedPath_; +}; + +/** + * Set whether this connections is hidden (not tracked in a database) or not. + * @param {boolean} hidden True if connection is hidden. + */ +Blockly.RenderedConnection.prototype.setHidden = function(hidden) { + this.hidden_ = hidden; + if (hidden && this.inDB_) { + this.db_.removeConnection_(this); + } else if (!hidden && !this.inDB_) { + this.db_.addConnection(this); + } +}; + +/** + * Hide this connection, as well as all down-stream connections on any block + * attached to this connection. This happens when a block is collapsed. + * Also hides down-stream comments. + */ +Blockly.RenderedConnection.prototype.hideAll = function() { + this.setHidden(true); + if (this.targetConnection) { + var blocks = this.targetBlock().getDescendants(); + for (var b = 0; b < blocks.length; b++) { + var block = blocks[b]; + // Hide all connections of all children. + var connections = block.getConnections_(true); + for (var c = 0; c < connections.length; c++) { + connections[c].setHidden(true); + } + // Close all bubbles of all children. + var icons = block.getIcons(); + for (var i = 0; i < icons.length; i++) { + icons[i].setVisible(false); + } + } + } +}; + +/** + * Check if the two connections can be dragged to connect to each other. + * @param {!Blockly.Connection} candidate A nearby connection to check. + * @param {number} maxRadius The maximum radius allowed for connections. + * @return {boolean} True if the connection is allowed, false otherwise. + */ +Blockly.RenderedConnection.prototype.isConnectionAllowed = function(candidate, + maxRadius) { + if (this.distanceFrom(candidate) > maxRadius) { + return false; + } + + return Blockly.RenderedConnection.superClass_.isConnectionAllowed.call(this, + candidate); +}; + +/** + * Disconnect two blocks that are connected by this connection. + * @param {!Blockly.Block} parentBlock The superior block. + * @param {!Blockly.Block} childBlock The inferior block. + * @private + */ +Blockly.RenderedConnection.prototype.disconnectInternal_ = function(parentBlock, + childBlock) { + Blockly.RenderedConnection.superClass_.disconnectInternal_.call(this, + parentBlock, childBlock); + // Rerender the parent so that it may reflow. + if (parentBlock.rendered) { + parentBlock.render(); + } + if (childBlock.rendered) { + childBlock.updateDisabled(); + childBlock.render(); + } +}; + +/** + * Respawn the shadow block if there was one connected to the this connection. + * Render/rerender blocks as needed. + * @private + */ +Blockly.RenderedConnection.prototype.respawnShadow_ = function() { + var parentBlock = this.getSourceBlock(); + // Respawn the shadow block if there is one. + var shadow = this.getShadowDom(); + if (parentBlock.workspace && shadow && Blockly.Events.recordUndo) { + var blockShadow = + Blockly.RenderedConnection.superClass_.respawnShadow_.call(this); + if (!blockShadow) { + throw 'Couldn\'t respawn the shadow block that should exist here.'; + } + blockShadow.initSvg(); + blockShadow.render(false); + if (parentBlock.rendered) { + parentBlock.render(); + } + } +}; + +/** + * Find all nearby compatible connections to this connection. + * Type checking does not apply, since this function is used for bumping. + * @param {number} maxLimit The maximum radius to another connection. + * @return {!Array.} List of connections. + * @private + */ +Blockly.RenderedConnection.prototype.neighbours_ = function(maxLimit) { + return this.dbOpposite_.getNeighbours(this, maxLimit); +}; + +/** + * Connect two connections together. This is the connection on the superior + * block. Rerender blocks as needed. + * @param {!Blockly.Connection} childConnection Connection on inferior block. + * @private + */ +Blockly.RenderedConnection.prototype.connect_ = function(childConnection) { + Blockly.RenderedConnection.superClass_.connect_.call(this, childConnection); + + var parentConnection = this; + var parentBlock = parentConnection.getSourceBlock(); + var childBlock = childConnection.getSourceBlock(); + + if (parentBlock.rendered) { + parentBlock.updateDisabled(); + } + if (childBlock.rendered) { + childBlock.updateDisabled(); + } + if (parentBlock.rendered && childBlock.rendered) { + if (parentConnection.type == Blockly.NEXT_STATEMENT || + parentConnection.type == Blockly.PREVIOUS_STATEMENT) { + // Child block may need to square off its corners if it is in a stack. + // Rendering a child will render its parent. + childBlock.render(); + } else { + // Child block does not change shape. Rendering the parent node will + // move its connected children into position. + parentBlock.render(); + } + } +}; diff --git a/core/scrollbar.js b/core/scrollbar.js index 14ee7eac3..b97fe35d9 100644 --- a/core/scrollbar.js +++ b/core/scrollbar.js @@ -446,6 +446,7 @@ Blockly.Scrollbar.prototype.onMouseDownBar_ = function(e) { this.constrainKnob_(knobValue)); this.onScroll_(); e.stopPropagation(); + e.preventDefault(); }; /** @@ -462,7 +463,6 @@ Blockly.Scrollbar.prototype.onMouseDownKnob_ = function(e) { e.stopPropagation(); return; } - Blockly.setPageSelectable(false); // Look up the current translation and record it. this.startDragKnob = parseFloat( this.svgKnob_.getAttribute(this.horizontal_ ? 'x' : 'y')); @@ -473,6 +473,7 @@ Blockly.Scrollbar.prototype.onMouseDownKnob_ = function(e) { Blockly.Scrollbar.onMouseMoveWrapper_ = Blockly.bindEvent_(document, 'mousemove', this, this.onMouseMoveKnob_); e.stopPropagation(); + e.preventDefault(); }; /** @@ -495,7 +496,6 @@ Blockly.Scrollbar.prototype.onMouseMoveKnob_ = function(e) { * @private */ Blockly.Scrollbar.prototype.onMouseUpKnob_ = function() { - Blockly.setPageSelectable(true); Blockly.hideChaff(true); if (Blockly.Scrollbar.onMouseUpWrapper_) { Blockly.unbindEvent_(Blockly.Scrollbar.onMouseUpWrapper_); diff --git a/core/toolbox.js b/core/toolbox.js index f49b4c2c8..129ca73f1 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -150,7 +150,7 @@ Blockly.Toolbox.prototype.init = function() { this.HtmlDiv.setAttribute('dir', workspace.RTL ? 'RTL' : 'LTR'); document.body.appendChild(this.HtmlDiv); - // Clicking on toolbar closes popups. + // Clicking on toolbox closes popups. Blockly.bindEvent_(this.HtmlDiv, 'mousedown', this, function(e) { if (Blockly.isRightButton(e) || e.target == this.HtmlDiv) { @@ -348,7 +348,7 @@ Blockly.Toolbox.prototype.populate_ = function(newTree) { } // Fire a resize event since the toolbox may have changed width and height. - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(this.workspace_); }; /** @@ -386,7 +386,7 @@ Blockly.Toolbox.prototype.clearSelection = function() { }; /** - * Return the deletion rectangle for this toolbar. + * Return the deletion rectangle for this toolbox. * @return {goog.math.Rect} Rectangle in which to delete. */ Blockly.Toolbox.prototype.getClientRect = function() { @@ -533,7 +533,7 @@ Blockly.Toolbox.TreeNode = function(toolbox, html, opt_config, opt_domHelper) { goog.ui.tree.TreeNode.call(this, html, opt_config, opt_domHelper); if (toolbox) { var resize = function() { - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(toolbox.workspace_); }; // Fire a resize event since the toolbox may have changed width. goog.events.listen(toolbox.tree_, diff --git a/core/utils.js b/core/utils.js index 02d07df4f..1a0fba1b6 100644 --- a/core/utils.js +++ b/core/utils.js @@ -163,63 +163,6 @@ Blockly.unbindEvent_ = function(bindData) { return func; }; -/** - * Fire a synthetic event synchronously. - * @param {!EventTarget} node The event's target node. - * @param {string} eventName Name of event (e.g. 'click'). - */ -Blockly.fireUiEventNow = function(node, eventName) { - // Remove the event from the anti-duplicate database. - var list = Blockly.fireUiEvent.DB_[eventName]; - if (list) { - var i = list.indexOf(node); - if (i != -1) { - list.splice(i, 1); - } - } - // Create a UI event in a browser-compatible way. - if (typeof UIEvent == 'function') { - // W3 - var evt = new UIEvent(eventName, {}); - } else { - // MSIE - var evt = document.createEvent('UIEvent'); - evt.initUIEvent(eventName, false, false, window, 0); - } - node.dispatchEvent(evt); -}; - -/** - * Fire a synthetic event asynchronously. Groups of simultaneous events (e.g. - * a tree of blocks being deleted) are merged into one event. - * @param {!EventTarget} node The event's target node. - * @param {string} eventName Name of event (e.g. 'click'). - */ -Blockly.fireUiEvent = function(node, eventName) { - var list = Blockly.fireUiEvent.DB_[eventName]; - if (list) { - if (list.indexOf(node) != -1) { - // This event is already scheduled to fire. - return; - } - list.push(node); - } else { - Blockly.fireUiEvent.DB_[eventName] = [node]; - } - var fire = function() { - Blockly.fireUiEventNow(node, eventName); - }; - setTimeout(fire, 0); -}; - -/** - * Database of upcoming firing event types. - * Used to fire only one event after multiple changes. - * @type {!Object} - * @private - */ -Blockly.fireUiEvent.DB_ = {}; - /** * Don't do anything for this event, just halt propagation. * @param {!Event} e An event. @@ -346,19 +289,6 @@ Blockly.createSvgElement = function(name, attrs, parent, opt_workspace) { return e; }; -/** - * Set css classes to allow/disallow the browser from selecting/highlighting - * text, etc. on the page. - * @param {boolean} selectable Whether elements on the page can be selected. - */ -Blockly.setPageSelectable = function(selectable) { - if (selectable) { - Blockly.removeClass_(document.body, 'blocklyNonSelectable'); - } else { - Blockly.addClass_(document.body, 'blocklyNonSelectable'); - } -}; - /** * Is this event a right-click? * @param {!Event} e Mouse event. @@ -545,7 +475,7 @@ Blockly.tokenizeInterpolation = function(message) { /** * Generate a unique ID. This should be globally unique. * 87 characters ^ 20 length > 128 bits (better than a UUID). - * @return {string} + * @return {string} A globally unique ID string. */ Blockly.genUid = function() { var length = 20; diff --git a/core/workspace.js b/core/workspace.js index d5d976e5c..200196b70 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -45,16 +45,33 @@ Blockly.Workspace = function(opt_options) { this.RTL = !!this.options.RTL; /** @type {boolean} */ this.horizontalLayout = !!this.options.horizontalLayout; + /** @type {number} */ this.toolboxPosition = this.options.toolboxPosition; - /** @type {!Array.} */ + + /** + * @type {!Array.} + * @private + */ this.topBlocks_ = []; - /** @type {!Array.} */ + /** + * @type {!Array.} + * @private + */ this.listeners_ = []; - /** @type {!Array.} */ + /** + * @type {!Array.} + * @private + */ this.undoStack_ = []; - /** @type {!Array.} */ + /** + * @type {!Array.} + * @private + */ this.redoStack_ = []; - /** @type {!Object} */ + /** + * @type {!Object} + * @private + */ this.blockDB_ = Object.create(null); }; @@ -207,14 +224,14 @@ Blockly.Workspace.prototype.remainingCapacity = function() { Blockly.Workspace.prototype.undo = function(redo) { var inputStack = redo ? this.redoStack_ : this.undoStack_; var outputStack = redo ? this.undoStack_ : this.redoStack_; - var event = inputStack.pop(); - if (!event) { + var inputEvent = inputStack.pop(); + if (!inputEvent) { return; } - var events = [event]; + var events = [inputEvent]; // Do another undo/redo if the next one is of the same group. - while (inputStack.length && event.group && - event.group == inputStack[inputStack.length - 1].group) { + while (inputStack.length && inputEvent.group && + inputEvent.group == inputStack[inputStack.length - 1].group) { events.push(inputStack.pop()); } // Push these popped events on the opposite stack. diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 659aa7044..0fbd1e0eb 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -415,7 +415,7 @@ Blockly.WorkspaceSvg.prototype.traceOn = function(armed) { } if (armed) { this.traceWrapper_ = Blockly.bindEvent_(this.svgBlockCanvas_, - 'blocklySelectChange', this, function() {this.traceOn_ = false}); + 'blocklySelectChange', this, function() {this.traceOn_ = false;}); } }; @@ -534,13 +534,12 @@ Blockly.WorkspaceSvg.prototype.recordDeleteAreas = function() { }; /** - * Is the mouse event over a delete area (toolbar or non-closing flyout)? + * Is the mouse event over a delete area (toolbox or non-closing flyout)? * Opens or closes the trashcan and sets the cursor as a side effect. * @param {!Event} e Mouse move event. * @return {boolean} True if event is in a delete area. */ Blockly.WorkspaceSvg.prototype.isDeleteArea = function(e) { - var isDelete = false; var xy = new goog.math.Coordinate(e.clientX, e.clientY); if (this.deleteAreaTrash_) { if (this.deleteAreaTrash_.contains(xy)) { @@ -567,7 +566,6 @@ Blockly.WorkspaceSvg.prototype.isDeleteArea = function(e) { */ Blockly.WorkspaceSvg.prototype.onMouseDown_ = function(e) { this.markFocused(); - Blockly.setPageSelectable(false); if (Blockly.isTargetInput_(e)) { return; } @@ -610,6 +608,7 @@ Blockly.WorkspaceSvg.prototype.onMouseDown_ = function(e) { } // This event has been handled. No need to bubble up to the document. e.stopPropagation(); + e.preventDefault(); }; /** @@ -710,7 +709,7 @@ Blockly.WorkspaceSvg.prototype.cleanUp_ = function() { } Blockly.Events.setGroup(false); // Fire an event to allow scrollbars to resize. - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(this); }; /** diff --git a/core/xml.js b/core/xml.js index e6e3a1c5a..e2651e025 100644 --- a/core/xml.js +++ b/core/xml.js @@ -349,7 +349,7 @@ Blockly.Xml.domToBlock = function(xmlBlock, workspace) { }, 1); topBlock.updateDisabled(); // Fire an event to allow scrollbars to resize. - Blockly.fireUiEvent(window, 'resize'); + Blockly.asyncSvgResize(workspace); } Blockly.Events.enable(); if (Blockly.Events.isEnabled()) { @@ -386,7 +386,6 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) { // Find any enclosed blocks or shadows in this tag. var childBlockNode = null; var childShadowNode = null; - var shadowActive = false; for (var j = 0, grandchildNode; grandchildNode = xmlChild.childNodes[j]; j++) { if (grandchildNode.nodeType == 1) { @@ -400,7 +399,6 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) { // Use the shadow block if there is no child block. if (!childBlockNode && childShadowNode) { childBlockNode = childShadowNode; - shadowActive = true; } var name = xmlChild.getAttribute('name'); diff --git a/dart_compressed.js b/dart_compressed.js index b12fd0a54..ea8876c09 100644 --- a/dart_compressed.js +++ b/dart_compressed.js @@ -29,6 +29,8 @@ c+".insert("+c+".length - "+f+", "+a+");\n"}else if("RANDOM"==e){Blockly.Dart.de Blockly.Dart.lists_getSublist=function(a){var b=Blockly.Dart.valueToCode(a,"LIST",Blockly.Dart.ORDER_UNARY_POSTFIX)||"[]",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=Blockly.Dart.valueToCode(a,"AT1",Blockly.Dart.ORDER_NONE)||"1";a=Blockly.Dart.valueToCode(a,"AT2",Blockly.Dart.ORDER_NONE)||"1";("FIRST"==c||"FROM_START"==c&&Blockly.isNumber(e))&&("LAST"==d||"FROM_START"==d&&Blockly.isNumber(a))?(e="FIRST"==c?0:parseInt(e,10)-1,"LAST"==d?b=b+".sublist("+e+")":(a=parseInt(a,10),b=b+".sublist("+ e+", "+a+")")):b=Blockly.Dart.provideFunction_("lists_get_sublist",["List "+Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_+"(list, where1, at1, where2, at2) {"," int getAt(where, at) {"," if (where == 'FROM_START') {"," at--;"," } else if (where == 'FROM_END') {"," at = list.length - at;"," } else if (where == 'FIRST') {"," at = 0;"," } else if (where == 'LAST') {"," at = list.length - 1;"," } else {"," throw 'Unhandled option (lists_getSublist).';"," }"," return at;", " }"," at1 = getAt(where1, at1);"," at2 = getAt(where2, at2) + 1;"," return list.sublist(at1, at2);","}"])+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")";return[b,Blockly.Dart.ORDER_UNARY_POSTFIX]}; +Blockly.Dart.lists_sort=function(a){var b=Blockly.Dart.valueToCode(a,"LIST",Blockly.Dart.ORDER_UNARY_POSTFIX)||"[]",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");return[Blockly.Dart.provideFunction_("lists_sort",["List "+Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_+"(list, type, direction) {"," var compareFuncs = {",' "NUMERIC": (a, b) => direction * a.compareTo(b),',' "TEXT": (a, b) => direction * a.toString().compareTo(b.toString()),',' "IGNORE_CASE": '," (a, b) => direction * ", +" a.toString().toLowerCase().compareTo(b.toString().toLowerCase())"," };"," list = new List.from(list);"," var compare = compareFuncs[type];"," list.sort(compare);"," return list;","}"])+"("+b+', "'+a+'", '+c+")",Blockly.Dart.ORDER_UNARY_POSTFIX]}; Blockly.Dart.lists_split=function(a){var b=Blockly.Dart.valueToCode(a,"INPUT",Blockly.Dart.ORDER_UNARY_POSTFIX),c=Blockly.Dart.valueToCode(a,"DELIM",Blockly.Dart.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"==a)b||(b="''"),a="split";else if("JOIN"==a)b||(b="[]"),a="join";else throw"Unknown mode: "+a;return[b+"."+a+"("+c+")",Blockly.Dart.ORDER_UNARY_POSTFIX]};Blockly.Dart.logic={};Blockly.Dart.controls_if=function(a){for(var b=0,c=Blockly.Dart.valueToCode(a,"IF"+b,Blockly.Dart.ORDER_NONE)||"false",d=Blockly.Dart.statementToCode(a,"DO"+b),e="if ("+c+") {\n"+d+"}",b=1;b<=a.elseifCount_;b++)c=Blockly.Dart.valueToCode(a,"IF"+b,Blockly.Dart.ORDER_NONE)||"false",d=Blockly.Dart.statementToCode(a,"DO"+b),e+=" else if ("+c+") {\n"+d+"}";a.elseCount_&&(d=Blockly.Dart.statementToCode(a,"ELSE"),e+=" else {\n"+d+"}");return e+"\n"}; Blockly.Dart.logic_compare=function(a){var b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c="=="==b||"!="==b?Blockly.Dart.ORDER_EQUALITY:Blockly.Dart.ORDER_RELATIONAL,d=Blockly.Dart.valueToCode(a,"A",c)||"0";a=Blockly.Dart.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]}; Blockly.Dart.logic_operation=function(a){var b="AND"==a.getFieldValue("OP")?"&&":"||",c="&&"==b?Blockly.Dart.ORDER_LOGICAL_AND:Blockly.Dart.ORDER_LOGICAL_OR,d=Blockly.Dart.valueToCode(a,"A",c);a=Blockly.Dart.valueToCode(a,"B",c);if(d||a){var e="&&"==b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};Blockly.Dart.logic_negate=function(a){var b=Blockly.Dart.ORDER_UNARY_PREFIX;return["!"+(Blockly.Dart.valueToCode(a,"BOOL",b)||"true"),b]}; diff --git a/demos/code/index.html b/demos/code/index.html index 97cc27369..4e12249dd 100644 --- a/demos/code/index.html +++ b/demos/code/index.html @@ -332,6 +332,7 @@ + diff --git a/demos/interpreter/acorn_interpreter.js b/demos/interpreter/acorn_interpreter.js old mode 100755 new mode 100644 index b039ad390..698f14cc3 --- a/demos/interpreter/acorn_interpreter.js +++ b/demos/interpreter/acorn_interpreter.js @@ -1,33 +1,33 @@ -var mod$$inline_58=function(a){function b(a){n=a||{};for(var b in Ua)Object.prototype.hasOwnProperty.call(n,b)||(n[b]=Ua[b]);wa=n.sourceFile||null}function c(a,b){var c=Ab(k,a);b+=" ("+c.line+":"+c.column+")";var e=new SyntaxError(b);e.pos=a;e.loc=c;e.raisedAt=g;throw e;}function d(a){function b(a){if(1==a.length)return c+="return str === "+JSON.stringify(a[0])+";";c+="switch(str){";for(var va=0;vaa)++g;else if(47===a)if(a=k.charCodeAt(g+1),42===a){var a=n.onComment&&n.locations&&new f,b=g,e=k.indexOf("*/",g+=2);-1===e&&c(g-2,"Unterminated comment"); -g=e+2;if(n.locations){Y.lastIndex=b;for(var d=void 0;(d=Y.exec(k))&&d.index=a?a=P(!0):(++g,a=e(xa)),a;case 40:return++g,e(J);case 41:return++g,e(F);case 59:return++g,e(K);case 44:return++g,e(L);case 91:return++g,e(ja); -case 93:return++g,e(ka);case 123:return++g,e(Z);case 125:return++g,e(T);case 58:return++g,e(aa);case 63:return++g,e(ya);case 48:if(a=k.charCodeAt(g+1),120===a||88===a)return g+=2,a=l(16),null==a&&c(y+2,"Expected hexadecimal number"),la(k.charCodeAt(g))&&c(g,"Identifier directly after number"),a=e(ba,a);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return P(!1);case 34:case 39:a:{g++;for(var b="";;){g>=S&&c(y,"Unterminated string constant");var f=k.charCodeAt(g);if(f===a){++g; +var mod$$inline_58=function(a){function b(a){n=a||{};for(var b in Ua)Object.prototype.hasOwnProperty.call(n,b)||(n[b]=Ua[b]);wa=n.sourceFile||null}function c(a,b){var c=Ab(k,a);b+=" ("+c.line+":"+c.column+")";var f=new SyntaxError(b);f.pos=a;f.loc=c;f.raisedAt=g;throw f;}function d(a){function b(a){if(1==a.length)return c+="return str === "+JSON.stringify(a[0])+";";c+="switch(str){";for(var va=0;vaa)++g;else if(47===a)if(a=k.charCodeAt(g+1),42===a){var a=n.onComment&&n.locations&&new f,b=g,e=k.indexOf("*/",g+=2);-1===e&&c(g-2,"Unterminated comment"); +g=e+2;if(n.locations){Y.lastIndex=b;for(var d=void 0;(d=Y.exec(k))&&d.index=a?a=P(!0):(++g,a=e(xa)),a;case 40:return++g,e(J);case 41:return++g,e(F);case 59:return++g,e(K);case 44:return++g,e(L);case 91:return++g,e(ja); +case 93:return++g,e(ka);case 123:return++g,e(Z);case 125:return++g,e(T);case 58:return++g,e(aa);case 63:return++g,e(ya);case 48:if(a=k.charCodeAt(g+1),120===a||88===a)return g+=2,a=x(16),null==a&&c(y+2,"Expected hexadecimal number"),la(k.charCodeAt(g))&&c(g,"Identifier directly after number"),a=e(ba,a);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return P(!1);case 34:case 39:a:{g++;for(var b="";;){g>=S&&c(y,"Unterminated string constant");var f=k.charCodeAt(g);if(f===a){++g; a=e(da,b);break a}if(92===f){var f=k.charCodeAt(++g),d=/^[0-7]+/.exec(k.slice(g,g+3));for(d&&(d=d[0]);d&&255=S)return e(pa);var b=k.charCodeAt(g);if(la(b)||92===b)return Ya();a=r(b);if(!1===a){b=String.fromCharCode(b);if("\\"===b||Za.test(b))return Ya();c(g,"Unexpected character '"+b+"'")}return a}function u(a,b){var c=k.slice(g,g+b);g+=b;e(a,c)}function D(){for(var a="",b,f,d=g;;){g>= -S&&c(d,"Unterminated regular expression");a=k.charAt(g);na.test(a)&&c(d,"Unterminated regular expression");if(b)b=!1;else{if("["===a)f=!0;else if("]"===a&&f)f=!1;else if("/"===a&&!f)break;b="\\"===a}++g}a=k.slice(d,g);++g;(b=$a())&&!/^[gmsiy]*$/.test(b)&&c(d,"Invalid regexp flag");return e(Ba,new RegExp(a,b))}function l(a,b){for(var c=g,f=0,e=0,d=null==b?Infinity:b;e=h?h-48:Infinity;if(h>=a)break;++g;f=f*a+h}return g===c||null!= -b&&g-c!==b?null:f}function P(a){var b=g,f=!1,d=48===k.charCodeAt(g);a||null!==l(10)||c(b,"Invalid number");46===k.charCodeAt(g)&&(++g,l(10),f=!0);a=k.charCodeAt(g);if(69===a||101===a)a=k.charCodeAt(++g),43!==a&&45!==a||++g,null===l(10)&&c(b,"Invalid number"),f=!0;la(k.charCodeAt(g))&&c(g,"Identifier directly after number");a=k.slice(b,g);var h;f?h=parseFloat(a):d&&1!==a.length?/[89]/.test(a)||C?c(b,"Invalid number"):h=parseInt(a,8):h=parseInt(a,10);return e(ba,h)}function ma(a){a=l(16,a);null===a&& +"\x0B";break;case 102:b+="\f";break;case 48:b+="\x00";break;case 13:10===k.charCodeAt(g)&&++g;case 10:n.locations&&(E=g,++H);break;default:b+=String.fromCharCode(f)}}else 13!==f&&10!==f&&8232!==f&&8233!==f||c(y,"Unterminated string constant"),b+=String.fromCharCode(f),++g}}return a;case 47:return a=k.charCodeAt(g+1),R?(++g,a=D()):a=61===a?t(U,2):t(za,1),a;case 37:case 42:return a=k.charCodeAt(g+1),a=61===a?t(U,2):t(Cb,1),a;case 124:case 38:return b=k.charCodeAt(g+1),a=b===a?t(124===a?Va:Wa,2):61=== +b?t(U,2):t(124===a?Db:Eb,1),a;case 94:return a=k.charCodeAt(g+1),a=61===a?t(U,2):t(Fb,1),a;case 43:case 45:return b=k.charCodeAt(g+1),b===a?45==b&&62==k.charCodeAt(g+2)&&na.test(k.slice(M,g))?(g+=3,h(),l(),a=A()):a=t(Gb,2):a=61===b?t(U,2):t(Hb,1),a;case 60:case 62:return b=k.charCodeAt(g+1),f=1,b===a?(f=62===a&&62===k.charCodeAt(g+2)?3:2,a=61===k.charCodeAt(g+f)?t(U,f+1):t(Ib,f)):33==b&&60==a&&45==k.charCodeAt(g+2)&&45==k.charCodeAt(g+3)?(g+=4,h(),l(),a=A()):(61===b&&(f=61===k.charCodeAt(g+2)?3:2), +a=t(Jb,f)),a;case 61:case 33:return b=k.charCodeAt(g+1),a=61===b?t(Kb,61===k.charCodeAt(g+2)?3:2):t(61===a?Aa:Xa,1),a;case 126:return t(Xa,1)}return!1}function A(a){a?g=y+1:y=g;n.locations&&(oa=new f);if(a)return D();if(g>=S)return e(pa);var b=k.charCodeAt(g);if(la(b)||92===b)return Ya();a=m(b);if(!1===a){b=String.fromCharCode(b);if("\\"===b||Za.test(b))return Ya();c(g,"Unexpected character '"+b+"'")}return a}function t(a,b){var c=k.slice(g,g+b);g+=b;e(a,c)}function D(){for(var a="",b,f,d=g;;){g>= +S&&c(d,"Unterminated regular expression");a=k.charAt(g);na.test(a)&&c(d,"Unterminated regular expression");if(b)b=!1;else{if("["===a)f=!0;else if("]"===a&&f)f=!1;else if("/"===a&&!f)break;b="\\"===a}++g}a=k.slice(d,g);++g;(b=$a())&&!/^[gmsiy]*$/.test(b)&&c(d,"Invalid regexp flag");return e(Ba,new RegExp(a,b))}function x(a,b){for(var c=g,f=0,e=0,d=null==b?Infinity:b;e=h?h-48:Infinity;if(h>=a)break;++g;f=f*a+h}return g===c||null!= +b&&g-c!==b?null:f}function P(a){var b=g,f=!1,d=48===k.charCodeAt(g);a||null!==x(10)||c(b,"Invalid number");46===k.charCodeAt(g)&&(++g,x(10),f=!0);a=k.charCodeAt(g);if(69===a||101===a)a=k.charCodeAt(++g),43!==a&&45!==a||++g,null===x(10)&&c(b,"Invalid number"),f=!0;la(k.charCodeAt(g))&&c(g,"Identifier directly after number");a=k.slice(b,g);var h;f?h=parseFloat(a):d&&1!==a.length?/[89]/.test(a)||C?c(b,"Invalid number"):h=parseInt(a,8):h=parseInt(a,10);return e(ba,h)}function ma(a){a=x(16,a);null===a&& c(y,"Bad character escape sequence");return a}function $a(){ca=!1;for(var a,b=!0,f=g;;){var e=k.charCodeAt(g);if(ab(e))ca&&(a+=k.charAt(g)),++g;else if(92===e){ca||(a=k.slice(f,g));ca=!0;117!=k.charCodeAt(++g)&&c(g,"Expecting Unicode escape sequence \\uXXXX");++g;var e=ma(4),d=String.fromCharCode(e);d||c(g-1,"Invalid Unicode escape");(b?la(e):ab(e))||c(g-4,"Invalid Unicode escape");a+=d}else break;b=!1}return ca?a:k.slice(f,g)}function Ya(){var a=$a(),b=V;ca||(Lb(a)?b=Ca[a]:(n.forbidReserved&&(3=== -n.ecmaVersion?Mb:Nb)(a)||C&&bb(a))&&c(y,"The keyword '"+a+"' is reserved"));return e(b,a)}function t(){Da=y;M=X;Ea=ia;A()}function Fa(a){C=a;g=M;if(n.locations)for(;gb){var e=Q(a);e.left=a;e.operator=I;a=p;t();e.right=Ra(Sa(),f,c);f=q(e,a===Va||a===Wa?"LogicalExpression":"BinaryExpression");return Ra(f,b,c)}return a}function Sa(){if(p.prefix){var a=z(),b=p.isUpdate;a.operator=I;R=a.prefix=!0;t();a.argument= -Sa();b?ra(a.argument):C&&"delete"===a.operator&&"Identifier"===a.argument.type&&c(a.start,"Deleting local variable in strict mode");return q(a,b?"UpdateExpression":"UnaryExpression")}for(b=ha(ua());p.postfix&&!qa();)a=Q(b),a.operator=I,a.prefix=!1,a.argument=b,ra(b),t(),b=q(a,"UpdateExpression");return b}function ha(a,b){if(v(xa)){var c=Q(a);c.object=a;c.property=O(!0);c.computed=!1;return ha(q(c,"MemberExpression"),b)}return v(ja)?(c=Q(a),c.object=a,c.property=B(),c.computed=!0,w(ka),ha(q(c,"MemberExpression"), -b)):!b&&v(J)?(c=Q(a),c.callee=a,c.arguments=Ta(F,!1),ha(q(c,"CallExpression"),b)):a}function ua(){switch(p){case ub:var a=z();t();return q(a,"ThisExpression");case V:return O();case ba:case da:case Ba:return a=z(),a.value=I,a.raw=k.slice(y,X),t(),q(a,"Literal");case vb:case wb:case xb:return a=z(),a.value=p.atomValue,a.raw=p.keyword,t(),q(a,"Literal");case J:var a=oa,b=y;t();var f=B();f.start=b;f.end=X;n.locations&&(f.loc.start=a,f.loc.end=ia);n.ranges&&(f.range=[b,X]);w(F);return f;case ja:return a= -z(),t(),a.elements=Ta(ka,!0,!0),q(a,"ArrayExpression");case Z:a=z();b=!0;f=!1;a.properties=[];for(t();!v(T);){if(b)b=!1;else if(w(L),n.allowTrailingCommas&&v(T))break;var e={key:p===ba||p===da?ua():O(!0)},d=!1,h;v(aa)?(e.value=B(!0),h=e.kind="init"):5<=n.ecmaVersion&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)?(d=f=!0,h=e.kind=e.key.name,e.key=p===ba||p===da?ua():O(!0),p!==J&&N(),e.value=Na(z(),!1)):N();if("Identifier"===e.key.type&&(C||f))for(var g=0;gf?a.id:a.params[f],(bb(e.name)||sa(e.name))&&c(e.start,"Defining '"+e.name+"' in strict mode"),0<=f)for(var d=0;db){var e=Q(a);e.left=a;e.operator=I;a=p;r();e.right=Ra(Sa(),f,c);f=q(e,a===Va||a===Wa?"LogicalExpression":"BinaryExpression");return Ra(f,b,c)}return a}function Sa(){if(p.prefix){var a=z(),b=p.isUpdate;a.operator=I;R=a.prefix=!0;r();a.argument= +Sa();b?ra(a.argument):C&&"delete"===a.operator&&"Identifier"===a.argument.type&&c(a.start,"Deleting local variable in strict mode");return q(a,b?"UpdateExpression":"UnaryExpression")}for(b=ha(ua());p.postfix&&!qa();)a=Q(b),a.operator=I,a.prefix=!1,a.argument=b,ra(b),r(),b=q(a,"UpdateExpression");return b}function ha(a,b){if(u(xa)){var c=Q(a);c.object=a;c.property=O(!0);c.computed=!1;return ha(q(c,"MemberExpression"),b)}return u(ja)?(c=Q(a),c.object=a,c.property=B(),c.computed=!0,v(ka),ha(q(c,"MemberExpression"), +b)):!b&&u(J)?(c=Q(a),c.callee=a,c.arguments=Ta(F,!1),ha(q(c,"CallExpression"),b)):a}function ua(){switch(p){case ub:var a=z();r();return q(a,"ThisExpression");case V:return O();case ba:case da:case Ba:return a=z(),a.value=I,a.raw=k.slice(y,X),r(),q(a,"Literal");case vb:case wb:case xb:return a=z(),a.value=p.atomValue,a.raw=p.keyword,r(),q(a,"Literal");case J:var a=oa,b=y;r();var f=B();f.start=b;f.end=X;n.locations&&(f.loc.start=a,f.loc.end=ia);n.ranges&&(f.range=[b,X]);v(F);return f;case ja:return a= +z(),r(),a.elements=Ta(ka,!0,!0),q(a,"ArrayExpression");case Z:a=z();b=!0;f=!1;a.properties=[];for(r();!u(T);){if(b)b=!1;else if(v(L),n.allowTrailingCommas&&u(T))break;var e={key:p===ba||p===da?ua():O(!0)},d=!1,h;u(aa)?(e.value=B(!0),h=e.kind="init"):5<=n.ecmaVersion&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)?(d=f=!0,h=e.kind=e.key.name,e.key=p===ba||p===da?ua():O(!0),p!==J&&N(),e.value=Na(z(),!1)):N();if("Identifier"===e.key.type&&(C||f))for(var g=0;gf?a.id:a.params[f],(bb(e.name)||sa(e.name))&&c(e.start,"Defining '"+e.name+"' in strict mode"),0<=f)for(var d=0;da?36===a:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Za.test(String.fromCharCode(a))},ab=a.isIdentifierChar=function(a){return 48>a?36===a:58>a?!0:65>a?!1:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Pb.test(String.fromCharCode(a))},ca,Ia={kind:"loop"},Ob={kind:"switch"}}; -"object"==typeof exports&&"object"==typeof module?mod$$inline_58(exports):"function"==typeof define&&define.amd?define(["exports"],mod$$inline_58):mod$$inline_58(this.acorn||(this.acorn={})); -var Interpreter=function(a,b){this.initFunc_=b;this.UNDEFINED=this.createPrimitive(void 0);this.ast=acorn.parse(a);this.paused_=!1;var c=this.createScope(this.ast,null);this.stateStack=[{node:this.ast,scope:c,thisExpression:c}]};Interpreter.prototype.step=function(){if(!this.stateStack.length)return!1;if(this.paused_)return!0;var a=this.stateStack[0];this["step"+a.node.type]();return!0};Interpreter.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_}; +"object"==typeof exports&&"object"==typeof module?mod$$inline_58(exports):"function"==typeof define&&define.amd?define(["exports"],mod$$inline_58):mod$$inline_58(this.acorn||(this.acorn={}));/* + + JavaScript Interpreter + + Copyright 2013 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +var Interpreter=function(a,b){this.ast=acorn.parse(a);this.initFunc_=b;this.paused_=!1;this.UNDEFINED=new Interpreter.Primitive(void 0,this);this.NULL=new Interpreter.Primitive(null,this);this.TRUE=new Interpreter.Primitive(!0,this);this.FALSE=new Interpreter.Primitive(!1,this);this.NUMBER_ZERO=new Interpreter.Primitive(0,this);this.NUMBER_ONE=new Interpreter.Primitive(1,this);this.STRING_EMPTY=new Interpreter.Primitive("",this);var c=this.createScope(this.ast,null);this.TRUE.parent=this.BOOLEAN; +this.FALSE.parent=this.BOOLEAN;this.NUMBER_ZERO.parent=this.NUMBER;this.NUMBER_ONE.parent=this.NUMBER;this.STRING_EMPTY.parent=this.STRING;this.stateStack=[{node:this.ast,scope:c,thisExpression:c,done:!1}]}; +Interpreter.prototype.appendCode=function(a){var b=this.stateStack[this.stateStack.length-1];if(!b||"Program"!=b.node.type)throw"Expecting original AST to start with a Program node.";a=acorn.parse(a);if(!a||"Program"!=a.type)throw"Expecting new AST to start with a Program node.";for(var c=0,d;d=a.body[c];c++)b.node.body.push(d);b.done=!1}; +Interpreter.prototype.step=function(){var a=this.stateStack[0];if(!a||"Program"==a.node.type&&a.done)return!1;if(this.paused_)return!0;this["step"+a.node.type]();return!0};Interpreter.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_}; Interpreter.prototype.initGlobalScope=function(a){this.setProperty(a,"Infinity",this.createPrimitive(Infinity),!0);this.setProperty(a,"NaN",this.createPrimitive(NaN),!0);this.setProperty(a,"undefined",this.UNDEFINED,!0);this.setProperty(a,"window",a,!0);this.setProperty(a,"self",a,!1);this.initFunction(a);this.initObject(a);a.parent=this.OBJECT;this.initArray(a);this.initNumber(a);this.initString(a);this.initBoolean(a);this.initDate(a);this.initMath(a);this.initRegExp(a);this.initJSON(a);var b=this, c;c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isNaN(a.toNumber()))};this.setProperty(a,"isNaN",this.createNativeFunction(c));c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isFinite(a.toNumber()))};this.setProperty(a,"isFinite",this.createNativeFunction(c));c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(parseFloat(a.toNumber()))};this.setProperty(a,"parseFloat",this.createNativeFunction(c));c=function(a,c){a=a||b.UNDEFINED;c=c||b.UNDEFINED;return b.createPrimitive(parseInt(a.toString(), -c.toNumber()))};this.setProperty(a,"parseInt",this.createNativeFunction(c));c=this.createObject(this.FUNCTION);c.eval=!0;this.setProperty(c,"length",this.createPrimitive(1),!0);this.setProperty(a,"eval",c);for(var d="escape unescape decodeURI decodeURIComponent encodeURI encodeURIComponent".split(" "),f=0;fa?Math.max(this.length+a,0):Math.min(a,this.length);e=c(e,Infinity);e=Math.min(e,this.length-a);for(var m=b.createObject(b.ARRAY),r=a;r=a;r--)this.properties[r+arguments.length-2]=this.properties[r];this.length+=arguments.length-2;for(r=2;rm&&(m=this.length+m);var m= -Math.max(0,Math.min(m,this.length)),r=c(e,this.length);0>r&&(r=this.length+r);for(var r=Math.max(0,Math.min(r,this.length)),A=0;mh&&(h=this.length+h);for(h=Math.max(0,Math.min(h, -this.length));hh&&(h=this.length+h);for(h=Math.max(0,Math.min(h,this.length));0<=h;h--){var m=b.getProperty(this,h);if(0==b.comp(m,a))return b.createPrimitive(h)}return b.createPrimitive(-1)};this.setProperty(this.ARRAY.properties.prototype, -"lastIndexOf",this.createNativeFunction(d),!1,!0);d=function(){for(var a=[],c=0;ca?Math.max(this.length+a,0):Math.min(a,this.length);e=c(e,Infinity);e=Math.min(e,this.length-a);for(var l=b.createObject(b.ARRAY),m=a;m=a;m--)this.properties[m+arguments.length-2]=this.properties[m];this.length+=arguments.length-2;for(m=2;ml&&(l=this.length+l);var l=Math.max(0,Math.min(l,this.length)),m=c(e,this.length);0>m&&(m=this.length+m);for(var m=Math.max(0,Math.min(m,this.length)),A=0;lh&&(h=this.length+h);for(h=Math.max(0,Math.min(h,this.length));hh&&(h=this.length+h);for(h=Math.max(0,Math.min(h,this.length));0<=h;h--){var l=b.getProperty(this,h);if(0==b.comp(l,a))return b.createPrimitive(h)}return b.createPrimitive(-1)}; +this.setProperty(this.ARRAY.properties.prototype,"lastIndexOf",this.createNativeFunction(d),!1,!0);d=function(){for(var a=[],c=0;cb?1:0};Interpreter.prototype.arrayIndex=function(a){a=Number(a);return!isFinite(a)||a!=Math.floor(a)||0>a?NaN:a}; -Interpreter.prototype.createPrimitive=function(a){if(void 0===a&&this.UNDEFINED)return this.UNDEFINED;if(a instanceof RegExp)return this.createRegExp(this.createObject(this.REGEXP),a);var b=typeof a;a={data:a,isPrimitive:!0,type:b,toBoolean:function(){return Boolean(this.data)},toNumber:function(){return Number(this.data)},toString:function(){return String(this.data)},valueOf:function(){return this.data}};"number"==b?a.parent=this.NUMBER:"string"==b?a.parent=this.STRING:"boolean"==b&&(a.parent=this.BOOLEAN); -return a}; -Interpreter.prototype.createObject=function(a){a={isPrimitive:!1,type:"object",parent:a,fixed:Object.create(null),nonenumerable:Object.create(null),properties:Object.create(null),toBoolean:function(){return!0},toNumber:function(){return 0},toString:function(){return"["+this.type+"]"},valueOf:function(){return this}};this.isa(a,this.FUNCTION)&&(a.type="function",this.setProperty(a,"prototype",this.createObject(this.OBJECT||null)));this.isa(a,this.ARRAY)&&(a.length=0,a.toString=function(){for(var a=[], -c=0;c>="==b.operator)b=f>>e;else if(">>>="==b.operator)b=f>>>e;else if("&="==b.operator)b=f&e;else if("^="==b.operator)b=f^e;else if("|="==b.operator)b=f|e;else throw"Unknown assignment expression: "+b.operator;b=this.createPrimitive(b)}this.setValue(c,b);this.stateStack[0].value=b}else a.doneRight=!0,a.leftSide=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left,components:!0})}; Interpreter.prototype.stepBinaryExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneLeft)if(a.doneRight){this.stateStack.shift();var c=a.leftValue,a=a.value,d=this.comp(c,a);if("=="==b.operator||"!="==b.operator)c=c.isPrimitive&&a.isPrimitive?c.data==a.data:0===d,"!="==b.operator&&(c=!c);else if("==="==b.operator||"!=="==b.operator)c=c.isPrimitive&&a.isPrimitive?c.data===a.data:c===a,"!=="==b.operator&&(c=!c);else if(">"==b.operator)c=1==d;else if(">="==b.operator)c=1==d||0===d;else if("<"== b.operator)c=-1==d;else if("<="==b.operator)c=-1==d||0===d;else if("+"==b.operator)"string"==c.type||"string"==a.type?(c=c.toString(),a=a.toString()):(c=c.toNumber(),a=a.toNumber()),c+=a;else if("in"==b.operator)c=this.hasProperty(a,c);else if(c=c.toNumber(),a=a.toNumber(),"-"==b.operator)c-=a;else if("*"==b.operator)c*=a;else if("/"==b.operator)c/=a;else if("%"==b.operator)c%=a;else if("&"==b.operator)c&=a;else if("|"==b.operator)c|=a;else if("^"==b.operator)c^=a;else if("<<"==b.operator)c<<=a;else if(">>"== -b.operator)c>>=a;else if(">>>"==b.operator)c>>>=a;else throw"Unknown binary operator: "+b.operator;this.stateStack[0].value=this.createPrimitive(c)}else a.doneRight=!0,a.leftValue=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left})}; -Interpreter.prototype.stepBreakStatement=function(){var a=this.stateStack.shift(),a=a.node,b=null;a.label&&(b=a.label.name);for(a=this.stateStack.shift();a&&"callExpression"!=a.node.type;){if(b?b==a.label:a.isLoop||a.isSwitch)return;a=this.stateStack.shift()}throw new SyntaxError("Illegal break statement");};Interpreter.prototype.stepBlockStatement=function(){var a=this.stateStack[0],b=a.node,c=a.n_||0;b.body[c]?(a.n_=c+1,this.stateStack.unshift({node:b.body[c]})):this.stateStack.shift()}; -Interpreter.prototype.stepCallExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneCallee_){if(a.func_)c=a.n_,a.arguments.length!=b.arguments.length&&(a.arguments[c-1]=a.value);else{if("function"==a.value.type)a.func_=a.value;else if(a.member_=a.value[0],a.func_=this.getValue(a.value),!a.func_||"function"!=a.func_.type)throw new TypeError((a.func_&&a.func_.type)+" is not a function");"NewExpression"==a.node.type?(a.funcThis_=this.createObject(a.func_),a.isConstructor_=!0):a.funcThis_= -a.value.length?a.value[0]:this.stateStack[this.stateStack.length-1].thisExpression;a.arguments=[];var c=0}if(b.arguments[c])a.n_=c+1,this.stateStack.unshift({node:b.arguments[c]});else if(a.doneExec)this.stateStack.shift(),this.stateStack[0].value=a.isConstructor_?a.funcThis_:a.value;else{a.doneExec=!0;if(a.func_.node&&("FunctionApply_"==a.func_.node.type||"FunctionCall_"==a.func_.node.type)){a.funcThis_=a.arguments.shift();if("FunctionApply_"==a.func_.node.type){var d=a.arguments.shift();if(d&&this.isa(d, -this.ARRAY))for(a.arguments=[],b=0;bb?a.arguments[b]:this.UNDEFINED;this.setProperty(c,d,f)}d=this.createObject(this.ARRAY);for(b=0;b>=a;else if(">>>"==b.operator)c>>>=a;else throw"Unknown binary operator: "+b.operator;this.stateStack[0].value=this.createPrimitive(c)}else a.doneRight=!0,a.leftValue=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left})};Interpreter.prototype.stepBlockStatement=function(){var a=this.stateStack[0],b=a.node,c=a.n_||0;b.body[c]?(a.done=!1,a.n_=c+1,this.stateStack.unshift({node:b.body[c]})):(a.done=!0,"Program"!=a.node.type&&this.stateStack.shift())}; +Interpreter.prototype.stepBreakStatement=function(){var a=this.stateStack.shift(),a=a.node,b=null;a.label&&(b=a.label.name);for(a=this.stateStack.shift();a&&"CallExpression"!=a.node.type&&"NewExpression"!=a.node.type;){if(b?b==a.label:a.isLoop||a.isSwitch)return;a=this.stateStack.shift()}throw new SyntaxError("Illegal break statement");}; +Interpreter.prototype.stepCallExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneCallee_){if(a.func_)c=a.n_,a.arguments.length!=b.arguments.length&&(a.arguments[c-1]=a.value);else{if("function"==a.value.type)a.func_=a.value;else if(a.member_=a.value[0],a.func_=this.getValue(a.value),!a.func_||"function"!=a.func_.type){this.throwException((a.func_&&a.func_.type)+" is not a function");return}"NewExpression"==a.node.type?(a.funcThis_=this.createObject(a.func_),a.isConstructor_=!0):a.funcThis_= +a.value.length?a.value[0]:this.stateStack[this.stateStack.length-1].thisExpression;a.arguments=[];var c=0}if(b.arguments[c])a.n_=c+1,this.stateStack.unshift({node:b.arguments[c]});else if(a.doneExec)this.stateStack.shift(),this.stateStack[0].value=a.isConstructor_&&"object"!==a.value.type?a.funcThis_:a.value;else{a.doneExec=!0;if(a.func_.node&&("FunctionApply_"==a.func_.node.type||"FunctionCall_"==a.func_.node.type)){a.funcThis_=a.arguments.shift();if("FunctionApply_"==a.func_.node.type){var d=a.arguments.shift(); +if(d&&this.isa(d,this.ARRAY))for(a.arguments=[],b=0;bb?a.arguments[b]:this.UNDEFINED;this.setProperty(c,d,f)}d=this.createObject(this.ARRAY);for(b=0;b direction * a.compareTo(b),', + ' "TEXT": (a, b) => direction * a.toString().compareTo(b.toString()),', + ' "IGNORE_CASE": ', + ' (a, b) => direction * ', + ' a.toString().toLowerCase().compareTo(b.toString().toLowerCase())', + ' };', + ' list = new List.from(list);', // Clone the list. + ' var compare = compareFuncs[type];', + ' list.sort(compare);', + ' return list;', + '}']); + return [sortFunctionName + '(' + listCode + ', ' + + '"' + type + '", ' + direction + ')', + Blockly.Dart.ORDER_UNARY_POSTFIX]; +}; + Blockly.Dart['lists_split'] = function(block) { // Block for splitting text into a list, or joining a list into text. var value_input = Blockly.Dart.valueToCode(block, 'INPUT', diff --git a/generators/javascript/lists.js b/generators/javascript/lists.js index a309a28ea..c9115e9e4 100644 --- a/generators/javascript/lists.js +++ b/generators/javascript/lists.js @@ -299,6 +299,34 @@ Blockly.JavaScript['lists_getSublist'] = function(block) { return [code, Blockly.JavaScript.ORDER_FUNCTION_CALL]; }; +Blockly.JavaScript['lists_sort'] = function(block) { + // Block for sorting a list. + var listCode = Blockly.JavaScript.valueToCode( + block, 'LIST', + Blockly.JavaScript.ORDER_FUNCTION_CALL) || '[]'; + var direction = block.getFieldValue('DIRECTION') === '1' ? 1 : -1; + var type = block.getFieldValue('TYPE'); + var getCompareFunctionName = Blockly.JavaScript.provideFunction_( + 'lists_get_sort_compare', + ['function ' + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + + '(type, direction) {', + ' var compareFuncs = {', + ' "NUMERIC": function(a, b) {', + ' return parseFloat(a) - parseFloat(b); },', + ' "TEXT": function(a, b) {', + ' return a.toString().localeCompare(b.toString(), "en"); },', + ' "IGNORE_CASE": function(a, b) {', + ' return a.toString().localeCompare(b.toString(), "en",', + ' {"sensitivity": "base"}); },', + ' };', + ' var compare = compareFuncs[type];', + ' return function(a, b) { return compare(a, b) * direction; }', + '}']); + return ['(' + listCode + ').slice().sort(' + + getCompareFunctionName + '("' + type + '", ' + direction + '))', + Blockly.JavaScript.ORDER_FUNCTION_CALL]; +}; + Blockly.JavaScript['lists_split'] = function(block) { // Block for splitting text into a list, or joining a list into text. var value_input = Blockly.JavaScript.valueToCode(block, 'INPUT', diff --git a/generators/lua/lists.js b/generators/lua/lists.js index b7fe54586..0d4cfa4b1 100644 --- a/generators/lua/lists.js +++ b/generators/lua/lists.js @@ -320,6 +320,42 @@ Blockly.Lua['lists_getSublist'] = function(block) { return [code, Blockly.Lua.ORDER_HIGH]; }; +Blockly.Lua['lists_sort'] = function(block) { + // Block for sorting a list. + var listCode = Blockly.Lua.valueToCode( + block, 'LIST', Blockly.Lua.ORDER_HIGH) || '({})'; + var direction = block.getFieldValue('DIRECTION') === '1' ? 1 : -1; + var type = block.getFieldValue('TYPE'); + + var functionName = Blockly.Lua.provideFunction_( + 'list_sort', + ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + + '(list, typev, direction)', + ' local t = {}', + ' for n,v in pairs(list) do table.insert(t, v) end', // Shallow-copy. + ' local compareFuncs = {', + ' NUMERIC = function(a, b)', + ' return (tonumber(tostring(a)) or 0)', + ' < (tonumber(tostring(b)) or 0) end,', + ' TEXT = function(a, b)', + ' return tostring(a) < tostring(b) end,', + ' IGNORE_CASE = function(a, b)', + ' return string.lower(tostring(a)) < string.lower(tostring(b)) end', + ' }', + ' local compareTemp = compareFuncs[typev]', + ' local compare = compareTemp', + ' if direction == -1', + ' then compare = function(a, b) return compareTemp(b, a) end', + ' end', + ' table.sort(t, compare)', + ' return t', + 'end']); + + var code = functionName + + '(' + listCode + ',"' + type + '", ' + direction + ')'; + return [code, Blockly.Lua.ORDER_HIGH]; +}; + Blockly.Lua['lists_split'] = function(block) { // Block for splitting text into a list, or joining a list into text. var value_input = Blockly.Lua.valueToCode(block, 'INPUT', diff --git a/generators/php/lists.js b/generators/php/lists.js index 1173da554..d8685ca0e 100644 --- a/generators/php/lists.js +++ b/generators/php/lists.js @@ -356,6 +356,34 @@ Blockly.PHP['lists_getSublist'] = function(block) { return [code, Blockly.PHP.ORDER_FUNCTION_CALL]; }; +Blockly.PHP['lists_sort'] = function(block) { + // Block for sorting a list. + var listCode = Blockly.PHP.valueToCode(block, 'LIST', + Blockly.PHP.ORDER_FUNCTION_CALL) || 'array()'; + var direction = block.getFieldValue('DIRECTION') === '1' ? 1 : -1; + var type = block.getFieldValue('TYPE'); + var functionName = Blockly.PHP.provideFunction_( + 'lists_sort', [ + 'function ' + Blockly.PHP.FUNCTION_NAME_PLACEHOLDER_ + + '($list, $type, $direction) {', + ' $sortCmpFuncs = array(', + ' "NUMERIC" => "strnatcasecmp",', + ' "TEXT" => "strcmp",', + ' "IGNORE_CASE" => "strcasecmp"', + ' );', + ' $sortCmp = $sortCmpFuncs[$type];', + ' $list2 = $list;', // Clone list. + ' usort($list2, $sortCmp);', + ' if ($direction == -1) {', + ' $list2 = array_reverse($list2);', + ' }', + ' return $list2;', + '}']); + var sortCode = functionName + + '(' + listCode + ', "' + type + '", ' + direction + ')'; + return [sortCode, Blockly.PHP.ORDER_FUNCTION_CALL]; +}; + Blockly.PHP['lists_split'] = function(block) { // Block for splitting text into a list, or joining a list into text. var value_input = Blockly.PHP.valueToCode(block, 'INPUT', diff --git a/generators/python/lists.js b/generators/python/lists.js index 05ed4d23e..43352c2c2 100644 --- a/generators/python/lists.js +++ b/generators/python/lists.js @@ -312,6 +312,35 @@ Blockly.Python['lists_getSublist'] = function(block) { return [code, Blockly.Python.ORDER_MEMBER]; }; +Blockly.Python['lists_sort'] = function(block) { + // Block for sorting a list. + var listCode = (Blockly.Python.valueToCode(block, 'LIST', + Blockly.Python.ORDER_MEMBER) || '[]'); + var type = block.getFieldValue('TYPE'); + var reverse = block.getFieldValue('DIRECTION') === '1' ? 'False' : 'True'; + var sortFunctionName = Blockly.Python.provideFunction_('lists_sort', + ['def ' + Blockly.Python.FUNCTION_NAME_PLACEHOLDER_ + + '(listv, type, reversev):', + ' def tryfloat(s):', + ' try:', + ' return float(s)', + ' except:', + ' return 0', + ' keyFuncts = {', + ' "NUMERIC": tryfloat,', + ' "TEXT": str,', + ' "IGNORE_CASE": lambda s: str(s).lower()', + ' }', + ' keyv = keyFuncts[type]', + ' tmp_list = list(listv)', // Clone the list. + ' return sorted(tmp_list, key=keyv, reverse=reversev)' + ]); + + var code = sortFunctionName + + '(' + listCode + ', "' + type + '", ' + reverse + ')'; + return [code, Blockly.Python.ORDER_FUNCTION_CALL]; +}; + Blockly.Python['lists_split'] = function(block) { // Block for splitting text into a list, or joining a list into text. var mode = block.getFieldValue('MODE'); diff --git a/javascript_compressed.js b/javascript_compressed.js index 12223e073..f3e36ffa9 100644 --- a/javascript_compressed.js +++ b/javascript_compressed.js @@ -28,7 +28,10 @@ Blockly.JavaScript.lists_setIndex=function(a){function b(){if(c.match(/^\w+$/))r c+".splice("+c+".length - "+f+", 0, "+a+");\n"}else if("RANDOM"==e){e=b();f=Blockly.JavaScript.variableDB_.getDistinctName("tmp_x",Blockly.Variables.NAME_TYPE);e+="var "+f+" = Math.floor(Math.random() * "+c+".length);\n";if("SET"==d)return e+=c+"["+f+"] = "+a+";\n";if("INSERT"==d)return e+=c+".splice("+f+", 0, "+a+");\n"}throw"Unhandled combination (lists_setIndex).";}; Blockly.JavaScript.lists_getSublist=function(a){var b=Blockly.JavaScript.valueToCode(a,"LIST",Blockly.JavaScript.ORDER_MEMBER)||"[]",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=Blockly.JavaScript.valueToCode(a,"AT1",Blockly.JavaScript.ORDER_NONE)||"1";a=Blockly.JavaScript.valueToCode(a,"AT2",Blockly.JavaScript.ORDER_NONE)||"1";return["FIRST"==c&&"LAST"==d?b+".concat()":Blockly.JavaScript.provideFunction_("lists_get_sublist",["function "+Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+ "(list, where1, at1, where2, at2) {"," function getAt(where, at) {"," if (where == 'FROM_START') {"," at--;"," } else if (where == 'FROM_END') {"," at = list.length - at;"," } else if (where == 'FIRST') {"," at = 0;"," } else if (where == 'LAST') {"," at = list.length - 1;"," } else {"," throw 'Unhandled option (lists_getSublist).';"," }"," return at;"," }"," at1 = getAt(where1, at1);"," at2 = getAt(where2, at2) + 1;"," return list.slice(at1, at2);", -"}"])+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")",Blockly.JavaScript.ORDER_FUNCTION_CALL]};Blockly.JavaScript.lists_split=function(a){var b=Blockly.JavaScript.valueToCode(a,"INPUT",Blockly.JavaScript.ORDER_MEMBER),c=Blockly.JavaScript.valueToCode(a,"DELIM",Blockly.JavaScript.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"==a)b||(b="''"),a="split";else if("JOIN"==a)b||(b="[]"),a="join";else throw"Unknown mode: "+a;return[b+"."+a+"("+c+")",Blockly.JavaScript.ORDER_FUNCTION_CALL]};Blockly.JavaScript.logic={}; +"}"])+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")",Blockly.JavaScript.ORDER_FUNCTION_CALL]}; +Blockly.JavaScript.lists_sort=function(a){var b=Blockly.JavaScript.valueToCode(a,"LIST",Blockly.JavaScript.ORDER_FUNCTION_CALL)||"[]",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");var d=Blockly.JavaScript.provideFunction_("lists_get_sort_compare",["function "+Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(type, direction) {"," var compareFuncs = {",' "NUMERIC": function(a, b) {'," return parseFloat(a) - parseFloat(b); },",' "TEXT": function(a, b) {',' return a.toString().localeCompare(b.toString(), "en"); },', +' "IGNORE_CASE": function(a, b) {',' return a.toString().localeCompare(b.toString(), "en",',' {"sensitivity": "base"}); },'," };"," var compare = compareFuncs[type];"," return function(a, b) { return compare(a, b) * direction; }","}"]);return["("+b+").slice().sort("+d+'("'+a+'", '+c+"))",Blockly.JavaScript.ORDER_FUNCTION_CALL]}; +Blockly.JavaScript.lists_split=function(a){var b=Blockly.JavaScript.valueToCode(a,"INPUT",Blockly.JavaScript.ORDER_MEMBER),c=Blockly.JavaScript.valueToCode(a,"DELIM",Blockly.JavaScript.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"==a)b||(b="''"),a="split";else if("JOIN"==a)b||(b="[]"),a="join";else throw"Unknown mode: "+a;return[b+"."+a+"("+c+")",Blockly.JavaScript.ORDER_FUNCTION_CALL]};Blockly.JavaScript.logic={}; Blockly.JavaScript.controls_if=function(a){for(var b=0,c=Blockly.JavaScript.valueToCode(a,"IF"+b,Blockly.JavaScript.ORDER_NONE)||"false",d=Blockly.JavaScript.statementToCode(a,"DO"+b),e="if ("+c+") {\n"+d+"}",b=1;b<=a.elseifCount_;b++)c=Blockly.JavaScript.valueToCode(a,"IF"+b,Blockly.JavaScript.ORDER_NONE)||"false",d=Blockly.JavaScript.statementToCode(a,"DO"+b),e+=" else if ("+c+") {\n"+d+"}";a.elseCount_&&(d=Blockly.JavaScript.statementToCode(a,"ELSE"),e+=" else {\n"+d+"}");return e+"\n"}; Blockly.JavaScript.logic_compare=function(a){var b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c="=="==b||"!="==b?Blockly.JavaScript.ORDER_EQUALITY:Blockly.JavaScript.ORDER_RELATIONAL,d=Blockly.JavaScript.valueToCode(a,"A",c)||"0";a=Blockly.JavaScript.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]}; Blockly.JavaScript.logic_operation=function(a){var b="AND"==a.getFieldValue("OP")?"&&":"||",c="&&"==b?Blockly.JavaScript.ORDER_LOGICAL_AND:Blockly.JavaScript.ORDER_LOGICAL_OR,d=Blockly.JavaScript.valueToCode(a,"A",c);a=Blockly.JavaScript.valueToCode(a,"B",c);if(d||a){var e="&&"==b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]}; diff --git a/lua_compressed.js b/lua_compressed.js index d6fd33f95..8738f3ffb 100644 --- a/lua_compressed.js +++ b/lua_compressed.js @@ -24,6 +24,8 @@ Blockly.Lua.lists_setIndex=function(a){var b=Blockly.Lua.valueToCode(a,"LIST",Bl Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_+"(t, index, val)"," t[#t + 1 - index] = val","end"]):Blockly.Lua.provideFunction_("list_insert_from_end",["function "+Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_+"(t, index, val)"," table.insert(t, #t + 1 - index, val)","end"]);return c+"("+b+", "+e+", "+a+")\n"}; Blockly.Lua.lists_getSublist=function(a){var b=Blockly.Lua.valueToCode(a,"LIST",Blockly.Lua.ORDER_HIGH)||"({})",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=Blockly.Lua.valueToCode(a,"AT1",Blockly.Lua.ORDER_ADDITIVE)||"1";a=Blockly.Lua.valueToCode(a,"AT2",Blockly.Lua.ORDER_ADDITIVE)||"1";var f=Blockly.Lua.lists.getIndex_;return[Blockly.Lua.provideFunction_("list_sublist_"+Blockly.Lua.lists.gensym_(),["function "+Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_+"(source)"," local t = {}"," local start = "+ f("source",c,e)," local finish = "+f("source",d,a)," for i = start, finish do"," table.insert(t, source[i])"," end"," return t","end"])+"("+b+")",Blockly.Lua.ORDER_HIGH]}; +Blockly.Lua.lists_sort=function(a){var b=Blockly.Lua.valueToCode(a,"LIST",Blockly.Lua.ORDER_HIGH)||"({})",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");return[Blockly.Lua.provideFunction_("list_sort",["function "+Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_+"(list, typev, direction)"," local t = {}"," for n,v in pairs(list) do table.insert(t, v) end"," local compareFuncs = {"," NUMERIC = function(a, b)"," return (tonumber(tostring(a)) or 0)"," < (tonumber(tostring(b)) or 0) end,", +" TEXT = function(a, b)"," return tostring(a) < tostring(b) end,"," IGNORE_CASE = function(a, b)"," return string.lower(tostring(a)) < string.lower(tostring(b)) end"," }"," local compareTemp = compareFuncs[typev]"," local compare = compareTemp"," if direction == -1"," then compare = function(a, b) return compareTemp(b, a) end"," end"," table.sort(t, compare)"," return t","end"])+"("+b+',"'+a+'", '+c+")",Blockly.Lua.ORDER_HIGH]}; Blockly.Lua.lists_split=function(a){var b=Blockly.Lua.valueToCode(a,"INPUT",Blockly.Lua.ORDER_NONE),c=Blockly.Lua.valueToCode(a,"DELIM",Blockly.Lua.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"==a)b||(b="''"),a=Blockly.Lua.provideFunction_("list_string_split",["function "+Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_+"(input, delim)"," local t = {}"," local pos = 1"," while true do"," next_delim = string.find(input, delim, pos)"," if next_delim == nil then"," table.insert(t, string.sub(input, pos))", " break"," else"," table.insert(t, string.sub(input, pos, next_delim-1))"," pos = next_delim + #delim"," end"," end"," return t","end"]);else if("JOIN"==a)b||(b="({})"),a="table.concat";else throw"Unknown mode: "+a;return[a+"("+b+", "+c+")",Blockly.Lua.ORDER_HIGH]};Blockly.Lua.logic={};Blockly.Lua.controls_if=function(a){for(var b=0,c=Blockly.Lua.valueToCode(a,"IF"+b,Blockly.Lua.ORDER_NONE)||"false",d=Blockly.Lua.statementToCode(a,"DO"+b),e="if "+c+" then\n"+d,b=1;b<=a.elseifCount_;b++)c=Blockly.Lua.valueToCode(a,"IF"+b,Blockly.Lua.ORDER_NONE)||"false",d=Blockly.Lua.statementToCode(a,"DO"+b),e+=" elseif "+c+" then\n"+d;a.elseCount_&&(d=Blockly.Lua.statementToCode(a,"ELSE"),e+=" else\n"+d);return e+"end\n"}; Blockly.Lua.logic_compare=function(a){var b={EQ:"==",NEQ:"~=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c=Blockly.Lua.valueToCode(a,"A",Blockly.Lua.ORDER_RELATIONAL)||"0";a=Blockly.Lua.valueToCode(a,"B",Blockly.Lua.ORDER_RELATIONAL)||"0";return[c+" "+b+" "+a,Blockly.Lua.ORDER_RELATIONAL]}; diff --git a/msg/js/ar.js b/msg/js/ar.js index 7df7e8988..adb016dee 100644 --- a/msg/js/ar.js +++ b/msg/js/ar.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "يحدد العنصر في Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "يحدد العنصر في الموضع المحدد في قائمة ما. #1 هو العنصر الأول."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "يحدد العنصر الأخير في قائمة."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "يحدد عنصرا عشوائيا في قائمة."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "إعداد قائمة من النصوص"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "إعداد نص من القائمة"; diff --git a/msg/js/az.js b/msg/js/az.js index 9cc49ccef..a186c6309 100644 --- a/msg/js/az.js +++ b/msg/js/az.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Siyahının göstərilən ye Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Siyahının göstərilən yerdəki elementini təyin edir. #1 birinci elementdir."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Siyahının sonuncu elementini təyin edir."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Siyahının təsadüfi seçilmiş bir elementini təyin edir."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/ba.js b/msg/js/ba.js index 8c6b00db1..4b0f93398 100644 --- a/msg/js/ba.js +++ b/msg/js/ba.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/bcc.js b/msg/js/bcc.js index 6b2ce5b57..e1949722c 100644 --- a/msg/js/bcc.js +++ b/msg/js/bcc.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "مورد مشخص‌شده Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "مورد مشخص‌شده در یک فهرست را قرار می‌دهد. #1 اولین مورد است."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "آخرین مورد در یک فهرست را تعیین می‌کند."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "یک مورد تصادفی در یک فهرست را تعیین می‌کند."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/be-tarask.js b/msg/js/be-tarask.js index 6ea014e62..27ce00e4d 100644 --- a/msg/js/be-tarask.js +++ b/msg/js/be-tarask.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Задае элемэнт у Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Задае элемэнт у пазначанай пазыцыі ў сьпісе. №1 — першы элемэнт."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Задае апошні элемэнт у сьпісе."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Задае выпадковы элемэнт у сьпісе."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "стварыць сьпіс з тэксту"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "стварыць тэкст са сьпісу"; diff --git a/msg/js/bg.js b/msg/js/bg.js index 34c436419..36c1ca314 100644 --- a/msg/js/bg.js +++ b/msg/js/bg.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Променя елемен Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Променя елемента на определена позиция в списък. #1 е първият елемент."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Променя последния елемент в списък."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Променя случаен елемент от списък."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "Направи списък от текст"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "направи текст от списък"; diff --git a/msg/js/bn.js b/msg/js/bn.js index 55c678b66..b6b23179b 100644 --- a/msg/js/bn.js +++ b/msg/js/bn.js @@ -80,7 +80,7 @@ Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "তালিকা"; Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Add, remove, or reorder sections to reconfigure this list block."; // untranslated Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "create list with"; // untranslated -Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "তালিকায় একটি পদ যোগ করে।"; +Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "তালিকায় একটি পদ যোগ করুন।"; Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "যেকোন সংখ্যক পদ নিয়ে একটি তালিকা তৈরি করুন।"; Blockly.Msg.LISTS_GET_INDEX_FIRST = "প্রথম"; Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# শেষ থেকে"; @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "লিখা থেকে তালিকা তৈরি করুন"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "তালিকা থেকে লিখা তৈরি করুন"; @@ -165,7 +173,7 @@ Blockly.Msg.LOGIC_NEGATE_TITLE = "%1 নয়"; Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "পাঠাবে সত্য যদি ইনপুট মিথ্যা হয়। পাঠাবে মিথ্যা যদি ইনপুট সত্য হয়।"; Blockly.Msg.LOGIC_NULL = "কিছু না"; Blockly.Msg.LOGIC_NULL_HELPURL = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated -Blockly.Msg.LOGIC_NULL_TOOLTIP = "কিছু না ফেরত দিবে।"; +Blockly.Msg.LOGIC_NULL_TOOLTIP = "কিছু ফেরত দিবে না।"; Blockly.Msg.LOGIC_OPERATION_AND = "এবং"; Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated Blockly.Msg.LOGIC_OPERATION_OR = "অথবা"; diff --git a/msg/js/br.js b/msg/js/br.js index 3869956a5..180104806 100644 --- a/msg/js/br.js +++ b/msg/js/br.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Termenañ a ra an elfenn el Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Termenañ a ra an elfenn el lec'h meneget en ul listenn. #1 eo an elfenn ziwezhañ."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Termenañ a ra an elfenn diwezhañ en ul listenn."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Termenañ a ra un elfenn dre zegouezh en ul listenn."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "Krouiñ ul listenn diwar an destenn"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "Krouiñ un destenn diwar al listenn"; diff --git a/msg/js/ca.js b/msg/js/ca.js index 3e38123d9..d85028f95 100644 --- a/msg/js/ca.js +++ b/msg/js/ca.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Modifica l'element de la pos Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Modifica l'element de la posició especificada d'una llista. #1 és el primer element."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Modifica l'últim element d'una llista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Modifica un element a l'atzar d'una llista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/cs.js b/msg/js/cs.js index 563f79e16..72809048f 100644 --- a/msg/js/cs.js +++ b/msg/js/cs.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Nastaví položku na konkré Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Nastaví položku na konkrétní místo v seznamu. #1 je první položka."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Nastaví poslední položku v seznamu."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Nastaví náhodnou položku v seznamu."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "udělat z textu seznam"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "udělat ze seznamu text"; diff --git a/msg/js/da.js b/msg/js/da.js index d13b80ce6..b21e19da1 100644 --- a/msg/js/da.js +++ b/msg/js/da.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sætter elementet på den an Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sætter elementet på den angivne position i en liste. #1 er det første element."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sætter det sidste element i en liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sætter et tilfældigt element i en liste."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "lav tekst til liste"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "lav liste til tekst"; diff --git a/msg/js/de.js b/msg/js/de.js index b0273abb2..d8cd070c9 100644 --- a/msg/js/de.js +++ b/msg/js/de.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Setzt das Element an der ang Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Setzte das Element an der angegebenen Position in der Liste. #1 ist das erste Element."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Setzt das letzte Element in der Liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Setzt ein zufälliges Element in der Liste."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "Liste aus Text erstellen"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "Text aus Liste erstellen"; diff --git a/msg/js/el.js b/msg/js/el.js index a29b7961b..33cd53110 100644 --- a/msg/js/el.js +++ b/msg/js/el.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Ορίζει το στοιχ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Ορίζει το στοιχείο στην καθορισμένη θέση σε μια λίστα. Το #1 είναι το πρώτο στοιχείο."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Ορίζει το τελευταίο στοιχείο σε μια λίστα."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Ορίζει ένα τυχαίο στοιχείο σε μια λίστα."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "κάνετε λίστα από το κείμενο"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "κάνετε κείμενο από τη λίστα"; diff --git a/msg/js/en.js b/msg/js/en.js index d0df4ca86..d33ae9638 100644 --- a/msg/js/en.js +++ b/msg/js/en.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; diff --git a/msg/js/es.js b/msg/js/es.js index ba3202939..56891f7f0 100644 --- a/msg/js/es.js +++ b/msg/js/es.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Establece el elemento en la Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Establece el elemento en la posición especificada en una lista. #1 es el primer elemento."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Establece el último elemento de una lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Establece un elemento aleatorio en una lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "hacer lista a partir de texto"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "hacer texto a partir de lista"; diff --git a/msg/js/fa.js b/msg/js/fa.js index 0a9f8196f..5cd272ab7 100644 --- a/msg/js/fa.js +++ b/msg/js/fa.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "مورد مشخص‌شده Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "مورد مشخص‌شده در یک فهرست را قرار می‌دهد. #1 اولین مورد است."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "آخرین مورد در یک فهرست را تعیین می‌کند."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "یک مورد تصادفی در یک فهرست را تعیین می‌کند."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "ایجاد فهرست از متن"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "ایجاد متن از فهرست"; diff --git a/msg/js/fi.js b/msg/js/fi.js index 67b4b7e6c..ab84ec021 100644 --- a/msg/js/fi.js +++ b/msg/js/fi.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Asettaa listan määrätyss Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Asettaa kohteen määrättyyn kohtaa listassa. Nro 1 on listan alku."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Asettaa listan viimeisen kohteen."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Asettaa satunnaisen kohteen listassa."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "tee lista tekstistä"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "tee listasta teksti"; diff --git a/msg/js/fr.js b/msg/js/fr.js index b15541565..7835f9169 100644 --- a/msg/js/fr.js +++ b/msg/js/fr.js @@ -7,7 +7,7 @@ goog.provide('Blockly.Msg.fr'); goog.require('Blockly.Msg'); Blockly.Msg.ADD_COMMENT = "Ajouter un commentaire"; -Blockly.Msg.AUTH = "Veuillez autoriser cette application à permettre la sauvegarde de votre travail et à l’autoriser à la partager."; +Blockly.Msg.AUTH = "Veuillez autoriser cette application à permettre la sauvegarde de votre travail et à l’autoriser d'être partagé par vous."; Blockly.Msg.CHANGE_VALUE_TITLE = "Modifier la valeur :"; Blockly.Msg.CHAT = "Discutez avec votre collaborateur en tapant dans cette zone !"; Blockly.Msg.CLEAN_UP = "Nettoyer les blocs"; @@ -28,7 +28,7 @@ Blockly.Msg.COLOUR_RGB_BLUE = "bleu"; Blockly.Msg.COLOUR_RGB_GREEN = "vert"; Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html"; Blockly.Msg.COLOUR_RGB_RED = "rouge"; -Blockly.Msg.COLOUR_RGB_TITLE = "colorer avec"; +Blockly.Msg.COLOUR_RGB_TITLE = "colorier avec"; Blockly.Msg.COLOUR_RGB_TOOLTIP = "Créer une couleur avec la quantité spécifiée de rouge, vert et bleu. Les valeurs doivent être comprises entre 0 et 100."; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "quitter la boucle"; @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Fixe l’élément à la pos Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Fixe l’élément à la position indiquée dans une liste. #1 est le premier élément."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Fixe le dernier élément dans une liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Fixe un élément au hasard dans une liste."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "créer une liste depuis le texte"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "créer un texte depuis la liste"; @@ -261,7 +269,7 @@ Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Renvoie le sinus d’un angle en degrés (p Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Renvoie la tangente d’un angle en degrés (pas en radians)."; Blockly.Msg.ME = "Moi"; Blockly.Msg.NEW_VARIABLE = "Nouvelle variable…"; -Blockly.Msg.NEW_VARIABLE_TITLE = "Nom de la nouvelle variable :"; +Blockly.Msg.NEW_VARIABLE_TITLE = "Nouveau nom de la variable :"; Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "autoriser les ordres"; Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "avec :"; diff --git a/msg/js/he.js b/msg/js/he.js index af685f632..36497f795 100644 --- a/msg/js/he.js +++ b/msg/js/he.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "מגדיר את הפריט Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "מגדיר את הפריט במיקום שצוין ברשימה. #1 הוא הפריט הראשון."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "מגדיר את הפריט האחרון ברשימה."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "מגדיר פריט אקראי ברשימה."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "יצירת רשימה מטקסט"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "יצירת טקסט מרשימה"; diff --git a/msg/js/hi.js b/msg/js/hi.js index 609efcfa4..84539aed5 100644 --- a/msg/js/hi.js +++ b/msg/js/hi.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "सूची मे बत Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "सूची मे बताए गये स्थान में आइटम सैट करता है। #1 पहला आइटम है।"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "सूची में आखरी आइटम सैट करता है।"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "सूची में रैन्डम आइटम सैट करता है।"; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/hrx.js b/msg/js/hrx.js index 825a4e05b..bbe6bffe4 100644 --- a/msg/js/hrx.js +++ b/msg/js/hrx.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Setzt das Element zu en defi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Setzt das Element zu en definierte Stell in en List. #1 ist das earschte Element."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Setzt das letzte Element an en List."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Setzt en zufälliches Element an en List."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/hu.js b/msg/js/hu.js index 78a011115..60fa8db0c 100644 --- a/msg/js/hu.js +++ b/msg/js/hu.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "A megadott sorszámú elem c Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "A megadott sorszámú elem cseréje a listában. 1 az első elemet jelenti."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Az utolsó elem cseréje a listában."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Véletlenszerűen választott elem cseréje a listában."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "lista készítése szövegből"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "sztring készítése listából"; diff --git a/msg/js/ia.js b/msg/js/ia.js index 13f338dea..c44402c48 100644 --- a/msg/js/ia.js +++ b/msg/js/ia.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Defini le valor del elemento Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Defini le valor del elemento al position specificate in un lista. № 1 es le prime elemento."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Defini le valor del ultime elemento in un lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Defini le valor de un elemento aleatori in un lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "Crear un lista per un texto"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "crear un texto per un lista"; diff --git a/msg/js/id.js b/msg/js/id.js index 6969a69e0..c19e7ad8d 100644 --- a/msg/js/id.js +++ b/msg/js/id.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Tetapkan item ke dalam posis Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Tetapkan item ke dalam posisi yang telah ditentukan di dalam list. #1 adalah item yang pertama."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Menetapkan item terakhir dalam list."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Tetapkan secara acak sebuah item dalam list."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "buat list dari teks"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "buat teks dari list"; diff --git a/msg/js/is.js b/msg/js/is.js index f817ce56e..f9969e4e3 100644 --- a/msg/js/is.js +++ b/msg/js/is.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Setur atriðið í tiltekna Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Setur atriðið í tiltekna sætið í listanum. #1 er fyrsta atriðið."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Setur atriðið í síðasta sæti lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Setur atriðið í eitthvert sæti lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "gera lista úr texta"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "gera texta úr lista"; diff --git a/msg/js/it.js b/msg/js/it.js index b49822206..e2f2e6d77 100644 --- a/msg/js/it.js +++ b/msg/js/it.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Imposta l'elemento nella pos Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Imposta l'elemento nella posizione indicata di una lista. 1 corrisponde al primo elemento."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Imposta l'ultimo elemento in una lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Imposta un elemento casuale in una lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "crea lista da testo"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "crea testo da lista"; diff --git a/msg/js/ja.js b/msg/js/ja.js index 6cc2cd83a..ffb028705 100644 --- a/msg/js/ja.js +++ b/msg/js/ja.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "リスト内の指定され Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "リスト内の指定された位置に項目を設定します。# 1 は、最初の項目です。"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "リスト内の最後の項目を設定します。"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "リスト内にランダムなアイテムを設定します。"; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "テキストからリストを作る"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "リストからテキストを作る"; diff --git a/msg/js/ko.js b/msg/js/ko.js index 4e3da55ad..07e4db0bd 100644 --- a/msg/js/ko.js +++ b/msg/js/ko.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "특정 번째 위치의 아 Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "특정 번째 위치의 아이템으로 설정합니다. #1 는 첫번째 아이템."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "마지막 아이템으로 설정합니다."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "목록에서 임의 위치의 아이템을 설정합니다."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "텍스트에서 목록 만들기"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "목록에서 텍스트 만들기"; diff --git a/msg/js/lb.js b/msg/js/lb.js index a46baaafd..b267f1547 100644 --- a/msg/js/lb.js +++ b/msg/js/lb.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Setzt en zoufällegt Element an eng Lëscht."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/lki.js b/msg/js/lki.js index 97e913d85..fff84fccc 100644 --- a/msg/js/lki.js +++ b/msg/js/lki.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "مورد مشخص‌شده Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "مورد مشخص‌شده در یک فهرست را قرار می‌دهد. #1 اولین مورد است."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "آخرین مورد در یک فهرست را تعیین می‌کند."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "یک مورد تصادفی در یک فهرست را تعیین می‌کند."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "ساخت لیست إژ متن"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "ساخت متن إژ لیست"; diff --git a/msg/js/lrc.js b/msg/js/lrc.js index 1d8f62ec5..a616694e5 100644 --- a/msg/js/lrc.js +++ b/msg/js/lrc.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/lt.js b/msg/js/lt.js index 2dc12b1d9..9bfa65c0a 100644 --- a/msg/js/lt.js +++ b/msg/js/lt.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/mk.js b/msg/js/mk.js index cf4ebcc9b..b42a5387f 100644 --- a/msg/js/mk.js +++ b/msg/js/mk.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/ms.js b/msg/js/ms.js index 71f22f6fb..7ceccd71b 100644 --- a/msg/js/ms.js +++ b/msg/js/ms.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Masukkan item pada posisi ya Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Masukkan item pada posisi yang ditentukan dalam senarai. #1 ialah item terakhir."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Set item terakhir dalam senarai."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Set item rawak dalam senarai."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "buat senarai dgn teks"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "buat teks drpd senarai"; diff --git a/msg/js/nb.js b/msg/js/nb.js index f449c5a0d..2f09735ff 100644 --- a/msg/js/nb.js +++ b/msg/js/nb.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Setter inn elementet ved den Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Setter inn elementet ved den angitte posisjonen i en liste. #1 er det første elementet."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Angir det siste elementet i en liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Angir et tilfeldig element i en liste."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "lag liste av tekst"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "lag tekst av liste"; diff --git a/msg/js/nl.js b/msg/js/nl.js index ae22bbd2a..1bbdb1e1c 100644 --- a/msg/js/nl.js +++ b/msg/js/nl.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Stelt het item op een opgege Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Stelt het item op de opgegeven positie in de lijst in. Item 1 is het eerste item."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Stelt het laatste item van een lijst in."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Stelt een willekeurig item uit de lijst in."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "lijst maken van tekst"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "tekst maken van lijst"; diff --git a/msg/js/oc.js b/msg/js/oc.js index cf4418d5e..2947d8b6b 100644 --- a/msg/js/oc.js +++ b/msg/js/oc.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/pl.js b/msg/js/pl.js index a1e43d013..fa0ad887a 100644 --- a/msg/js/pl.js +++ b/msg/js/pl.js @@ -7,7 +7,7 @@ goog.provide('Blockly.Msg.pl'); goog.require('Blockly.Msg'); Blockly.Msg.ADD_COMMENT = "Dodaj komentarz"; -Blockly.Msg.AUTH = "Proszę autoryzować ten program, aby można było zapisać swoją pracę i umożliwić Ci dzielenie się nią."; +Blockly.Msg.AUTH = "Autoryzuj ten program, aby można było zapisać Twoją pracę i umożliwić Ci dzielenie się nią z innymi."; Blockly.Msg.CHANGE_VALUE_TITLE = "Zmień wartość:"; Blockly.Msg.CHAT = "Rozmawiaj z swoim współpracownikiem, pisząc w tym polu!"; Blockly.Msg.CLEAN_UP = "Uporządkuj bloki"; @@ -35,10 +35,10 @@ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "wyjdź z pętli"; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "przejdź do kolejnej iteracji pętli"; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Wyjdź z zawierającej pętli."; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Pomiń resztę pętli i kontynuuj w kolejnej iteracji."; -Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Ostrzeżenie: Ten blok może być użyty tylko w pętli."; +Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Uwaga: Ten blok może być użyty tylko w pętli."; Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated Blockly.Msg.CONTROLS_FOREACH_TITLE = "dla każdego elementu %1 na liście %2"; -Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Dla każdego elementu z listy przyporządkuj zmienną '%1', a następnie wykonaj kilka instrukcji."; +Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Dla każdego elementu listy ustaw zmienną %1 na ten element, a następnie wykonaj kilka instrukcji."; Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated Blockly.Msg.CONTROLS_FOR_TITLE = "licz z %1 od %2 do %3 co %4 (wartość kroku)"; Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Przypisuje zmiennej %1 wartości od numeru startowego do numeru końcowego, licząc co określony interwał, wykonując określone bloki."; @@ -66,7 +66,7 @@ Blockly.Msg.DELETE_ALL_BLOCKS = "Usunąć wszystkie %1 bloki(ów)?"; Blockly.Msg.DELETE_BLOCK = "Usuń blok"; Blockly.Msg.DELETE_X_BLOCKS = "Usuń %1 bloki(ów)"; Blockly.Msg.DISABLE_BLOCK = "Wyłącz blok"; -Blockly.Msg.DUPLICATE_BLOCK = "Powiel"; +Blockly.Msg.DUPLICATE_BLOCK = "Duplikuj"; Blockly.Msg.ENABLE_BLOCK = "Włącz blok"; Blockly.Msg.EXPAND_ALL = "Rozwiń bloki"; Blockly.Msg.EXPAND_BLOCK = "Rozwiń blok"; @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Ustawia element w określony Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Ustawia element w określonym miejscu na liście. #1 to pierwszy element."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Ustawia ostatni element na liście."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Ustawia losowy element na liście."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "stwórz listę z tekstu"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "stwórz tekst z listy"; @@ -280,11 +288,11 @@ Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Tworzy funkcję bez wyniku."; Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29"; Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "zwróć"; Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Tworzy funkcję z wynikiem."; -Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Ostrzeżenie: Ta funkcja ma powtórzone parametry."; +Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Uwaga: Ta funkcja ma powtórzone parametry."; Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Podświetl definicję funkcji"; Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause"; // untranslated Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Jeśli wartość jest prawdziwa, zwróć drugą wartość."; -Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Ostrzeżenie: Ten blok może być używany tylko w definicji funkcji."; +Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Uwaga: Ten blok może być używany tylko w definicji funkcji."; Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "nazwa wejścia:"; Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Dodaj dane wejściowe do funkcji."; Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "wejścia"; diff --git a/msg/js/pms.js b/msg/js/pms.js index 1f2a1653f..df68de18e 100644 --- a/msg/js/pms.js +++ b/msg/js/pms.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "A fissa l'element a la posis Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "A fissa l'element a la posission ëspessificà an na lista. #1 a l'é ël prim element."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "A fissa l'ùltim element an na lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "A fissa n'element a l'ancàpit an na lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "fé na lista da 'n test"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "fé 'n test da na lista"; diff --git a/msg/js/pt-br.js b/msg/js/pt-br.js index 7b15dc7c1..032c6dedb 100644 --- a/msg/js/pt-br.js +++ b/msg/js/pt-br.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Define o item da posição e Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Define o item da posição especificada de uma lista. #1 é o primeiro item."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Define o último item de uma lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Define um item aleatório de uma lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "Fazer uma lista a partir do texto"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "fazer um texto a partir da lista"; diff --git a/msg/js/pt.js b/msg/js/pt.js index 4e669e4f7..58facb1f0 100644 --- a/msg/js/pt.js +++ b/msg/js/pt.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Define o item na posição e Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Define o item na posição especificada de uma lista. #1 é o primeiro item."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Define o último item de uma lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Define um item aleatório de uma lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "fazer lista a partir de texto"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "fazer texto a partir da lista"; diff --git a/msg/js/ro.js b/msg/js/ro.js index b45e051d4..d5db5f024 100644 --- a/msg/js/ro.js +++ b/msg/js/ro.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Setează elementul la poziţ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Setează elementul la poziţia specificată într-o listă. #1 este primul element."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Setează ultimul element într-o listă."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Setează un element aleator într-o listă."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "convertește textul în listă"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "convertește lista în text"; diff --git a/msg/js/ru.js b/msg/js/ru.js index 49914dddb..f2d69ec88 100644 --- a/msg/js/ru.js +++ b/msg/js/ru.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Присваивает зн Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Присваивает значение элементу в указанной позиции списка (№1 - первый элемент)."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Присваивает значение последнему элементу списка."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Присваивает значение случайному элементу списка."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "сделать список из текста"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "собрать текст из списка"; diff --git a/msg/js/sc.js b/msg/js/sc.js index dde758929..aeeb71ff3 100644 --- a/msg/js/sc.js +++ b/msg/js/sc.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Impostat s'elementu in su po Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Impostat s'elementu in su postu inditau de una lista. Postu 1 est po su primu elementu."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Impostat s'urtimu elementu in una lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Impostat unu elementu random in una lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "fai una lista de unu testu"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "fai unu testu de una lista"; diff --git a/msg/js/sd.js b/msg/js/sd.js index 90c3dd309..0f7f05bfa 100644 --- a/msg/js/sd.js +++ b/msg/js/sd.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/shn.js b/msg/js/shn.js index a109759b2..55ab61cca 100644 --- a/msg/js/shn.js +++ b/msg/js/shn.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/sk.js b/msg/js/sk.js index 7f3e6eb72..e08997513 100644 --- a/msg/js/sk.js +++ b/msg/js/sk.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Nastaví prvok na určenej p Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Nastaví prvok na určenej pozícii v zozname. #1 je prvý prvok."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Nastaví posledný prvok v zozname."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Nastaví posledný prvok v zozname."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "vytvoriť zoznam z textu"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "vytvoriť text zo zoznamu"; diff --git a/msg/js/sl.js b/msg/js/sl.js index 958eed589..c995cb356 100644 --- a/msg/js/sl.js +++ b/msg/js/sl.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Nastavi element na določene Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Nastavi element na določenem mestu v seznamu. Prvi element je št. 1."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Nastavi zadnji element seznama."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Nastavi naključni element seznama."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "ustvari seznam iz besedila"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "ustvari besedilo iz seznama"; diff --git a/msg/js/sq.js b/msg/js/sq.js index dcc116328..607c0579b 100644 --- a/msg/js/sq.js +++ b/msg/js/sq.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Vendos sendin ne pozicionin Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Vendos sendin në pozicionin e specifikuar në listë. #1 është sendi i parë."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Vendos sendin e fundit në listë."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Vendos një send të rastësishëm në listë."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/sr.js b/msg/js/sr.js index 6c2aa445a..6f640b4a7 100644 --- a/msg/js/sr.js +++ b/msg/js/sr.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Поставља ставк Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Поставља ставку на одређени положај на списку. #1 је прва ставка."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Поставља последњу ставку на списку."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Поставља случајну ставку на списку."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "направите листу са текста"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "да текст из листе"; diff --git a/msg/js/sv.js b/msg/js/sv.js index 7e22e052f..247b73295 100644 --- a/msg/js/sv.js +++ b/msg/js/sv.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sätter in objektet vid en s Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sätter in objektet vid en specificerad position i en lista. #1 är det första objektet."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Anger det sista elementet i en lista."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sätter in ett slumpat objekt i en lista."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "skapa lista från text"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "skapa text från lista"; diff --git a/msg/js/ta.js b/msg/js/ta.js index d3d2838ca..d2d87debf 100644 --- a/msg/js/ta.js +++ b/msg/js/ta.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "பட்டியலில Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "பட்டியலில் கேட்ட இடத்தில் உருப்படியை வை. #1, முதல் உருப்படி."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "மதிப்பை பட்டியலில் கடைசி உருப்படியில் வை"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "மதிப்பை பட்டியலில் சீரற்ற உருப்படியில் வை"; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "உரையில் இருந்து பட்டியல் உருவாக்கு"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "பட்டியலில் இருந்து உரை உருவாக்கு"; diff --git a/msg/js/tcy.js b/msg/js/tcy.js index 29ded796a..2bc9e5b4b 100644 --- a/msg/js/tcy.js +++ b/msg/js/tcy.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/th.js b/msg/js/th.js index c853295d6..ef98e239a 100644 --- a/msg/js/th.js +++ b/msg/js/th.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "กำหนดไอเท Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "กำหนดไอเท็มในตำแหน่งที่ระบุในรายการ #1 คือไอเท็มอันแรกสุด"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "กำหนดไอเท็มอันสุดท้ายในรายการ"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "กำหนดไอเท็มแบบสุ่มในรายการ"; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "สร้างรายการจากข้อความ"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "สร้างข้อความจากรายการ"; diff --git a/msg/js/tl.js b/msg/js/tl.js index f781a85e2..2834e10b5 100644 --- a/msg/js/tl.js +++ b/msg/js/tl.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Pag set ng item sa tinukoy n Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Pag set ng item sa tinukoy na position sa isang list. #1 ay ang unang item."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Pag set sa huling item sa isang list."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Pag set ng walang pinipiling item sa isang list."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/tlh.js b/msg/js/tlh.js index 688fda65e..5385d7383 100644 --- a/msg/js/tlh.js +++ b/msg/js/tlh.js @@ -10,7 +10,7 @@ Blockly.Msg.ADD_COMMENT = "QInHom chel"; Blockly.Msg.AUTH = "ngogh nablIj DapollaHmeH qoj latlhvaD DangeHlaHmeH chaw' yInob."; Blockly.Msg.CHANGE_VALUE_TITLE = "choH:"; Blockly.Msg.CHAT = "beqpu'lI'vaD bIjawmeH naDev yIrI'!"; -Blockly.Msg.CLEAN_UP = "ngoghmey Say'"; +Blockly.Msg.CLEAN_UP = "ngoghmeyvaD tlhegh rurmoH"; Blockly.Msg.COLLAPSE_ALL = "ngoghmey DejmoH"; Blockly.Msg.COLLAPSE_BLOCK = "ngogh DejmoH"; Blockly.Msg.COLOUR_BLEND_COLOUR1 = "rItlh wa'"; @@ -143,12 +143,20 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Sets the item at the specifi Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Sets the item at the specified position in a list. #1 is the first item."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list."; // untranslated Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list."; // untranslated +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated -Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "tetlh ghom ghItlhmey"; -Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "ghItlhmey ghom tetlh"; +Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "tetlh ghermeH ghItlh wav"; +Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "ghItlh chenmoHmeH tetlh gherHa'"; Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Join a list of texts into one text, separated by a delimiter."; // untranslated Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Split text into a list of texts, breaking at each delimiter."; // untranslated -Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "rarwI'Hom"; +Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "rarwI'Hom lo'"; Blockly.Msg.LOGIC_BOOLEAN_FALSE = "teHbe'"; Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Returns either true or false."; // untranslated @@ -271,7 +279,7 @@ Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://en.wikipedia.org/wiki/Proce Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Run the user-defined function '%1' and use its output."; // untranslated Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "qel:"; Blockly.Msg.PROCEDURES_CREATE_DO = "chel '%1'"; -Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "mIwQInHom yIchel..."; +Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "mIw yIDel..."; Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29"; // untranslated Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "mIw"; @@ -289,7 +297,7 @@ Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "pong:"; Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "qelwI'mey"; Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated -Blockly.Msg.REDO = "wumqa'"; +Blockly.Msg.REDO = "vangqa'"; Blockly.Msg.REMOVE_COMMENT = "QInHom chelHa'"; Blockly.Msg.RENAME_VARIABLE = "lIw pong choH..."; Blockly.Msg.RENAME_VARIABLE_TITLE = "Hoch \"%1\" lIwmey pongmey choH:"; @@ -354,8 +362,8 @@ Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "poSnIHlogh pei"; Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "poSlogh pei"; Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "nIHlogh pei"; Blockly.Msg.TEXT_TRIM_TOOLTIP = "Return a copy of the text with spaces removed from one or both ends."; // untranslated -Blockly.Msg.TODAY = "jajvam"; -Blockly.Msg.UNDO = "wumHa'"; +Blockly.Msg.TODAY = "DaHjaj"; +Blockly.Msg.UNDO = "vangHa'"; Blockly.Msg.VARIABLES_DEFAULT_NAME = "Doch"; Blockly.Msg.VARIABLES_GET_CREATE_SET = "chel 'choH %1'"; Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated diff --git a/msg/js/tr.js b/msg/js/tr.js index c412b7ac8..5f1b31fc3 100644 --- a/msg/js/tr.js +++ b/msg/js/tr.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Bir öğeyi belirtilen yere Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Bir öğeyi belirtilen yere göre listeye yerleştirir . #1 ilk öğedir ."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Bir listedeki son öğeyi yerleştirir ."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Listeye rast gele bir öğe yerleştirir ."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "metinden liste yap"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "listeden metin yap"; @@ -289,7 +297,7 @@ Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "girdi adı:"; Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "İşleve bir girdi ekleyin."; Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "girdiler"; Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Bu işlevin girdilerini ekleyin, çıkarın, ya da yeniden sıralayın."; -Blockly.Msg.REDO = "Redo"; // untranslated +Blockly.Msg.REDO = "Yinele"; Blockly.Msg.REMOVE_COMMENT = "Yorumu Sil"; Blockly.Msg.RENAME_VARIABLE = "Değişkeni yeniden adlandır..."; Blockly.Msg.RENAME_VARIABLE_TITLE = "Tüm '%1' değişkenlerini yeniden isimlendir:"; @@ -355,7 +363,7 @@ Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "solundan boşlukları temizle"; Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "sağından boşlukları temizle"; Blockly.Msg.TEXT_TRIM_TOOLTIP = "Metnin bir veya her iki sondan da boşlukları silinmiş şekilde kopyasını verir."; Blockly.Msg.TODAY = "Bugün"; -Blockly.Msg.UNDO = "Undo"; // untranslated +Blockly.Msg.UNDO = "Geri al"; Blockly.Msg.VARIABLES_DEFAULT_NAME = "öge"; Blockly.Msg.VARIABLES_GET_CREATE_SET = "'set %1' oluştur"; Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated diff --git a/msg/js/uk.js b/msg/js/uk.js index c6d5311ec..cf97fe2d4 100644 --- a/msg/js/uk.js +++ b/msg/js/uk.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Задає елемент с Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Задає елемент списку у вказаній позиції. #1 - це перший елемент."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Задає останній елемент списку."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Задає випадковий елемент у списку."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "зробити з тексту список"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "зробити зі списку текст"; diff --git a/msg/js/vi.js b/msg/js/vi.js index 219d22f85..a95546692 100644 --- a/msg/js/vi.js +++ b/msg/js/vi.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Đặt giá trị của thà Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Đặt giá trị của thành tố ở vị trí ấn định trong một danh sách. #1 là thành tố đầu tiên."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Đặt giá trị của thành tố cuối cùng trong danh sách."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Đặt giá trị của thành tố ngẫu nhiên trong danh sách."; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated diff --git a/msg/js/zh-hans.js b/msg/js/zh-hans.js index 8cadd4169..e9aa87c1a 100644 --- a/msg/js/zh-hans.js +++ b/msg/js/zh-hans.js @@ -50,9 +50,9 @@ Blockly.Msg.CONTROLS_IF_MSG_ELSE = "否则"; Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "否则如果"; Blockly.Msg.CONTROLS_IF_MSG_IF = "如果"; Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "如果值为真,执行一些语句。"; -Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "如果值为真,则执行语句的第一块;否则,则执行语句的第二块。"; -Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "如果第一个值为真,则执行语句的第一个块;否则,如果第二个值为真,则执行语句的第二块。"; -Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "如果第一个值为真,则执行语句的第一块;否则,如果第二个值为真,则执行语句的第二块;如果没有值为真,则执行语句的最后一块。"; +Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "如果值为真,则执行语句的第一块。否则,则执行语句的第二块。"; +Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "如果第一个值为真,则执行语句的第一个块。否则,如果第二个值为真,则执行语句的第二块。"; +Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "如果第一个值为真,则执行语句的第一块。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行语句的最后一块。"; Blockly.Msg.CONTROLS_REPEAT_HELPURL = "https://zh.wikipedia.org/wiki/For循环"; Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "执行"; Blockly.Msg.CONTROLS_REPEAT_TITLE = "重复 %1 次"; @@ -65,7 +65,7 @@ Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "只要值为真,执行一些 Blockly.Msg.DELETE_ALL_BLOCKS = "删除所有%1块吗?"; Blockly.Msg.DELETE_BLOCK = "删除块"; Blockly.Msg.DELETE_X_BLOCKS = "删除 %1 块"; -Blockly.Msg.DISABLE_BLOCK = "停用块"; +Blockly.Msg.DISABLE_BLOCK = "禁用块"; Blockly.Msg.DUPLICATE_BLOCK = "复制"; Blockly.Msg.ENABLE_BLOCK = "启用块"; Blockly.Msg.EXPAND_ALL = "展开块"; @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "设置在列表中指定位 Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "设置在列表中指定位置的项。#1是第一项。"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "设置列表中的最后一项。"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "设置列表中一个随机的项目。"; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "从文本制作列表"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "从列表拆出文本"; @@ -160,7 +168,7 @@ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "如果第一个输入结果大于或等 Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "如果第一个输入结果比第二个小,则返回真。"; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "如果第一个输入结果小于或等于第二个输入结果,则返回真。"; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "如果两个输入结果不相等,则返回真。"; -Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://zh.wikipedia.org/wiki/逻辑非"; +Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; Blockly.Msg.LOGIC_NEGATE_TITLE = "非%1"; Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "如果输入结果为假,则返回真;如果输入结果为真,则返回假。"; Blockly.Msg.LOGIC_NULL = "空"; diff --git a/msg/js/zh-hant.js b/msg/js/zh-hant.js index 181842d60..c02df83d7 100644 --- a/msg/js/zh-hant.js +++ b/msg/js/zh-hant.js @@ -143,6 +143,14 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "設定在列表中的指定 Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "設定在列表中的指定位置的項目。#1 是第一個項目。"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "設定列表中的最後一個項目"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "設定列表中隨機的一個項目"; +Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated +Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated +Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated +Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "從文本製作列表"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "從列表拆出文本"; diff --git a/msg/json/bn.json b/msg/json/bn.json index 389dd8197..1c96ff3a2 100644 --- a/msg/json/bn.json +++ b/msg/json/bn.json @@ -4,7 +4,8 @@ "Aftabuzzaman", "Rakibul", "Tauhid16", - "MasterMinhaz" + "MasterMinhaz", + "এম আবু সাঈদ" ] }, "VARIABLES_DEFAULT_NAME": "পদ", @@ -67,7 +68,7 @@ "LOGIC_BOOLEAN_FALSE": "মিথ্যা", "LOGIC_BOOLEAN_TOOLTIP": "পাঠাবে হয় সত্য অথবা মিথ্যা।", "LOGIC_NULL": "কিছু না", - "LOGIC_NULL_TOOLTIP": "কিছু না ফেরত দিবে।", + "LOGIC_NULL_TOOLTIP": "কিছু ফেরত দিবে না।", "LOGIC_TERNARY_CONDITION": "পরীক্ষা", "LOGIC_TERNARY_IF_TRUE": "যদি সত্য হয়", "LOGIC_TERNARY_IF_FALSE": "যদি মিথ্যা হয়", @@ -119,7 +120,7 @@ "LISTS_CREATE_EMPTY_TOOLTIP": "পাঠাবে একটি তালিকা, দের্ঘ্য হবে ০, কোন উপাত্ত থাকবে না", "LISTS_CREATE_WITH_TOOLTIP": "যেকোন সংখ্যক পদ নিয়ে একটি তালিকা তৈরি করুন।", "LISTS_CREATE_WITH_CONTAINER_TITLE_ADD": "তালিকা", - "LISTS_CREATE_WITH_ITEM_TOOLTIP": "তালিকায় একটি পদ যোগ করে।", + "LISTS_CREATE_WITH_ITEM_TOOLTIP": "তালিকায় একটি পদ যোগ করুন।", "LISTS_LENGTH_TITLE": "%1-এর দৈর্ঘ্য", "LISTS_LENGTH_TOOLTIP": "একটি তালিকার দৈর্ঘ্য পাঠাবে।", "LISTS_ISEMPTY_TITLE": "%1 খালি", diff --git a/msg/json/en.json b/msg/json/en.json index 30d1219a5..6b05d3a1c 100644 --- a/msg/json/en.json +++ b/msg/json/en.json @@ -1,7 +1,7 @@ { "@metadata": { "author": "Ellen Spertus ", - "lastupdated": "2016-03-17 14:41:13.974918", + "lastupdated": "2016-05-06 10:42:01.474947", "locale": "en", "messagedocumentation" : "qqq" }, @@ -323,6 +323,14 @@ "LISTS_GET_SUBLIST_END_LAST": "to last", "LISTS_GET_SUBLIST_TAIL": "", "LISTS_GET_SUBLIST_TOOLTIP": "Creates a copy of the specified portion of a list.", + "LISTS_SORT_HELPURL": "https://github.com/google/blockly/wiki/Lists#sorting-a-list", + "LISTS_SORT_TITLE": "sort %1 %2 %3", + "LISTS_SORT_TOOLTIP": "Sort a copy of a list.", + "LISTS_SORT_ORDER_ASCENDING": "ascending", + "LISTS_SORT_ORDER_DESCENDING": "descending", + "LISTS_SORT_TYPE_NUMERIC": "numeric", + "LISTS_SORT_TYPE_TEXT": "alphabetic", + "LISTS_SORT_TYPE_IGNORECASE": "alphabetic, ignore case", "LISTS_SPLIT_HELPURL": "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists", "LISTS_SPLIT_LIST_FROM_TEXT": "make list from text", "LISTS_SPLIT_TEXT_FROM_LIST": "make text from list", diff --git a/msg/json/fr.json b/msg/json/fr.json index a3f554e65..03f90d530 100644 --- a/msg/json/fr.json +++ b/msg/json/fr.json @@ -32,11 +32,11 @@ "UNDO": "Annuler", "REDO": "Refaire", "CHAT": "Discutez avec votre collaborateur en tapant dans cette zone !", - "AUTH": "Veuillez autoriser cette application à permettre la sauvegarde de votre travail et à l’autoriser à la partager.", + "AUTH": "Veuillez autoriser cette application à permettre la sauvegarde de votre travail et à l’autoriser d'être partagé par vous.", "ME": "Moi", "CHANGE_VALUE_TITLE": "Modifier la valeur :", "NEW_VARIABLE": "Nouvelle variable…", - "NEW_VARIABLE_TITLE": "Nom de la nouvelle variable :", + "NEW_VARIABLE_TITLE": "Nouveau nom de la variable :", "RENAME_VARIABLE": "Renommer la variable…", "RENAME_VARIABLE_TITLE": "Renommer toutes les variables « %1 » en :", "COLOUR_PICKER_HELPURL": "https://fr.wikipedia.org/wiki/Couleur", @@ -44,7 +44,7 @@ "COLOUR_RANDOM_TITLE": "couleur aléatoire", "COLOUR_RANDOM_TOOLTIP": "Choisir une couleur au hasard.", "COLOUR_RGB_HELPURL": "http://www.december.com/html/spec/colorper.html", - "COLOUR_RGB_TITLE": "colorer avec", + "COLOUR_RGB_TITLE": "colorier avec", "COLOUR_RGB_RED": "rouge", "COLOUR_RGB_GREEN": "vert", "COLOUR_RGB_BLUE": "bleu", diff --git a/msg/json/pl.json b/msg/json/pl.json index a9f60c84c..3c4319840 100644 --- a/msg/json/pl.json +++ b/msg/json/pl.json @@ -9,12 +9,13 @@ "아라", "Mateon1", "Expert3222", - "Cirasean" + "Cirasean", + "Fringoo" ] }, "VARIABLES_DEFAULT_NAME": "element", "TODAY": "Dzisiaj", - "DUPLICATE_BLOCK": "Powiel", + "DUPLICATE_BLOCK": "Duplikuj", "ADD_COMMENT": "Dodaj komentarz", "REMOVE_COMMENT": "Usuń komentarz", "EXTERNAL_INPUTS": "Zewnętrzne wejścia", @@ -33,7 +34,7 @@ "UNDO": "Cofnij", "REDO": "Ponów", "CHAT": "Rozmawiaj z swoim współpracownikiem, pisząc w tym polu!", - "AUTH": "Proszę autoryzować ten program, aby można było zapisać swoją pracę i umożliwić Ci dzielenie się nią.", + "AUTH": "Autoryzuj ten program, aby można było zapisać Twoją pracę i umożliwić Ci dzielenie się nią z innymi.", "ME": "Ja", "CHANGE_VALUE_TITLE": "Zmień wartość:", "NEW_VARIABLE": "Nowa zmienna...", @@ -67,12 +68,12 @@ "CONTROLS_FOR_TOOLTIP": "Przypisuje zmiennej %1 wartości od numeru startowego do numeru końcowego, licząc co określony interwał, wykonując określone bloki.", "CONTROLS_FOR_TITLE": "licz z %1 od %2 do %3 co %4 (wartość kroku)", "CONTROLS_FOREACH_TITLE": "dla każdego elementu %1 na liście %2", - "CONTROLS_FOREACH_TOOLTIP": "Dla każdego elementu z listy przyporządkuj zmienną '%1', a następnie wykonaj kilka instrukcji.", + "CONTROLS_FOREACH_TOOLTIP": "Dla każdego elementu listy ustaw zmienną %1 na ten element, a następnie wykonaj kilka instrukcji.", "CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK": "wyjdź z pętli", "CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE": "przejdź do kolejnej iteracji pętli", "CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK": "Wyjdź z zawierającej pętli.", "CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE": "Pomiń resztę pętli i kontynuuj w kolejnej iteracji.", - "CONTROLS_FLOW_STATEMENTS_WARNING": "Ostrzeżenie: Ten blok może być użyty tylko w pętli.", + "CONTROLS_FLOW_STATEMENTS_WARNING": "Uwaga: Ten blok może być użyty tylko w pętli.", "CONTROLS_IF_TOOLTIP_1": "Jeśli wartość jest prawdziwa, to wykonaj kilka instrukcji.", "CONTROLS_IF_TOOLTIP_2": "Jeśli wartość jest prawdziwa, to wykonaj pierwszy blok instrukcji. W przeciwnym razie, wykonaj drugi blok instrukcji.", "CONTROLS_IF_TOOLTIP_3": "Jeśli pierwsza wartość jest prawdziwa, to wykonaj pierwszy blok instrukcji. W przeciwnym razie, jeśli druga wartość jest prawdziwa, to wykonaj drugi blok instrukcji.", @@ -325,7 +326,7 @@ "PROCEDURES_DEFRETURN_RETURN": "zwróć", "PROCEDURES_DEFRETURN_TOOLTIP": "Tworzy funkcję z wynikiem.", "PROCEDURES_ALLOW_STATEMENTS": "zezwól na instrukcje", - "PROCEDURES_DEF_DUPLICATE_WARNING": "Ostrzeżenie: Ta funkcja ma powtórzone parametry.", + "PROCEDURES_DEF_DUPLICATE_WARNING": "Uwaga: Ta funkcja ma powtórzone parametry.", "PROCEDURES_CALLNORETURN_HELPURL": "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29", "PROCEDURES_CALLNORETURN_TOOLTIP": "Uruchom funkcję zdefiniowaną przez użytkownika '%1'.", "PROCEDURES_CALLRETURN_HELPURL": "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29", @@ -337,5 +338,5 @@ "PROCEDURES_HIGHLIGHT_DEF": "Podświetl definicję funkcji", "PROCEDURES_CREATE_DO": "Stwórz '%1'", "PROCEDURES_IFRETURN_TOOLTIP": "Jeśli wartość jest prawdziwa, zwróć drugą wartość.", - "PROCEDURES_IFRETURN_WARNING": "Ostrzeżenie: Ten blok może być używany tylko w definicji funkcji." + "PROCEDURES_IFRETURN_WARNING": "Uwaga: Ten blok może być używany tylko w definicji funkcji." } diff --git a/msg/json/qqq.json b/msg/json/qqq.json index 5d41dc4c0..37b487e90 100644 --- a/msg/json/qqq.json +++ b/msg/json/qqq.json @@ -1,13 +1,6 @@ { - "@metadata": { - "authors": [ - "Espertus", - "Liuxinyu970226", - "Shirayuki" - ] - }, "VARIABLES_DEFAULT_NAME": "default name - A simple, general default name for a variable, preferably short. For more context, see [[Translating:Blockly#infrequent_message_types]].\n{{Identical|Item}}", - "TODAY": "button text - Botton that sets a calendar to today's date.\n{{Identical|Today}}", + "TODAY": "button text - Button that sets a calendar to today's date.\n{{Identical|Today}}", "DUPLICATE_BLOCK": "context menu - Make a copy of the selected block (and any blocks it contains).\n{{Identical|Duplicate}}", "ADD_COMMENT": "context menu - Add a descriptive comment to the selected block.", "REMOVE_COMMENT": "context menu - Remove the descriptive comment from the selected block.", @@ -324,6 +317,14 @@ "LISTS_GET_SUBLIST_END_LAST": "dropdown - Indicates that the '''last''' item in the given list should be [https://github.com/google/blockly/wiki/Lists#getting-a-sublist the end of the selected sublist]. [[File:Blockly-get-sublist.png]]", "LISTS_GET_SUBLIST_TAIL": "block text - This appears in the rightmost position ('tail') of the sublist block, as described at [https://github.com/google/blockly/wiki/Lists#getting-a-sublist https://github.com/google/blockly/wiki/Lists#getting-a-sublist]. In English and most other languages, this is the empty string. [[File:Blockly-get-sublist.png]]", "LISTS_GET_SUBLIST_TOOLTIP": "tooltip - See [https://github.com/google/blockly/wiki/Lists#getting-a-sublist https://github.com/google/blockly/wiki/Lists#getting-a-sublist] for more information. [[File:Blockly-get-sublist.png]]", + "LISTS_SORT_HELPURL": "url - Information describing sorting a list.", + "LISTS_SORT_TITLE": "Sort as type %1 (numeric or alphabetic) in order %2 (ascending or descending) a list of items %3.", + "LISTS_SORT_TOOLTIP": "tooltip - See [https://github.com/google/blockly/wiki/Lists#sorting-a-list].", + "LISTS_SORT_ORDER_ASCENDING": "sorting order or direction from low to high value for numeric, or A-Z for alphabetic.", + "LISTS_SORT_ORDER_DESCENDING": "sorting order or direction from high to low value for numeric, or Z-A for alphabetic.", + "LISTS_SORT_TYPE_NUMERIC": "sort by treating each item as a number.", + "LISTS_SORT_TYPE_TEXT": "sort by treating each item alphabetically, case-sensitive.", + "LISTS_SORT_TYPE_IGNORECASE": "sort by treating each item alphabetically, ignoring differences in case.", "LISTS_SPLIT_HELPURL": "url - Information describing splitting text into a list, or joining a list into text.", "LISTS_SPLIT_LIST_FROM_TEXT": "dropdown - Indicates that text will be split up into a list (e.g. 'a-b-c' -> ['a', 'b', 'c']).", "LISTS_SPLIT_TEXT_FROM_LIST": "dropdown - Indicates that a list will be joined together to form text (e.g. ['a', 'b', 'c'] -> 'a-b-c').", diff --git a/msg/json/tlh.json b/msg/json/tlh.json index c6ea8824b..4413dfd46 100644 --- a/msg/json/tlh.json +++ b/msg/json/tlh.json @@ -6,7 +6,7 @@ "messagedocumentation" : "qqq" }, "VARIABLES_DEFAULT_NAME": "Doch", - "TODAY": "jajvam", + "TODAY": "DaHjaj", "DUPLICATE_BLOCK": "velqa' chenmoH", "ADD_COMMENT": "QInHom chel", "REMOVE_COMMENT": "QInHom chelHa'", @@ -15,7 +15,7 @@ "DELETE_BLOCK": "ngogh Qaw'", "DELETE_X_BLOCKS": "%1 ngoghmey Qaw'", "DELETE_ALL_BLOCKS": "Hoch %1 ngoghmey Qaw'?", - "CLEAN_UP": "ngoghmey Say'", + "CLEAN_UP": "ngoghmeyvaD tlhegh rurmoH", "COLLAPSE_BLOCK": "ngogh DejmoH", "COLLAPSE_ALL": "ngoghmey DejmoH", "EXPAND_BLOCK": "ngogh DejHa'moH", @@ -23,8 +23,8 @@ "DISABLE_BLOCK": "ngogh Qotlh", "ENABLE_BLOCK": "ngogh QotlhHa'", "HELP": "QaH", - "UNDO": "wumHa'", - "REDO": "wumqa'", + "UNDO": "vangHa'", + "REDO": "vangqa'", "CHAT": "beqpu'lI'vaD bIjawmeH naDev yIrI'!", "AUTH": "ngogh nablIj DapollaHmeH qoj latlhvaD DangeHlaHmeH chaw' yInob.", "CHANGE_VALUE_TITLE": "choH:", @@ -160,9 +160,9 @@ "LISTS_GET_SUBLIST_END_FROM_END": "mojaQ # Qav", "LISTS_GET_SUBLIST_END_LAST": "mojaQ Qav", "LISTS_GET_SUBLIST_TAIL": "Suq", - "LISTS_SPLIT_LIST_FROM_TEXT": "tetlh ghom ghItlhmey", - "LISTS_SPLIT_TEXT_FROM_LIST": "ghItlhmey ghom tetlh", - "LISTS_SPLIT_WITH_DELIMITER": "rarwI'Hom", + "LISTS_SPLIT_LIST_FROM_TEXT": "tetlh ghermeH ghItlh wav", + "LISTS_SPLIT_TEXT_FROM_LIST": "ghItlh chenmoHmeH tetlh gherHa'", + "LISTS_SPLIT_WITH_DELIMITER": "rarwI'Hom lo'", "ORDINAL_NUMBER_SUFFIX": "", "VARIABLES_GET_CREATE_SET": "chel 'choH %1'", "VARIABLES_SET": "choH %1 %2", @@ -172,7 +172,7 @@ "PROCEDURES_BEFORE_PARAMS": "qel:", "PROCEDURES_CALL_BEFORE_PARAMS": "qel:", "PROCEDURES_DEFNORETURN_DO": "", - "PROCEDURES_DEFNORETURN_COMMENT": "mIwQInHom yIchel...", + "PROCEDURES_DEFNORETURN_COMMENT": "mIw yIDel...", "PROCEDURES_DEFRETURN_RETURN": "chegh", "PROCEDURES_ALLOW_STATEMENTS": "mu'tlhegh chaw'", "PROCEDURES_DEF_DUPLICATE_WARNING": "ghuHmoHna': qelwI' cha'logh chen.", diff --git a/msg/json/tr.json b/msg/json/tr.json index b0944b09b..de0807b81 100644 --- a/msg/json/tr.json +++ b/msg/json/tr.json @@ -11,7 +11,8 @@ "McAang", "Gurkanht", "HakanIST", - "Imabadplayer" + "Imabadplayer", + "Kumkumuk" ] }, "VARIABLES_DEFAULT_NAME": "öge", @@ -32,6 +33,8 @@ "DISABLE_BLOCK": "Bloğu Devre Dışı Bırak", "ENABLE_BLOCK": "Bloğu Etkinleştir", "HELP": "Yardım", + "UNDO": "Geri al", + "REDO": "Yinele", "CHAT": "Bu kutuya yazarak iş birlikçin ile sohbet et!", "AUTH": "Çalışmanızın kaydedilmesi ve sizinle paylaşılmasına izin verilmesi için lütfen bu uygulamaya yetki verin.", "ME": "Beni", diff --git a/msg/json/zh-hans.json b/msg/json/zh-hans.json index 4d346c204..0698b5117 100644 --- a/msg/json/zh-hans.json +++ b/msg/json/zh-hans.json @@ -26,7 +26,7 @@ "COLLAPSE_ALL": "折叠块", "EXPAND_BLOCK": "展开块", "EXPAND_ALL": "展开块", - "DISABLE_BLOCK": "停用块", + "DISABLE_BLOCK": "禁用块", "ENABLE_BLOCK": "启用块", "HELP": "帮助", "UNDO": "撤销", @@ -71,9 +71,9 @@ "CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE": "跳过这个循环的剩余部分,并继续下一次迭代。", "CONTROLS_FLOW_STATEMENTS_WARNING": "警告:此块仅可用于在一个循环内。", "CONTROLS_IF_TOOLTIP_1": "如果值为真,执行一些语句。", - "CONTROLS_IF_TOOLTIP_2": "如果值为真,则执行语句的第一块;否则,则执行语句的第二块。", - "CONTROLS_IF_TOOLTIP_3": "如果第一个值为真,则执行语句的第一个块;否则,如果第二个值为真,则执行语句的第二块。", - "CONTROLS_IF_TOOLTIP_4": "如果第一个值为真,则执行语句的第一块;否则,如果第二个值为真,则执行语句的第二块;如果没有值为真,则执行语句的最后一块。", + "CONTROLS_IF_TOOLTIP_2": "如果值为真,则执行语句的第一块。否则,则执行语句的第二块。", + "CONTROLS_IF_TOOLTIP_3": "如果第一个值为真,则执行语句的第一个块。否则,如果第二个值为真,则执行语句的第二块。", + "CONTROLS_IF_TOOLTIP_4": "如果第一个值为真,则执行语句的第一块。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行语句的最后一块。", "CONTROLS_IF_MSG_IF": "如果", "CONTROLS_IF_MSG_ELSEIF": "否则如果", "CONTROLS_IF_MSG_ELSE": "否则", @@ -91,7 +91,7 @@ "LOGIC_OPERATION_AND": "和", "LOGIC_OPERATION_TOOLTIP_OR": "如果至少有一个输入结果为真,则返回真。", "LOGIC_OPERATION_OR": "或", - "LOGIC_NEGATE_HELPURL": "https://zh.wikipedia.org/wiki/逻辑非", + "LOGIC_NEGATE_HELPURL": "https://github.com/google/blockly/wiki/Logic#not", "LOGIC_NEGATE_TITLE": "非%1", "LOGIC_NEGATE_TOOLTIP": "如果输入结果为假,则返回真;如果输入结果为真,则返回假。", "LOGIC_BOOLEAN_TRUE": "真", diff --git a/msg/messages.js b/msg/messages.js index e9b73d513..6e1b507e7 100644 --- a/msg/messages.js +++ b/msg/messages.js @@ -52,7 +52,7 @@ goog.require('Blockly.Msg'); /// For more context, see /// [[Translating:Blockly#infrequent_message_types]].\n{{Identical|Item}} Blockly.Msg.VARIABLES_DEFAULT_NAME = 'item'; -/// button text - Botton that sets a calendar to today's date.\n{{Identical|Today}} +/// button text - Button that sets a calendar to today's date.\n{{Identical|Today}} Blockly.Msg.TODAY = 'Today'; // Context menus. @@ -975,6 +975,23 @@ Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ''; /// [[File:Blockly-get-sublist.png]] Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = 'Creates a copy of the specified portion of a list.'; +/// url - Information describing sorting a list. +Blockly.Msg.LISTS_SORT_HELPURL = 'https://github.com/google/blockly/wiki/Lists#sorting-a-list'; +/// Sort as type %1 (numeric or alphabetic) in order %2 (ascending or descending) a list of items %3. +Blockly.Msg.LISTS_SORT_TITLE = 'sort %1 %2 %3'; +/// tooltip - See [https://github.com/google/blockly/wiki/Lists#sorting-a-list]. +Blockly.Msg.LISTS_SORT_TOOLTIP = 'Sort a copy of a list.'; +/// sorting order or direction from low to high value for numeric, or A-Z for alphabetic. +Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = 'ascending'; +/// sorting order or direction from high to low value for numeric, or Z-A for alphabetic. +Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = 'descending'; +/// sort by treating each item as a number. +Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = 'numeric'; +/// sort by treating each item alphabetically, case-sensitive. +Blockly.Msg.LISTS_SORT_TYPE_TEXT = 'alphabetic'; +/// sort by treating each item alphabetically, ignoring differences in case. +Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = 'alphabetic, ignore case'; + /// url - Information describing splitting text into a list, or joining a list into text. Blockly.Msg.LISTS_SPLIT_HELPURL = 'https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists'; /// dropdown - Indicates that text will be split up into a list (e.g. "a-b-c" -> ["a", "b", "c"]). diff --git a/php_compressed.js b/php_compressed.js index cee7c12aa..6f6bfd35b 100644 --- a/php_compressed.js +++ b/php_compressed.js @@ -30,6 +30,8 @@ Blockly.Variables.NAME_TYPE);e+=d+" = rand(0, count("+b+")-1);\n";if("SET"==c)re Blockly.PHP.lists_getSublist=function(a){var b=Blockly.PHP.valueToCode(a,"LIST",Blockly.PHP.ORDER_MEMBER)||"array()",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=Blockly.PHP.valueToCode(a,"AT1",Blockly.PHP.ORDER_NONE)||"1";a=Blockly.PHP.valueToCode(a,"AT2",Blockly.PHP.ORDER_NONE)||"1";return["FIRST"==c&&"LAST"==d?b:Blockly.PHP.provideFunction_("lists_get_sublist",["function "+Blockly.PHP.FUNCTION_NAME_PLACEHOLDER_+"($list, $where1, $at1, $where2, $at2) {"," if ($where2 == 'FROM_START') {", " $at2--;"," } else if ($where2 == 'FROM_END') {"," $at2 = $at2 - $at1;"," } else if ($where2 == 'FIRST') {"," $at2 = 0;"," } else if ($where2 == 'LAST') {"," $at2 = count($list);"," } else {"," throw 'Unhandled option (lists_getSublist).';"," }"," if ($where1 == 'FROM_START') {"," $at1--;"," } else if ($where1 == 'FROM_END') {"," $at1 = count($list) - $at1;"," } else if ($where1 == 'FIRST') {"," $at1 = 0;"," } else if ($where1 == 'LAST') {"," $at1 = count($list) - 1;", " } else {"," throw 'Unhandled option (lists_getSublist).';"," }"," return array_slice($list, $at1, $at2);","}"])+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")",Blockly.PHP.ORDER_FUNCTION_CALL]}; +Blockly.PHP.lists_sort=function(a){var b=Blockly.PHP.valueToCode(a,"LIST",Blockly.PHP.ORDER_FUNCTION_CALL)||"array()",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");return[Blockly.PHP.provideFunction_("lists_sort",["function "+Blockly.PHP.FUNCTION_NAME_PLACEHOLDER_+"($list, $type, $direction) {"," $sortCmpFuncs = array(",' "NUMERIC" => "strnatcasecmp",',' "TEXT" => "strcmp",',' "IGNORE_CASE" => "strcasecmp"'," );"," $sortCmp = $sortCmpFuncs[$type];"," $list2 = $list;", +" usort($list2, $sortCmp);"," if ($direction == -1) {"," $list2 = array_reverse($list2);"," }"," return $list2;","}"])+"("+b+', "'+a+'", '+c+")",Blockly.PHP.ORDER_FUNCTION_CALL]}; Blockly.PHP.lists_split=function(a){var b=Blockly.PHP.valueToCode(a,"INPUT",Blockly.PHP.ORDER_MEMBER),c=Blockly.PHP.valueToCode(a,"DELIM",Blockly.PHP.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"==a)b||(b="''"),a="explode";else if("JOIN"==a)b||(b="array()"),a="implode";else throw"Unknown mode: "+a;return[a+"("+c+", "+b+")",Blockly.PHP.ORDER_FUNCTION_CALL]};Blockly.PHP.logic={};Blockly.PHP.controls_if=function(a){for(var b=0,c=Blockly.PHP.valueToCode(a,"IF"+b,Blockly.PHP.ORDER_NONE)||"false",d=Blockly.PHP.statementToCode(a,"DO"+b),e="if ("+c+") {\n"+d+"}",b=1;b<=a.elseifCount_;b++)c=Blockly.PHP.valueToCode(a,"IF"+b,Blockly.PHP.ORDER_NONE)||"false",d=Blockly.PHP.statementToCode(a,"DO"+b),e+=" else if ("+c+") {\n"+d+"}";a.elseCount_&&(d=Blockly.PHP.statementToCode(a,"ELSE"),e+=" else {\n"+d+"}");return e+"\n"}; Blockly.PHP.logic_compare=function(a){var b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c="=="==b||"!="==b?Blockly.PHP.ORDER_EQUALITY:Blockly.PHP.ORDER_RELATIONAL,d=Blockly.PHP.valueToCode(a,"A",c)||"0";a=Blockly.PHP.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]}; Blockly.PHP.logic_operation=function(a){var b="AND"==a.getFieldValue("OP")?"&&":"||",c="&&"==b?Blockly.PHP.ORDER_LOGICAL_AND:Blockly.PHP.ORDER_LOGICAL_OR,d=Blockly.PHP.valueToCode(a,"A",c);a=Blockly.PHP.valueToCode(a,"B",c);if(d||a){var e="&&"==b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};Blockly.PHP.logic_negate=function(a){var b=Blockly.PHP.ORDER_LOGICAL_NOT;return["!"+(Blockly.PHP.valueToCode(a,"BOOL",b)||"true"),b]}; diff --git a/python_compressed.js b/python_compressed.js index ea13b4007..f4cbf2d4b 100644 --- a/python_compressed.js +++ b/python_compressed.js @@ -27,6 +27,8 @@ Blockly.Python.lists_setIndex=function(a){var b=Blockly.Python.valueToCode(a,"LI b+"\n",b=d,d=e);e=Blockly.Python.variableDB_.getDistinctName("tmp_x",Blockly.Variables.NAME_TYPE);d+=e+" = int(random.random() * len("+b+"))\n";if("SET"==c)return d+(b+"["+e+"] = "+a+"\n");if("INSERT"==c)return d+=b+".insert("+e+", "+a+")\n"}throw"Unhandled combination (lists_setIndex).";}; Blockly.Python.lists_getSublist=function(a){var b=Blockly.Python.valueToCode(a,"LIST",Blockly.Python.ORDER_MEMBER)||"[]",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=Blockly.Python.valueToCode(a,"AT1",Blockly.Python.ORDER_ADDITIVE)||"1";a=Blockly.Python.valueToCode(a,"AT2",Blockly.Python.ORDER_ADDITIVE)||"1";"FIRST"==c||"FROM_START"==c&&"1"==e?e="":"FROM_START"==c?e=Blockly.isNumber(e)?parseInt(e,10)-1:"int("+e+" - 1)":"FROM_END"==c&&(e=Blockly.isNumber(e)?-parseInt(e,10):"-int("+e+")"); "LAST"==d||"FROM_END"==d&&"1"==a?a="":"FROM_START"==c?a=Blockly.isNumber(a)?parseInt(a,10):"int("+a+")":"FROM_END"==c&&(Blockly.isNumber(a)?(a=1-parseInt(a,10),0==a&&(a="")):(Blockly.Python.definitions_.import_sys="import sys",a="int(1 - "+a+") or sys.maxsize"));return[b+"["+e+" : "+a+"]",Blockly.Python.ORDER_MEMBER]}; +Blockly.Python.lists_sort=function(a){var b=Blockly.Python.valueToCode(a,"LIST",Blockly.Python.ORDER_MEMBER)||"[]",c=a.getFieldValue("TYPE");a="1"===a.getFieldValue("DIRECTION")?"False":"True";return[Blockly.Python.provideFunction_("lists_sort",["def "+Blockly.Python.FUNCTION_NAME_PLACEHOLDER_+"(listv, type, reversev):"," def tryfloat(s):"," try:"," return float(s)"," except:"," return 0"," keyFuncts = {",' "NUMERIC": tryfloat,',' "TEXT": str,',' "IGNORE_CASE": lambda s: str(s).lower()', +" }"," keyv = keyFuncts[type]"," tmp_list = list(listv)"," return sorted(tmp_list, key=keyv, reverse=reversev)"])+"("+b+', "'+c+'", '+a+")",Blockly.Python.ORDER_FUNCTION_CALL]}; Blockly.Python.lists_split=function(a){var b=a.getFieldValue("MODE");if("SPLIT"==b)b=Blockly.Python.valueToCode(a,"INPUT",Blockly.Python.ORDER_MEMBER)||"''",a=Blockly.Python.valueToCode(a,"DELIM",Blockly.Python.ORDER_NONE),a=b+".split("+a+")";else if("JOIN"==b)b=Blockly.Python.valueToCode(a,"INPUT",Blockly.Python.ORDER_NONE)||"[]",a=Blockly.Python.valueToCode(a,"DELIM",Blockly.Python.ORDER_MEMBER)||"''",a=a+".join("+b+")";else throw"Unknown mode: "+b;return[a,Blockly.Python.ORDER_FUNCTION_CALL]};Blockly.Python.logic={}; Blockly.Python.controls_if=function(a){for(var b=0,c=Blockly.Python.valueToCode(a,"IF"+b,Blockly.Python.ORDER_NONE)||"False",d=Blockly.Python.statementToCode(a,"DO"+b)||Blockly.Python.PASS,e="if "+c+":\n"+d,b=1;b<=a.elseifCount_;b++)c=Blockly.Python.valueToCode(a,"IF"+b,Blockly.Python.ORDER_NONE)||"False",d=Blockly.Python.statementToCode(a,"DO"+b)||Blockly.Python.PASS,e+="elif "+c+":\n"+d;a.elseCount_&&(d=Blockly.Python.statementToCode(a,"ELSE")||Blockly.Python.PASS,e+="else:\n"+d);return e}; Blockly.Python.logic_compare=function(a){var b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c=Blockly.Python.ORDER_RELATIONAL,d=Blockly.Python.valueToCode(a,"A",c)||"0";a=Blockly.Python.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]}; diff --git a/tests/generators/index.html b/tests/generators/index.html index fcff572e8..f10e5493a 100644 --- a/tests/generators/index.html +++ b/tests/generators/index.html @@ -264,6 +264,7 @@ h1 { + diff --git a/tests/generators/lists.xml b/tests/generators/lists.xml index ebbbec9f8..374185fa6 100644 --- a/tests/generators/lists.xml +++ b/tests/generators/lists.xml @@ -33,6 +33,21 @@ + + + + + + + + + + + + + + + @@ -58,6 +73,7 @@ test create + Describe this function... test create empty @@ -148,6 +164,7 @@ test empty + Describe this function... not empty @@ -184,6 +201,7 @@ test length + Describe this function... zero length @@ -260,6 +278,7 @@ test find + Describe this function... find first @@ -398,6 +417,7 @@ test get + Describe this function... list @@ -558,6 +578,7 @@ test get remove + Describe this function... list @@ -941,6 +962,7 @@ test remove + Describe this function... list @@ -1258,6 +1280,7 @@ test set + Describe this function... x @@ -1620,6 +1643,7 @@ test insert + Describe this function... x @@ -2002,6 +2026,7 @@ test sublist + Describe this function... list @@ -2146,6 +2171,7 @@ test join + Describe this function... list @@ -2200,6 +2226,7 @@ test split + Describe this function... list @@ -2221,7 +2248,7 @@ - join + split list @@ -2252,4 +2279,209 @@ - + + test sort alphabetic + Describe this function... + + + list + + + TEXT + 1 + + + + + + Vulcan + + + + + Klingon + + + + + Borg + + + + + + + + + sort alphabetic ascending + + + list + + + + + + + + Borg + + + + + Klingon + + + + + Vulcan + + + + + + + + + + + test sort ignoreCase + Describe this function... + + + list + + + IGNORE_CASE + 1 + + + + + + borg + + + + + Klingon + + + + + Borg + + + + + Vulcan + + + + + + + + + sort ignore case ascending + + + list + + + + + + + + borg + + + + + Borg + + + + + Klingon + + + + + Vulcan + + + + + + + + + + + test sort numeric + Describe this function... + + + list + + + NUMERIC + -1 + + + + + + 0-Borg + + + + + Vulcan + + + + + 1-Klingon + + + + + + + + + sort numeric descending + + + list + + + + + + + + Vulcan + + + + + 1-Klingon + + + + + 0-Borg + + + + + + + + + + \ No newline at end of file diff --git a/tests/jsunit/connection_db_test.js b/tests/jsunit/connection_db_test.js index e31eaa5ac..269d2d123 100644 --- a/tests/jsunit/connection_db_test.js +++ b/tests/jsunit/connection_db_test.js @@ -115,7 +115,7 @@ function test_DB_getNeighbours() { // Set up some connections. for (var i = 0; i < 10; i++) { db.addConnection(helper_createConnection(0, i, - Blockly.PREVIOUS_STATEMENT)); + Blockly.PREVIOUS_STATEMENT, null, true)); } // Test block belongs at beginning. @@ -154,14 +154,20 @@ function test_DB_getNeighbours() { function test_DB_findPositionForConnection() { var db = new Blockly.ConnectionDB(); - db.addConnection(helper_createConnection(0, 0, Blockly.PREVIOUS_STATEMENT)); - db.addConnection(helper_createConnection(0, 1, Blockly.PREVIOUS_STATEMENT)); - db.addConnection(helper_createConnection(0, 2, Blockly.PREVIOUS_STATEMENT)); - db.addConnection(helper_createConnection(0, 4, Blockly.PREVIOUS_STATEMENT)); - db.addConnection(helper_createConnection(0, 5, Blockly.PREVIOUS_STATEMENT)); + db.addConnection(helper_createConnection(0, 0, Blockly.PREVIOUS_STATEMENT, + null, true)); + db.addConnection(helper_createConnection(0, 1, Blockly.PREVIOUS_STATEMENT, + null, true)); + db.addConnection(helper_createConnection(0, 2, Blockly.PREVIOUS_STATEMENT, + null, true)); + db.addConnection(helper_createConnection(0, 4, Blockly.PREVIOUS_STATEMENT, + null, true)); + db.addConnection(helper_createConnection(0, 5, Blockly.PREVIOUS_STATEMENT, + null, true)); assertEquals(5, db.length); - var conn = helper_createConnection(0, 3, Blockly.PREVIOUS_STATEMENT); + var conn = helper_createConnection(0, 3, Blockly.PREVIOUS_STATEMENT, null, + true); assertEquals(3, db.findPositionForConnection_(conn)); } @@ -169,16 +175,17 @@ function test_DB_findConnection() { var db = new Blockly.ConnectionDB(); for (var i = 0; i < 10; i++) { db.addConnection(helper_createConnection(i, 0, - Blockly.PREVIOUS_STATEMENT)); + Blockly.PREVIOUS_STATEMENT, null, true)); db.addConnection(helper_createConnection(0, i, - Blockly.PREVIOUS_STATEMENT)); + Blockly.PREVIOUS_STATEMENT, null, true)); } - var conn = helper_createConnection(3, 3, Blockly.PREVIOUS_STATEMENT); + var conn = helper_createConnection(3, 3, Blockly.PREVIOUS_STATEMENT, null, + true); db.addConnection(conn); assertEquals(conn, db[db.findConnection(conn)]); - conn = helper_createConnection(3, 3, Blockly.PREVIOUS_STATEMENT); + conn = helper_createConnection(3, 3, Blockly.PREVIOUS_STATEMENT, null, true); assertEquals(-1, db.findConnection(conn)); } @@ -186,7 +193,7 @@ function test_DB_ordering() { var db = new Blockly.ConnectionDB(); for (var i = 0; i < 10; i++) { db.addConnection(helper_createConnection(0, 9 - i, - Blockly.PREVIOUS_STATEMENT)); + Blockly.PREVIOUS_STATEMENT), null, true); } for (i = 0; i < 10; i++) { @@ -210,7 +217,7 @@ function test_DB_ordering() { -19, -20, -95]; for (i = 0; i < xCoords.length; i++) { db.addConnection(helper_createConnection(xCoords[i], yCoords[i], - Blockly.PREVIOUS_STATEMENT)); + Blockly.PREVIOUS_STATEMENT), null, true); } for (i = 1; i < xCoords.length; i++) { @@ -227,13 +234,13 @@ function test_SearchForClosest() { 100 /* radius */)); db.addConnection(helper_createConnection(100, 0, Blockly.PREVIOUS_STATEMENT, - sharedWorkspace)); + sharedWorkspace, true)); assertEquals(null, helper_searchDB(db, 0, 0, 5, sharedWorkspace)); db = new Blockly.ConnectionDB(); for (var i = 0; i < 10; i++) { var tempConn = helper_createConnection(0, i, Blockly.PREVIOUS_STATEMENT, - sharedWorkspace); + sharedWorkspace, true); tempConn.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); db.addConnection(tempConn); } @@ -248,11 +255,11 @@ function test_SearchForClosest() { assertEquals(db[0], helper_searchDB(db, 0, 0, 0, sharedWorkspace)); tempConn = helper_createConnection(6, 6, Blockly.PREVIOUS_STATEMENT, - sharedWorkspace); + sharedWorkspace, true); tempConn.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); db.addConnection(tempConn); tempConn = helper_createConnection(5, 5, Blockly.PREVIOUS_STATEMENT, - sharedWorkspace); + sharedWorkspace, true); tempConn.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); db.addConnection(tempConn); @@ -263,15 +270,16 @@ function test_SearchForClosest() { function helper_getNeighbours(db, x, y, radius) { - return db.getNeighbours(helper_createConnection(x, y, Blockly.NEXT_STATEMENT), + return db.getNeighbours(helper_createConnection(x, y, Blockly.NEXT_STATEMENT, + null, true), radius); } function helper_searchDB(db, x, y, radius, shared_workspace) { var tempConn = helper_createConnection(x, y, - Blockly.NEXT_STATEMENT, shared_workspace); + Blockly.NEXT_STATEMENT, shared_workspace, true); tempConn.sourceBlock_ = helper_makeSourceBlock(shared_workspace); - var closest = db.searchForClosest(tempConn, radius, 0, 0); + var closest = db.searchForClosest(tempConn, radius, {x: 0, y: 0}); return closest.connection; } @@ -285,9 +293,14 @@ function helper_makeSourceBlock(sharedWorkspace) { }; } -function helper_createConnection(x, y, type, opt_shared_workspace) { +function helper_createConnection(x, y, type, opt_shared_workspace, + opt_rendered) { var workspace = opt_shared_workspace ? opt_shared_workspace : {}; - var conn = new Blockly.Connection({workspace: workspace}, type); + if (opt_rendered) { + var conn = new Blockly.RenderedConnection({workspace: workspace}, type); + } else { + var conn = new Blockly.Connection({workspace: workspace}, type); + } conn.x_ = x; conn.y_ = y; return conn; diff --git a/tests/jsunit/connection_test.js b/tests/jsunit/connection_test.js index c9ad00dae..d0a11662a 100644 --- a/tests/jsunit/connection_test.js +++ b/tests/jsunit/connection_test.js @@ -245,15 +245,15 @@ function testCheckConnection_TypeNextOutput() { connectionTest_tearDown(); } -function test_isConnectionAllowed() { +function test_isConnectionAllowed_Distance() { var sharedWorkspace = {}; // Two connections of opposite types near each other. var one = helper_createConnection(5 /* x */, 10 /* y */, - Blockly.INPUT_VALUE); + Blockly.INPUT_VALUE, null, true); one.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); var two = helper_createConnection(10 /* x */, 15 /* y */, - Blockly.OUTPUT_VALUE); + Blockly.OUTPUT_VALUE, null, true); two.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); assertTrue(one.isConnectionAllowed(two, 20.0)); @@ -261,22 +261,30 @@ function test_isConnectionAllowed() { two.x_ = 100; two.y_ = 100; assertFalse(one.isConnectionAllowed(two, 20.0)); +} + +function test_isConnectionAllowed_Unrendered() { + var sharedWorkspace = {}; + + var one = helper_createConnection(5 /* x */, 10 /* y */, + Blockly.INPUT_VALUE); + one.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); // Don't offer to connect an already connected left (male) value plug to // an available right (female) value plug. - var three = helper_createConnection(0, 0, Blockly.OUTPUT_VALUE); + var two = helper_createConnection(0, 0, Blockly.OUTPUT_VALUE); + two.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); + + assertTrue(one.isConnectionAllowed(two)); + var three = helper_createConnection(0, 0, Blockly.INPUT_VALUE); three.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); - assertTrue(one.isConnectionAllowed(three, 20.0)); - var four = helper_createConnection(0, 0, Blockly.INPUT_VALUE); - four.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); - - Blockly.Connection.connectReciprocally_(three, four); - assertFalse(one.isConnectionAllowed(three, 20.0)); + Blockly.Connection.connectReciprocally_(two, three); + assertFalse(one.isConnectionAllowed(two)); // Don't connect two connections on the same block. two.sourceBlock_ = one.sourceBlock_; - assertFalse(one.isConnectionAllowed(two, 1000.0)); + assertFalse(one.isConnectionAllowed(two)); } function test_isConnectionAllowed_NoNext() { @@ -288,14 +296,14 @@ function test_isConnectionAllowed_NoNext() { var two = helper_createConnection(0, 0, Blockly.PREVIOUS_STATEMENT); two.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); - assertTrue(two.isConnectionAllowed(one, 1000.0)); + assertTrue(two.isConnectionAllowed(one)); var three = helper_createConnection(0, 0, Blockly.PREVIOUS_STATEMENT); three.sourceBlock_ = helper_makeSourceBlock(sharedWorkspace); three.sourceBlock_.previousConnection = three; Blockly.Connection.connectReciprocally_(one, three); - assertFalse(two.isConnectionAllowed(one, 1000.0)); + assertFalse(two.isConnectionAllowed(one)); } function testCheckConnection_Okay() { diff --git a/tests/playground.html b/tests/playground.html index f6ac446c2..6b6c81333 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -510,6 +510,7 @@ h1 { +