pxt-core 6.4.30 → 6.4.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/pxtblockly.js +561 -545
- package/built/target.js +1 -1
- package/built/web/blockly.css +1 -1
- package/built/web/icons.css +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtblockly.js +1 -1
- package/built/web/pxtembed.js +561 -545
- package/built/web/rtlblockly.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/localtypings/blockly.d.ts +11952 -11905
- package/package.json +2 -2
- package/theme/blockly-core.less +1 -1
- package/theme/tutorial.less +7 -1
- package/webapp/public/blockly/blockly_compressed.js +77 -65
- package/webapp/public/blockly/blocks_compressed.js +38 -34
- package/webapp/public/blockly/media/add.svg +71 -71
- package/webapp/public/blockly/media/arrow.svg +75 -75
- package/webapp/public/blockly/media/comment-arrow-down.svg +9 -9
- package/webapp/public/blockly/media/comment-arrow-up.svg +9 -9
- package/webapp/public/blockly/media/delete-x.svg +9 -9
- package/webapp/public/blockly/media/dropdown-arrow-dark.svg +1 -1
- package/webapp/public/blockly/media/position_eyedropper.svg +85 -85
- package/webapp/public/blockly/media/question.svg +4 -4
- package/webapp/public/blockly/media/quote0.svg +63 -63
- package/webapp/public/blockly/media/quote1.svg +63 -63
- package/webapp/public/blockly/media/remove.svg +62 -62
- package/webapp/public/blockly/media/removeArg.svg +18 -18
- package/webapp/public/blockly/media/sprites.svg +204 -204
- package/webapp/public/blockly/msg/js/en.js +446 -446
- package/webapp/public/blockly/msg/json/en.json +420 -420
package/built/pxtblockly.js
CHANGED
|
@@ -169,7 +169,9 @@ Blockly.utils.is3dSupported=function(){if(void 0!==Blockly.utils.is3dSupported.c
|
|
|
169
169
|
if(!b)return document.body.removeChild(a),!1;b=b.getPropertyValue(c[d])}document.body.removeChild(a);Blockly.utils.is3dSupported.cached_="none"!==b;return Blockly.utils.is3dSupported.cached_};Blockly.utils.runAfterPageLoad=function(a){if("object"!=typeof document)throw Error("Blockly.utils.runAfterPageLoad() requires browser document.");if("complete"==document.readyState)a();else var b=setInterval(function(){"complete"==document.readyState&&(clearInterval(b),a())},10)};
|
|
170
170
|
Blockly.utils.getViewportBBox=function(){var a=Blockly.utils.style.getViewportPageOffset();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}};Blockly.utils.arrayRemove=function(a,b){b=a.indexOf(b);if(-1==b)return!1;a.splice(b,1);return!0};
|
|
171
171
|
Blockly.utils.getDocumentScroll=function(){var a=document.documentElement,b=window;return Blockly.utils.userAgent.IE&&b.pageYOffset!=a.scrollTop?new Blockly.utils.Coordinate(a.scrollLeft,a.scrollTop):new Blockly.utils.Coordinate(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)};Blockly.utils.getBlockTypeCounts=function(a,b){var c=Object.create(null),d=a.getDescendants(!0);b&&(a=a.getNextBlock())&&(a=d.indexOf(a),d.splice(a,d.length-a));for(a=0;b=d[a];a++)c[b.type]?c[b.type]++:c[b.type]=1;return c};
|
|
172
|
-
|
|
172
|
+
var resizeFromKeyboard=!0,initialWidth=0,lastHeight=0,debounceTimeout=null;
|
|
173
|
+
Blockly.utils.resizeTracker=function(a){debounceTimeout&&clearTimeout(debounceTimeout);debounceTimeout=setTimeout(function(){var b=a.getInjectionDiv();resizeFromKeyboard=!0;b&&(initialWidth=b.clientWidth,lastHeight=b.clientHeight)},1E3);var b=a.getInjectionDiv();if(b&&(0==initialWidth&&(resizeFromKeyboard=!0,initialWidth=b.clientWidth,lastHeight=b.clientHeight),resizeFromKeyboard)){var c=b.clientHeight;b.clientWidth!=initialWidth&&(resizeFromKeyboard=!1);c>lastHeight?resizeFromKeyboard=!1:lastHeight=
|
|
174
|
+
c}};Blockly.utils.isOnScreenKeyboardResize=function(){return Blockly.utils.dom.hasClass(document.activeElement,"blocklyHtmlInput")&&resizeFromKeyboard?!0:!1};Blockly.utils.screenToWsCoordinates=function(a,b){var c=b.x;b=b.y;var d=a.getInjectionDiv().getBoundingClientRect();c=new Blockly.utils.Coordinate(c-d.left,b-d.top);b=a.getOriginOffsetInPixels();return Blockly.utils.Coordinate.difference(c,b).scale(1/a.scale)};
|
|
173
175
|
Blockly.utils.parseBlockColour=function(a){var b="string"==typeof a?Blockly.utils.replaceMessageReferences(a):a,c=Number(b);if(!isNaN(c)&&0<=c&&360>=c)return{hue:c,hex:Blockly.utils.colour.hsvToHex(c,Blockly.HSV_SATURATION,255*Blockly.HSV_VALUE)};if(c=Blockly.utils.colour.parse(b))return{hue:null,hex:c};c='Invalid colour: "'+b+'"';a!=b&&(c+=' (from "'+a+'")');throw Error(c);};Blockly.Events={};Blockly.Events.group_="";Blockly.Events.recordUndo=!0;Blockly.Events.disabled_=0;Blockly.Events.CREATE="create";Blockly.Events.BLOCK_CREATE=Blockly.Events.CREATE;Blockly.Events.DELETE="delete";Blockly.Events.BLOCK_DELETE=Blockly.Events.DELETE;Blockly.Events.CHANGE="change";Blockly.Events.BLOCK_CHANGE=Blockly.Events.CHANGE;Blockly.Events.MOVE="move";Blockly.Events.BLOCK_MOVE=Blockly.Events.MOVE;Blockly.Events.VAR_CREATE="var_create";Blockly.Events.VAR_DELETE="var_delete";
|
|
174
176
|
Blockly.Events.VAR_RENAME="var_rename";Blockly.Events.COMMENT_CREATE="comment_create";Blockly.Events.COMMENT_DELETE="comment_delete";Blockly.Events.COMMENT_CHANGE="comment_change";Blockly.Events.COMMENT_MOVE="comment_move";Blockly.Events.UI="ui";Blockly.Events.END_DRAG="end_drag";Blockly.Events.COMMENT_CREATE="comment_create";Blockly.Events.COMMENT_DELETE="comment_delete";Blockly.Events.COMMENT_CHANGE="comment_change";Blockly.Events.COMMENT_MOVE="comment_move";Blockly.Events.FINISHED_LOADING="finished_loading";
|
|
175
177
|
Blockly.Events.BUMP_EVENTS=[Blockly.Events.BLOCK_CREATE,Blockly.Events.BLOCK_MOVE,Blockly.Events.COMMENT_CREATE,Blockly.Events.COMMENT_MOVE];Blockly.Events.FIRE_QUEUE_=[];Blockly.Events.fire=function(a){Blockly.Events.isEnabled()&&(Blockly.Events.FIRE_QUEUE_.length||setTimeout(Blockly.Events.fireNow_,0),Blockly.Events.FIRE_QUEUE_.push(a))};
|
|
@@ -274,9 +276,9 @@ Blockly.Colours.dropDownShadow+";","padding: 4px;","box-shadow: 0px 0px 3px 1px
|
|
|
274
276
|
"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,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",
|
|
275
277
|
".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px !important;","position: static;","float: left;","margin-left: -24px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {",
|
|
276
278
|
"float: right;","margin-right: -24px;","}",".blocklyWidgetDiv .goog-menuseparator, ",".blocklyDropDownDiv .goog-menuseparator {","border-top: 1px solid #ccc;","margin: 4px 0;","padding: 0;","}",".blocklyComputeCanvas {","position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}",".blocklyDropDownDiv .goog-slider-horizontal {","margin: 8px;","height: 22px;","width: 150px;","position: relative;","outline: none;","border-radius: 11px;","margin-bottom: 20px;",
|
|
277
|
-
"background: #547AB2","}",".blocklyDropDownDiv .goog-slider-horizontal .goog-slider-thumb {","width: 26px;","height: 26px;","
|
|
278
|
-
"
|
|
279
|
-
"
|
|
279
|
+
"background: #547AB2","}",".blocklyDropDownDiv .goog-slider-horizontal .goog-slider-thumb {","width: 26px;","height: 26px;","top: -1px;","position: absolute;","background-color: white;","border-radius: 100%;","-webkit-box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);","-moz-box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);","box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);","cursor: pointer","}",".blocklyFieldSliderLabel {",'font-family: "Helvetica Neue", "Segoe UI", Helvetica, sans-serif;',"font-size: 0.65rem;","color: $colour_toolboxText;",
|
|
280
|
+
"margin: 8px;","}",".blocklyFieldSliderLabelText {","font-weight: bold;","}",".blocklyFieldSliderReadout {","margin-left: 10px;","}",".blocklyHighlighted>.blocklyPath {","stroke: #ff8b27;","stroke-width: 5px;","}",".argumentEditorRemoveIcon {","position: absolute;","width: 24px;","height: 24px;","top: -40px;","left: 50%;","margin-left: -12px;","cursor: pointer;","}",".functioneditor i.argumentEditorTypeIcon {","position: absolute;","width: 24px;","height: 24px;","top: 40px;","left: 50%;","margin-left: -12px;",
|
|
281
|
+
"}",".blocklyWidgetDiv.fieldTextInput.argumentEditorInput {","overflow: visible;","}",".functionNameText {","font-weight: bold;","}",".field-text-quote {","fill: #a31515 !important;","}",""];Blockly.utils.math={};Blockly.utils.math.toRadians=function(a){return a*Math.PI/180};Blockly.utils.math.toDegrees=function(a){return 180*a/Math.PI};Blockly.utils.math.clamp=function(a,b,c){if(c<a){var d=c;c=a;a=d}return Math.max(a,Math.min(b,c))};/*
|
|
280
282
|
|
|
281
283
|
Copyright 2016 Massachusetts Institute of Technology
|
|
282
284
|
All rights reserved.
|
|
@@ -374,10 +376,11 @@ a.isCollapsed()&&c.setAttribute("collapsed",!0);a.isEnabled()||c.setAttribute("d
|
|
|
374
376
|
b));return c};Blockly.Xml.cloneShadow_=function(a,b){for(var c=a=a.cloneNode(!0),d;c;)if(b&&"shadow"==c.nodeName&&c.removeAttribute("id"),c.firstChild)c=c.firstChild;else{for(;c&&!c.nextSibling;)d=c,c=c.parentNode,d.nodeType==Blockly.utils.dom.Node.TEXT_NODE&&""==d.data.trim()&&c.firstChild!=d&&Blockly.utils.dom.removeNode(d);c&&(d=c,c=c.nextSibling,d.nodeType==Blockly.utils.dom.Node.TEXT_NODE&&""==d.data.trim()&&Blockly.utils.dom.removeNode(d))}return a};Blockly.Xml.domToText=function(a){return Blockly.utils.xml.domToText(a)};
|
|
375
377
|
Blockly.Xml.domToPrettyText=function(a){a=Blockly.Xml.domToText(a).split("<");for(var b="",c=1;c<a.length;c++){var d=a[c];"/"==d[0]&&(b=b.substring(2));a[c]=b+"<"+d;"/"!=d[0]&&"/>"!=d.slice(-2)&&(b+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1</$2>");return a.replace(/^\n/,"")};
|
|
376
378
|
Blockly.Xml.textToDom=function(a){a=a.replace(/xmlns="(.*?)"/,'xmlns="'+Blockly.utils.xml.NAME_SPACE+'"');var b=Blockly.utils.xml.textToDomDocument(a);if(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return b.documentElement};Blockly.Xml.clearWorkspaceAndLoadFromXml=function(a,b){b.setResizesEnabled(!1);b.clear();a=Blockly.Xml.domToWorkspace(a,b);b.setResizesEnabled(!0);return a};
|
|
377
|
-
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());c=[];Blockly.utils.dom.startTextWidthCache();var e=Blockly.Events.getGroup();e||Blockly.Events.setGroup(!0);b.setResizesEnabled&&b.setResizesEnabled(!1);var f=!0;try{for(var g=0,h;h=a.childNodes[g];g++){var k=h.nodeName.toLowerCase(),l=h;if("block"==k||"shadow"==k&&!Blockly.Events.recordUndo){var m=
|
|
379
|
+
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.")}b.loadingEventsDisabled=!0;var d;b.RTL&&(d=b.getWidth());c=[];Blockly.utils.dom.startTextWidthCache();var e=Blockly.Events.getGroup();e||Blockly.Events.setGroup(!0);b.setResizesEnabled&&b.setResizesEnabled(!1);var f=!0;try{for(var g=0,h;h=a.childNodes[g];g++){var k=h.nodeName.toLowerCase(),l=h;if("block"==k||"shadow"==k&&!Blockly.Events.recordUndo){var m=
|
|
378
380
|
Blockly.Xml.domToBlock(l,b);c.push(m.id);var n=l.hasAttribute("x")?parseInt(l.getAttribute("x"),10):10,p=l.hasAttribute("y")?parseInt(l.getAttribute("y"),10):10;isNaN(n)||isNaN(p)||m.moveBy(b.RTL?d-n:n,p);f=!1}else{if("shadow"==k)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==k)b.rendered?Blockly.WorkspaceCommentSvg?Blockly.WorkspaceCommentSvg.fromXml(l,b,d):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):Blockly.WorkspaceComment?
|
|
379
|
-
Blockly.WorkspaceComment.fromXml(l,b):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==k){if(f)Blockly.Xml.domToVariables(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");f=!1}}}}finally{e||Blockly.Events.setGroup(!1),Blockly.utils.dom.stopTextWidthCache()}b.setResizesEnabled&&b.setResizesEnabled(!0);
|
|
380
|
-
|
|
381
|
+
Blockly.WorkspaceComment.fromXml(l,b):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==k){if(f)Blockly.Xml.domToVariables(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");f=!1}}}}finally{e||Blockly.Events.setGroup(!1),Blockly.utils.dom.stopTextWidthCache()}b.setResizesEnabled&&b.setResizesEnabled(!0);b.loadingEventsDisabled=!1;b.getAllBlocks(!1).forEach(function(a){a.onLoadedIntoWorkspace()});
|
|
382
|
+
Blockly.Events.fire(new Blockly.Events.FinishedLoading(b));return c};
|
|
383
|
+
Blockly.Xml.appendDomToWorkspace=function(a,b){var c;b.hasOwnProperty("scale")&&(c=b.getBlocksBoundingBox());a=Blockly.Xml.domToWorkspace(a,b);if(c&&c.top!=c.bottom){var d=c.bottom;var e=b.RTL?c.right:c.left;var f=Infinity,g=-Infinity,h=Infinity;for(c=0;c<a.length;c++){var k=b.getBlockById(a[c]).getRelativeToSurfaceXY();k.y<h&&(h=k.y);k.x<f&&(f=k.x);k.x>g&&(g=k.x)}d=d-h+10;e=b.RTL?e-g:e-f;for(c=0;c<a.length;c++)b.getBlockById(a[c]).moveBy(e,d)}return a};
|
|
381
384
|
Blockly.Xml.domToBlock=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}Blockly.Events.disable();c=b.getAllVariables();try{var d=Blockly.Xml.domToBlockHeadless_(a,b),e=d.getDescendants(!1);if(b.rendered){d.setConnectionTracking(!1);for(var f=e.length-1;0<=f;f--)e[f].initSvg();for(f=e.length-1;0<=f;f--)e[f].render(!1);setTimeout(function(){d.disposed||d.setConnectionTracking(!0)},1);d.updateDisabled();b.resizeContents()}else for(f=
|
|
382
385
|
e.length-1;0<=f;f--)e[f].initModel()}finally{Blockly.Events.enable()}if(Blockly.Events.isEnabled()){a=Blockly.Variables.getAddedVariables(b,c);for(f=0;f<a.length;f++)Blockly.Events.fire(new Blockly.Events.VarCreate(a[f]));Blockly.Events.fire(new Blockly.Events.BlockCreate(d))}return d};
|
|
383
386
|
Blockly.Xml.domToVariables=function(a,b){for(var c=0,d;d=a.childNodes[c];c++)if(d.nodeType==Blockly.utils.dom.Node.ELEMENT_NODE){var e=d.getAttribute("type"),f=d.getAttribute("id");b.createVariable(d.textContent,e,f)}};
|
|
@@ -400,7 +403,7 @@ Blockly.utils.global.PointerEvent?Blockly.Touch.TOUCH_MAP={mousedown:["pointerdo
|
|
|
400
403
|
Blockly.longStart=function(a,b){Blockly.longStop_();a.changedTouches&&1!=a.changedTouches.length||(Blockly.longPid_=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);b&&b.handleRightClick(a)},Blockly.LONGPRESS))};Blockly.longStop_=function(){Blockly.longPid_&&(clearTimeout(Blockly.longPid_),Blockly.longPid_=0)};Blockly.Touch.clearTouchIdentifier=function(){Blockly.Touch.touchIdentifier_=null};
|
|
401
404
|
Blockly.Touch.shouldHandleEvent=function(a){return!Blockly.Touch.isMouseOrTouchEvent(a)||Blockly.Touch.checkTouchIdentifier(a)};Blockly.Touch.getTouchIdentifierFromEvent=function(a){return void 0!=a.pointerId?a.pointerId:a.changedTouches&&a.changedTouches[0]&&void 0!==a.changedTouches[0].identifier&&null!==a.changedTouches[0].identifier?a.changedTouches[0].identifier:"mouse"};
|
|
402
405
|
Blockly.Touch.checkTouchIdentifier=function(a){var b=Blockly.Touch.getTouchIdentifierFromEvent(a);return void 0!==Blockly.Touch.touchIdentifier_&&null!==Blockly.Touch.touchIdentifier_?Blockly.Touch.touchIdentifier_==b:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(Blockly.Touch.touchIdentifier_=b,!0):!1};Blockly.Touch.setClientFromTouch=function(a){if(Blockly.utils.string.startsWith(a.type,"touch")){var b=a.changedTouches[0];a.clientX=b.clientX;a.clientY=b.clientY}};
|
|
403
|
-
Blockly.Touch.isMouseOrTouchEvent=function(a){return Blockly.utils.string.startsWith(a.type,"touch")||Blockly.utils.string.startsWith(a.type,"mouse")||Blockly.utils.string.startsWith(a.type,"pointer")};Blockly.Touch.isTouchEvent=function(a){return Blockly.utils.string.startsWith(a.type,"touch")||Blockly.utils.string.startsWith(a.type,"pointer")};
|
|
406
|
+
Blockly.Touch.isMouseOrTouchEvent=function(a){return Blockly.utils.string.startsWith(a.type,"touch")||Blockly.utils.string.startsWith(a.type,"mouse")||Blockly.utils.string.startsWith(a.type,"pointer")};Blockly.Touch.isTouchEvent=function(a){return a instanceof PointerEvent&&"mouse"==a.pointerType?!1:Blockly.utils.string.startsWith(a.type,"touch")||Blockly.utils.string.startsWith(a.type,"pointer")};
|
|
404
407
|
Blockly.Touch.splitEventByTouches=function(a){var b=[];if(a.changedTouches)for(var c=0;c<a.changedTouches.length;c++)b[c]={type:a.type,changedTouches:[a.changedTouches[c]],target:a.target,stopPropagation:function(){a.stopPropagation()},preventDefault:function(){a.preventDefault()}};else b.push(a);return b};/*
|
|
405
408
|
|
|
406
409
|
Copyright 2011 Google LLC
|
|
@@ -417,11 +420,12 @@ Blockly.Touch.splitEventByTouches=function(a){var b=[];if(a.changedTouches)for(v
|
|
|
417
420
|
See the License for the specific language governing permissions and
|
|
418
421
|
limitations under the License.
|
|
419
422
|
*/
|
|
420
|
-
Blockly.ScrollbarPair=function(a){this.workspace_=a;this.hScroll=new Blockly.Scrollbar(a,!0,!0,
|
|
421
|
-
Blockly.ScrollbarPair.prototype.
|
|
423
|
+
Blockly.ScrollbarPair=function(a,b,c){this.workspace_=a;this.hScroll=new Blockly.Scrollbar(a,!0,!0,c);this.vScroll=new Blockly.Scrollbar(a,!1,!0,c);this.corner_=Blockly.utils.dom.createSvgElement("rect",{height:Blockly.Scrollbar.scrollbarThickness,width:Blockly.Scrollbar.scrollbarThickness,"class":"blocklyScrollbarBackground"},null);this.infinite=b;Blockly.utils.dom.insertAfter(this.corner_,a.getBubbleCanvas())};Blockly.ScrollbarPair.prototype.oldHostMetrics_=null;
|
|
424
|
+
Blockly.ScrollbarPair.prototype.dispose=function(){Blockly.utils.dom.removeNode(this.corner_);this.oldHostMetrics_=this.workspace_=this.corner_=null;this.hScroll.dispose();this.hScroll=null;this.vScroll.dispose();this.vScroll=null};
|
|
422
425
|
Blockly.ScrollbarPair.prototype.resize=function(){var a=this.workspace_.getMetrics();if(a){var b=!1,c=!1;this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth==a.viewWidth&&this.oldHostMetrics_.viewHeight==a.viewHeight&&this.oldHostMetrics_.absoluteTop==a.absoluteTop&&this.oldHostMetrics_.absoluteLeft==a.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.contentWidth==a.contentWidth&&this.oldHostMetrics_.viewLeft==a.viewLeft&&this.oldHostMetrics_.contentLeft==a.contentLeft||(b=!0),this.oldHostMetrics_&&
|
|
423
426
|
this.oldHostMetrics_.contentHeight==a.contentHeight&&this.oldHostMetrics_.viewTop==a.viewTop&&this.oldHostMetrics_.contentTop==a.contentTop||(c=!0)):c=b=!0;b&&this.hScroll.resize(a);c&&this.vScroll.resize(a);this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth==a.viewWidth&&this.oldHostMetrics_.absoluteLeft==a.absoluteLeft||this.corner_.setAttribute("x",this.vScroll.position_.x);this.oldHostMetrics_&&this.oldHostMetrics_.viewHeight==a.viewHeight&&this.oldHostMetrics_.absoluteTop==a.absoluteTop||this.corner_.setAttribute("y",
|
|
424
|
-
this.hScroll.position_.y);this.oldHostMetrics_=a}};Blockly.ScrollbarPair.prototype.set=function(a,b){var c={};a*=this.hScroll.ratio_;b*=this.vScroll.ratio_;var d=this.vScroll.scrollViewSize_;c.x=this.getRatio_(a,this.hScroll.scrollViewSize_);c.y=this.getRatio_(b,d);this.workspace_.setMetrics(c);this.hScroll.setHandlePosition(a);this.vScroll.setHandlePosition(b)};
|
|
427
|
+
this.hScroll.position_.y);this.oldHostMetrics_=a}};Blockly.ScrollbarPair.prototype.set=function(a,b){var c={};a*=this.hScroll.ratio_;b*=this.vScroll.ratio_;this.infinite||(a=this.hScroll.constrainHandle_(a),b=this.vScroll.constrainHandle_(b));var d=this.vScroll.scrollViewSize_;c.x=this.getRatio_(a,this.hScroll.scrollViewSize_);c.y=this.getRatio_(b,d);this.workspace_.setMetrics(c);this.hScroll.setHandlePosition(a);this.vScroll.setHandlePosition(b)};
|
|
428
|
+
Blockly.ScrollbarPair.prototype.getRatio_=function(a,b){a/=b;return isNaN(a)?0:a};
|
|
425
429
|
Blockly.Scrollbar=function(a,b,c,d){this.workspace_=a;this.pair_=c||!1;this.horizontal_=b;this.svgGroup_=this.oldHostMetrics_=null;this.createDom_(d);this.position_=new Blockly.utils.Coordinate(0,0);a=Blockly.Scrollbar.scrollbarThickness;b?(this.svgBackground_.setAttribute("height",a),this.outerSvg_.setAttribute("height",a),this.svgHandle_.setAttribute("height",a-5),this.svgHandle_.setAttribute("y",2.5),this.lengthAttribute_="width",this.positionAttribute_="x"):(this.svgBackground_.setAttribute("width",
|
|
426
430
|
a),this.outerSvg_.setAttribute("width",a),this.svgHandle_.setAttribute("width",a-5),this.svgHandle_.setAttribute("x",2.5),this.lengthAttribute_="height",this.positionAttribute_="y");this.onMouseDownBarWrapper_=Blockly.bindEventWithChecks_(this.svgBackground_,"mousedown",this,this.onMouseDownBar_);this.onMouseDownHandleWrapper_=Blockly.bindEventWithChecks_(this.svgHandle_,"mousedown",this,this.onMouseDownHandle_)};Blockly.Scrollbar.prototype.origin_=new Blockly.utils.Coordinate(0,0);
|
|
427
431
|
Blockly.Scrollbar.prototype.originHasChanged_=!0;Blockly.Scrollbar.prototype.startDragMouse_=0;Blockly.Scrollbar.prototype.scrollViewSize_=0;Blockly.Scrollbar.prototype.handleLength_=0;Blockly.Scrollbar.prototype.handlePosition_=0;Blockly.Scrollbar.prototype.isVisible_=!0;Blockly.Scrollbar.prototype.containerVisible_=!0;Blockly.Scrollbar.scrollbarThickness=15;Blockly.Touch.TOUCH_ENABLED&&(Blockly.Scrollbar.scrollbarThickness=25);
|
|
@@ -561,8 +565,8 @@ Blockly.Events.EndBlockDrag.prototype.toJson=function(){var a=Blockly.Events.End
|
|
|
561
565
|
Blockly.InsertionMarkerManager.prototype.dispose=function(){this.availableConnections_.length=0;Blockly.Events.disable();try{this.firstMarker_&&this.firstMarker_.dispose(),this.lastMarker_&&this.lastMarker_.dispose()}finally{Blockly.Events.enable()}};Blockly.InsertionMarkerManager.prototype.wouldDeleteBlock=function(){return this.wouldDeleteBlock_};Blockly.InsertionMarkerManager.prototype.wouldConnectBlock=function(){return!!this.closestConnection_};
|
|
562
566
|
Blockly.InsertionMarkerManager.prototype.applyConnections=function(){if(this.closestConnection_&&(Blockly.Events.disable(),this.hidePreview_(),Blockly.Events.enable(),this.localConnection_.connect(this.closestConnection_),this.topBlock_.rendered)){var a=this.localConnection_.isSuperior()?this.closestConnection_:this.localConnection_;Blockly.blockAnimations.connectionUiEffect(a.getSourceBlock());this.topBlock_.getRootBlock().bringToFront()}};
|
|
563
567
|
Blockly.InsertionMarkerManager.prototype.update=function(a,b){var c=this.getCandidate_(a);if((this.wouldDeleteBlock_=this.shouldDelete_(c,b))||this.shouldUpdatePreviews_(c,a))Blockly.Events.disable(),this.maybeHidePreview_(c),this.maybeShowPreview_(c),Blockly.Events.enable();this.updateConnectionLine_(a)};
|
|
564
|
-
Blockly.InsertionMarkerManager.prototype.createMarkerBlock_=function(a){var b=a.type;Blockly.Events.disable();try{var c=this.workspace_.newBlock(b);c.setInsertionMarker(!0);if(a.mutationToDom){var d=a.mutationToDom();d&&c.domToMutation(d)}c.setCollapsed(a.isCollapsed());for(b=0;b<a.inputList.length;b++){var e=a.inputList[b];if(e.isVisible()){var f=c.inputList[b];for(d=0;d<e.fieldRow.length;d++)f.fieldRow[d].setValue(e.fieldRow[d].getValue())}}c.initSvg();
|
|
565
|
-
Blockly.InsertionMarkerManager.prototype.initAvailableConnections_=function(){var a=this.topBlock_.getConnections_(!1),b=this.topBlock_.lastConnectionInStack();b&&b!=this.topBlock_.nextConnection&&(a.push(b),this.lastOnStack_=b,this.lastMarker_=this.createMarkerBlock_(b.getSourceBlock()));return a};
|
|
568
|
+
Blockly.InsertionMarkerManager.prototype.createMarkerBlock_=function(a){var b=a.type;Blockly.Events.disable();try{this.workspace_.loadingEventsDisabled=!0;var c=this.workspace_.newBlock(b);this.workspace_.loadingEventsDisabled=!1;c.setInsertionMarker(!0);if(a.mutationToDom){var d=a.mutationToDom();d&&c.domToMutation(d)}c.setCollapsed(a.isCollapsed());for(b=0;b<a.inputList.length;b++){var e=a.inputList[b];if(e.isVisible()){var f=c.inputList[b];for(d=0;d<e.fieldRow.length;d++)f.fieldRow[d].setValue(e.fieldRow[d].getValue())}}c.initSvg();
|
|
569
|
+
c.getSvgRoot().setAttribute("visibility","hidden")}finally{Blockly.Events.enable()}return c};Blockly.InsertionMarkerManager.prototype.initAvailableConnections_=function(){var a=this.topBlock_.getConnections_(!1),b=this.topBlock_.lastConnectionInStack();b&&b!=this.topBlock_.nextConnection&&(a.push(b),this.lastOnStack_=b,this.lastMarker_=this.createMarkerBlock_(b.getSourceBlock()));return a};
|
|
566
570
|
Blockly.InsertionMarkerManager.prototype.shouldUpdatePreviews_=function(a,b){var c=a.local,d=a.closest;a=a.radius;if(c&&d){if(this.localConnection_&&this.closestConnection_){if(this.closestConnection_==d&&this.localConnection_==c)return!1;c=this.localConnection_.x+b.x-this.closestConnection_.x;b=this.localConnection_.y+b.y-this.closestConnection_.y;b=Math.sqrt(c*c+b*b);return!(d&&a>b-Blockly.CURRENT_CONNECTION_PREFERENCE)}if(this.localConnection_||this.closestConnection_)console.error("Only one of localConnection_ and closestConnection_ was set.");
|
|
567
571
|
else return!0}else return!(!this.localConnection_||!this.closestConnection_);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0};Blockly.InsertionMarkerManager.prototype.getCandidate_=function(a){for(var b=this.getStartRadius_(),c=null,d=null,e=0;e<this.availableConnections_.length;e++){var f=this.availableConnections_[e],g=f.closest(b,a);g.connection&&(c=g.connection,d=f,b=g.radius)}return{closest:c,local:d,radius:b}};
|
|
568
572
|
Blockly.InsertionMarkerManager.prototype.getStartRadius_=function(){return this.closestConnection_&&this.localConnection_?Blockly.CONNECTING_SNAP_RADIUS:Blockly.SNAP_RADIUS};
|
|
@@ -600,8 +604,8 @@ Blockly.VariableMap.prototype.deleteVariableById=function(a){var b=this.getVaria
|
|
|
600
604
|
b&&f.deleteVariableInternal(b,d)})):f.deleteVariableInternal(b,d)}else console.warn("Can't delete non-existent variable: "+a)};Blockly.VariableMap.prototype.deleteVariableInternal=function(a,b){var c=Blockly.Events.getGroup();c||Blockly.Events.setGroup(!0);try{for(var d=0;d<b.length;d++)b[d].dispose(!0);this.deleteVariable(a)}finally{c||Blockly.Events.setGroup(!1)}};
|
|
601
605
|
Blockly.VariableMap.prototype.getVariable=function(a,b){if(b=this.variableMap_[b||""])for(var c=0,d;d=b[c];c++)if(Blockly.Names.equals(d.name,a))return d;return null};Blockly.VariableMap.prototype.getVariableById=function(a){for(var b=Object.keys(this.variableMap_),c=0;c<b.length;c++)for(var d=b[c],e=0,f;f=this.variableMap_[d][e];e++)if(f.getId()==a)return f;return null};Blockly.VariableMap.prototype.getVariablesOfType=function(a){return(a=this.variableMap_[a||""])?a.slice():[]};
|
|
602
606
|
Blockly.VariableMap.prototype.getVariableTypes=function(a){var b={};Blockly.utils.object.mixin(b,this.variableMap_);a&&a.getPotentialVariableMap()&&Blockly.utils.object.mixin(b,a.getPotentialVariableMap().variableMap_);a=Object.keys(b);b=!1;for(var c=0;c<a.length;c++)""==a[c]&&(b=!0);b||a.push("");return a};Blockly.VariableMap.prototype.getAllVariables=function(){var a=[],b;for(b in this.variableMap_)a=a.concat(this.variableMap_[b]);return a};
|
|
603
|
-
Blockly.VariableMap.prototype.getAllVariableNames=function(){var a=[],b;for(b in this.variableMap_)for(var c=this.variableMap_[b],d=0,e;e=c[d];d++)a.push(e.name);return a};Blockly.VariableMap.prototype.getVariableUsesById=function(a){for(var b=[],c=this.workspace.getAllBlocks(!1),d=0;d<c.length;d++){var e=c[d].getVarModels();if(e)for(var f=0;f<e.length;f++)e[f].getId()==a&&b.push(c[d])}return b};Blockly.Workspace=function(a){this.id=Blockly.utils.genUid();Blockly.Workspace.WorkspaceDB_[this.id]=this;this.options=a||{};this.RTL=!!this.options.RTL;this.horizontalLayout=!!this.options.horizontalLayout;this.toolboxPosition=this.options.toolboxPosition;this.topBlocks_=[];this.topComments_=[];this.commentDB_=Object.create(null);this.listeners_=[];this.tapListeners_=[];this.undoStack_=[];this.redoStack_=[];this.blockDB_=Object.create(null);this.typedBlocksDB_=Object.create(null);
|
|
604
|
-
new Blockly.VariableMap(this);this.potentialVariableMap_=null};Blockly.Workspace.prototype.rendered=!1;Blockly.Workspace.prototype.isClearing=!1;Blockly.Workspace.prototype.MAX_UNDO=1024;Blockly.Workspace.prototype.connectionDBList=null;Blockly.Workspace.prototype.dispose=function(){this.listeners_.length=0;this.clear();delete Blockly.Workspace.WorkspaceDB_[this.id]};Blockly.Workspace.SCAN_ANGLE=3;
|
|
607
|
+
Blockly.VariableMap.prototype.getAllVariableNames=function(){var a=[],b;for(b in this.variableMap_)for(var c=this.variableMap_[b],d=0,e;e=c[d];d++)a.push(e.name);return a};Blockly.VariableMap.prototype.getVariableUsesById=function(a){for(var b=[],c=this.workspace.getAllBlocks(!1),d=0;d<c.length;d++){var e=c[d].getVarModels();if(e)for(var f=0;f<e.length;f++)e[f].getId()==a&&b.push(c[d])}return b};Blockly.Workspace=function(a){this.id=Blockly.utils.genUid();Blockly.Workspace.WorkspaceDB_[this.id]=this;this.options=a||{};this.RTL=!!this.options.RTL;this.horizontalLayout=!!this.options.horizontalLayout;this.toolboxPosition=this.options.toolboxPosition;this.loadingEventsDisabled=!1;this.topBlocks_=[];this.topComments_=[];this.commentDB_=Object.create(null);this.listeners_=[];this.tapListeners_=[];this.undoStack_=[];this.redoStack_=[];this.blockDB_=Object.create(null);this.typedBlocksDB_=Object.create(null);
|
|
608
|
+
this.variableMap_=new Blockly.VariableMap(this);this.potentialVariableMap_=null};Blockly.Workspace.prototype.rendered=!1;Blockly.Workspace.prototype.isClearing=!1;Blockly.Workspace.prototype.MAX_UNDO=1024;Blockly.Workspace.prototype.connectionDBList=null;Blockly.Workspace.prototype.dispose=function(){this.listeners_.length=0;this.clear();delete Blockly.Workspace.WorkspaceDB_[this.id]};Blockly.Workspace.SCAN_ANGLE=3;
|
|
605
609
|
Blockly.Workspace.prototype.sortObjects_=function(a,b){a=a.getRelativeToSurfaceXY();b=b.getRelativeToSurfaceXY();return a.y+Blockly.Workspace.prototype.sortObjects_.offset*a.x-(b.y+Blockly.Workspace.prototype.sortObjects_.offset*b.x)};Blockly.Workspace.prototype.addTopBlock=function(a){this.topBlocks_.push(a)};Blockly.Workspace.prototype.removeTopBlock=function(a){if(!Blockly.utils.arrayRemove(this.topBlocks_,a))throw Error("Block not present in workspace's list of top-most blocks.");};
|
|
606
610
|
Blockly.Workspace.prototype.getTopBlocks=function(a){var b=[].concat(this.topBlocks_);a&&1<b.length&&(this.sortObjects_.offset=Math.sin(Blockly.utils.math.toRadians(Blockly.Workspace.SCAN_ANGLE)),this.RTL&&(this.sortObjects_.offset*=-1),b.sort(this.sortObjects_));return b};Blockly.Workspace.prototype.addTypedBlock=function(a){this.typedBlocksDB_[a.type]||(this.typedBlocksDB_[a.type]=[]);this.typedBlocksDB_[a.type].push(a)};
|
|
607
611
|
Blockly.Workspace.prototype.removeTypedBlock=function(a){this.typedBlocksDB_[a.type].splice(this.typedBlocksDB_[a.type].indexOf(a),1);this.typedBlocksDB_[a.type].length||delete this.typedBlocksDB_[a.type]};
|
|
@@ -614,7 +618,7 @@ Blockly.Workspace.prototype.clear=function(){this.isClearing=!0;try{var a=Blockl
|
|
|
614
618
|
!1}};Blockly.Workspace.prototype.renameVariableById=function(a,b){this.variableMap_.renameVariableById(a,b)};Blockly.Workspace.prototype.createVariable=function(a,b,c){return this.variableMap_.createVariable(a,b,c)};Blockly.Workspace.prototype.getVariableUsesById=function(a){return this.variableMap_.getVariableUsesById(a)};Blockly.Workspace.prototype.deleteVariableById=function(a){this.variableMap_.deleteVariableById(a)};
|
|
615
619
|
Blockly.Workspace.prototype.deleteVariableInternal_=function(a,b){this.variableMap_.deleteVariableInternal(a,b)};Blockly.Workspace.prototype.variableIndexOf=function(a){console.warn("Deprecated call to Blockly.Workspace.prototype.variableIndexOf");return-1};Blockly.Workspace.prototype.getVariable=function(a,b){return this.variableMap_.getVariable(a,b)};Blockly.Workspace.prototype.getVariableById=function(a){return this.variableMap_.getVariableById(a)};
|
|
616
620
|
Blockly.Workspace.prototype.getVariablesOfType=function(a){return this.variableMap_.getVariablesOfType(a)};Blockly.Workspace.prototype.getVariableTypes=function(){return this.variableMap_.getVariableTypes(this)};Blockly.Workspace.prototype.getAllVariables=function(){return this.variableMap_.getAllVariables()};Blockly.Workspace.prototype.getAllVariableNames=function(){return this.variableMap_.getAllVariableNames()};Blockly.Workspace.prototype.getWidth=function(){return 0};
|
|
617
|
-
Blockly.Workspace.prototype.newBlock=function(a,b){
|
|
621
|
+
Blockly.Workspace.prototype.newBlock=function(a,b){a=new Blockly.Block(this,a,b);if(!this.loadingEventsDisabled)a.onLoadedIntoWorkspace();return a};Blockly.Workspace.prototype.remainingCapacity=function(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks(!1).length};Blockly.Workspace.prototype.remainingCapacityOfType=function(a){return this.options.maxInstances?(this.options.maxInstances[a]||Infinity)-this.getBlocksByType(a,!1).length:Infinity};
|
|
618
622
|
Blockly.Workspace.prototype.isCapacityAvailable=function(a){if(!this.hasBlockLimits())return!0;var b=0,c;for(c in a){if(a[c]>this.remainingCapacityOfType(c))return!1;b+=a[c]}return b>this.remainingCapacity()?!1:!0};Blockly.Workspace.prototype.hasBlockLimits=function(){return Infinity!=this.options.maxBlocks||!!this.options.maxInstances};
|
|
619
623
|
Blockly.Workspace.prototype.undo=function(a){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_,d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group==b[b.length-1].group;)e.push(b.pop());for(b=0;d=e[b];b++)c.push(d);e=Blockly.Events.filter(e,a);Blockly.Events.recordUndo=!1;try{for(b=0;d=e[b];b++)d.run(a)}finally{Blockly.Events.recordUndo=!0}}};Blockly.Workspace.prototype.clearUndo=function(){this.undoStack_.length=0;this.redoStack_.length=0;Blockly.Events.clearPendingUndo()};
|
|
620
624
|
Blockly.Workspace.prototype.hasRedoStack=function(){return 0!=this.redoStack_.length};Blockly.Workspace.prototype.hasUndoStack=function(){return 0!=this.undoStack_.length};Blockly.Workspace.prototype.addChangeListener=function(a){this.listeners_.push(a);return a};Blockly.Workspace.prototype.removeChangeListener=function(a){Blockly.utils.arrayRemove(this.listeners_,a)};
|
|
@@ -669,7 +673,8 @@ Blockly.BubbleDragger.prototype.updateCursorDuringBubbleDrag_=function(){this.wo
|
|
|
669
673
|
Blockly.BubbleDragger.prototype.endBubbleDrag=function(a,b){this.dragBubble(a,b);a=this.pixelsToWorkspaceUnits_(b);a=Blockly.utils.Coordinate.sum(this.startXY_,a);this.draggingBubble_.moveTo(a.x,a.y);this.maybeDeleteBubble_()||(this.dragSurface_&&this.dragSurface_.clearAndHide(this.workspace_.getBubbleCanvas()),this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!1),this.fireMoveEvent_());this.workspace_.setResizesEnabled(!0);this.workspace_.getToolbox()&&(a=this.draggingBubble_.isDeletable()?
|
|
670
674
|
"blocklyToolboxDelete":"blocklyToolboxGrab",this.workspace_.getToolbox().removeStyle(a));Blockly.Events.setGroup(!1)};Blockly.BubbleDragger.prototype.fireMoveEvent_=function(){if(this.draggingBubble_.isComment){var a=new Blockly.Events.CommentMove(this.draggingBubble_);a.setOldCoordinate(this.startXY_);a.recordNew();Blockly.Events.fire(a)}};
|
|
671
675
|
Blockly.BubbleDragger.prototype.pixelsToWorkspaceUnits_=function(a){a=new Blockly.utils.Coordinate(a.x/this.workspace_.scale,a.y/this.workspace_.scale);this.workspace_.isMutator&&a.scale(1/this.workspace_.options.parentWorkspace.scale);return a};Blockly.BubbleDragger.prototype.moveToDragSurface_=function(){this.draggingBubble_.moveTo(0,0);this.dragSurface_.translateSurface(this.startXY_.x,this.startXY_.y);this.dragSurface_.setBlocksAndShow(this.draggingBubble_.getSvgRoot())};Blockly.WorkspaceDragger=function(a){this.workspace_=a;this.startScrollXY_=new Blockly.utils.Coordinate(a.scrollX,a.scrollY)};Blockly.WorkspaceDragger.prototype.dispose=function(){this.workspace_=null};Blockly.WorkspaceDragger.prototype.startDrag=function(){Blockly.selected&&Blockly.selected.unselect();this.workspace_.setupDragSurface()};Blockly.WorkspaceDragger.prototype.endDrag=function(a){this.drag(a);this.workspace_.resetDragSurface()};
|
|
672
|
-
Blockly.WorkspaceDragger.prototype.drag=function(a){a=Blockly.utils.Coordinate.sum(this.startScrollXY_,a);this.workspace_.scroll(a.x,a.y)};Blockly.FlyoutDragger=function(a){Blockly.FlyoutDragger.superClass_.constructor.call(this,a.getWorkspace());this.scrollbar_=a.scrollbar_;this.
|
|
676
|
+
Blockly.WorkspaceDragger.prototype.drag=function(a){a=Blockly.utils.Coordinate.sum(this.startScrollXY_,a);this.workspace_.scroll(a.x,a.y)};Blockly.FlyoutDragger=function(a){Blockly.FlyoutDragger.superClass_.constructor.call(this,a.getWorkspace());this.scrollbar_=a.scrollbar_;this.hasTwoScrolls=a.hasTwoScrolls;this.scrollbarPair_=a.scrollbarPair_;this.horizontalLayout_=a.horizontalLayout_};Blockly.utils.object.inherits(Blockly.FlyoutDragger,Blockly.WorkspaceDragger);
|
|
677
|
+
Blockly.FlyoutDragger.prototype.drag=function(a){a=Blockly.utils.Coordinate.sum(this.startScrollXY_,a);this.horizontalLayout_?this.scrollbar_.set(-a.x):this.hasTwoScrolls?this.scrollbarPair_.set(-a.x,-a.y):this.scrollbar_.set(-a.y)};Blockly.Action=function(a,b){this.name=a;this.desc=b};Blockly.navigation={};Blockly.navigation.loggingCallback=null;Blockly.navigation.STATE_FLYOUT=1;Blockly.navigation.STATE_WS=2;Blockly.navigation.STATE_TOOLBOX=3;Blockly.navigation.WS_MOVE_DISTANCE=40;Blockly.navigation.currentState_=Blockly.navigation.STATE_WS;
|
|
673
678
|
Blockly.navigation.actionNames={PREVIOUS:"previous",NEXT:"next",IN:"in",OUT:"out",INSERT:"insert",MARK:"mark",DISCONNECT:"disconnect",TOOLBOX:"toolbox",EXIT:"exit",TOGGLE_KEYBOARD_NAV:"toggle_keyboard_nav",MOVE_WS_CURSOR_UP:"move workspace cursor up",MOVE_WS_CURSOR_DOWN:"move workspace cursor down",MOVE_WS_CURSOR_LEFT:"move workspace cursor left",MOVE_WS_CURSOR_RIGHT:"move workspace cursor right"};Blockly.navigation.MARKER_NAME="local_marker_1";Blockly.navigation.getMarker=function(){return Blockly.getMainWorkspace().getMarker(Blockly.navigation.MARKER_NAME)};
|
|
674
679
|
Blockly.navigation.focusToolbox_=function(){var a=Blockly.getMainWorkspace().getToolbox();a&&(Blockly.navigation.currentState_=Blockly.navigation.STATE_TOOLBOX,Blockly.navigation.resetFlyout_(!1),Blockly.navigation.getMarker().getCurNode()||Blockly.navigation.markAtCursor_(),a.selectFirstCategory())};
|
|
675
680
|
Blockly.navigation.focusFlyout_=function(){Blockly.navigation.currentState_=Blockly.navigation.STATE_FLYOUT;var a=Blockly.getMainWorkspace();var b=a.getToolbox();a=b?b.flyout_:a.getFlyout();Blockly.navigation.getMarker().getCurNode()||Blockly.navigation.markAtCursor_();a&&a.getWorkspace()&&(a=a.getWorkspace().getTopBlocks(!0),0<a.length&&(a=a[0],a=Blockly.ASTNode.createStackNode(a),Blockly.navigation.getFlyoutCursor_().setCurNode(a)))};
|
|
@@ -715,7 +720,7 @@ Blockly.navigation.ACTION_MOVE_WS_CURSOR_DOWN=new Blockly.Action(Blockly.navigat
|
|
|
715
720
|
See LICENSE file for details.
|
|
716
721
|
*/
|
|
717
722
|
Blockly.pxtBlocklyUtils={};Blockly.pxtBlocklyUtils._duplicateOnDragWhitelist=null;Blockly.pxtBlocklyUtils.measureText=function(a,b,c,d){var e=document.createElement("canvas").getContext("2d");e.font=c+" "+a+" "+b;return e.measureText(d).width};
|
|
718
|
-
Blockly.pxtBlocklyUtils.isShadowArgumentReporter=function(a){return a.isShadow()&&("variables_get_reporter"===a.type||"argument_reporter_boolean"===a.type||"argument_reporter_number"===a.type||"argument_reporter_string"===a.type||"argument_reporter_custom"===a.type||Blockly.pxtBlocklyUtils._duplicateOnDragWhitelist&&-1!==Blockly.pxtBlocklyUtils._duplicateOnDragWhitelist.indexOf(a.type))};
|
|
723
|
+
Blockly.pxtBlocklyUtils.isShadowArgumentReporter=function(a){return a.isShadow()&&("variables_get_reporter"===a.type||"argument_reporter_boolean"===a.type||"argument_reporter_number"===a.type||"argument_reporter_string"===a.type||"argument_reporter_array"===a.type||"argument_reporter_custom"===a.type||Blockly.pxtBlocklyUtils._duplicateOnDragWhitelist&&-1!==Blockly.pxtBlocklyUtils._duplicateOnDragWhitelist.indexOf(a.type))};
|
|
719
724
|
Blockly.pxtBlocklyUtils.whitelistDraggableBlockTypes=function(a){Blockly.pxtBlocklyUtils._duplicateOnDragWhitelist=a.slice()};Blockly.pxtBlocklyUtils.hasMatchingArgumentReporter=function(a,b){for(var c=b.getFieldValue("VALUE"),d=b.getTypeName(),e=0;e<a.inputList.length;++e){var f=a.inputList[e];if(f.type==Blockly.INPUT_VALUE){var g=f.connection.targetBlock();if(g&&g.type==b.type&&(f=g.getFieldValue("VALUE"),g=g.getTypeName(),f==c&&d==g))return!0}}return!1};Blockly.Gesture=function(a,b){this.mouseDownXY_=null;this.currentDragDeltaXY_=new Blockly.utils.Coordinate(0,0);this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=this.startBubble_=null;this.creatorWorkspace_=b;this.isDraggingBubble_=this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1;this.mostRecentEvent_=a;this.flyout_=this.workspaceDragger_=this.blockDragger_=this.bubbleDragger_=this.onUpWrapper_=this.onMoveWrapper_=null;this.shouldDuplicateOnDrag_=
|
|
720
725
|
this.isEnding_=this.hasStarted_=this.calledUpdateIsDragging_=!1;this.healStack_=!Blockly.DRAG_STACK};Blockly.Gesture.prototype.dispose=function(){Blockly.Touch.clearTouchIdentifier();Blockly.Tooltip.unblock();this.creatorWorkspace_.clearGesture();this.onMoveWrapper_&&Blockly.unbindEvent_(this.onMoveWrapper_);this.onUpWrapper_&&Blockly.unbindEvent_(this.onUpWrapper_);this.blockDragger_&&this.blockDragger_.dispose();this.workspaceDragger_&&this.workspaceDragger_.dispose();this.bubbleDragger_&&this.bubbleDragger_.dispose()};
|
|
721
726
|
Blockly.Gesture.prototype.updateFromEvent_=function(a){var b=new Blockly.utils.Coordinate(a.clientX,a.clientY);this.updateDragDelta_(b)&&(this.updateIsDragging_(),Blockly.longStop_());this.mostRecentEvent_=a};
|
|
@@ -750,7 +755,7 @@ Blockly.Events.fire(new Blockly.Events.BlockCreate(a)),a.select(),this.targetBlo
|
|
|
750
755
|
Blockly.Field.prototype.sourceBlock_=null;Blockly.Field.prototype.isDirty_=!0;Blockly.Field.prototype.visible_=!0;Blockly.Field.prototype.argType_=null;Blockly.Field.prototype.clickTarget_=null;Blockly.Field.NBSP="\u00a0";Blockly.Field.IE_TEXT_OFFSET="0.3em";Blockly.Field.prototype.EDITABLE=!0;Blockly.Field.prototype.SERIALIZABLE=!1;Blockly.Field.prototype.configure_=function(a){var b=a.tooltip;"string"==typeof b&&(b=Blockly.utils.replaceMessageReferences(a.tooltip));b&&this.setTooltip(b)};
|
|
751
756
|
Blockly.Field.prototype.setSourceBlock=function(a){if(this.sourceBlock_)throw Error("Field already bound to a block.");this.sourceBlock_=a;a.workspace.rendered&&(this.constants_=a.workspace.getRenderer().getConstants())};Blockly.Field.prototype.getSourceBlock=function(){return this.sourceBlock_};
|
|
752
757
|
Blockly.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.dom.createSvgElement("g",{},null),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.setDataAttribute_(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())};Blockly.Field.prototype.initView=function(){this.createBorderRect_();this.createTextElement_()};
|
|
753
|
-
Blockly.Field.prototype.initModel=function(){};
|
|
758
|
+
Blockly.Field.prototype.initModel=function(){};Blockly.Field.prototype.onLoadedIntoWorkspace=function(){};
|
|
754
759
|
Blockly.Field.prototype.createBorderRect_=function(){this.size_.height=Math.max(this.size_.height,this.constants_.FIELD_BORDER_RECT_HEIGHT);this.size_.width=Math.max(this.size_.width,2*this.constants_.FIELD_BORDER_RECT_X_PADDING);this.borderRect_=Blockly.utils.dom.createSvgElement("rect",{rx:this.constants_.FIELD_BORDER_RECT_RADIUS,ry:this.constants_.FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)};
|
|
755
760
|
Blockly.Field.prototype.createTextElement_=function(){var a=this.borderRect_?this.constants_.FIELD_BORDER_RECT_X_PADDING:0,b=this.constants_.FIELD_TEXT_BASELINE_CENTER,c=this.constants_.FIELD_TEXT_BASELINE_Y;this.size_.height=Math.max(this.size_.height,b?this.constants_.FIELD_TEXT_HEIGHT:c);this.size_.height>this.constants_.FIELD_TEXT_HEIGHT&&(c+=(this.size_.height-c)/2);this.textElement_=Blockly.utils.dom.createSvgElement("text",{"class":"blocklyText",y:b?this.size_.height/2:c,dy:this.constants_.FIELD_TEXT_Y_OFFSET,
|
|
756
761
|
x:a},this.fieldGroup_);b&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)};Blockly.Field.prototype.setDataAttribute_=function(){null!==this.getArgTypes()&&(this.sourceBlock_.isShadow()?this.sourceBlock_.svgGroup_.setAttribute("data-argument-type",this.getArgTypes()):this.fieldGroup_.setAttribute("data-argument-type",this.getArgTypes()))};
|
|
@@ -834,10 +839,10 @@ Blockly.Block.prototype.getSurroundParent=function(){var a=this;do{var b=a;a=a.g
|
|
|
834
839
|
Blockly.Block.prototype.getFirstStatementConnection=function(){for(var a=0,b;b=this.inputList[a];a++)if(b.connection&&b.connection.type==Blockly.NEXT_STATEMENT)return b.connection;return null};Blockly.Block.prototype.getRootBlock=function(){var a=this;do{var b=a;a=b.parentBlock_}while(a);return b};Blockly.Block.prototype.getTopStackBlock=function(){var a=this;do var b=a.getPreviousBlock();while(b&&b.getNextBlock()==a&&(a=b));return a};
|
|
835
840
|
Blockly.Block.prototype.getChildren=function(a){if(!a)return this.childBlocks_;a=[];for(var b=0,c;c=this.inputList[b];b++)c.connection&&(c=c.connection.targetBlock())&&a.push(c);(b=this.getNextBlock())&&a.push(b);return a};
|
|
836
841
|
Blockly.Block.prototype.setParent=function(a){if(a!=this.parentBlock_){if(this.parentBlock_){Blockly.utils.arrayRemove(this.parentBlock_.childBlocks_,this);if(this.previousConnection&&this.previousConnection.isConnected())throw Error("Still connected to previous block.");if(this.outputConnection&&this.outputConnection.isConnected())throw Error("Still connected to parent block.");this.parentBlock_=null}else this.workspace.removeTopBlock(this);(this.parentBlock_=a)?a.childBlocks_.push(this):this.workspace.addTopBlock(this)}};
|
|
837
|
-
Blockly.Block.prototype.getDescendants=function(a,b){for(var c=[this],d=this.getChildren(a),e,f=0;e=d[f];f++)b&&e.isShadow()||c.push.apply(c,e.getDescendants(a));return c};Blockly.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.
|
|
838
|
-
Blockly.Block.prototype.isMovablePersisted=function(){return this.movable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setMovable=function(a){this.movable_=a};Blockly.Block.prototype.isDuplicatable=function(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(Blockly.utils.getBlockTypeCounts(this,!0)):!0};
|
|
839
|
-
Blockly.Block.prototype.setShadow=function(a){this.isShadow_=a};Blockly.Block.prototype.isInsertionMarker=function(){return this.isInsertionMarker_};Blockly.Block.prototype.setInsertionMarker=function(a){this.isInsertionMarker_!=a&&(this.isInsertionMarker_=a)&&(this.setColour(Blockly.Colours.insertionMarker),this.setOpacity(Blockly.Colours.insertionMarkerOpacity),Blockly.utils.dom.addClass(this.svgGroup_,"blocklyInsertionMarker"))};
|
|
840
|
-
Blockly.Block.prototype.isEditable=function(){return this.isEditablePersisted()&&!
|
|
842
|
+
Blockly.Block.prototype.getDescendants=function(a,b){for(var c=[this],d=this.getChildren(a),e,f=0;e=d[f];f++)b&&e.isShadow()||c.push.apply(c,e.getDescendants(a));return c};Blockly.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.inDebugWorkspace=function(){return!(!this.workspace||!this.workspace.options.debugMode)};Blockly.Block.prototype.setDeletable=function(a){this.deletable_=a};
|
|
843
|
+
Blockly.Block.prototype.isMovable=function(){return this.isMovablePersisted()&&!this.inDebugWorkspace()};Blockly.Block.prototype.isMovablePersisted=function(){return this.movable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setMovable=function(a){this.movable_=a};Blockly.Block.prototype.isDuplicatable=function(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(Blockly.utils.getBlockTypeCounts(this,!0)):!0};
|
|
844
|
+
Blockly.Block.prototype.isShadow=function(){return this.isShadow_};Blockly.Block.prototype.setShadow=function(a){this.isShadow_=a};Blockly.Block.prototype.isInsertionMarker=function(){return this.isInsertionMarker_};Blockly.Block.prototype.setInsertionMarker=function(a){this.isInsertionMarker_!=a&&(this.isInsertionMarker_=a)&&(this.setColour(Blockly.Colours.insertionMarker),this.setOpacity(Blockly.Colours.insertionMarkerOpacity),Blockly.utils.dom.addClass(this.svgGroup_,"blocklyInsertionMarker"))};
|
|
845
|
+
Blockly.Block.prototype.isEditable=function(){return this.isEditablePersisted()&&!this.inDebugWorkspace()};Blockly.Block.prototype.isEditablePersisted=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setEditable=function(a){this.editable_=a;a=0;for(var b;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)d.updateEditable()};Blockly.Block.prototype.isDisposed=function(){return this.disposed};
|
|
841
846
|
Blockly.Block.prototype.getMatchingConnection=function(a,b){var c=this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!=a.length)throw Error("Connection lists did not match in length.");for(var d=0;d<a.length;d++)if(a[d]==b)return c[d];return null};Blockly.Block.prototype.setHelpUrl=function(a){this.helpUrl=a};Blockly.Block.prototype.setTooltip=function(a){this.tooltip=a};Blockly.Block.prototype.getColour=function(){return this.colour_};Blockly.Block.prototype.getStyleName=function(){return this.styleName_};
|
|
842
847
|
Blockly.Block.prototype.getHue=function(){return this.hue_};Blockly.Block.prototype.setColour=function(a){a=Blockly.utils.parseBlockColour(a);this.hue_=a.hue;this.colour_=a.hex};Blockly.Block.prototype.setStyle=function(a){this.styleName_=a};Blockly.Block.prototype.setOnChange=function(a){if(a&&"function"!=typeof a)throw Error("onchange must be a function.");this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_);if(this.onchange=a)this.onchangeWrapper_=a.bind(this),this.workspace.addChangeListener(this.onchangeWrapper_)};
|
|
843
848
|
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.referencesVariables()&&a.push(e.getValue());return a};
|
|
@@ -870,7 +875,8 @@ Blockly.Block.prototype.setCommentText=function(a){this.commentModel.text!=a&&(B
|
|
|
870
875
|
Blockly.Block.prototype.enableBreakpoint=function(a){var b=!1;a?(this.breakpoint||(this.breakpoint=new Blockly.Breakpoint(this),b=!0),this.breakpoint.setVisible(this.isBreakpointSet())):this.breakpoint&&(this.breakpoint.dispose(),b=!0);b&&Blockly.Events.fire(new Blockly.Events.BlockChange(this,"breakpoint",null,!a,a))};Blockly.Block.prototype.isBreakpointSet=function(){return this.breakpointSet_||!1};Blockly.Block.prototype.setBreakpoint=function(a){this.breakpointSet_=a};
|
|
871
876
|
Blockly.Block.prototype.setOutputShape=function(a){this.outputShape_=a};Blockly.Block.prototype.getOutputShape=function(){return this.outputShape_||Blockly.OUTPUT_SHAPE_ROUND};Blockly.Block.prototype.setCategory=function(a){this.category_=a};Blockly.Block.prototype.getCategory=function(){return this.category_};Blockly.Block.prototype.setWarningText=function(a,b){};Blockly.Block.prototype.setMutator=function(a){};Blockly.Block.prototype.getRelativeToSurfaceXY=function(){return this.xy_};
|
|
872
877
|
Blockly.Block.prototype.moveBy=function(a,b){if(this.parentBlock_)throw Error("Block has parent.");var c=new Blockly.Events.BlockMove(this);this.xy_.translate(a,b);c.recordNew();Blockly.Events.fire(c)};Blockly.Block.prototype.makeConnection_=function(a){return new Blockly.Connection(this,a)};
|
|
873
|
-
Blockly.Block.prototype.allInputsFilled=function(a){void 0===a&&(a=!0);if(!a&&this.isShadow())return!1;for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&(c=c.connection.targetBlock(),!c||!c.allInputsFilled(a)))return!1;return(b=this.getNextBlock())?b.allInputsFilled(a):!0};Blockly.Block.prototype.toDevString=function(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a};
|
|
878
|
+
Blockly.Block.prototype.allInputsFilled=function(a){void 0===a&&(a=!0);if(!a&&this.isShadow())return!1;for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&(c=c.connection.targetBlock(),!c||!c.allInputsFilled(a)))return!1;return(b=this.getNextBlock())?b.allInputsFilled(a):!0};Blockly.Block.prototype.toDevString=function(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a};
|
|
879
|
+
Blockly.Block.prototype.onLoadedIntoWorkspace=function(){for(var a=0,b;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)if(d.onLoadedIntoWorkspace)d.onLoadedIntoWorkspace()};Blockly.blockRendering={};Blockly.blockRendering.IPathObject=function(a,b){};Blockly.utils.aria={};Blockly.utils.aria.ARIA_PREFIX_="aria-";Blockly.utils.aria.ROLE_ATTRIBUTE_="role";Blockly.utils.aria.Role={GRID:"grid",GRIDCELL:"gridcell",GROUP:"group",LISTBOX:"listbox",MENU:"menu",MENUITEM:"menuitem",MENUITEMCHECKBOX:"menuitemcheckbox",OPTION:"option",PRESENTATION:"presentation",ROW:"row",TREE:"tree",TREEITEM:"treeitem",SEPARATOR:"separator"};
|
|
874
880
|
Blockly.utils.aria.State={ACTIVEDESCENDANT:"activedescendant",COLCOUNT:"colcount",EXPANDED:"expanded",INVALID:"invalid",LABEL:"label",LABELLEDBY:"labelledby",LEVEL:"level",ORIENTATION:"orientation",POSINSET:"posinset",ROWCOUNT:"rowcount",SELECTED:"selected",SETSIZE:"setsize",VALUEMAX:"valuemax",VALUEMIN:"valuemin",DISABLED:"disabled"};Blockly.utils.aria.setRole=function(a,b){a.setAttribute(Blockly.utils.aria.ROLE_ATTRIBUTE_,b)};
|
|
875
881
|
Blockly.utils.aria.setState=function(a,b,c){Array.isArray(c)&&(c=c.join(" "));a.setAttribute(Blockly.utils.aria.ARIA_PREFIX_+b,c)};Blockly.Menu=function(){Blockly.Component.call(this);this.openingCoords=null;this.highlightedIndex_=-1;this.onKeyDownWrapper_=this.mouseLeaveHandler_=this.mouseEnterHandler_=this.clickHandler_=this.mouseOverHandler_=null};Blockly.utils.object.inherits(Blockly.Menu,Blockly.Component);
|
|
876
882
|
Blockly.Menu.prototype.createDom=function(){var a=document.createElement("div");a.id=this.getId();this.setElementInternal(a);a.className="goog-menu goog-menu-vertical blocklyNonSelectable";a.tabIndex=0;Blockly.utils.aria.setRole(a,this.roleName_||Blockly.utils.aria.Role.MENU)};Blockly.Menu.prototype.focus=function(){var a=this.getElement();a&&(a.focus({preventScroll:!0}),Blockly.utils.dom.addClass(a,"focused"))};
|
|
@@ -1486,10 +1492,11 @@ Blockly.ContextMenu.populate_=function(a,b){var c=new Blockly.Menu;c.setRightToL
|
|
|
1486
1492
|
Blockly.ContextMenu.position_=function(a,b,c){var d=Blockly.utils.getViewportBBox();b={top:b.clientY+d.top,bottom:b.clientY+d.top,left:b.clientX+d.left,right:b.clientX+d.left};Blockly.ContextMenu.createWidget_(a);var e=Blockly.utils.uiMenu.getSize(a);c&&Blockly.utils.uiMenu.adjustBBoxesForRTL(d,b,e);Blockly.WidgetDiv.positionWithAnchor(d,b,e,c);a.getElement().focus()};
|
|
1487
1493
|
Blockly.ContextMenu.createWidget_=function(a){a.render(Blockly.WidgetDiv.DIV);var b=a.getElement();Blockly.utils.dom.addClass(b,"blocklyContextMenu");Blockly.bindEventWithChecks_(b,"contextmenu",null,Blockly.utils.noEvent);a.focus()};Blockly.ContextMenu.hide=function(){Blockly.WidgetDiv.hideIfOwner(Blockly.ContextMenu);Blockly.ContextMenu.currentBlock=null;Blockly.ContextMenu.eventWrapper_&&(Blockly.unbindEvent_(Blockly.ContextMenu.eventWrapper_),Blockly.ContextMenu.eventWrapper_=null)};
|
|
1488
1494
|
Blockly.ContextMenu.callbackFactory=function(a,b){return function(){Blockly.Events.disable();try{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)}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!c.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(c));c.select()}};
|
|
1489
|
-
Blockly.ContextMenu.blockDeleteOption=function(a){var b=a.getDescendants(!1,!0).length,c=a.getNextBlock();c&&(b-=c.getDescendants(!1,!0).length);return{text:1==b?Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(b)),enabled:!
|
|
1490
|
-
Blockly.ContextMenu.
|
|
1491
|
-
Blockly.ContextMenu.
|
|
1492
|
-
Blockly.ContextMenu.
|
|
1495
|
+
Blockly.ContextMenu.blockDeleteOption=function(a){var b=a.getDescendants(!1,!0).length,c=a.getNextBlock();c&&(b-=c.getDescendants(!1,!0).length);return{text:1==b?Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(b)),enabled:!a.inDebugWorkspace(),callback:function(){Blockly.Events.setGroup(!0);a.dispose(!0,!0);Blockly.Events.setGroup(!1)}}};
|
|
1496
|
+
Blockly.ContextMenu.blockHelpOption=function(a){return{enabled:!("function"==typeof a.helpUrl?!a.helpUrl():!a.helpUrl),text:Blockly.Msg.HELP,callback:function(){a.showHelp()}}};Blockly.ContextMenu.blockDuplicateOption=function(a){var b=a.isDuplicatable()&&!a.inDebugWorkspace();return{text:Blockly.Msg.DUPLICATE_BLOCK,enabled:b,callback:function(){Blockly.duplicate(a)}}};
|
|
1497
|
+
Blockly.ContextMenu.blockCommentOption=function(a){var b={enabled:!Blockly.utils.userAgent.IE&&!a.inDebugWorkspace()};a.getCommentIcon()?(b.text=Blockly.Msg.REMOVE_COMMENT,b.callback=function(){a.setCommentText(null)}):(b.text=Blockly.Msg.ADD_COMMENT,b.callback=function(){a.setCommentText("");a.comment.setVisible(!0)});return b};
|
|
1498
|
+
Blockly.ContextMenu.commentDeleteOption=function(a){return{text:Blockly.Msg.REMOVE_COMMENT,enabled:!a.workspace.options.debugMode,callback:function(){Blockly.Events.setGroup(!0);a.dispose(!0,!0);Blockly.Events.setGroup(!1)}}};Blockly.ContextMenu.commentDuplicateOption=function(a){return{text:Blockly.Msg.DUPLICATE_COMMENT,enabled:!a.workspace.options.debugMode,callback:function(){Blockly.duplicate(a)}}};
|
|
1499
|
+
Blockly.ContextMenu.workspaceCommentOption=function(a,b){if(!Blockly.WorkspaceCommentSvg)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var c={enabled:!Blockly.utils.userAgent.IE&&!a.options.debugMode};c.text=Blockly.Msg.ADD_COMMENT;c.callback=function(){var c=new Blockly.WorkspaceCommentSvg(a,Blockly.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT,Blockly.WorkspaceCommentSvg.DEFAULT_SIZE,Blockly.WorkspaceCommentSvg.DEFAULT_SIZE),e=a.getInjectionDiv().getBoundingClientRect();e=new Blockly.utils.Coordinate(b.clientX-
|
|
1493
1500
|
e.left,b.clientY-e.top);var f=a.getOriginOffsetInPixels();e=Blockly.utils.Coordinate.difference(e,f);e.scale(1/a.scale);c.moveBy(e.x,e.y);a.rendered&&(c.initSvg(),c.render(),c.select())};return c};Blockly.RenderedConnection=function(a,b){Blockly.RenderedConnection.superClass_.constructor.call(this,a,b);this.db_=a.workspace.connectionDBList[b];this.dbOpposite_=a.workspace.connectionDBList[Blockly.OPPOSITE_TYPE[b]];this.offsetInBlock_=new Blockly.utils.Coordinate(0,0);this.trackedState_=Blockly.RenderedConnection.TrackedState.WILL_TRACK};Blockly.utils.object.inherits(Blockly.RenderedConnection,Blockly.Connection);Blockly.RenderedConnection.TrackedState={WILL_TRACK:-1,UNTRACKED:0,TRACKED:1};
|
|
1494
1501
|
Blockly.RenderedConnection.prototype.dispose=function(){Blockly.RenderedConnection.superClass_.dispose.call(this);this.trackedState_==Blockly.RenderedConnection.TrackedState.TRACKED&&this.db_.removeConnection(this,this.y)};Blockly.RenderedConnection.prototype.getSourceBlock=function(){return Blockly.RenderedConnection.superClass_.getSourceBlock.call(this)};Blockly.RenderedConnection.prototype.targetBlock=function(){return Blockly.RenderedConnection.superClass_.targetBlock.call(this)};
|
|
1495
1502
|
Blockly.RenderedConnection.prototype.distanceFrom=function(a){var b=this.x-a.x;a=this.y-a.y;return Math.sqrt(b*b+a*a)};
|
|
@@ -1536,8 +1543,8 @@ d=this.getDescendants(!0);if(c=this.getNextBlock())c=d.indexOf(c),d.splice(c,d.l
|
|
|
1536
1543
|
if(this.rendered)for(c=0;f=b[c];c++)f.render()}};Blockly.BlockSvg.prototype.tab=function(a,b){var c=new Blockly.TabNavigateCursor;c.setCurNode(Blockly.ASTNode.createFieldNode(a));a=c.getCurNode();c.onBlocklyAction(b?Blockly.navigation.ACTION_NEXT:Blockly.navigation.ACTION_PREVIOUS);(b=c.getCurNode())&&b!==a&&b.getLocation().showEditor()};Blockly.BlockSvg.prototype.onMouseDown_=function(a){var b=this.workspace&&this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)};
|
|
1537
1544
|
Blockly.BlockSvg.prototype.showHelp=function(){var a="function"==typeof this.helpUrl?this.helpUrl():this.helpUrl;a&&alert(a)};
|
|
1538
1545
|
Blockly.BlockSvg.prototype.generateContextMenu=function(){if(this.workspace.options.readOnly||!this.contextMenu)return null;var a=this,b=[],c=null==a.previousConnection&&null==a.outputConnection;if(!this.isInFlyout){this.isDeletable()&&this.isMovable()&&b.push(Blockly.ContextMenu.blockDuplicateOption(a));this.workspace.options.comments&&!this.collapsed_&&this.isEditable()&&!Blockly.pxtBlocklyUtils.isShadowArgumentReporter(a)&&b.push(Blockly.ContextMenu.blockCommentOption(a));if(this.isMovable())if(this.collapsed_)this.workspace.options.collapse&&
|
|
1539
|
-
c&&(c={enabled:!
|
|
1540
|
-
c.text=Blockly.Msg.COLLAPSE_BLOCK,c.callback=function(){a.setCollapsed(!0)},b.push(c))}this.workspace.options.disable&&this.isEditable()&&(c={text:this.isEnabled()?Blockly.Msg.DISABLE_BLOCK:Blockly.Msg.ENABLE_BLOCK,enabled:!this.getInheritedDisabled(),callback:function(){var b=Blockly.Events.getGroup();b||Blockly.Events.setGroup(!0);a.setEnabled(!a.isEnabled());b||Blockly.Events.setGroup(!1)}},b.push(c));this.isDeletable()&&b.push(Blockly.ContextMenu.blockDeleteOption(a))}b.push(Blockly.ContextMenu.blockHelpOption(a));
|
|
1546
|
+
c&&(c={enabled:!this.inDebugWorkspace()},c.text=Blockly.Msg.EXPAND_BLOCK,c.callback=function(){a.setCollapsed(!1)},b.push(c));else{if(this.workspace.options.inline)for(var d=1;d<this.inputList.length;d++)if(this.inputList[d-1].type!=Blockly.NEXT_STATEMENT&&this.inputList[d].type!=Blockly.NEXT_STATEMENT){d={enabled:!this.inDebugWorkspace()};var e=this.getInputsInline();d.text=e?Blockly.Msg.EXTERNAL_INPUTS:Blockly.Msg.INLINE_INPUTS;d.callback=function(){a.setInputsInline(!e)};b.push(d);break}this.workspace.options.collapse&&
|
|
1547
|
+
c&&(c={enabled:!this.inDebugWorkspace()},c.text=Blockly.Msg.COLLAPSE_BLOCK,c.callback=function(){a.setCollapsed(!0)},b.push(c))}this.workspace.options.disable&&this.isEditable()&&(c={text:this.isEnabled()?Blockly.Msg.DISABLE_BLOCK:Blockly.Msg.ENABLE_BLOCK,enabled:!this.getInheritedDisabled()&&!this.inDebugWorkspace(),callback:function(){var b=Blockly.Events.getGroup();b||Blockly.Events.setGroup(!0);a.setEnabled(!a.isEnabled());b||Blockly.Events.setGroup(!1)}},b.push(c));this.isDeletable()&&b.push(Blockly.ContextMenu.blockDeleteOption(a))}b.push(Blockly.ContextMenu.blockHelpOption(a));
|
|
1541
1548
|
this.customContextMenu&&this.customContextMenu(b);return b};Blockly.BlockSvg.prototype.showContextMenu=function(a){if(this.parentBlock_&&this.isShadow_&&!Blockly.pxtBlocklyUtils.isShadowArgumentReporter(this))this.parentBlock_.showContextMenu_(a);else{var b=this.generateContextMenu();b&&b.length&&(Blockly.ContextMenu.show(a,b,this.RTL),Blockly.ContextMenu.currentBlock=this)}};
|
|
1542
1549
|
Blockly.BlockSvg.prototype.moveConnections=function(a,b){if(this.rendered){for(var c=this.getConnections_(!1),d=0;d<c.length;d++)c[d].moveBy(a,b);c=this.getIcons();for(d=0;d<c.length;d++)c[d].computeIconLocation();for(d=0;d<this.childBlocks_.length;d++)this.childBlocks_[d].moveConnections(a,b);Blockly.WidgetDiv.repositionForWindowResize();Blockly.DropDownDiv.repositionForWindowResize()}};
|
|
1543
1550
|
Blockly.BlockSvg.prototype.setDragging=function(a){if(a){var b=this.getSvgRoot();b.translate_="";b.skew_="";Blockly.draggingConnections=Blockly.draggingConnections.concat(this.getConnections_(!0));Blockly.utils.dom.addClass(this.svgGroup_,"blocklyDragging")}else Blockly.draggingConnections=[],Blockly.utils.dom.removeClass(this.svgGroup_,"blocklyDragging");for(b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)};
|
|
@@ -1633,7 +1640,7 @@ Blockly.WorkspaceSvg.prototype.createDom=function(a){this.svgGroup_=Blockly.util
|
|
|
1633
1640
|
this.recordDeleteAreas();this.markerManager_.setCursor(new Blockly.Cursor);this.markerManager_.registerMarker(Blockly.navigation.MARKER_NAME,new Blockly.Marker);a=this.getRenderer().getConstants();a.injectCSS(this.getRenderer().name);a.createDom(this.svgGroup_);return this.svgGroup_};
|
|
1634
1641
|
Blockly.WorkspaceSvg.prototype.dispose=function(){this.rendered=!1;this.currentGesture_&&this.currentGesture_.cancel();this.svgGroup_&&(Blockly.utils.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.svgBubbleCanvas_=this.svgBlockCanvas_=null;this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null);this.flyout_&&(this.flyout_.dispose(),this.flyout_=null);this.trashcan&&(this.trashcan.dispose(),this.trashcan=null);this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null);this.zoomControls_&&
|
|
1635
1642
|
(this.zoomControls_.dispose(),this.zoomControls_=null);this.audioManager_&&(this.audioManager_.dispose(),this.audioManager_=null);this.grid_&&(this.grid_.dispose(),this.grid_=null);this.renderer_.getConstants().dispose();this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||(this.themeManager_.dispose(),this.themeManager_=null));this.markerManager_&&(this.markerManager_.dispose(),this.markerManager_=null);
|
|
1636
|
-
Blockly.WorkspaceSvg.superClass_.dispose.call(this);this.flyoutButtonCallbacks_=this.toolboxCategoryCallbacks_=this.connectionDBList=null;if(!this.options.parentWorkspace){var a=this.getParentSvg().parentNode;a&&Blockly.utils.dom.removeNode(a)}this.resizeHandlerWrapper_&&(Blockly.unbindEvent_(this.resizeHandlerWrapper_),this.resizeHandlerWrapper_=null)};Blockly.WorkspaceSvg.prototype.newBlock=function(a,b){
|
|
1643
|
+
Blockly.WorkspaceSvg.superClass_.dispose.call(this);this.flyoutButtonCallbacks_=this.toolboxCategoryCallbacks_=this.connectionDBList=null;if(!this.options.parentWorkspace){var a=this.getParentSvg().parentNode;a&&Blockly.utils.dom.removeNode(a)}this.resizeHandlerWrapper_&&(Blockly.unbindEvent_(this.resizeHandlerWrapper_),this.resizeHandlerWrapper_=null)};Blockly.WorkspaceSvg.prototype.newBlock=function(a,b){a=new Blockly.BlockSvg(this,a,b);if(!this.loadingEventsDisabled)a.onLoadedIntoWorkspace();return a};
|
|
1637
1644
|
Blockly.WorkspaceSvg.prototype.addTrashcan=function(){if(!Blockly.Trashcan)throw Error("Missing require for Blockly.Trashcan");this.trashcan=new Blockly.Trashcan(this);var a=this.trashcan.createDom();this.svgGroup_.insertBefore(a,this.svgBlockCanvas_)};Blockly.WorkspaceSvg.prototype.addZoomControls=function(){if(!Blockly.ZoomControls)throw Error("Missing require for Blockly.ZoomControls");this.zoomControls_=new Blockly.ZoomControls(this);var a=this.zoomControls_.createDom();this.svgGroup_.appendChild(a)};
|
|
1638
1645
|
Blockly.WorkspaceSvg.prototype.addFlyout=function(a){var b={parentWorkspace:this,RTL:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,toolboxPosition:this.options.toolboxPosition,renderer:this.options.renderer};if(this.horizontalLayout){if(!Blockly.HorizontalFlyout)throw Error("Missing require for Blockly.HorizontalFlyout");this.flyout_=new Blockly.HorizontalFlyout(b)}else{if(!Blockly.VerticalFlyout)throw Error("Missing require for Blockly.VerticalFlyout");
|
|
1639
1646
|
this.flyout_=new Blockly.VerticalFlyout(b)}this.flyout_.autoClose=!1;return this.flyout_.createDom(a)};Blockly.WorkspaceSvg.prototype.getFlyout=function(a){return this.flyout_||a?this.flyout_:this.toolbox_?this.toolbox_.getFlyout():null};Blockly.WorkspaceSvg.prototype.getToolbox=function(){return this.toolbox_};Blockly.WorkspaceSvg.prototype.updateScreenCalculations_=function(){this.updateInverseScreenCTM();this.recordDeleteAreas()};
|
|
@@ -1663,9 +1670,9 @@ this.zoom(b.x,b.y,d));a.ctrlKey||a.metaKey?(d=-a.deltaY/50,b=Blockly.utils.mouse
|
|
|
1663
1670
|
Blockly.WorkspaceSvg.prototype.getBlocksBoundingBox=function(){var a=this.getTopBlocks(!1),b=this.getTopComments(!1);a=a.concat(b);if(!a.length)return new Blockly.utils.Rect(0,0,0,0);b=a[0].getBoundingRectangle();for(var c=1;c<a.length;c++){var d=a[c].getBoundingRectangle();d.top<b.top&&(b.top=d.top);d.bottom>b.bottom&&(b.bottom=d.bottom);d.left<b.left&&(b.left=d.left);d.right>b.right&&(b.right=d.right)}return b};
|
|
1664
1671
|
Blockly.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1);Blockly.Events.setGroup(!0);for(var a=this.getTopBlocks(!0),b=0,c=0,d;d=a[c];c++)if(d.isMovable()){var e=d.getRelativeToSurfaceXY();d.moveBy(-e.x,b-e.y);d.snapToGrid();b=d.getRelativeToSurfaceXY().y+d.getHeightWidth().height+this.renderer_.getConstants().MIN_BLOCK_HEIGHT}Blockly.Events.setGroup(!1);this.setResizesEnabled(!0)};
|
|
1665
1672
|
Blockly.WorkspaceSvg.prototype.showContextMenu=function(a){function b(){Blockly.Events.setGroup(e);var a=n.shift();a&&(a.workspace?(a.dispose(!1,!0),setTimeout(b,q)):b());Blockly.Events.setGroup(!1)}if(!this.options.readOnly&&!this.isFlyout){var c=[],d=this.getTopBlocks(!0),e=Blockly.utils.genUid(),f=this,g={};g.text=Blockly.Msg.UNDO;g.enabled=0<this.undoStack_.length;g.callback=this.undo.bind(this,!1);c.push(g);g={};g.text=Blockly.Msg.REDO;g.enabled=0<this.redoStack_.length;g.callback=this.undo.bind(this,
|
|
1666
|
-
!0);c.push(g);this.options.comments&&c.push(Blockly.ContextMenu.workspaceCommentOption(f,a));this.isMovable()&&(g={},g.text=Blockly.Msg.CLEAN_UP,g.enabled=1<d.length,g.callback=this.cleanUp.bind(this),c.push(g));if(this.options.collapse){for(var h=g=!1,k=0;k<d.length;k++)for(var l=d[k];l;)l.isCollapsed()?g=!0:h=!0,l=l.getNextBlock();var m=function(a){for(var b=0,c=0;c<d.length;c++)for(var e=d[c];e;)setTimeout(e.setCollapsed.bind(e,a),b),e=e.getNextBlock(),b+=q};h={enabled:h
|
|
1667
|
-
h.callback=function(){m(!0)};c.push(h);g={enabled:g};g.text=Blockly.Msg.EXPAND_ALL;g.callback=function(){m(!1)};c.push(g)}var n=Blockly.WorkspaceSvg.buildDeleteList_(d),p=0;for(k=0;k<n.length;k++)n[k].isShadow()||p++;var q=10;g={text:1==n.length?Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(n.length)),enabled:0<n.length,callback:function(){f.currentGesture_&&f.currentGesture_.cancel();2>p?
|
|
1668
|
-
b()})}};c.push(g);this.configureContextMenu&&this.configureContextMenu(c,a);Blockly.ContextMenu.show(a,c,this.RTL)}};Blockly.WorkspaceSvg.buildDeleteList_=function(a){function b(a){if(a.isDeletable())c=c.concat(a.getDescendants());else{a=a.getChildren();for(var d=0;d<a.length;d++)b(a[d])}}for(var c=[],d=0;d<a.length;d++)b(a[d]);return c};
|
|
1673
|
+
!0);c.push(g);this.options.comments&&c.push(Blockly.ContextMenu.workspaceCommentOption(f,a));this.isMovable()&&(g={},g.text=Blockly.Msg.CLEAN_UP,g.enabled=1<d.length,g.callback=this.cleanUp.bind(this),c.push(g));if(this.options.collapse){for(var h=g=!1,k=0;k<d.length;k++)for(var l=d[k];l;)l.isCollapsed()?g=!0:h=!0,l=l.getNextBlock();var m=function(a){for(var b=0,c=0;c<d.length;c++)for(var e=d[c];e;)setTimeout(e.setCollapsed.bind(e,a),b),e=e.getNextBlock(),b+=q};h={enabled:h&&!this.options.debugMode};
|
|
1674
|
+
h.text=Blockly.Msg.COLLAPSE_ALL;h.callback=function(){m(!0)};c.push(h);g={enabled:g&&!this.options.debugMode};g.text=Blockly.Msg.EXPAND_ALL;g.callback=function(){m(!1)};c.push(g)}var n=Blockly.WorkspaceSvg.buildDeleteList_(d),p=0;for(k=0;k<n.length;k++)n[k].isShadow()||p++;var q=10;g={text:1==n.length?Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(n.length)),enabled:0<n.length&&!this.options.debugMode,callback:function(){f.currentGesture_&&f.currentGesture_.cancel();2>p?
|
|
1675
|
+
b():Blockly.confirm(Blockly.Msg.DELETE_ALL_BLOCKS.replace("%1",n.length),function(a){a&&b()})}};c.push(g);this.configureContextMenu&&this.configureContextMenu(c,a);Blockly.ContextMenu.show(a,c,this.RTL)}};Blockly.WorkspaceSvg.buildDeleteList_=function(a){function b(a){if(a.isDeletable())c=c.concat(a.getDescendants());else{a=a.getChildren();for(var d=0;d<a.length;d++)b(a[d])}}for(var c=[],d=0;d<a.length;d++)b(a[d]);return c};
|
|
1669
1676
|
Blockly.WorkspaceSvg.prototype.updateToolbox=function(a){if(a=Blockly.Options.parseToolboxTree(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(a.getElementsByTagName("category").length){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox_.renderTree(a)}else{if(!this.flyout_)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=
|
|
1670
1677
|
a;this.flyout_.show(a.childNodes)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");};Blockly.WorkspaceSvg.prototype.markFocused=function(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(Blockly.mainWorkspace=this,this.setBrowserFocus())};Blockly.WorkspaceSvg.prototype.setBrowserFocus=function(){document.activeElement&&document.activeElement.blur&&document.activeElement.blur();try{this.getParentSvg().focus({preventScroll:!0})}catch(a){try{this.getParentSvg().parentNode.setActive()}catch(b){this.getParentSvg().parentNode.focus({preventScroll:!0})}}};
|
|
1671
1678
|
Blockly.WorkspaceSvg.prototype.zoom=function(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);var d=this.scale*c;if(this.scale!=d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale:d<this.options.zoomOptions.minScale&&(c=this.options.zoomOptions.minScale/this.scale);var e=this.getCanvas().getCTM(),f=this.getParentSvg().createSVGPoint();f.x=a;f.y=b;f=f.matrixTransform(e.inverse());a=f.x;b=f.y;e=e.translate(a*(1-c),b*(1-c)).scale(c);this.scrollX=e.e;this.scrollY=
|
|
@@ -1699,9 +1706,9 @@ e.addZoomControls();e.getThemeManager().subscribe(a,"workspaceBackgroundColour",
|
|
|
1699
1706
|
c.left,b.contentTop=c.top,b.contentRight=c.right,b.contentBottom=c.bottom):(b.contentLeft=c.contentLeft/d,b.contentTop=c.contentTop/d,b.contentRight=(c.contentLeft+c.contentWidth)/d,b.contentBottom=(c.contentTop+c.contentHeight)/d);if(b.contentTop<b.viewTop||b.contentBottom>b.viewBottom||b.contentLeft<b.viewLeft||b.contentRight>b.viewRight){c=null;a&&(c=Blockly.Events.getGroup(),Blockly.Events.setGroup(a.group));switch(a.type){case Blockly.Events.BLOCK_CREATE:case Blockly.Events.BLOCK_MOVE:var f=
|
|
1700
1707
|
e.getBlockById(a.blockId);f&&(f=f.getRootBlock());break;case Blockly.Events.COMMENT_CREATE:case Blockly.Events.COMMENT_MOVE:f=e.getCommentById(a.commentId)}if(f){d=f.getBoundingRectangle();d.height=d.bottom-d.top;d.width=d.right-d.left;var m=b.viewTop,n=b.viewBottom-d.height;n=Math.max(m,n);m=Blockly.utils.math.clamp(m,d.top,n)-d.top;n=b.viewLeft;var p=b.viewRight-d.width;b.RTL?n=Math.min(p,n):p=Math.max(n,p);b=Blockly.utils.math.clamp(n,d.left,p)-d.left;f.moveBy(b,m)}a&&(!a.group&&f&&console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),
|
|
1701
1708
|
null!==c&&Blockly.Events.setGroup(c))}}});Blockly.svgResize(e);Blockly.WidgetDiv.createDom();Blockly.DropDownDiv.createDom();Blockly.Tooltip.createDom();return e};
|
|
1702
|
-
Blockly.init_=function(a){var b=a.options,c=a.getParentSvg();Blockly.bindEventWithChecks_(c.parentNode,"contextmenu",null,function(a){Blockly.utils.isTargetInput(a)||a.preventDefault()});c=Blockly.bindEventWithChecks_(window,"resize",null,function(){Blockly.hideChaffOnResize(!0);Blockly.svgResize(a)});a.setResizeHandlerWrapper(c);Blockly.inject.bindDocumentEvents_();if(b.languageTree){c=a.getToolbox();var d=a.getFlyout(!0);c?c.init():d&&(d.init(a),d.show(b.languageTree.childNodes),
|
|
1703
|
-
b.horizontalLayout?(a.scrollY=d.height_,b.toolboxPosition==Blockly.TOOLBOX_AT_BOTTOM&&(a.scrollY*=-1)):(a.scrollX=d.width_,b.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT&&(a.scrollX*=-1)),a.translate(a.scrollX,a.scrollY))}c=Blockly.Scrollbar.scrollbarThickness;b.hasTrashcan&&(c=a.trashcan.init(c));b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init(c);b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=new Blockly.ScrollbarPair(a),a.scrollbar.resize()):
|
|
1704
|
-
Blockly.inject.loadSounds_(b.pathToMedia,a)};
|
|
1709
|
+
Blockly.init_=function(a){var b=a.options,c=a.getParentSvg();Blockly.bindEventWithChecks_(c.parentNode,"contextmenu",null,function(a){Blockly.utils.isTargetInput(a)||a.preventDefault()});c=Blockly.bindEventWithChecks_(window,"resize",null,function(){Blockly.utils.resizeTracker(a);Blockly.hideChaffOnResize(!0);Blockly.svgResize(a)});a.setResizeHandlerWrapper(c);Blockly.inject.bindDocumentEvents_();if(b.languageTree){c=a.getToolbox();var d=a.getFlyout(!0);c?c.init():d&&(d.init(a),d.show(b.languageTree.childNodes),
|
|
1710
|
+
d.scrollToStart(),b.horizontalLayout?(a.scrollY=d.height_,b.toolboxPosition==Blockly.TOOLBOX_AT_BOTTOM&&(a.scrollY*=-1)):(a.scrollX=d.width_,b.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT&&(a.scrollX*=-1)),a.translate(a.scrollX,a.scrollY))}c=Blockly.Scrollbar.scrollbarThickness;b.hasTrashcan&&(c=a.trashcan.init(c));b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init(c);b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=new Blockly.ScrollbarPair(a,!0,"blocklyMainWorkspaceScrollbar"),a.scrollbar.resize()):
|
|
1711
|
+
a.setMetrics({x:.5,y:.5});b.hasSounds&&Blockly.inject.loadSounds_(b.pathToMedia,a)};
|
|
1705
1712
|
Blockly.inject.bindDocumentEvents_=function(){Blockly.documentEventsBound_||(Blockly.bindEventWithChecks_(document,"scroll",null,function(){for(var a=Blockly.Workspace.getAll(),b=0,c;c=a[b];b++)c.updateInverseScreenCTM&&c.updateInverseScreenCTM()}),Blockly.bindEventWithChecks_(document,"keydown",null,Blockly.onKeyDown),Blockly.bindEvent_(document,"touchend",null,Blockly.longStop_),Blockly.bindEvent_(document,"touchcancel",null,Blockly.longStop_),Blockly.utils.userAgent.IPAD&&Blockly.bindEventWithChecks_(window,
|
|
1706
1713
|
"orientationchange",document,function(){Blockly.svgResize(Blockly.getMainWorkspace())}));Blockly.documentEventsBound_=!0};
|
|
1707
1714
|
Blockly.inject.loadSounds_=function(a,b){var c=b.getAudioManager();c.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");c.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");c.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");var d=[];a=function(){for(;d.length;)Blockly.unbindEvent_(d.pop());c.preload()};d.push(Blockly.bindEventWithChecks_(document,"mousemove",null,a,!0));d.push(Blockly.bindEventWithChecks_(document,"touchstart",null,a,!0))};Blockly.Names=function(a,b){this.variablePrefix_=b||"";this.reservedDict_=Object.create(null);if(a)for(a=a.split(","),b=0;b<a.length;b++)this.reservedDict_[a[b]]=!0;this.reset()};Blockly.Names.DEVELOPER_VARIABLE_TYPE="DEVELOPER_VARIABLE";Blockly.Names.prototype.reset=function(){this.db_=Object.create(null);this.dbReverse_=Object.create(null);this.variableMap_=null};Blockly.Names.prototype.setVariableMap=function(a){this.variableMap_=a};
|
|
@@ -1728,9 +1735,9 @@ Blockly.Functions.newFunctionMutation=function(a){a='<xml><mutation name="'+Bloc
|
|
|
1728
1735
|
Blockly.Functions.findUniqueParamName=function(a,b){for(;!Blockly.Functions.isUniqueParamName(a,b);)a=Blockly.Functions.incrementNameSuffix(a);return a};Blockly.Functions.isUniqueParamName=function(a,b){return b?-1==b.indexOf(a):!0};Blockly.Functions.createFunctionCallback_=function(a){Blockly.hideChaff();Blockly.selected&&Blockly.selected.unselect();Blockly.Functions.editFunctionExternalHandler(Blockly.Functions.newFunctionMutation(a),Blockly.Functions.createFunctionCallbackFactory_(a))};
|
|
1729
1736
|
Blockly.Functions.createFunctionCallbackFactory_=function(a){return function(b){if(b){b='<xml><block type="'+Blockly.FUNCTION_DEFINITION_BLOCK_TYPE+'">'+Blockly.Xml.domToText(b)+"</block></xml>";b=Blockly.Xml.textToDom(b);Blockly.Events.setGroup(!0);b=Blockly.Xml.domToBlock(b.firstChild,a);b.updateDisplay_();if(a.getMetrics){var c=a.getMetrics(),d=b.getHeightWidth();b.moveBy(c.viewLeft+c.viewWidth/2-d.width/2,c.viewTop+c.viewHeight/2-d.height/2);b.scheduleSnapAndBump()}a.centerOnBlock(b.id);Blockly.Events.setGroup(!1)}}};
|
|
1730
1737
|
Blockly.Functions.editFunctionCallback_=function(a){if(a.type==Blockly.FUNCTION_CALL_BLOCK_TYPE||a.type==Blockly.FUNCTION_CALL_OUTPUT_BLOCK_TYPE){var b=a.workspace.isFlyout?a.workspace.targetWorkspace:a.workspace;a=Blockly.Functions.getDefinition(a.getName(),b)}Blockly.hideChaff();Blockly.selected&&Blockly.selected.unselect();Blockly.Functions.editFunctionExternalHandler(a.mutationToDom(),Blockly.Functions.editFunctionCallbackFactory_(a))};
|
|
1731
|
-
Blockly.Functions.editFunctionCallbackFactory_=function(a){return function(b){b&&(Blockly.Functions.mutateCallersAndDefinition(a.getName(),a.workspace,b),a.updateDisplay_())}};Blockly.Functions.editFunctionExternalHandler=function(a,b){console.warn("External function editor must be overriden: Blockly.Functions.editFunctionExternalHandler",a,b)};Blockly.Functions.makeEditOption=function(a){return{enabled:!
|
|
1732
|
-
Blockly.Functions.makeCreateCallOption=function(a){var b=a.getField("function_name").getText(),c=goog.dom.createDom("mutation");c.setAttribute("name",b);c=goog.dom.createDom("block",null,c);c.setAttribute("type","function_call");return{enabled:0<a.workspace.remainingCapacity(),text:Blockly.Msg.FUNCTIONS_CREATE_CALL_OPTION.replace("%1",b),callback:Blockly.ContextMenu.callbackFactory(a,c)}};
|
|
1733
|
-
Blockly.Functions.makeGoToDefinitionOption=function(a){return{enabled:!
|
|
1738
|
+
Blockly.Functions.editFunctionCallbackFactory_=function(a){return function(b){b&&(Blockly.Functions.mutateCallersAndDefinition(a.getName(),a.workspace,b),a.updateDisplay_())}};Blockly.Functions.editFunctionExternalHandler=function(a,b){console.warn("External function editor must be overriden: Blockly.Functions.editFunctionExternalHandler",a,b)};Blockly.Functions.makeEditOption=function(a){return{enabled:!a.inDebugWorkspace(),text:Blockly.Msg.FUNCTIONS_EDIT_OPTION,callback:function(){Blockly.Functions.editFunctionCallback_(a)}}};
|
|
1739
|
+
Blockly.Functions.makeCreateCallOption=function(a){var b=a.getField("function_name").getText(),c=goog.dom.createDom("mutation");c.setAttribute("name",b);c=goog.dom.createDom("block",null,c);c.setAttribute("type","function_call");return{enabled:0<a.workspace.remainingCapacity()&&!a.inDebugWorkspace(),text:Blockly.Msg.FUNCTIONS_CREATE_CALL_OPTION.replace("%1",b),callback:Blockly.ContextMenu.callbackFactory(a,c)}};
|
|
1740
|
+
Blockly.Functions.makeGoToDefinitionOption=function(a){return{enabled:!a.inDebugWorkspace(),text:Blockly.Msg.FUNCTIONS_GO_TO_DEFINITION_OPTION,callback:function(){var b=a.getField("function_name").getText();(b=Blockly.Functions.getDefinition(b,a.workspace))&&a.workspace.centerOnBlock(b.id)}}};Blockly.Functions.getReporterArgumentType=function(a){switch(a){case "Boolean":case "Number":case "String":return a.toLowerCase();default:return a}};
|
|
1734
1741
|
Blockly.Functions.namesInUse=function(a,b,c){var d={};a.getAllVariables().forEach(function(a){d[a.name]=!0});a.getAllBlocks().forEach(function(a){if(!(a==b||c&&a.getFunctionId&&a.getFunctionId()==c))if(a.type==Blockly.FUNCTION_DEFINITION_BLOCK_TYPE)d[a.getName()]=!0;else if("procedures_defreturn"==a.type||"procedures_defnoreturn"==a.type)d[a.getProcedureDef()[0]]=!0});return d};
|
|
1735
1742
|
Blockly.Functions.idsInUse=function(a){var b=[];a.getAllBlocks().forEach(function(a){a.type==Blockly.FUNCTION_DEFINITION_BLOCK_TYPE&&b.push(a.getFunctionId())});return b};Blockly.Functions.findLegalName=function(a,b,c){if(c&&c.isInFlyout)return a;for(b=Blockly.Functions.namesInUse(b,c);b[a];)a=Blockly.Functions.incrementNameSuffix(a);return a};
|
|
1736
1743
|
Blockly.Functions.rename=function(a){a=a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"");var b=Blockly.Functions.findLegalName(a,this.sourceBlock_.workspace,this.sourceBlock_),c=this.getValue();if(!a)return c;if(!b)return a;if(!c)return this.sourceBlock_.name_=b;if(c!=a&&c!=b){a=this.sourceBlock_;a.name_=b;var d=a.mutationToDom();a.name_=c;Blockly.Functions.mutateCallersAndDefinition(c,a.workspace,d)}return b};
|
|
@@ -1738,7 +1745,7 @@ Blockly.Functions.validateFunctionExternal=function(a,b){var c=a.getAttribute("n
|
|
|
1738
1745
|
return Blockly.Functions.namesInUse(b,null,a)[c]?(Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS.replace("%1",c)),!1):!0};Blockly.Functions.getArgMap=function(a,b){for(var c={},d=0;d<a.childNodes.length;++d){var e=a.childNodes[d],f=b?e.getAttribute("id"):e.getAttribute("name");e=b?e.getAttribute("name"):e.getAttribute("id");c[f]=e}return c};
|
|
1739
1746
|
Blockly.Functions.mutateCallersAndDefinition=function(a,b,c){var d=Blockly.Functions.getDefinition(a,b);d?(a=Blockly.Functions.getCallers(a,d.workspace),a.push(d),Blockly.Events.setGroup(!0),a.forEach(function(a){var b=a.mutationToDom(),e=b&&Blockly.Xml.domToText(b);a.domToMutation(c);var h=a.mutationToDom(),k=h&&Blockly.Xml.domToText(h);if(e!=k)if(Blockly.Events.fire(new Blockly.Events.BlockChange(a,"mutation",null,e,k)),a.id==d.id){var l=Blockly.Functions.getArgMap(b),m=Blockly.Functions.getArgMap(h,
|
|
1740
1747
|
!0);d.getDescendants().forEach(function(a){if(Blockly.Functions.isFunctionArgumentReporter(a)){var b=a.getFieldValue("VALUE"),c=l[b];m[c]?m[c]!==b&&a.setFieldValue(m[c],"VALUE"):a.dispose()}})}else setTimeout(function(){a.bumpNeighbours()},Blockly.BUMP_DELAY)}),Blockly.Events.setGroup(!1)):console.warn("Attempted to change function "+a+", but no definition block was found on the workspace")};
|
|
1741
|
-
Blockly.Functions.isFunctionArgumentReporter=function(a){return"argument_reporter_boolean"==a.type||"argument_reporter_number"==a.type||"argument_reporter_string"==a.type||"argument_reporter_custom"==a.type};
|
|
1748
|
+
Blockly.Functions.isFunctionArgumentReporter=function(a){return"argument_reporter_boolean"==a.type||"argument_reporter_number"==a.type||"argument_reporter_string"==a.type||"argument_reporter_array"==a.type||"argument_reporter_custom"==a.type};
|
|
1742
1749
|
Blockly.Functions.createFlyout=function(a,b){var c={disabledPatternId:a.options.disabledPatternId,parentWorkspace:a,RTL:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,toolboxPosition:a.options.toolboxPosition,zoomOptions:a.options.zoomOptions,renderer:a.options.renderer,newFunctions:a.options.newFunctions};c=c.horizontalLayout?new Blockly.HorizontalFlyout(c):new Blockly.VerticalFlyout(c);var d=c.createDom("svg");goog.dom.insertSiblingAfter(d,b);c.init(a);return c};Blockly.VariableModel=function(a,b,c,d){this.workspace=a;this.name=b;this.type=c||"";this.id_=d||Blockly.utils.genUid();Blockly.Events.fire(new Blockly.Events.VarCreate(this))};Blockly.VariableModel.prototype.getId=function(){return this.id_};Blockly.VariableModel.compareByName=function(a,b){a=a.name.toLowerCase();b=b.name.toLowerCase();return a<b?-1:a==b?0:1};Blockly.Variables={};Blockly.Variables.NAME_TYPE=Blockly.VARIABLE_CATEGORY_NAME;Blockly.Variables.allUsedVarModels=function(a){var b=a.getAllBlocks(!1).filter(function(a){return!a.disabled});a=Object.create(null);for(var c=0;c<b.length;c++){var d=b[c].getVarModels();if(d)for(var e=0;e<d.length;e++){var f=d[e],g=f.getId();g&&(a[g]=f)}}b=[];for(g in a)b.push(a[g]);return b};Blockly.Variables.allUsedVariables=function(){console.warn("Deprecated call to Blockly.Variables.allUsedVariables. Use Blockly.Variables.allUsedVarModels instead.\nIf this is a major issue please file a bug on GitHub.")};
|
|
1743
1750
|
Blockly.Variables.ALL_DEVELOPER_VARS_WARNINGS_BY_BLOCK_TYPE_={};
|
|
1744
1751
|
Blockly.Variables.allDeveloperVariables=function(a){a=a.getAllBlocks(!1);for(var b=Object.create(null),c=0,d;d=a[c];c++){var e=d.getDeveloperVariables;!e&&d.getDeveloperVars&&(e=d.getDeveloperVars,Blockly.Variables.ALL_DEVELOPER_VARS_WARNINGS_BY_BLOCK_TYPE_[d.type]||(console.warn("Function getDeveloperVars() deprecated. Use getDeveloperVariables() (block type '"+d.type+"')"),Blockly.Variables.ALL_DEVELOPER_VARS_WARNINGS_BY_BLOCK_TYPE_[d.type]=!0));if(e)for(d=e(),e=0;e<d.length;e++)b[d[e]]=!0}return Object.keys(b)};
|
|
@@ -1760,15 +1767,15 @@ Blockly.WidgetDiv.repositionForWindowResize=function(){if(Blockly.WidgetDiv.owne
|
|
|
1760
1767
|
Blockly.WidgetDiv.hide=function(){var a=Blockly.WidgetDiv.DIV;if(Blockly.WidgetDiv.owner_){Blockly.WidgetDiv.owner_=null;a.style.display="none";a.style.left="";a.style.top="";Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_();Blockly.WidgetDiv.dispose_=null;a.innerHTML="";var b=Blockly.getMainWorkspace();b&&b.markFocused()}Blockly.WidgetDiv.rendererClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.WidgetDiv.rendererClassName_),Blockly.WidgetDiv.rendererClassName_=null);Blockly.WidgetDiv.themeClassName_&&
|
|
1761
1768
|
(Blockly.utils.dom.removeClass(a,Blockly.WidgetDiv.themeClassName_),Blockly.WidgetDiv.themeClassName_=null)};Blockly.WidgetDiv.isVisible=function(){return!!Blockly.WidgetDiv.owner_};Blockly.WidgetDiv.isDisplayed=function(){return"none"!=Blockly.WidgetDiv.DIV.style.display};Blockly.WidgetDiv.hideIfOwner=function(a){Blockly.WidgetDiv.owner_==a&&Blockly.WidgetDiv.hide()};
|
|
1762
1769
|
Blockly.WidgetDiv.positionInternal_=function(a,b,c){Blockly.WidgetDiv.DIV.style.left=a+"px";Blockly.WidgetDiv.DIV.style.top=b+"px";Blockly.WidgetDiv.DIV.style.height=c+"px"};Blockly.WidgetDiv.positionWithAnchor=function(a,b,c,d){var e=Blockly.WidgetDiv.calculateY_(a,b,c);a=Blockly.WidgetDiv.calculateX_(a,b,c,d);0>e?Blockly.WidgetDiv.positionInternal_(a,0,c.height+e):Blockly.WidgetDiv.positionInternal_(a,e,c.height)};
|
|
1763
|
-
Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)};Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.
|
|
1770
|
+
Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)};Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.1.2";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()};
|
|
1764
1771
|
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()}};
|
|
1765
1772
|
Blockly.onKeyDown=function(a){var b=Blockly.mainWorkspace;if(b&&!(Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible()))if(b.options.readOnly)Blockly.navigation.onKeyPress(a);else{var c=!1;if(a.keyCode==Blockly.utils.KeyCodes.ESC)Blockly.hideChaff(),Blockly.navigation.onBlocklyAction(Blockly.navigation.ACTION_EXIT);else{if(Blockly.navigation.onKeyPress(a))return;if(a.keyCode==Blockly.utils.KeyCodes.BACKSPACE||a.keyCode==Blockly.utils.KeyCodes.DELETE){a.preventDefault();if(Blockly.Gesture.inProgress())return;
|
|
1766
1773
|
Blockly.selected&&Blockly.selected.isDeletable()&&(c=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(Blockly.Gesture.inProgress())return;Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(a.keyCode==Blockly.utils.KeyCodes.C?(Blockly.hideChaff(),Blockly.copy_(Blockly.selected)):a.keyCode!=Blockly.utils.KeyCodes.X||Blockly.selected.workspace.isFlyout||(Blockly.copy_(Blockly.selected),c=!0,Blockly.hideChaff(),Blockly.selected.dispose(!0,!0)));a.keyCode==Blockly.utils.KeyCodes.V?
|
|
1767
1774
|
Blockly.clipboardXml_&&(a=Blockly.clipboardSource_,a.isFlyout&&(a=a.targetWorkspace),Blockly.clipboardTypeCounts_&&a.isCapacityAvailable(Blockly.clipboardTypeCounts_)&&(Blockly.Events.setGroup(!0),a.paste(Blockly.clipboardXml_),Blockly.Events.setGroup(!1))):a.keyCode==Blockly.utils.KeyCodes.Z&&(Blockly.hideChaff(),b.undo(a.shiftKey))}}c&&!Blockly.selected.workspace.isFlyout&&(Blockly.Events.setGroup(!0),Blockly.hideChaff(),Blockly.selected.dispose(!0,!0),Blockly.Events.setGroup(!1))}};
|
|
1768
1775
|
Blockly.copy_=function(a){if(a.isComment)var b=a.toXmlWithXY();else{b=Blockly.Xml.blockToDom(a,!0);Blockly.Xml.deleteNext(b);var c=a.getRelativeToSurfaceXY();b.setAttribute("x",a.RTL?-c.x:c.x);b.setAttribute("y",c.y)}Blockly.clipboardXml_=b;Blockly.clipboardSource_=a.workspace;Blockly.clipboardTypeCounts_=a.isComment?null:Blockly.utils.getBlockTypeCounts(a,!0)};
|
|
1769
1776
|
Blockly.duplicate=function(a){var b=Blockly.clipboardXml_,c=Blockly.clipboardSource_;Blockly.copy_(a);a.workspace.paste(Blockly.clipboardXml_);Blockly.clipboardXml_=b;Blockly.clipboardSource_=c};Blockly.onContextMenu_=function(a){Blockly.utils.isTargetInput(a)||a.preventDefault()};Blockly.hideChaff=function(a){Blockly.hideChaffInternal_(a);Blockly.WidgetDiv.hide(!0);Blockly.DropDownDiv.hideWithoutAnimation()};
|
|
1770
|
-
Blockly.hideChaffOnResize=function(a){Blockly.hideChaffInternal_(a);Blockly.WidgetDiv.repositionForWindowResize();Blockly.DropDownDiv.repositionForWindowResize()};Blockly.hideChaffInternal_=function(a){Blockly.Tooltip.hide()
|
|
1771
|
-
Blockly.alert=function(a,b){alert(a);b&&b()};Blockly.confirm=function(a,b){b(confirm(a))};Blockly.prompt=function(a,b,c,d){c(prompt(a,b,d))};Blockly.jsonInitFactory_=function(a){return function(){this.jsonInit(a)}};
|
|
1777
|
+
Blockly.hideChaffOnResize=function(a){Blockly.hideChaffInternal_(a);Blockly.WidgetDiv.repositionForWindowResize();Blockly.DropDownDiv.repositionForWindowResize()};Blockly.hideChaffInternal_=function(a){Blockly.utils.isOnScreenKeyboardResize()||(Blockly.Tooltip.hide(),Blockly.WidgetDiv.hide(),Blockly.DropDownDiv.hideWithoutAnimation());a||(a=Blockly.getMainWorkspace(),a.trashcan&&a.trashcan.flyout&&a.trashcan.flyout.hide(),(a=a.getToolbox())&&a.getFlyout()&&a.getFlyout().autoClose&&a.clearSelection())};
|
|
1778
|
+
Blockly.getMainWorkspace=function(){return Blockly.mainWorkspace};Blockly.alert=function(a,b){alert(a);b&&b()};Blockly.confirm=function(a,b){b(confirm(a))};Blockly.prompt=function(a,b,c,d){c(prompt(a,b,d))};Blockly.jsonInitFactory_=function(a){return function(){this.jsonInit(a)}};
|
|
1772
1779
|
Blockly.defineBlocksWithJsonArray=function(a){for(var b=0;b<a.length;b++){var c=a[b];if(c){var d=c.type;null==d||""===d?console.warn("Block definition #"+b+" in JSON array is missing a type attribute. Skipping."):(Blockly.Blocks[d]&&console.warn("Block definition #"+b+' in JSON array overwrites prior definition of "'+d+'".'),Blockly.Blocks[d]={init:Blockly.jsonInitFactory_(c)})}else console.warn("Block definition #"+b+" in JSON array is "+c+". Skipping.")}};
|
|
1773
1780
|
Blockly.bindEventWithChecks_=function(a,b,c,d,e,f){var g=!1,h=function(a){var b=!e;a=Blockly.Touch.splitEventByTouches(a);for(var f=0,h;h=a[f];f++)if(!b||Blockly.Touch.shouldHandleEvent(h))Blockly.Touch.setClientFromTouch(h),c?d.call(c,h):d(h),g=!0},k=[];if(Blockly.utils.global.PointerEvent&&b in Blockly.Touch.TOUCH_MAP)for(var l=0,m;m=Blockly.Touch.TOUCH_MAP[b][l];l++)a.addEventListener(m,h,!1),k.push([a,m,h]);else if(a.addEventListener(b,h,!1),k.push([a,b,h]),b in Blockly.Touch.TOUCH_MAP){var n=
|
|
1774
1781
|
function(a){h(a);var b=!f;g&&b&&a.preventDefault()};for(l=0;m=Blockly.Touch.TOUCH_MAP[b][l];l++)a.addEventListener(m,n,!1),k.push([a,m,n])}return k};
|
|
@@ -1803,17 +1810,19 @@ Blockly.Comment.prototype.createEditableBubble_=function(){this.bubble_=new Bloc
|
|
|
1803
1810
|
Blockly.Comment.prototype.disposeBubble_=function(){this.paragraphElement_?Blockly.Warning.prototype.disposeBubble.call(this):(this.onMouseUpWrapper_&&(Blockly.unbindEvent_(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onWheelWrapper_&&(Blockly.unbindEvent_(this.onWheelWrapper_),this.onWheelWrapper_=null),this.onChangeWrapper_&&(Blockly.unbindEvent_(this.onChangeWrapper_),this.onChangeWrapper_=null),this.onInputWrapper_&&(Blockly.unbindEvent_(this.onInputWrapper_),this.onInputWrapper_=
|
|
1804
1811
|
null),this.bubble_.dispose(),this.foreignObject_=this.textarea_=this.bubble_=null)};Blockly.Comment.prototype.startEdit_=function(a){this.bubble_.promote()&&this.textarea_.focus();this.cachedText_=this.model_.text};Blockly.Comment.prototype.getBubbleSize=function(){return this.model_.size};Blockly.Comment.prototype.setBubbleSize=function(a,b){this.bubble_?this.bubble_.setBubbleSize(a,b):(this.model_.size.width=a,this.model_.size.height=b)};
|
|
1805
1812
|
Blockly.Comment.prototype.getText=function(){return this.model_.text||""};Blockly.Comment.prototype.setText=function(a){this.model_.text!=a&&(this.model_.text=a,this.updateText())};Blockly.Comment.prototype.updateText=function(){this.textarea_?this.textarea_.value=this.model_.text:this.paragraphElement_&&(this.paragraphElement_.firstChild.textContent=this.model_.text)};Blockly.Comment.prototype.dispose=function(){this.block_.comment=null;Blockly.Icon.prototype.dispose.call(this)};Blockly.Css.register(".blocklyCommentTextarea {,background-color: #FAF6BD;,border: 0;,outline: 0;,margin: 0;,padding: 3px;,resize: none;,display: block;,color: $colour_text;,overflow: hidden;,font-size: 12pt;,line-height: 22px;,}".split(","));Blockly.FlyoutCursor=function(){Blockly.FlyoutCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.FlyoutCursor,Blockly.Cursor);Blockly.FlyoutCursor.prototype.onBlocklyAction=function(a){switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return this.prev(),!0;case Blockly.navigation.actionNames.NEXT:return this.next(),!0;default:return!1}};
|
|
1806
|
-
Blockly.FlyoutCursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;(a=a.next())&&this.setCurNode(a);return a};Blockly.FlyoutCursor.prototype.in=function(){return null};Blockly.FlyoutCursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;(a=a.prev())&&this.setCurNode(a);return a};Blockly.FlyoutCursor.prototype.out=function(){return null};Blockly.Flyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(a);this.workspace_.isFlyout=!0;this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.mats_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[];this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH};Blockly.Flyout.prototype.autoClose=!0;
|
|
1807
|
-
Blockly.Flyout.prototype.containerVisible_=!0;Blockly.Flyout.prototype.CORNER_RADIUS=8;Blockly.Flyout.prototype.MARGIN=Blockly.Flyout.prototype.CORNER_RADIUS;Blockly.Flyout.prototype.GAP_X=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.GAP_Y=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.SCROLLBAR_PADDING=2;Blockly.Flyout.prototype.width_=0;Blockly.Flyout.prototype.height_=0;Blockly.Flyout.prototype.dragAngleRange_=70;
|
|
1808
|
-
Blockly.Flyout.prototype.scrollbar_=null;Blockly.Flyout.prototype.targetWorkspace_=null;
|
|
1813
|
+
Blockly.FlyoutCursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;(a=a.next())&&this.setCurNode(a);return a};Blockly.FlyoutCursor.prototype.in=function(){return null};Blockly.FlyoutCursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;(a=a.prev())&&this.setCurNode(a);return a};Blockly.FlyoutCursor.prototype.out=function(){return null};Blockly.Flyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(a);this.workspace_.isFlyout=!0;this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.hasTwoScrolls=!1;this.eventWrappers_=[];this.mats_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[];this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH};Blockly.Flyout.prototype.autoClose=!0;
|
|
1814
|
+
Blockly.Flyout.prototype.isVisible_=!1;Blockly.Flyout.prototype.containerVisible_=!0;Blockly.Flyout.prototype.CORNER_RADIUS=8;Blockly.Flyout.prototype.MARGIN=Blockly.Flyout.prototype.CORNER_RADIUS;Blockly.Flyout.prototype.GAP_X=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.GAP_Y=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.SCROLLBAR_PADDING=2;Blockly.Flyout.prototype.width_=0;Blockly.Flyout.prototype.height_=0;Blockly.Flyout.prototype.dragAngleRange_=70;
|
|
1815
|
+
Blockly.Flyout.prototype.svgGroup_=null;Blockly.Flyout.prototype.scrollbar_=null;Blockly.Flyout.prototype.scrollbarPair_=null;Blockly.Flyout.prototype.targetWorkspace_=null;
|
|
1809
1816
|
Blockly.Flyout.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.dom.createSvgElement(a,{"class":"blocklyFlyout",style:"display: none"},null);this.svgBackground_=Blockly.utils.dom.createSvgElement("path",{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour","fill");this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity");
|
|
1810
1817
|
this.workspace_.getMarkerManager().setCursor(new Blockly.FlyoutCursor);return this.svgGroup_};
|
|
1811
|
-
Blockly.Flyout.prototype.init=function(a){this.targetWorkspace_=a;this.workspace_.targetWorkspace=a;this.scrollbar_=new Blockly.Scrollbar(this.workspace_,this.horizontalLayout_,!1,"blocklyFlyoutScrollbar");this.hide();Array.prototype.push.apply(this.eventWrappers_,Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.wheel_));this.autoClose||(this.filterWrapper_=this.filterForCapacity_.bind(this),
|
|
1812
|
-
Blockly.bindEventWithChecks_(this.svgBackground_,"mousedown",this,this.onMouseDown_));this.workspace_.getGesture=this.targetWorkspace_.getGesture.bind(this.targetWorkspace_);this.workspace_.setVariableMap(this.targetWorkspace_.getVariableMap());this.workspace_.createPotentialVariableMap()};
|
|
1813
|
-
Blockly.Flyout.prototype.dispose=function(){this.hide();this.clearOldEventListeners_();Blockly.unbindEvent_(this.eventWrappers_);this.filterWrapper_&&(this.targetWorkspace_.removeChangeListener(this.filterWrapper_),this.filterWrapper_=null);this.scrollbar_&&(this.scrollbar_.dispose(),this.scrollbar_=null);this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.targetWorkspace=null,
|
|
1814
|
-
this.svgGroup_=null);this.targetWorkspace_=this.svgBackground_=null};Blockly.Flyout.prototype.getWidth=function(){return this.width_};Blockly.Flyout.prototype.getHeight=function(){return this.height_};Blockly.Flyout.prototype.getWorkspace=function(){return this.workspace_};Blockly.Flyout.prototype.isVisible=function(){return this.isVisible_};
|
|
1815
|
-
Blockly.Flyout.prototype.setContainerVisible=function(a){var b=a!=this.containerVisible_;this.containerVisible_=a;b&&this.updateDisplay_()};Blockly.Flyout.prototype.updateDisplay_=function(){var a=this.containerVisible_?this.isVisible():!1;this.svgGroup_.style.display=a?"block":"none";this.scrollbar_.setContainerVisible(a)};
|
|
1816
|
-
Blockly.Flyout.prototype.
|
|
1818
|
+
Blockly.Flyout.prototype.init=function(a){this.targetWorkspace_=a;this.workspace_.targetWorkspace=a;this.hasTwoScrolls?this.scrollbarPair_=new Blockly.ScrollbarPair(this.workspace_,"blocklyFlyoutScrollbar"):this.scrollbar_=new Blockly.Scrollbar(this.workspace_,this.horizontalLayout_,!1,"blocklyFlyoutScrollbar");this.hide();Array.prototype.push.apply(this.eventWrappers_,Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.wheel_));this.autoClose||(this.filterWrapper_=this.filterForCapacity_.bind(this),
|
|
1819
|
+
this.targetWorkspace_.addChangeListener(this.filterWrapper_));Array.prototype.push.apply(this.eventWrappers_,Blockly.bindEventWithChecks_(this.svgBackground_,"mousedown",this,this.onMouseDown_));this.workspace_.getGesture=this.targetWorkspace_.getGesture.bind(this.targetWorkspace_);this.workspace_.setVariableMap(this.targetWorkspace_.getVariableMap());this.workspace_.createPotentialVariableMap()};
|
|
1820
|
+
Blockly.Flyout.prototype.dispose=function(){this.hide();this.clearOldEventListeners_();Blockly.unbindEvent_(this.eventWrappers_);this.filterWrapper_&&(this.targetWorkspace_.removeChangeListener(this.filterWrapper_),this.filterWrapper_=null);this.hasTwoScrolls?(this.scrollbarPair_.dispose(),this.scrollbarPair_=null):this.scrollbar_&&(this.scrollbar_.dispose(),this.scrollbar_=null);this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.targetWorkspace=null,
|
|
1821
|
+
this.workspace_.dispose(),this.workspace_=null);this.svgGroup_&&(Blockly.utils.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.targetWorkspace_=this.svgBackground_=null};Blockly.Flyout.prototype.getWidth=function(){return this.width_};Blockly.Flyout.prototype.getHeight=function(){return this.height_};Blockly.Flyout.prototype.getWorkspace=function(){return this.workspace_};Blockly.Flyout.prototype.isVisible=function(){return this.isVisible_};
|
|
1822
|
+
Blockly.Flyout.prototype.setVisible=function(a){var b=a!=this.isVisible();this.isVisible_=a;b&&this.updateDisplay_()};Blockly.Flyout.prototype.setContainerVisible=function(a){var b=a!=this.containerVisible_;this.containerVisible_=a;b&&this.updateDisplay_()};Blockly.Flyout.prototype.updateDisplay_=function(){var a=this.containerVisible_?this.isVisible():!1;this.svgGroup_.style.display=a?"block":"none";this.hasTwoScrolls?this.scrollbarPair_.setContainerVisible(a):this.scrollbar_.setContainerVisible(a)};
|
|
1823
|
+
Blockly.Flyout.prototype.setTwoScrolls=function(){this.hasTwoScrolls||(this.scrollbar_&&(this.scrollbar_.dispose(),this.scrollbar_=null),this.hasTwoScrolls=!0,this.scrollbarPair_=new Blockly.ScrollbarPair(this.workspace_,!1,"blocklyFlyoutScrollbar"))};
|
|
1824
|
+
Blockly.Flyout.prototype.positionAt_=function(a,b,c,d){this.svgGroup_.setAttribute("width",a);this.svgGroup_.setAttribute("height",b);"svg"==this.svgGroup_.tagName?Blockly.utils.dom.setCssTransform(this.svgGroup_,"translate("+c+"px,"+d+"px)"):this.svgGroup_.setAttribute("transform","translate("+c+","+d+")");this.hasTwoScrolls?this.scrollbarPair_&&(this.scrollbarPair_.hScroll&&(this.scrollbarPair_.hScroll.setOrigin(c,d),this.scrollbarPair_.hScroll.resize(),this.scrollbarPair_.hScroll.position&&this.scrollbarPair_.hScroll.setPosition_(this.scrollbarPair_.hScroll.position.x,
|
|
1825
|
+
this.scrollbarPair_.hScroll.position.y)),this.scrollbarPair_.vScroll&&(this.scrollbarPair_.vScroll.setOrigin(c,d),this.scrollbarPair_.vScroll.resize(),this.scrollbarPair_.vScroll.position&&this.scrollbarPair_.vScroll.setPosition_(this.scrollbarPair_.vScroll.position.x,this.scrollbarPair_.vScroll.position.y))):this.scrollbar_&&(this.scrollbar_.setOrigin(c,d),this.scrollbar_.resize(),this.scrollbar_.setPosition_(this.scrollbar_.position_.x,this.scrollbar_.position_.y))};
|
|
1817
1826
|
Blockly.Flyout.prototype.hide=function(){this.isVisible()&&this.setVisible(!1)};Blockly.Flyout.prototype.clearOldEventListeners_=function(){for(var a=0,b;b=this.listeners_[a];a++)Blockly.unbindEvent_(b);this.listeners_.length=0;this.reflowWrapper_&&(this.workspace_.removeChangeListener(this.reflowWrapper_),this.reflowWrapper_=null)};
|
|
1818
1827
|
Blockly.Flyout.prototype.show=function(a){this.workspace_.setResizesEnabled(!1);this.hide();this.clearOldEventListeners_();this.clearOldBlocks_();if("string"==typeof a){a=this.workspace_.targetWorkspace.getToolboxCategoryCallback(a);if("function"!=typeof a)throw TypeError("Couldn't find a callback function when opening a toolbox category.");a=a(this.workspace_.targetWorkspace);if(!Array.isArray(a))throw TypeError("Result of toolbox category callback must be an array.");}this.setVisible(!0);var b=
|
|
1819
1828
|
[],c=[];this.permanentlyDisabled_.length=0;for(var d=this.horizontalLayout_?this.GAP_X:this.GAP_Y,e=0,f;f=a[e];e++)if(f.tagName)switch(f.tagName.toUpperCase()){case "BLOCK":var g=Blockly.Xml.domToBlock(f,this.workspace_);g.isEnabled()||this.permanentlyDisabled_.push(g);b.push({type:"block",block:g});f=parseInt(f.getAttribute("gap"),10);c.push(isNaN(f)?d:f);break;case "SEP":f=parseInt(f.getAttribute("gap"),10);!isNaN(f)&&0<c.length?c[c.length-1]=f:c.push(d);break;case "LABEL":case "BUTTON":g="LABEL"==
|
|
@@ -1826,7 +1835,7 @@ this.autoClose?this.hide():this.filterForCapacity_();return b};Blockly.Flyout.pr
|
|
|
1826
1835
|
Blockly.Flyout.prototype.createRect_=function(a,b,c,d,e){b=Blockly.utils.dom.createSvgElement("rect",{"fill-opacity":0,x:b,y:c,height:d.height,width:d.width},null);b.tooltip=a;Blockly.Tooltip.bindMouseEvents(b);this.workspace_.getCanvas().insertBefore(b,a.getSvgRoot());a.flyoutRect_=b;return this.mats_[e]=b};
|
|
1827
1836
|
Blockly.Flyout.prototype.moveRectToBlock_=function(a,b){var c=b.getHeightWidth();a.setAttribute("width",c.width);a.setAttribute("height",c.height);b=b.getRelativeToSurfaceXY();a.setAttribute("y",b.y);a.setAttribute("x",this.RTL?b.x-c.width:b.x)};
|
|
1828
1837
|
Blockly.Flyout.prototype.filterForCapacity_=function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)if(-1==this.permanentlyDisabled_.indexOf(c))for(var d=this.targetWorkspace_.isCapacityAvailable(Blockly.utils.getBlockTypeCounts(c));c;)c.setEnabled(d),c=c.getNextBlock()};Blockly.Flyout.prototype.reflow=function(){this.reflowWrapper_&&this.workspace_.removeChangeListener(this.reflowWrapper_);this.reflowInternal_();this.reflowWrapper_&&this.workspace_.addChangeListener(this.reflowWrapper_)};
|
|
1829
|
-
Blockly.Flyout.prototype.isScrollable=function(){return this.scrollbar_?this.scrollbar_.isVisible():!1};
|
|
1838
|
+
Blockly.Flyout.prototype.isScrollable=function(){return this.hasTwoScrolls?this.scrollbarPair_?this.scrollbarPair_.hScroll.isVisible()||this.scrollbarPair_.vScroll.isVisible():!1:this.scrollbar_?this.scrollbar_.isVisible():!1};
|
|
1830
1839
|
Blockly.Flyout.prototype.placeNewBlock_=function(a){var b=this.targetWorkspace_;if(!a.getSvgRoot())throw Error("oldBlock is not rendered.");"function_call"==a.type&&a.inputList.forEach(function(a){if(a.connection&&a.connection.targetConnection&&"variables_get"==a.connection.targetBlock().type){a=a.connection.targetBlock();var c=a.inputList[0].fieldRow[0].getText();c=Blockly.Variables.getOrCreateVariablePackage(b,null,c,"").getId();a.setFieldValue(c,"VAR")}});var c=Blockly.Xml.blockToDom(a,!0);b.setResizesEnabled(!1);
|
|
1831
1840
|
c=Blockly.Xml.domToBlock(c,b);if(!c.getSvgRoot())throw Error("block is not rendered.");var d=b.getOriginOffsetInPixels(),e=this.workspace_.getOriginOffsetInPixels();a=a.getRelativeToSurfaceXY();a.scale(this.workspace_.scale);a=Blockly.utils.Coordinate.sum(e,a);d=Blockly.utils.Coordinate.difference(a,d);d.scale(1/b.scale);c.moveBy(d.x,d.y);return c};Blockly.Flyout.prototype.onBlocklyAction=function(a){return this.workspace_.getCursor().onBlocklyAction(a)};Blockly.HorizontalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.HorizontalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!0};Blockly.utils.object.inherits(Blockly.HorizontalFlyout,Blockly.Flyout);
|
|
1832
1841
|
Blockly.HorizontalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.SCROLLBAR_PADDING;this.toolboxPosition_==Blockly.TOOLBOX_AT_BOTTOM&&(b=0);var d=this.height_;this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP&&(d-=this.SCROLLBAR_PADDING);return{viewHeight:d,viewWidth:this.width_-2*this.SCROLLBAR_PADDING,contentHeight:(a.height+2*this.MARGIN)*this.workspace_.scale,
|
|
@@ -1841,11 +1850,13 @@ f.type&&(this.initFlyoutButton_(f.button,d,c),d+=f.button.width+b[e])};Blockly.H
|
|
|
1841
1850
|
Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E9,b+a.height,-1E9,1E9):new Blockly.utils.Rect(b,1E9,-1E9,1E9)};
|
|
1842
1851
|
Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.position()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};Blockly.utils.object.inherits(Blockly.VerticalFlyout,Blockly.Flyout);
|
|
1843
1852
|
Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX,
|
|
1844
|
-
contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&("number"==typeof a.y&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))};
|
|
1853
|
+
contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&("number"==typeof a.y&&(this.workspace_.scrollY=-b.contentHeight*a.y),"number"==typeof a.x&&(this.workspace_.scrollX=-b.contentWidth*a.x),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))};
|
|
1845
1854
|
Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();a&&(this.height_=a.viewHeight,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS),this.positionAt_(this.width_,this.height_,this.targetWorkspace_.toolboxPosition==this.toolboxPosition_?a.toolboxWidth?this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?a.toolboxWidth:a.viewWidth-this.width_:this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth:this.toolboxPosition_==
|
|
1846
1855
|
Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth+a.absoluteLeft-this.width_,0))}};
|
|
1847
1856
|
Blockly.VerticalFlyout.prototype.setBackgroundPath_=function(a,b){var c=this.toolboxPosition_==Blockly.TOOLBOX_AT_RIGHT,d=a+this.CORNER_RADIUS;d=["M "+(c?d:0)+",0"];d.push("h",c?-a:a);d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("v",Math.max(0,b));d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("h",c?a:-a);d.push("z");this.svgBackground_.setAttribute("d",
|
|
1848
|
-
d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.
|
|
1857
|
+
d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.hasTwoScrolls?this.scrollbarPair_.set(0,0):this.scrollbar_.set(0)};
|
|
1858
|
+
Blockly.VerticalFlyout.prototype.wheel_=function(a){var b=Blockly.utils.getScrollDeltaPixels(a);if(b.y){var c=this.getMetrics_(),d=c.viewTop-c.contentTop+b.y;c=c.contentHeight-c.viewHeight;d=Math.min(d,c);d=Math.max(d,0);this.hasTwoScrolls?this.scrollbarPair_.vScroll.set(d):this.scrollbar_.set(d);Blockly.WidgetDiv.hide()}b.x&&this.hasTwoScrolls&&(c=this.getMetrics_(),d=c.viewLeft+b.x,c=c.contentWidth-c.viewWidth,d=Math.min(d,c),d=Math.max(d,0),this.scrollbarPair_.hScroll.set(d),Blockly.WidgetDiv.hide());
|
|
1859
|
+
a.preventDefault();a.stopPropagation()};
|
|
1849
1860
|
Blockly.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;for(var c=this.MARGIN,d=this.RTL?c:c+this.tabWidth_,e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(!1),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?d-this.tabWidth_:d;f.moveBy(k,c);k=this.createRect_(f,this.RTL?k-h.width:k,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"==f.type&&(this.initFlyoutButton_(f.button,
|
|
1850
1861
|
d,c),c+=f.button.height+b[e])};Blockly.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;return a<b&&a>-b||a<-180+b||a>180-b?!0:!1};Blockly.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E9,1E9,-1E9,b+a.width):new Blockly.utils.Rect(-1E9,1E9,b,1E9)};
|
|
1851
1862
|
Blockly.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=this.tabWidth_);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+this.tabWidth_;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;(c=this.targetWorkspace_.getMetrics())&&(a=Math.min(a,c.viewWidth));if(this.width_!=a){for(c=
|
|
@@ -1965,7 +1976,7 @@ Blockly.WorkspaceComment.parseAttributes=function(a){var b=a.getAttribute("h"),c
|
|
|
1965
1976
|
!!a.blockDragSurface_;Blockly.WorkspaceCommentSvg.superClass_.constructor.call(this,a,b,c,d,e,f);this.render()};Blockly.utils.object.inherits(Blockly.WorkspaceCommentSvg,Blockly.WorkspaceComment);Blockly.WorkspaceCommentSvg.DEFAULT_SIZE=200;
|
|
1966
1977
|
Blockly.WorkspaceCommentSvg.prototype.dispose=function(){this.workspace&&(Blockly.selected==this&&(this.unselect(),this.workspace.cancelCurrentGesture()),Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.CommentDelete(this)),Blockly.utils.dom.removeNode(this.svgGroup_),this.svgRect_=this.svgGroup_=null,this.disposeInternal_(),Blockly.Events.disable(),Blockly.WorkspaceCommentSvg.superClass_.dispose.call(this),Blockly.Events.enable())};
|
|
1967
1978
|
Blockly.WorkspaceCommentSvg.prototype.initSvg=function(){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");this.workspace.options.readOnly||this.eventsInit_||(Blockly.bindEventWithChecks_(this.svgRectTarget_,"mousedown",this,this.pathMouseDown_),Blockly.bindEventWithChecks_(this.svgHandleTarget_,"mousedown",this,this.pathMouseDown_));this.eventsInit_=!0;this.updateMovable();this.getSvgRoot().parentNode||this.workspace.getBubbleCanvas().appendChild(this.getSvgRoot())};
|
|
1968
|
-
Blockly.WorkspaceCommentSvg.prototype.pathMouseDown_=function(a){var b=this.workspace.getGesture(a);b&&b.handleBubbleStart(a,this)};Blockly.WorkspaceCommentSvg.prototype.showContextMenu=function(a){if(!this.workspace.options.readOnly){var b=[];this.isDeletable()&&this.isMovable()&&(b.push(Blockly.ContextMenu.commentDuplicateOption(this)),b.push(Blockly.ContextMenu.commentDeleteOption(this)));Blockly.ContextMenu.show(a,b,this.RTL)}};
|
|
1979
|
+
Blockly.WorkspaceCommentSvg.prototype.pathMouseDown_=function(a){var b=this.workspace.getGesture(a);b&&b.handleBubbleStart(a,this)};Blockly.WorkspaceCommentSvg.prototype.showContextMenu=function(a){if(!this.workspace.options.readOnly&&!this.workspace.options.debugMode){var b=[];this.isDeletable()&&this.isMovable()&&(b.push(Blockly.ContextMenu.commentDuplicateOption(this)),b.push(Blockly.ContextMenu.commentDeleteOption(this)));Blockly.ContextMenu.show(a,b,this.RTL)}};
|
|
1969
1980
|
Blockly.WorkspaceCommentSvg.prototype.select=function(){if(Blockly.selected!=this){var a=null;if(Blockly.selected){a=Blockly.selected.id;Blockly.Events.disable();try{Blockly.selected.unselect()}finally{Blockly.Events.enable()}}a=new Blockly.Events.Ui(null,"selected",a,this.id);a.workspaceId=this.workspace.id;Blockly.Events.fire(a);Blockly.selected=this;this.addSelect()}};
|
|
1970
1981
|
Blockly.WorkspaceCommentSvg.prototype.unselect=function(){if(Blockly.selected==this){var a=new Blockly.Events.Ui(null,"selected",this.id,null);a.workspaceId=this.workspace.id;Blockly.Events.fire(a);Blockly.selected=null;this.removeSelect();this.blurFocus()}};Blockly.WorkspaceCommentSvg.prototype.addSelect=function(){Blockly.utils.dom.addClass(this.svgGroup_,"blocklySelected");this.setFocus()};
|
|
1971
1982
|
Blockly.WorkspaceCommentSvg.prototype.removeSelect=function(){Blockly.utils.dom.removeClass(this.svgGroup_,"blocklySelected");this.blurFocus()};Blockly.WorkspaceCommentSvg.prototype.addFocus=function(){Blockly.utils.dom.addClass(this.svgGroup_,"blocklyFocused")};Blockly.WorkspaceCommentSvg.prototype.removeFocus=function(){Blockly.utils.dom.removeClass(this.svgGroup_,"blocklyFocused")};
|
|
@@ -2365,7 +2376,8 @@ Blockly.FieldDropdown.fromJson=function(a){return new Blockly.FieldDropdown(a.op
|
|
|
2365
2376
|
Blockly.FieldDropdown.prototype.value_="";Blockly.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement_=Blockly.utils.dom.createSvgElement("image",{},this.fieldGroup_);this.constants_.FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&Blockly.utils.dom.addClass(this.borderRect_,"blocklyDropdownRect")};
|
|
2366
2377
|
Blockly.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.constants_.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.constants_.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()};
|
|
2367
2378
|
Blockly.FieldDropdown.prototype.createTextArrow_=function(){this.arrow_=Blockly.utils.dom.createSvgElement("tspan",{},this.textElement_);this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?Blockly.FieldDropdown.ARROW_CHAR+" ":" "+Blockly.FieldDropdown.ARROW_CHAR));this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):this.textElement_.appendChild(this.arrow_)};
|
|
2368
|
-
Blockly.FieldDropdown.prototype.createSVGArrow_=function(){var a=Blockly.utils.userAgent.IE||Blockly.utils.userAgent.IOS,b=a?this.constants_.FIELD_DROPDOWN_SVG_ARROW_DATAURI:"#blocklyDropdownArrowSvg";this.svgArrow_=Blockly.utils.dom.createSvgElement(a?"image":"use",{height:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,
|
|
2379
|
+
Blockly.FieldDropdown.prototype.createSVGArrow_=function(){var a=Blockly.utils.userAgent.IE||Blockly.utils.userAgent.IOS,b=a?this.constants_.FIELD_DROPDOWN_SVG_ARROW_DATAURI:"#"+(this.constants_.dropdownArrowImageId||"blocklyDropdownArrowSvg");this.svgArrow_=Blockly.utils.dom.createSvgElement(a?"image":"use",{height:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,
|
|
2380
|
+
"xlink:href",b)};
|
|
2369
2381
|
Blockly.FieldDropdown.prototype.showEditor_=function(a){this.menu_=this.dropdownCreate_();this.menu_.openingCoords=a&&"number"===typeof a.clientX?new Blockly.utils.Coordinate(a.clientX,a.clientY):null;this.menu_.render(Blockly.DropDownDiv.getContentDiv());Blockly.utils.dom.addClass(this.menu_.getElement(),"blocklyDropdownMenu");if(this.constants_.FIELD_DROPDOWN_COLOURED_DIV){a=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var b=this.sourceBlock_.isShadow()?
|
|
2370
2382
|
this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;Blockly.DropDownDiv.setColour(a,b)}Blockly.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this));this.menu_.focus();this.selectedMenuItem_&&Blockly.utils.style.scrollIntoContainerView(this.selectedMenuItem_.getElement(),this.menu_.getElement());this.applyColour()};
|
|
2371
2383
|
Blockly.FieldDropdown.prototype.dropdownCreate_=function(){var a=new Blockly.Menu;a.setRightToLeft(this.sourceBlock_.RTL);a.setRole(Blockly.utils.aria.Role.LISTBOX);var b=this.getOptions(!1);this.selectedMenuItem_=null;for(var c=0;c<b.length;c++){var d=b[c][0],e=b[c][1];if("SEPARATOR"===e)d=new Blockly.MenuSeparator,d.setRightToLeft(this.sourceBlock_.RTL),a.addChild(d,!0),d.getElement().style.borderColor=this.sourceBlock_.style.colourTertiary;else{if("object"==typeof d){var f=new Image(d.width,d.height);
|
|
@@ -2493,13 +2505,13 @@ function(a){a=d.getVariable(a,e);c.setValue(a.getId())},e);return}}this.setValue
|
|
|
2493
2505
|
Blockly.FieldVerticalSeparator=function(){Blockly.FieldVerticalSeparator.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.FieldVerticalSeparator,Blockly.Field);Blockly.FieldVerticalSeparator.fromJson=function(a){return new Blockly.FieldVerticalSeparator};Blockly.FieldVerticalSeparator.prototype.EDITABLE=!1;
|
|
2494
2506
|
Blockly.FieldVerticalSeparator.prototype.initView=function(){var a=this.constants_.ICON_SEPARATOR_HEIGHT;this.lineElement_=Blockly.utils.dom.createSvgElement("line",{stroke:this.sourceBlock_.style.colourSecondary,"stroke-linecap":"round",x1:0,y1:0,x2:0,y2:a},this.fieldGroup_);this.size_=new Blockly.utils.Size(1,a);this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_)};Blockly.FieldVerticalSeparator.prototype.setLineHeight=function(a){this.lineElement_.setAttribute("y2",a)};
|
|
2495
2507
|
Blockly.FieldVerticalSeparator.prototype.dispose=function(){Blockly.utils.dom.removeNode(this.fieldGroup_);this.lineElement_=this.fieldGroup_=null};Blockly.FieldVerticalSeparator.prototype.getValue=function(){return null};Blockly.FieldVerticalSeparator.prototype.setValue=function(a){};Blockly.FieldVerticalSeparator.prototype.setText=function(a){};Blockly.FieldVerticalSeparator.prototype.render_=function(){};Blockly.FieldVerticalSeparator.prototype.updateWidth=function(){};
|
|
2496
|
-
Blockly.fieldRegistry.register("field_vertical_separator",Blockly.FieldVerticalSeparator);Blockly.FieldSlider=function(a,b,c,d,e,f,g){Blockly.FieldSlider.superClass_.constructor.call(this,a,null,null,null,g);this.setConstraints(b,c,d);this.step_=parseFloat(e);this.labelText_=f};Blockly.utils.object.inherits(Blockly.FieldSlider,Blockly.FieldNumber);Blockly.FieldSlider.prototype.min_=null;Blockly.FieldSlider.prototype.max_=null;Blockly.FieldSlider.prototype.step_=null;Blockly.FieldSlider.prototype.precision_=null;Blockly.FieldSlider.prototype.labelText_=null;
|
|
2508
|
+
Blockly.fieldRegistry.register("field_vertical_separator",Blockly.FieldVerticalSeparator);Blockly.FieldSlider=function(a,b,c,d,e,f,g){Blockly.FieldSlider.superClass_.constructor.call(this,a,null,null,null,g);this.setConstraints(b,c,d);this.step_=parseFloat(e)||void 0;this.labelText_=f};Blockly.utils.object.inherits(Blockly.FieldSlider,Blockly.FieldNumber);Blockly.FieldSlider.prototype.min_=null;Blockly.FieldSlider.prototype.max_=null;Blockly.FieldSlider.prototype.step_=null;Blockly.FieldSlider.prototype.precision_=null;Blockly.FieldSlider.prototype.labelText_=null;
|
|
2497
2509
|
Blockly.FieldSlider.fromJson=function(a){return new Blockly.FieldSlider(a.value,a.min,a.max,a.precision,a.step,a.labelText)};Blockly.FieldSlider.prototype.setOptions=function(a,b,c,d){this.setConstraints(a,b,d);this.step_=parseFloat(c)||void 0;a=this.getNumRestrictor(this.min_,this.max_,this.precision_);this.setRestrictor(a)};Blockly.FieldSlider.prototype.setLabel=function(a){void 0!=a&&(this.labelText_=a)};Blockly.FieldSlider.prototype.setColor=function(a){void 0!=a&&(this.sliderColor_=a)};
|
|
2498
2510
|
Blockly.FieldSlider.prototype.init=function(){Blockly.FieldTextInput.superClass_.init.call(this);this.setValue(this.getValue());this.sourceBlock_.isEditable()&&(this.mouseOverWrapper_=Blockly.bindEvent_(this.getClickTarget_(),"mouseover",this,this.onMouseOver_),this.mouseOutWrapper_=Blockly.bindEvent_(this.getClickTarget_(),"mouseout",this,this.onMouseOut_))};
|
|
2499
|
-
Blockly.FieldSlider.prototype.showEditor_=function(a){Blockly.FieldSlider.superClass_.showEditor_.call(this,a
|
|
2511
|
+
Blockly.FieldSlider.prototype.showEditor_=function(a){Blockly.FieldSlider.superClass_.showEditor_.call(this,a);Infinity!=this.max_&&-Infinity!=this.min_&&(this.showSlider_(),this.setValue(this.getValue()))};
|
|
2500
2512
|
Blockly.FieldSlider.prototype.showSlider_=function(){Blockly.DropDownDiv.hideWithoutAnimation();Blockly.DropDownDiv.clearContent();var a=Blockly.DropDownDiv.getContentDiv();a.setAttribute("role","menu");a.setAttribute("aria-haspopup","true");this.addSlider_(a);Blockly.DropDownDiv.setColour("#ffffff","#dddddd");Blockly.DropDownDiv.showPositionedByBlock(this,this.sourceBlock_);this.slider_&&this.slider_.setVisible(!0)};
|
|
2501
|
-
Blockly.FieldSlider.prototype.addSlider_=function(a){if(this.labelText_){var b=this.createLabelDom_(this.labelText_);a.appendChild(b[0]);this.readout_=b[1]}this.slider_=new goog.ui.Slider;this.slider_.
|
|
2502
|
-
this;Blockly.FieldSlider.changeEventKey_=goog.events.listen(this.slider_,goog.ui.Component.EventType.CHANGE,function(a){a=a.target.getValue()||0;c.sourceBlock_&&(a=c.callValidator(a));if(null!==a){c.setValue(a);var b=c.htmlInput_;b&&(b.value=a,b.focus())}});Blockly.FieldSlider.focusEventKey_=goog.events.listen(this.slider_.getElement(),goog.ui.Component.EventType.FOCUS,function(){c.htmlInput_.focus()})};
|
|
2513
|
+
Blockly.FieldSlider.prototype.addSlider_=function(a){if(this.labelText_){var b=this.createLabelDom_(this.labelText_);a.appendChild(b[0]);this.readout_=b[1]}this.slider_=new goog.ui.Slider;this.slider_.setMinimum(this.min_);this.slider_.setMaximum(this.max_);this.slider_.setMoveToPointEnabled(!this.step_);this.step_&&this.slider_.setBlockIncrement(this.step_);this.slider_.setRightToLeft(this.sourceBlock_.RTL);b=parseFloat(this.getValue());b=isNaN(b)?0:b;this.slider_.setValue(b);this.slider_.render(a);
|
|
2514
|
+
var c=this;Blockly.FieldSlider.changeEventKey_=goog.events.listen(this.slider_,goog.ui.Component.EventType.CHANGE,function(a){a=a.target.getValue()||0;c.sourceBlock_&&(a=c.callValidator(a));if(null!==a){c.setValue(a);var b=c.htmlInput_;b&&(b.value=a,b.focus())}});Blockly.FieldSlider.focusEventKey_=goog.events.listen(this.slider_.getElement(),goog.ui.Component.EventType.FOCUS,function(){c.htmlInput_.focus()})};
|
|
2503
2515
|
Blockly.FieldSlider.prototype.createLabelDom_=function(a){var b=document.createElement("div");b.setAttribute("class","blocklyFieldSliderLabel");var c=document.createElement("span");c.setAttribute("class","blocklyFieldSliderReadout");var d=document.createElement("span");d.setAttribute("class","blocklyFieldSliderLabelText");d.innerHTML=a;b.appendChild(d);b.appendChild(c);return[b,c]};
|
|
2504
2516
|
Blockly.FieldSlider.prototype.setValue=function(a){Blockly.FieldSlider.superClass_.setValue.call(this,a);this.updateSliderHandles_();this.updateDom_()};Blockly.FieldSlider.prototype.updateDom_=function(){this.slider_&&this.readout_&&(this.setBackground_(this.slider_.getElement()),this.setReadout_(this.readout_,this.getValue()))};
|
|
2505
2517
|
Blockly.FieldSlider.prototype.setBackground_=function(a){this.sliderColor_?goog.style.setStyle(a,"background",this.sliderColor_):this.sourceBlock_.isShadow()&&this.sourceBlock_.parentBlock_&&goog.style.setStyle(a,"background",this.sourceBlock_.parentBlock_.getColourTertiary())};Blockly.FieldSlider.prototype.setReadout_=function(a,b){a.innerHTML=b};Blockly.FieldSlider.prototype.updateSliderHandles_=function(){this.slider_&&this.slider_.setValue(parseFloat(this.getValue()))};
|
|
@@ -2789,12 +2801,12 @@ Blockly.zelos.Renderer.prototype.makeMarkerDrawer=function(a,b){return new Block
|
|
|
2789
2801
|
Blockly.blockRendering.register("zelos",Blockly.zelos.Renderer);Blockly.pxt={};
|
|
2790
2802
|
Blockly.pxt.ConstantProvider=function(){Blockly.pxt.ConstantProvider.superClass_.constructor.call(this);this.FIELD_TEXT_FONTFAMILY='"Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace';this.FIELD_TEXT_FONTWEIGHT="600";this.ICON_SEPARATOR_HEIGHT=8*this.GRID_UNIT;this.ELLIPSES_RADIUS=6;this.ELLIPSES_SPACING=8;this.COLLAPSE_IMAGE_DATAURI="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg enable-background='new 0 0 24 24' version='1.1' viewBox='0 0 24 24' xml:space='preserve' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23CF8B17;%7D .st1%7Bfill:%23FFFFFF;%7D%0A%3C/style%3E%3Ctitle%3Erepeat%3C/title%3E%3Ccircle cx='12' cy='12' r='10.503' fill='none' stroke='%23fff' stroke-linecap='square' stroke-linejoin='round' stroke-width='2'/%3E%3Cg transform='matrix(.0086269 0 0 -.0086269 4.8224 17.354)'%3E%3Cpath d='m1611 367.42q0 53-37 90l-651 651q-38 38-91 38-54 0-90-38l-651-651q-38-36-38-90 0-53 38-91l74-75q39-37 91-37 53 0 90 37l486 486 486-486q37-37 90-37 52 0 91 37l75 75q37 39 37 91z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E%0A";this.EXPAND_IMAGE_DATAURI=
|
|
2791
2803
|
"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg enable-background='new 0 0 24 24' version='1.1' viewBox='0 0 24 24' xml:space='preserve' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23CF8B17;%7D .st1%7Bfill:%23FFFFFF;%7D%0A%3C/style%3E%3Ctitle%3Erepeat%3C/title%3E%3Ccircle cx='12' cy='12' r='10.503' fill='none' stroke='%23fff' stroke-linecap='square' stroke-linejoin='round' stroke-width='2'/%3E%3Cg transform='matrix(.0086269 0 0 -.0086269 4.8224 17.654)'%3E%3Cpath d='m1611 832q0-53-37-90l-651-651q-38-38-91-38-54 0-90 38l-651 651q-38 36-38 90 0 53 38 91l74 75q39 37 91 37 53 0 90-37l486-486 486 486q37 37 90 37 52 0 91-37l75-75q37-39 37-91z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E%0A";
|
|
2792
|
-
this.highlightedGlowFilterId="";this.highlightedGlowFilter_=null;this.warningGlowFilterId="";this.warningGlowFilter_=null};Blockly.utils.object.inherits(Blockly.pxt.ConstantProvider,Blockly.zelos.ConstantProvider);Blockly.pxt.ConstantProvider.prototype.init=function(){Blockly.pxt.ConstantProvider.superClass_.init.call(this);this.ELLIPSES=this.makeEllipses()};
|
|
2804
|
+
this.highlightedGlowFilterId="";this.highlightedGlowFilter_=null;this.warningGlowFilterId="";this.warningGlowFilter_=null;this.dropdownArrowImageId=""};Blockly.utils.object.inherits(Blockly.pxt.ConstantProvider,Blockly.zelos.ConstantProvider);Blockly.pxt.ConstantProvider.prototype.init=function(){Blockly.pxt.ConstantProvider.superClass_.init.call(this);this.ELLIPSES=this.makeEllipses()};
|
|
2793
2805
|
Blockly.pxt.ConstantProvider.prototype.createDom=function(a){Blockly.pxt.ConstantProvider.superClass_.createDom.call(this,a);a=Blockly.utils.dom.createSvgElement("defs",{},a);var b=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyHighlightGlowFilter"+this.randomIdentifier_,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:Blockly.Colours.highlightGlowSize},b);var c=Blockly.utils.dom.createSvgElement("feComponentTransfer",
|
|
2794
2806
|
{result:"outBlur"},b);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":Blockly.Colours.highlightGlow,"flood-opacity":Blockly.Colours.highlightGlowOpacity,result:"outColor"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.highlightedGlowFilterId=b.id;this.highlightedGlowFilter_=b;b=Blockly.utils.dom.createSvgElement("filter",
|
|
2795
2807
|
{id:"blocklyHighlightWarningFilter"+this.randomIdentifier_,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:Blockly.Colours.warningGlowSize},b);c=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"},b);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":Blockly.Colours.warningGlow,
|
|
2796
|
-
"flood-opacity":Blockly.Colours.warningGlowOpacity,result:"outColor"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.warningGlowFilterId=b.id;this.warningGlowFilter_=b;b=this.FIELD_DROPDOWN_SVG_ARROW_SIZE;Blockly.utils.dom.createSvgElement("image",{id:"blocklyDropdownArrowSvg",height:b+"px",width:b+"px"},a).setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.FIELD_DROPDOWN_SVG_ARROW_DATAURI)
|
|
2797
|
-
Blockly.pxt.ConstantProvider.prototype.makeEllipses=function(){for(var a=this.ELLIPSES_RADIUS,b=this.ELLIPSES_SPACING,c="",d=0;3>d;d++)c+=Blockly.utils.svgPaths.moveBy(b,0)+Blockly.utils.svgPaths.arc("a","180 1,1",a,Blockly.utils.svgPaths.point(2*a,0));for(d=0;3>d;d++)c+=Blockly.utils.svgPaths.arc("a","180 1,1",a,Blockly.utils.svgPaths.point(2*-a,0))+Blockly.utils.svgPaths.moveBy(-b,0);return c};
|
|
2808
|
+
"flood-opacity":Blockly.Colours.warningGlowOpacity,result:"outColor"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.warningGlowFilterId=b.id;this.warningGlowFilter_=b;b=this.FIELD_DROPDOWN_SVG_ARROW_SIZE;a=Blockly.utils.dom.createSvgElement("image",{id:"blocklyDropdownArrowSvg"+this.randomIdentifier_,height:b+"px",width:b+"px"},a);a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.FIELD_DROPDOWN_SVG_ARROW_DATAURI);
|
|
2809
|
+
this.dropdownArrowImageId=a.id};Blockly.pxt.ConstantProvider.prototype.makeEllipses=function(){for(var a=this.ELLIPSES_RADIUS,b=this.ELLIPSES_SPACING,c="",d=0;3>d;d++)c+=Blockly.utils.svgPaths.moveBy(b,0)+Blockly.utils.svgPaths.arc("a","180 1,1",a,Blockly.utils.svgPaths.point(2*a,0));for(d=0;3>d;d++)c+=Blockly.utils.svgPaths.arc("a","180 1,1",a,Blockly.utils.svgPaths.point(2*-a,0))+Blockly.utils.svgPaths.moveBy(-b,0);return c};
|
|
2798
2810
|
Blockly.pxt.ConstantProvider.prototype.getCSS_=function(a){var b="."+a+"-renderer";return Blockly.pxt.ConstantProvider.superClass_.getCSS_.call(this,a).concat([b+" .blocklyConnectionIndicator, "+b+" .blocklyInputConnectionIndicator {","fill: #ff0000;","fill-opacity: 0.9;","stroke: #ffff00;","stroke-width: 3px;","}",b+" .blocklyConnectionIndicator {","display: none;","}",b+" .blocklyBlockDragSurface > g > .blocklyDraggable > .blocklyConnectionIndicator {","display: block;","}",b+" .blocklyConnectionLine {",
|
|
2799
2811
|
"stroke: #ffff00;","stroke-width: 4px;","}",b+" .blocklyConnectionLine.hidden {","display: none;","}"])};Blockly.pxt.PathObject=function(a,b,c){Blockly.pxt.PathObject.superClass_.constructor.call(this,a,b,c);this.svgOutputConnectionIndicator_=this.svgPathHighlightedWarning_=this.svgPathHighlighted_=null;Blockly.utils.dom.addClass(this.svgPath,"blocklyBlockBackground")};Blockly.utils.object.inherits(Blockly.pxt.PathObject,Blockly.zelos.PathObject);
|
|
2800
2812
|
Blockly.pxt.PathObject.prototype.setPath=function(a){Blockly.pxt.PathObject.superClass_.setPath.call(this,a);this.svgPathHighlighted_&&this.svgPathHighlighted_.setAttribute("d",a);this.svgPathHighlightedWarning_&&this.svgPathHighlightedWarning_.setAttribute("d",a)};
|
|
@@ -2861,19 +2873,21 @@ Blockly.PXTBlockly={};Blockly.PXTBlockly.Extensions={};
|
|
|
2861
2873
|
Blockly.PXTBlockly.Extensions.INLINE_SVGS=function(){this.ADD_IMAGE_DATAURI="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4KCjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0icmVwZWF0IgogICB4PSIwcHgiCiAgIHk9IjBweCIKICAgdmlld0JveD0iMCAwIDI0IDI0IgogICBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiCiAgIHhtbDpzcGFjZT0icHJlc2VydmUiCiAgIGlua3NjYXBlOnZlcnNpb249IjAuOTEgcjEzNzI1IgogICBzb2RpcG9kaTpkb2NuYW1lPSJhZGQuc3ZnIj48bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGExNSI+PHJkZjpSREY+PGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPjxkYzpmb3JtYXQ+aW1hZ2Uvc3ZnK3htbDwvZGM6Zm9ybWF0PjxkYzp0eXBlCiAgICAgICAgICAgcmRmOnJlc291cmNlPSJodHRwOi8vcHVybC5vcmcvZGMvZGNtaXR5cGUvU3RpbGxJbWFnZSIgLz48ZGM6dGl0bGU+cmVwZWF0PC9kYzp0aXRsZT48L2NjOldvcms+PC9yZGY6UkRGPjwvbWV0YWRhdGE+PGRlZnMKICAgICBpZD0iZGVmczEzIiAvPjxzb2RpcG9kaTpuYW1lZHZpZXcKICAgICBwYWdlY29sb3I9IiNmZjQ4MjEiCiAgICAgYm9yZGVyY29sb3I9IiM2NjY2NjYiCiAgICAgYm9yZGVyb3BhY2l0eT0iMSIKICAgICBvYmplY3R0b2xlcmFuY2U9IjEwIgogICAgIGdyaWR0b2xlcmFuY2U9IjEwIgogICAgIGd1aWRldG9sZXJhbmNlPSIxMCIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBpbmtzY2FwZTpwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTY4MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI5NjkiCiAgICAgaWQ9Im5hbWVkdmlldzExIgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpbmtzY2FwZTp6b29tPSIxOS42NjY2NjciCiAgICAgaW5rc2NhcGU6Y3g9IjEyLjkxNTI1NCIKICAgICBpbmtzY2FwZTpjeT0iMTYuMDY3Nzk2IgogICAgIGlua3NjYXBlOndpbmRvdy14PSIwIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIwIgogICAgIGlua3NjYXBlOndpbmRvdy1tYXhpbWl6ZWQ9IjAiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0icmVwZWF0IiAvPjxzdHlsZQogICAgIHR5cGU9InRleHQvY3NzIgogICAgIGlkPSJzdHlsZTMiPgoJLnN0MHtmaWxsOiNDRjhCMTc7fQoJLnN0MXtmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPjx0aXRsZQogICAgIGlkPSJ0aXRsZTUiPnJlcGVhdDwvdGl0bGU+PHJlY3QKICAgICBzdHlsZT0ib3BhY2l0eToxO2ZpbGw6I2ZmZmZmZjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWNhcDpzcXVhcmU7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1kYXNob2Zmc2V0OjA7c3Ryb2tlLW9wYWNpdHk6MC4wNzg0MzEzNyIKICAgICBpZD0icmVjdDQxNDMiCiAgICAgd2lkdGg9IjQuMDUwMDAwMiIKICAgICBoZWlnaHQ9IjEyLjM5NzA1IgogICAgIHg9IjkuOTc1MDAwNCIKICAgICB5PSItMTguMTk4NTI2IgogICAgIHJ4PSIwLjgxIgogICAgIHJ5PSIwLjgxIgogICAgIHRyYW5zZm9ybT0ic2NhbGUoMSwtMSkiIC8+PHJlY3QKICAgICBzdHlsZT0ib3BhY2l0eToxO2ZpbGw6I2ZmZmZmZjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWNhcDpzcXVhcmU7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1kYXNob2Zmc2V0OjA7c3Ryb2tlLW9wYWNpdHk6MC4wNzg0MzEzNyIKICAgICBpZD0icmVjdDQxNDMtMSIKICAgICB3aWR0aD0iNC4wNTAwMDAyIgogICAgIGhlaWdodD0iMTIuMzk3MTE5IgogICAgIHg9IjkuOTc1MDAwNCIKICAgICB5PSI1LjgwMTQ0MDciCiAgICAgcng9IjAuODEiCiAgICAgcnk9IjAuODEiCiAgICAgdHJhbnNmb3JtPSJtYXRyaXgoMCwxLDEsMCwwLDApIiAvPjxjaXJjbGUKICAgICBzdHlsZT0ib3BhY2l0eToxO2ZpbGw6bm9uZTtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6I2ZmZmZmZjtzdHJva2Utd2lkdGg6MjtzdHJva2UtbGluZWNhcDpzcXVhcmU7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1kYXNob2Zmc2V0OjA7c3Ryb2tlLW9wYWNpdHk6MSIKICAgICBpZD0icGF0aDQxMzYiCiAgICAgY3g9IjEyIgogICAgIGN5PSIxMiIKICAgICByPSIxMC41MDMxOTEiIC8+PC9zdmc+";this.REMOVE_IMAGE_DATAURI=
|
|
2862
2874
|
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4KCjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0icmVwZWF0IgogICB4PSIwcHgiCiAgIHk9IjBweCIKICAgdmlld0JveD0iMCAwIDI0IDI0IgogICBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiCiAgIHhtbDpzcGFjZT0icHJlc2VydmUiCiAgIGlua3NjYXBlOnZlcnNpb249IjAuOTEgcjEzNzI1IgogICBzb2RpcG9kaTpkb2NuYW1lPSJyZW1vdmUuc3ZnIj48bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGExNSI+PHJkZjpSREY+PGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPjxkYzpmb3JtYXQ+aW1hZ2Uvc3ZnK3htbDwvZGM6Zm9ybWF0PjxkYzp0eXBlCiAgICAgICAgICAgcmRmOnJlc291cmNlPSJodHRwOi8vcHVybC5vcmcvZGMvZGNtaXR5cGUvU3RpbGxJbWFnZSIgLz48ZGM6dGl0bGU+cmVwZWF0PC9kYzp0aXRsZT48L2NjOldvcms+PC9yZGY6UkRGPjwvbWV0YWRhdGE+PGRlZnMKICAgICBpZD0iZGVmczEzIiAvPjxzb2RpcG9kaTpuYW1lZHZpZXcKICAgICBwYWdlY29sb3I9IiNmZjFhZmYiCiAgICAgYm9yZGVyY29sb3I9IiM2NjY2NjYiCiAgICAgYm9yZGVyb3BhY2l0eT0iMSIKICAgICBvYmplY3R0b2xlcmFuY2U9IjEwIgogICAgIGdyaWR0b2xlcmFuY2U9IjEwIgogICAgIGd1aWRldG9sZXJhbmNlPSIxMCIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBpbmtzY2FwZTpwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTY4MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI5NTAiCiAgICAgaWQ9Im5hbWVkdmlldzExIgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpbmtzY2FwZTp6b29tPSIxOS42NjY2NjciCiAgICAgaW5rc2NhcGU6Y3g9IjAuMDUwODQ3NTIxIgogICAgIGlua3NjYXBlOmN5PSI5Ljk2NjEwMTciCiAgICAgaW5rc2NhcGU6d2luZG93LXg9IjAiCiAgICAgaW5rc2NhcGU6d2luZG93LXk9IjAiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJyZXBlYXQiIC8+PHN0eWxlCiAgICAgdHlwZT0idGV4dC9jc3MiCiAgICAgaWQ9InN0eWxlMyI+Cgkuc3Qwe2ZpbGw6I0NGOEIxNzt9Cgkuc3Qxe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU+PHRpdGxlCiAgICAgaWQ9InRpdGxlNSI+cmVwZWF0PC90aXRsZT48cmVjdAogICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lY2FwOnNxdWFyZTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLWRhc2hvZmZzZXQ6MDtzdHJva2Utb3BhY2l0eTowLjA3ODQzMTM3IgogICAgIGlkPSJyZWN0NDE0My0xIgogICAgIHdpZHRoPSI0LjA1MDAwMDIiCiAgICAgaGVpZ2h0PSIxMi4zOTcxMTkiCiAgICAgeD0iOS45NzUwMDA0IgogICAgIHk9IjUuODAxNDQwNyIKICAgICByeD0iMC44MSIKICAgICByeT0iMC44MSIKICAgICB0cmFuc2Zvcm09Im1hdHJpeCgwLDEsMSwwLDAsMCkiIC8+PGNpcmNsZQogICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDpub25lO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTojZmZmZmZmO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnNxdWFyZTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLWRhc2hvZmZzZXQ6MDtzdHJva2Utb3BhY2l0eToxIgogICAgIGlkPSJwYXRoNDEzNiIKICAgICBjeD0iMTIiCiAgICAgY3k9IjEyIgogICAgIHI9IjEwLjUwMzE5MSIgLz48L3N2Zz4="};
|
|
2863
2875
|
Blockly.PXTBlockly.Extensions.FUNCTION_CONTEXTMENU_EDIT={customContextMenu:function(a){a.push(Blockly.Functions.makeGoToDefinitionOption(this))}};Blockly.PXTBlockly.Extensions.OUTPUT_NUMBER=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"Number")};Blockly.PXTBlockly.Extensions.OUTPUT_STRING=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"String")};
|
|
2864
|
-
Blockly.PXTBlockly.Extensions.OUTPUT_BOOLEAN=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_HEXAGONAL);this.setOutput(!0,"Boolean")};
|
|
2865
|
-
Blockly.PXTBlockly.Extensions.registerAll=function(){Blockly.Extensions.register("inline-svgs",this.INLINE_SVGS);Blockly.Extensions.registerMixin("function_contextmenu_edit",Blockly.PXTBlockly.Extensions.FUNCTION_CONTEXTMENU_EDIT);Blockly.Extensions.register("output_number",Blockly.PXTBlockly.Extensions.OUTPUT_NUMBER);Blockly.Extensions.register("output_string",Blockly.PXTBlockly.Extensions.OUTPUT_STRING);Blockly.Extensions.register("output_boolean",Blockly.PXTBlockly.Extensions.OUTPUT_BOOLEAN)
|
|
2866
|
-
Blockly.PXTBlockly.Extensions.registerAll();Blockly.Blocks.lists={};Blockly.Constants.Lists={};Blockly.Constants.Lists.HUE=260;
|
|
2876
|
+
Blockly.PXTBlockly.Extensions.OUTPUT_BOOLEAN=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_HEXAGONAL);this.setOutput(!0,"Boolean")};Blockly.PXTBlockly.Extensions.OUTPUT_ARRAY=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"Array")};
|
|
2877
|
+
Blockly.PXTBlockly.Extensions.registerAll=function(){Blockly.Extensions.register("inline-svgs",this.INLINE_SVGS);Blockly.Extensions.registerMixin("function_contextmenu_edit",Blockly.PXTBlockly.Extensions.FUNCTION_CONTEXTMENU_EDIT);Blockly.Extensions.register("output_number",Blockly.PXTBlockly.Extensions.OUTPUT_NUMBER);Blockly.Extensions.register("output_string",Blockly.PXTBlockly.Extensions.OUTPUT_STRING);Blockly.Extensions.register("output_boolean",Blockly.PXTBlockly.Extensions.OUTPUT_BOOLEAN);Blockly.Extensions.register("output_array",
|
|
2878
|
+
Blockly.PXTBlockly.Extensions.OUTPUT_ARRAY)};Blockly.PXTBlockly.Extensions.registerAll();Blockly.Blocks.lists={};Blockly.Constants.Lists={};Blockly.Constants.Lists.HUE=260;
|
|
2867
2879
|
Blockly.defineBlocksWithJsonArray([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",
|
|
2868
2880
|
helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",outputShape:Blockly.OUTPUT_SHAPE_ROUND,inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",outputShape:Blockly.OUTPUT_SHAPE_HEXAGONAL,
|
|
2869
2881
|
style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]);
|
|
2870
|
-
Blockly.Blocks.lists_create_with={init:function(){Blockly.Extensions.apply("inline-svgs",this,!1);this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setStyle("list_blocks");this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setInputsInline(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var a=Blockly.utils.xml.createElement("mutation");a.setAttribute("items",this.itemCount_);
|
|
2871
|
-
domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},storeConnections_:function(){this.valueConnections_=[];for(var a=0;a<this.itemCount_;a++)this.valueConnections_.push(this.getInput("ADD"+a).connection.targetConnection)},restoreConnections_:function(){for(var a=0;a<this.itemCount_;a++)Blockly.Mutator.reconnect(this.valueConnections_[a],
|
|
2872
|
-
|
|
2873
|
-
this.
|
|
2874
|
-
|
|
2875
|
-
var
|
|
2876
|
-
|
|
2882
|
+
Blockly.Blocks.lists_create_with={init:function(){Blockly.Extensions.apply("inline-svgs",this,!1);this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setStyle("list_blocks");this.horizontalAfter_=this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setInputsInline(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var a=Blockly.utils.xml.createElement("mutation");a.setAttribute("items",this.itemCount_);
|
|
2883
|
+
this.horizontalAfter_&&a.setAttribute("horizontalafter",this.horizontalAfter_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);if(a=a.getAttribute("horizontalafter"))this.horizontalAfter_=parseInt(a,10);this.updateShape_()},storeConnections_:function(){this.valueConnections_=[];for(var a=0;a<this.itemCount_;a++)this.valueConnections_.push(this.getInput("ADD"+a).connection.targetConnection)},restoreConnections_:function(){for(var a=0;a<this.itemCount_;a++)Blockly.Mutator.reconnect(this.valueConnections_[a],
|
|
2884
|
+
this,"ADD"+a)},addItem_:function(){function a(a,b){var c=[];if(!a||!a.children)return c;for(var d=0;d<a.children.length;d++){var e=a.children[d];e.tagName===b&&c.push(e)}return c}function b(a,b,d){if(b&&d){var e=Blockly.utils.xml.createElement("value");e.setAttribute("name",b);e.appendChild(c("shadow",d));a.appendChild(e)}}function c(a,b){a=Blockly.utils.xml.createElement(a);a.setAttribute("type",b);a.setAttribute("id",Blockly.utils.genUid());return a}this.storeConnections_();this.update_(function(){this.itemCount_++});
|
|
2885
|
+
this.restoreConnections_();if(1<this.itemCount_){var d=this.getInput("ADD0");if(d&&d.connection.targetConnection){var e=this.getInput("ADD"+(this.itemCount_-1)),f=d.connection.getShadowDom(),g=f&&f.getAttribute("type");if(g){var l=c("shadow",g),m=a(f,"value");for(f=0;f<m.length;f++){var k=m[f],n=k.getAttribute("name"),h=a(k,"shadow")[0];h=h&&h.getAttribute("type");b(l,n,h)}e.connection.setShadowDom(l)}if((f=(d=(f=d.connection.targetConnection)&&f.getSourceBlock())&&d.type)&&f!==g){g=c("block",f);
|
|
2886
|
+
if(d&&d.inputList)for(f=0;f<d.inputList.length;f++)k=d.inputList[f],h=(h=k.connection&&k.connection.getShadowDom())&&h.getAttribute("type"),b(g,k.name,h);g=Blockly.Xml.domToBlock(g,this.workspace);e.connection.connect(g.outputConnection)}else e.connection.respawnShadow_()}}},removeItem_:function(){this.storeConnections_();this.update_(function(){this.itemCount_--});this.restoreConnections_()},update_:function(a){Blockly.Events.setGroup(!0);var b=this,c=b.mutationToDom();c=c&&Blockly.Xml.domToText(c);
|
|
2887
|
+
var d=b.rendered;b.rendered=!1;a&&a.call(this);this.updateShape_();b.rendered=d;b.initSvg();var e=Blockly.Events.getGroup();a=(a=b.mutationToDom())&&Blockly.Xml.domToText(a);c!=a&&(Blockly.Events.fire(new Blockly.Events.BlockChange(b,"mutation",null,c,a)),setTimeout(function(){Blockly.Events.setGroup(e);b.bumpNeighbours();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY));b.rendered&&b.render();Blockly.Events.setGroup(!1)},updateShape_:function(){var a=this,b=function(){a.removeItem_()};this.itemCount_?
|
|
2888
|
+
(this.getInput("EMPTY")&&this.removeInput("EMPTY"),this.getInput("TITLE")||this.appendDummyInput("TITLE").appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH)):(this.getInput("TITLE")&&this.removeInput("TITLE"),this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE));var c=0;for(c=0;c<this.itemCount_;c++)this.getInput("ADD"+c)||this.appendValueInput("ADD"+c);for(;this.getInput("ADD"+c);)this.removeInput("ADD"+c),c++;this.getInput("BUTTONS")&&this.removeInput("BUTTONS");
|
|
2889
|
+
c=this.appendDummyInput("BUTTONS");0<this.itemCount_&&c.appendField(new Blockly.FieldImage(this.REMOVE_IMAGE_DATAURI,24,24,"*",b,!1));c.appendField(new Blockly.FieldImage(this.ADD_IMAGE_DATAURI,24,24,"*",function(){a.addItem_()},!1));b=this.itemCount_<=this.horizontalAfter_;this.setInputsInline(b);this.setOutputShape(b?Blockly.OUTPUT_SHAPE_ROUND:Blockly.OUTPUT_SHAPE_SQUARE)}};
|
|
2890
|
+
Blockly.Blocks.lists_create_with_container={init:function(){this.setStyle("list_blocks");this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP);this.contextMenu=!1}};
|
|
2877
2891
|
Blockly.Blocks.lists_create_with_item={init:function(){this.setStyle("list_blocks");this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);this.contextMenu=!1}};
|
|
2878
2892
|
Blockly.Blocks.lists_indexOf={init:function(){var a=[[Blockly.Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[Blockly.Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_INDEX_OF_HELPURL);this.setStyle("list_blocks");this.setOutput(!0,"Number");this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST);this.appendValueInput("FIND").appendField(new Blockly.FieldDropdown(a),"END");this.setInputsInline(!0);
|
|
2879
2893
|
var b=this;this.setTooltip(function(){return Blockly.Msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",b.workspace.options.oneBasedIndex?"0":"-1")})}};
|
|
@@ -2937,8 +2951,8 @@ check:"Number",align:"LEFT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args
|
|
|
2937
2951
|
name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",extensions:["controls_flow_tooltip",
|
|
2938
2952
|
"controls_flow_in_loop_check"]}]);Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};Blockly.Extensions.register("controls_whileUntil_tooltip",Blockly.Extensions.buildTooltipForDropdown("MODE",Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS));Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};
|
|
2939
2953
|
Blockly.Extensions.register("controls_flow_tooltip",Blockly.Extensions.buildTooltipForDropdown("FLOW",Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS));
|
|
2940
|
-
Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getField("VAR").getVariable(),c=b.name;if(!this.isCollapsed()&&null!=c){var d={enabled:!
|
|
2941
|
-
Blockly.Extensions.registerMixin("contextMenu_newGetVariableBlock",Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);Blockly.Extensions.register("controls_for_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR"));Blockly.Extensions.register("controls_forEach_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));
|
|
2954
|
+
Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getField("VAR").getVariable(),c=b.name;if(!this.isCollapsed()&&null!=c){var d={enabled:!this.inDebugWorkspace()};d.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c);b=Blockly.Variables.generateVariableFieldDom(b);c=Blockly.utils.xml.createElement("block");c.setAttribute("type","variables_get");c.appendChild(b);d.callback=Blockly.ContextMenu.callbackFactory(this,
|
|
2955
|
+
c);a.push(d)}}}};Blockly.Extensions.registerMixin("contextMenu_newGetVariableBlock",Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);Blockly.Extensions.register("controls_for_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR"));Blockly.Extensions.register("controls_forEach_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));
|
|
2942
2956
|
Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(a){do{if(-1!=Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(a.type))return a;a=a.getSurroundParent()}while(a);return null},onchange:function(a){this.workspace.isDragging&&!this.workspace.isDragging()&&(Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(this)?
|
|
2943
2957
|
(this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1)))}};Blockly.Extensions.registerMixin("controls_flow_in_loop_check",Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);Blockly.Blocks.math={};Blockly.Constants.Math={};Blockly.Constants.Math.HUE=230;
|
|
2944
2958
|
Blockly.defineBlocksWithJsonArray([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"field_blocks",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_integer",message0:"%1",args0:[{type:"field_number",name:"NUM",precision:1}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"field_blocks",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",
|
|
@@ -2974,9 +2988,9 @@ Blockly.utils.xml.createElement("block");e.setAttribute("type","procedures_mutat
|
|
|
2974
2988
|
return a},compose:function(a){this.arguments_=[];this.paramIds_=[];this.argumentVarModels_=[];for(var b=a.getInputTargetBlock("STACK");b;){var c=b.getFieldValue("NAME");this.arguments_.push(c);c=this.workspace.getVariable(c,"");this.argumentVarModels_.push(c);this.paramIds_.push(b.id);b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateParams_();Blockly.Procedures.mutateCallers(this);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"==a,this.hasStatements_!=a))if(a)this.setStatements_(!0),
|
|
2975
2989
|
Blockly.Mutator.reconnect(this.statementConnection_,this,"STACK"),this.statementConnection_=null;else{a=this.getInput("STACK").connection;if(this.statementConnection_=a.targetConnection)a=a.targetBlock(),a.unplug(),a.bumpNeighbours();this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(a,b){var c=this.workspace.getVariableById(a);
|
|
2976
2990
|
if(""==c.type){c=c.name;b=this.workspace.getVariableById(b);for(var d=!1,e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()==a&&(this.arguments_[e]=b.name,this.argumentVarModels_[e]=b,d=!0);d&&(this.displayRenamedVar_(c,b.name),Blockly.Procedures.mutateCallers(this))}},updateVarName:function(a){for(var b=a.name,c=!1,d=0;d<this.argumentVarModels_.length;d++)if(this.argumentVarModels_[d].getId()==a.getId()){var e=this.arguments_[d];this.arguments_[d]=b;c=!0}c&&(this.displayRenamedVar_(e,
|
|
2977
|
-
b),Blockly.Procedures.mutateCallers(this))},displayRenamedVar_:function(a,b){this.updateParams_();if(this.mutator&&this.mutator.isVisible())for(var c=this.mutator.workspace_.getAllBlocks(!1),d=0,e;e=c[d];d++)"procedures_mutatorarg"==e.type&&Blockly.Names.equals(a,e.getFieldValue("NAME"))&&e.setFieldValue(b,"NAME")},customContextMenu:function(a){if(!this.isInFlyout){var b={enabled:!
|
|
2978
|
-
d.setAttribute("name",c);for(c=0;c<this.arguments_.length;c++){var e=Blockly.utils.xml.createElement("arg");e.setAttribute("name",this.arguments_[c]);d.appendChild(e)}c=Blockly.utils.xml.createElement("block");c.setAttribute("type",this.callType_);c.appendChild(d);b.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(b);if(!this.isCollapsed())for(c=0;c<this.argumentVarModels_.length;c++)b={enabled:!
|
|
2979
|
-
d=Blockly.Variables.generateVariableFieldDom(d),e=Blockly.utils.xml.createElement("block"),e.setAttribute("type","variables_get"),e.appendChild(d),b.callback=Blockly.ContextMenu.callbackFactory(this,e),a.push(b)}},callType_:"procedures_callnoreturn"};
|
|
2991
|
+
b),Blockly.Procedures.mutateCallers(this))},displayRenamedVar_:function(a,b){this.updateParams_();if(this.mutator&&this.mutator.isVisible())for(var c=this.mutator.workspace_.getAllBlocks(!1),d=0,e;e=c[d];d++)"procedures_mutatorarg"==e.type&&Blockly.Names.equals(a,e.getFieldValue("NAME"))&&e.setFieldValue(b,"NAME")},customContextMenu:function(a){if(!this.isInFlyout){var b={enabled:!this.options.debugMode},c=this.getFieldValue("NAME");b.text=Blockly.Msg.PROCEDURES_CREATE_DO.replace("%1",c);var d=Blockly.utils.xml.createElement("mutation");
|
|
2992
|
+
d.setAttribute("name",c);for(c=0;c<this.arguments_.length;c++){var e=Blockly.utils.xml.createElement("arg");e.setAttribute("name",this.arguments_[c]);d.appendChild(e)}c=Blockly.utils.xml.createElement("block");c.setAttribute("type",this.callType_);c.appendChild(d);b.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(b);if(!this.isCollapsed())for(c=0;c<this.argumentVarModels_.length;c++)b={enabled:!this.inDebugWorkspace()},d=this.argumentVarModels_[c],b.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",
|
|
2993
|
+
d.name),d=Blockly.Variables.generateVariableFieldDom(d),e=Blockly.utils.xml.createElement("block"),e.setAttribute("type","variables_get"),e.appendChild(d),b.callback=Blockly.ContextMenu.callbackFactory(this,e),a.push(b)}},callType_:"procedures_callnoreturn"};
|
|
2980
2994
|
Blockly.Blocks.procedures_defreturn={init:function(){var a=new Blockly.FieldTextInput("",Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.appendValueInput("RETURN").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&
|
|
2981
2995
|
this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT);this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:Blockly.Blocks.procedures_defnoreturn.setStatements_,updateParams_:Blockly.Blocks.procedures_defnoreturn.updateParams_,
|
|
2982
2996
|
mutationToDom:Blockly.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_defnoreturn.domToMutation,decompose:Blockly.Blocks.procedures_defnoreturn.decompose,compose:Blockly.Blocks.procedures_defnoreturn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Blockly.Blocks.procedures_defnoreturn.getVars,getVarModels:Blockly.Blocks.procedures_defnoreturn.getVarModels,renameVarById:Blockly.Blocks.procedures_defnoreturn.renameVarById,
|
|
@@ -3041,19 +3055,19 @@ Blockly.PXTBlockly.FunctionUtils.createAllInputs_=function(a){var b=!1,c=!1,d=!1
|
|
|
3041
3055
|
"function_title")}c?this.updateFunctionLabel_(this.getName()):this.addFunctionLabel_(this.getName());var f=this;this.arguments_.forEach(function(b){var c=f.appendValueInput(b.id);Blockly.Functions.isCustomType(b.type)?c.setCheck(b.type):c.setCheck(b.type.charAt(0).toUpperCase()+b.type.slice(1));f.isInsertionMarker()||f.populateArgument_(b,a,c)});d&&this.moveInputBefore("function_collapse",null);this.hasStatements_&&this.moveInputBefore("STACK",null)};
|
|
3042
3056
|
Blockly.PXTBlockly.FunctionUtils.deleteShadows_=function(a){if(a)for(var b in a){var c=a[b];c&&(c=c.block)&&c.isShadow()&&(c.dispose(),delete a[b])}};Blockly.PXTBlockly.FunctionUtils.updateLabelEditor_=function(a){Blockly.Events.disable();this.getField("function_name").setValue(a);Blockly.Events.enable()};Blockly.PXTBlockly.FunctionUtils.updateLabelField_=function(a){this.getField("function_name").setValue(a)};
|
|
3043
3057
|
Blockly.PXTBlockly.FunctionUtils.addLabelEditor_=function(a){a=this.type===Blockly.FUNCTION_DEFINITION_BLOCK_TYPE?new Blockly.FieldTextInput(a||"",Blockly.Functions.rename):new Blockly.FieldTextInput(a||"");a.setSpellcheck(!1);a.setAutoCapitalize(!1);this.appendDummyInput("function_name").appendField(a,"function_name")};Blockly.PXTBlockly.FunctionUtils.addLabelField_=function(a){this.appendDummyInput("function_name").appendField(new Blockly.FieldLabel(a,"functionNameText"),"function_name")};
|
|
3044
|
-
Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_=function(a,b){switch(a){case "boolean":var c="logic_boolean";var d="BOOL";a="TRUE";break;case "number":c="math_number";d="NUM";a="1";break;case "string":c="text";d="TEXT";a="abc";break;default:c="variables_get",d="VAR",a=Blockly.Variables.getOrCreateVariablePackage(b,null,Blockly.PXTBlockly.FunctionUtils.getArgumentDefaultName(a),
|
|
3045
|
-
Blockly.PXTBlockly.FunctionUtils.buildShadowDom_=function(a){var b=Blockly.utils.xml.createElement("shadow"),c=Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_(a,this.workspace);a=c[1];var d=c[2];b.setAttribute("type",c[0]);c=goog.dom.createDom("field",null,d);c.setAttribute("name",a);b.appendChild(c);return b};
|
|
3058
|
+
Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_=function(a,b){switch(a){case "boolean":var c="logic_boolean";var d="BOOL";a="TRUE";break;case "number":c="math_number";d="NUM";a="1";break;case "string":c="text";d="TEXT";a="abc";break;case "Array":c="variables_get";d="VAR";a=Blockly.Variables.getOrCreateVariablePackage(b,null,"list","").getId();break;default:c="variables_get",d="VAR",a=Blockly.Variables.getOrCreateVariablePackage(b,null,Blockly.PXTBlockly.FunctionUtils.getArgumentDefaultName(a),
|
|
3059
|
+
"").getId()}return[c,d,a]};Blockly.PXTBlockly.FunctionUtils.buildShadowDom_=function(a){var b=Blockly.utils.xml.createElement("shadow"),c=Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_(a,this.workspace);a=c[1];var d=c[2];b.setAttribute("type",c[0]);c=goog.dom.createDom("field",null,d);c.setAttribute("name",a);b.appendChild(c);return b};
|
|
3046
3060
|
Blockly.PXTBlockly.FunctionUtils.attachShadow_=function(a,b){var c=Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_(b,this.workspace);b=c[0];var d=c[1];c=c[2];Blockly.Events.disable();var e=null;try{e=this.workspace.newBlock(b),e.setFieldValue(c,d),e.setShadow(!0),!this.isInsertionMarker()&&e.initSvg&&(e.initSvg(),e.render(!1))}finally{Blockly.Events.enable()}e&&e.outputConnection.connect(a.connection)};
|
|
3047
|
-
Blockly.PXTBlockly.FunctionUtils.createArgumentReporter_=function(a){switch(a.type){case "boolean":var b="argument_reporter_boolean";break;case "number":b="argument_reporter_number";break;case "string":b="argument_reporter_string";break;default:b="argument_reporter_custom"}Blockly.Events.disable();try{var c="argument_reporter_custom"==b?Blockly.PXTBlockly.FunctionUtils.createCustomArgumentReporter(a.type,this.workspace):this.workspace.newBlock(b);c.setShadow(!0);
|
|
3048
|
-
c.initSvg&&(c.initSvg(),c.render(!1))}finally{Blockly.Events.enable()}return c};Blockly.PXTBlockly.FunctionUtils.createCollapseIcon_=function(){var a=this;if(a.workspace&&a.workspace.getRenderer){var b=a.workspace.getRenderer().getConstants().COLLAPSE_IMAGE_DATAURI;b&&a.appendDummyInput("function_collapse").appendField(new Blockly.FieldImage(b,24,24,"",function(){a.setCollapsed(!0)},!1))}};
|
|
3049
|
-
Blockly.PXTBlockly.FunctionUtils.populateArgumentOnCaller_=function(a,b,c){var d=null,e=null;b&&a.id in b&&(e=b[a.id],d=e.block,e=e.shadow);b&&d?(b[c.name]=null,d.outputConnection.connect(c.connection),a=e||this.buildShadowDom_(a.type),c.connection.setShadowDom(a)):this.attachShadow_(c,a.type)};
|
|
3061
|
+
Blockly.PXTBlockly.FunctionUtils.createArgumentReporter_=function(a){switch(a.type){case "boolean":var b="argument_reporter_boolean";break;case "number":b="argument_reporter_number";break;case "string":b="argument_reporter_string";break;case "Array":b="argument_reporter_array";break;default:b="argument_reporter_custom"}Blockly.Events.disable();try{var c="argument_reporter_custom"==b?Blockly.PXTBlockly.FunctionUtils.createCustomArgumentReporter(a.type,this.workspace):this.workspace.newBlock(b);c.setShadow(!0);
|
|
3062
|
+
c.setFieldValue(a.name,"VALUE");!this.isInsertionMarker()&&c.initSvg&&(c.initSvg(),c.render(!1))}finally{Blockly.Events.enable()}return c};Blockly.PXTBlockly.FunctionUtils.createCollapseIcon_=function(){var a=this;if(a.workspace&&a.workspace.getRenderer){var b=a.workspace.getRenderer().getConstants().COLLAPSE_IMAGE_DATAURI;b&&a.appendDummyInput("function_collapse").appendField(new Blockly.FieldImage(b,24,24,"",function(){a.setCollapsed(!0)},!1))}};
|
|
3063
|
+
Blockly.PXTBlockly.FunctionUtils.populateArgumentOnCaller_=function(a,b,c){var d=null,e=null;b&&a.id in b&&(e=b[a.id],d=e.block,e=e.shadow);b&&d&&d.outputConnection.canConnectWithReason(c.connection)===Blockly.Connection.CAN_CONNECT?(b[c.name]=null,d.outputConnection.connect(c.connection),a=e||this.buildShadowDom_(a.type),c.connection.setShadowDom(a)):(this.attachShadow_(c,a.type),d&&d.isShadow_&&d.setShadow(!1))};
|
|
3050
3064
|
Blockly.PXTBlockly.FunctionUtils.populateArgumentOnDefinition_=function(a,b,c){var d=null;b&&a.id in b&&(d=b[a.id].block);b&&d?(d.setFieldValue(a.name,"VALUE"),b[c.name]=null):d=this.createArgumentReporter_(a);c.connection.connect(d.outputConnection)};Blockly.PXTBlockly.FunctionUtils.populateArgumentOnDeclaration_=function(a,b,c){a=this.createArgumentEditor_(a.type,a.name);c.connection.connect(a.outputConnection)};
|
|
3051
|
-
Blockly.PXTBlockly.FunctionUtils.createArgumentEditor_=function(a,b){Blockly.Events.disable();try{var c="";switch(a){case "boolean":c="argument_editor_boolean";break;case "number":c="argument_editor_number";break;case "string":c="argument_editor_string";break;default:c="argument_editor_custom"}var d="argument_editor_custom"==c?Blockly.PXTBlockly.FunctionUtils.createCustomArgumentEditor(a,this.workspace):this.workspace.newBlock(c);d.setFieldValue(b,"TEXT");
|
|
3052
|
-
d.initSvg&&(d.initSvg(),d.render(!1))}finally{Blockly.Events.enable()}return d};
|
|
3065
|
+
Blockly.PXTBlockly.FunctionUtils.createArgumentEditor_=function(a,b){Blockly.Events.disable();try{var c="";switch(a){case "boolean":c="argument_editor_boolean";break;case "number":c="argument_editor_number";break;case "string":c="argument_editor_string";break;case "Array":c="argument_editor_array";break;default:c="argument_editor_custom"}var d="argument_editor_custom"==c?Blockly.PXTBlockly.FunctionUtils.createCustomArgumentEditor(a,this.workspace):this.workspace.newBlock(c);d.setFieldValue(b,"TEXT");
|
|
3066
|
+
d.setShadow(!0);!this.isInsertionMarker()&&d.initSvg&&(d.initSvg(),d.render(!1))}finally{Blockly.Events.enable()}return d};
|
|
3053
3067
|
Blockly.PXTBlockly.FunctionUtils.updateDeclarationMutation_=function(){this.arguments_=[];for(var a=1;a<this.inputList.length;a++){var b=this.inputList[a];switch(b.type){case Blockly.NEXT_STATEMENT:break;case Blockly.DUMMY_INPUT:this.name_=b.fieldRow[0].getValue()||b.fieldRow[0].getText();break;case Blockly.INPUT_VALUE:var c=b.connection.targetBlock();this.arguments_.push({id:b.name,name:c.getFieldValue("TEXT"),type:c.getTypeName()});break;default:console.warn("Unexpected input type on a function mutator root: "+
|
|
3054
3068
|
b.type)}}};Blockly.PXTBlockly.FunctionUtils.focusLastEditor_=function(){if(0<this.inputList.length){var a=this.inputList[this.inputList.length-2];a.type==Blockly.DUMMY_INPUT?(this.workspace.centerOnBlock(this.id),a.fieldRow[0].showEditor_()):a.type==Blockly.INPUT_VALUE&&(a=a.connection.targetBlock(),a.workspace.centerOnBlock(a.id),a.getField("TEXT").showEditor_())}};
|
|
3055
3069
|
Blockly.PXTBlockly.FunctionUtils.addParam_=function(a,b){Blockly.WidgetDiv.hide(!0);b=Blockly.Functions.findUniqueParamName(b,this.arguments_.map(function(a){return a.name}));this.arguments_.push({id:Blockly.utils.genUid(),name:b,type:a});this.updateDisplay_();this.focusLastEditor_()};Blockly.PXTBlockly.FunctionUtils.addBooleanExternal=function(){this.addParam_("boolean",Blockly.Msg.FUNCTIONS_DEFAULT_BOOLEAN_ARG_NAME)};
|
|
3056
|
-
Blockly.PXTBlockly.FunctionUtils.addStringExternal=function(){this.addParam_("string",Blockly.Msg.FUNCTIONS_DEFAULT_STRING_ARG_NAME)};Blockly.PXTBlockly.FunctionUtils.addNumberExternal=function(){this.addParam_("number",Blockly.Msg.FUNCTIONS_DEFAULT_NUMBER_ARG_NAME)};Blockly.PXTBlockly.FunctionUtils.addCustomExternal=function(a){this.addParam_(a,Blockly.PXTBlockly.FunctionUtils.getArgumentDefaultName(a))};
|
|
3070
|
+
Blockly.PXTBlockly.FunctionUtils.addStringExternal=function(){this.addParam_("string",Blockly.Msg.FUNCTIONS_DEFAULT_STRING_ARG_NAME)};Blockly.PXTBlockly.FunctionUtils.addNumberExternal=function(){this.addParam_("number",Blockly.Msg.FUNCTIONS_DEFAULT_NUMBER_ARG_NAME)};Blockly.PXTBlockly.FunctionUtils.addArrayExternal=function(){this.addParam_("Array",Blockly.Msg.FUNCTIONS_DEFAULT_ARRAY_ARG_NAME)};Blockly.PXTBlockly.FunctionUtils.addCustomExternal=function(a){this.addParam_(a,Blockly.PXTBlockly.FunctionUtils.getArgumentDefaultName(a))};
|
|
3057
3071
|
Blockly.PXTBlockly.FunctionUtils.removeFieldCallback=function(a){for(var b=null,c=0;c<this.inputList.length&&!b;c++){var d=this.inputList[c];if(d.connection){var e=d.connection.targetBlock();e&&e.getField(a.name)===a&&(b=d.name)}else for(e=0;e<d.fieldRow.length;e++)d.fieldRow[e]==a&&(b=d.name)}b&&(Blockly.WidgetDiv.hide(!0),this.removeInput(b),this.updateFunctionSignature(),this.updateDisplay_())};
|
|
3058
3072
|
Blockly.PXTBlockly.FunctionUtils.removeArgumentCallback_=function(a){this.parentBlock_&&this.parentBlock_.removeFieldCallback&&this.parentBlock_.removeFieldCallback(a)};
|
|
3059
3073
|
Blockly.PXTBlockly.FunctionUtils.onCallerChange=function(a){if(this.workspace&&!this.workspace.isFlyout)if(a.type==Blockly.Events.BLOCK_CREATE&&-1!=a.ids.indexOf(this.id)){var b=this.getName();if(b=Blockly.Functions.getDefinition(b,this.workspace)){a=b.getArguments().slice();var c=this.arguments_.slice();JSON.stringify(c)!==JSON.stringify(a)&&Blockly.Functions.mutateCallersAndDefinition(b.getName(),this.workspace,b.mutationToDom());this.functionId_=b.functionId_}else{Blockly.Events.setGroup(a.group);
|
|
@@ -3062,9 +3076,9 @@ this.workspace),b||(Blockly.Events.setGroup(a.group),this.dispose(!0,!1),Blockly
|
|
|
3062
3076
|
Blockly.Blocks.function_declaration={init:function(){this.jsonInit({style:{hat:"cap"}});this.name_="";this.arguments_=[];this.functionId_="";this.createAllInputs_();this.setColour(Blockly.Msg.PROCEDURES_HUE);this.setStatements_(!0);this.setDeletable(!1);this.setMovable(!1);this.contextMenu=!1;this.setInputsInline(!0);this.statementConnection_=null},mutationToDom:Blockly.PXTBlockly.FunctionUtils.mutationToDom,domToMutation:Blockly.PXTBlockly.FunctionUtils.domToMutation,getName:Blockly.PXTBlockly.FunctionUtils.getName,
|
|
3063
3077
|
getFunctionId:Blockly.PXTBlockly.FunctionUtils.getFunctionId,getArguments:Blockly.PXTBlockly.FunctionUtils.getArguments,removeValueInputs_:Blockly.PXTBlockly.FunctionUtils.removeValueInputs_,disconnectOldBlocks_:Blockly.PXTBlockly.FunctionUtils.disconnectOldBlocks_,deleteShadows_:Blockly.PXTBlockly.FunctionUtils.deleteShadows_,createAllInputs_:Blockly.PXTBlockly.FunctionUtils.createAllInputs_,updateDisplay_:Blockly.PXTBlockly.FunctionUtils.updateDisplay_,setStatements_:Blockly.PXTBlockly.FunctionUtils.setStatements_,
|
|
3064
3078
|
ensureIds_:Blockly.PXTBlockly.FunctionUtils.ensureIds_,populateArgument_:Blockly.PXTBlockly.FunctionUtils.populateArgumentOnDeclaration_,addFunctionLabel_:Blockly.PXTBlockly.FunctionUtils.addLabelEditor_,updateFunctionLabel_:Blockly.PXTBlockly.FunctionUtils.updateLabelEditor_,createArgumentEditor_:Blockly.PXTBlockly.FunctionUtils.createArgumentEditor_,focusLastEditor_:Blockly.PXTBlockly.FunctionUtils.focusLastEditor_,removeFieldCallback:Blockly.PXTBlockly.FunctionUtils.removeFieldCallback,addParam_:Blockly.PXTBlockly.FunctionUtils.addParam_,
|
|
3065
|
-
addBooleanExternal:Blockly.PXTBlockly.FunctionUtils.addBooleanExternal,addStringExternal:Blockly.PXTBlockly.FunctionUtils.addStringExternal,addNumberExternal:Blockly.PXTBlockly.FunctionUtils.addNumberExternal,addCustomExternal:Blockly.PXTBlockly.FunctionUtils.addCustomExternal,updateFunctionSignature:Blockly.PXTBlockly.FunctionUtils.updateDeclarationMutation_};
|
|
3066
|
-
Blockly.Blocks.function_definition={init:function(){this.jsonInit({style:{hat:"cap"}});this.name_="";this.arguments_=[];this.functionId_="";this.createAllInputs_();this.setColour(Blockly.Msg.PROCEDURES_HUE);this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.setStatements_(!0);this.createCollapseIcon_();this.setInputsInline(!0);this.statementConnection_=null},customContextMenu:function(a){a.push(Blockly.Functions.makeEditOption(this))
|
|
3067
|
-
a.push(Blockly.Functions.makeCreateCallOption(this))},mutationToDom:Blockly.PXTBlockly.FunctionUtils.mutationToDom,domToMutation:Blockly.PXTBlockly.FunctionUtils.domToMutation,getName:Blockly.PXTBlockly.FunctionUtils.getName,getFunctionId:Blockly.PXTBlockly.FunctionUtils.getFunctionId,getArguments:Blockly.PXTBlockly.FunctionUtils.getArguments,removeValueInputs_:Blockly.PXTBlockly.FunctionUtils.removeValueInputs_,disconnectOldBlocks_:Blockly.PXTBlockly.FunctionUtils.disconnectOldBlocks_,deleteShadows_:Blockly.PXTBlockly.FunctionUtils.deleteShadows_,
|
|
3079
|
+
addBooleanExternal:Blockly.PXTBlockly.FunctionUtils.addBooleanExternal,addStringExternal:Blockly.PXTBlockly.FunctionUtils.addStringExternal,addNumberExternal:Blockly.PXTBlockly.FunctionUtils.addNumberExternal,addArrayExternal:Blockly.PXTBlockly.FunctionUtils.addArrayExternal,addCustomExternal:Blockly.PXTBlockly.FunctionUtils.addCustomExternal,updateFunctionSignature:Blockly.PXTBlockly.FunctionUtils.updateDeclarationMutation_};
|
|
3080
|
+
Blockly.Blocks.function_definition={init:function(){this.jsonInit({style:{hat:"cap"}});this.name_="";this.arguments_=[];this.functionId_="";this.createAllInputs_();this.setColour(Blockly.Msg.PROCEDURES_HUE);this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.setStatements_(!0);this.createCollapseIcon_();this.setInputsInline(!0);this.statementConnection_=null},customContextMenu:function(a){this.inDebugWorkspace()||(a.push(Blockly.Functions.makeEditOption(this)),
|
|
3081
|
+
a.push(Blockly.Functions.makeCreateCallOption(this)))},mutationToDom:Blockly.PXTBlockly.FunctionUtils.mutationToDom,domToMutation:Blockly.PXTBlockly.FunctionUtils.domToMutation,getName:Blockly.PXTBlockly.FunctionUtils.getName,getFunctionId:Blockly.PXTBlockly.FunctionUtils.getFunctionId,getArguments:Blockly.PXTBlockly.FunctionUtils.getArguments,removeValueInputs_:Blockly.PXTBlockly.FunctionUtils.removeValueInputs_,disconnectOldBlocks_:Blockly.PXTBlockly.FunctionUtils.disconnectOldBlocks_,deleteShadows_:Blockly.PXTBlockly.FunctionUtils.deleteShadows_,
|
|
3068
3082
|
createAllInputs_:Blockly.PXTBlockly.FunctionUtils.createAllInputs_,updateDisplay_:Blockly.PXTBlockly.FunctionUtils.updateDisplay_,setStatements_:Blockly.PXTBlockly.FunctionUtils.setStatements_,ensureIds_:Blockly.PXTBlockly.FunctionUtils.ensureIds_,populateArgument_:Blockly.PXTBlockly.FunctionUtils.populateArgumentOnDefinition_,addFunctionLabel_:Blockly.PXTBlockly.FunctionUtils.addLabelEditor_,updateFunctionLabel_:Blockly.PXTBlockly.FunctionUtils.updateLabelEditor_,createArgumentReporter_:Blockly.PXTBlockly.FunctionUtils.createArgumentReporter_,
|
|
3069
3083
|
createCollapseIcon_:Blockly.PXTBlockly.FunctionUtils.createCollapseIcon_};
|
|
3070
3084
|
Blockly.Blocks.function_call={init:function(){this.jsonInit({extensions:["function_contextmenu_edit"]});this.name_="";this.arguments_=[];this.functionId_="";this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Msg.PROCEDURES_HUE);this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL);this.setTooltip(Blockly.Msg.FUNCTION_CALL_TOOLTIP);this.setInputsInline(!0)},mutationToDom:Blockly.PXTBlockly.FunctionUtils.mutationToDom,domToMutation:Blockly.PXTBlockly.FunctionUtils.domToMutation,
|
|
@@ -3079,10 +3093,12 @@ Blockly.PXTBlockly.FunctionUtils.createCustomArgumentReporter=function(a,b){retu
|
|
|
3079
3093
|
Blockly.Blocks.argument_editor_boolean={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_argument_editor",name:"TEXT",text:"bool"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,extensions:["output_boolean"]});this.typeName_="boolean"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName,removeFieldCallback:Blockly.PXTBlockly.FunctionUtils.removeArgumentCallback_};
|
|
3080
3094
|
Blockly.Blocks.argument_editor_string={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_argument_editor",name:"TEXT",text:"text"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,extensions:["output_string"]});this.typeName_="string"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName,removeFieldCallback:Blockly.PXTBlockly.FunctionUtils.removeArgumentCallback_};
|
|
3081
3095
|
Blockly.Blocks.argument_editor_number={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_argument_editor",name:"TEXT",text:"num"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,extensions:["output_number"]});this.typeName_="number"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName,removeFieldCallback:Blockly.PXTBlockly.FunctionUtils.removeArgumentCallback_};
|
|
3096
|
+
Blockly.Blocks.argument_editor_array={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_argument_editor",name:"TEXT",text:"list"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,extensions:["output_array"]});this.typeName_="Array"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName,removeFieldCallback:Blockly.PXTBlockly.FunctionUtils.removeArgumentCallback_};
|
|
3082
3097
|
Blockly.Blocks.argument_editor_custom={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_argument_editor",name:"TEXT",text:"arg"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,outputShape:Blockly.OUTPUT_SHAPE_ROUND});this.typeName_="any"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName,removeFieldCallback:Blockly.PXTBlockly.FunctionUtils.removeArgumentCallback_,mutationToDom:Blockly.PXTBlockly.FunctionUtils.argumentMutationToDom,
|
|
3083
3098
|
domToMutation:Blockly.PXTBlockly.FunctionUtils.argumentDomToMutation};Blockly.Blocks.argument_reporter_boolean={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_hover",name:"VALUE",text:""}],colour:Blockly.Msg.REPORTERS_HUE,extensions:["output_boolean"]});this.typeName_="boolean"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName};
|
|
3084
3099
|
Blockly.Blocks.argument_reporter_number={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_hover",name:"VALUE",text:""}],colour:Blockly.Msg.REPORTERS_HUE,extensions:["output_number"]});this.typeName_="number"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName};
|
|
3085
3100
|
Blockly.Blocks.argument_reporter_string={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_hover",name:"VALUE",text:""}],colour:Blockly.Msg.REPORTERS_HUE,extensions:["output_string"]});this.typeName_="string"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName};
|
|
3101
|
+
Blockly.Blocks.argument_reporter_array={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_hover",name:"VALUE",text:""}],colour:Blockly.Msg.REPORTERS_HUE,extensions:["output_array"]});this.typeName_="Array"},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName};
|
|
3086
3102
|
Blockly.Blocks.argument_reporter_custom={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_hover",name:"VALUE",text:""}],colour:Blockly.Msg.REPORTERS_HUE,inputsInline:!0,outputShape:Blockly.OUTPUT_SHAPE_ROUND,output:null});this.typeName_=""},getTypeName:Blockly.PXTBlockly.FunctionUtils.getTypeName,mutationToDom:Blockly.PXTBlockly.FunctionUtils.argumentMutationToDom,domToMutation:Blockly.PXTBlockly.FunctionUtils.argumentDomToMutation};Blockly.Blocks.texts={};Blockly.Constants.Text={};Blockly.Constants.Text.HUE=160;
|
|
3087
3103
|
Blockly.defineBlocksWithJsonArray([{type:"text",message0:"%1",args0:[{type:"field_string",name:"TEXT",text:""}],output:"String",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"field_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,
|
|
3088
3104
|
height:17,alt:"\u00b6"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"},{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",
|
|
@@ -3123,11 +3139,11 @@ Blockly.Constants.Text.TEXT_CHARAT_EXTENSION=function(){this.getField("WHERE").s
|
|
|
3123
3139
|
Blockly.defineBlocksWithJsonArray([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_get_reporter",message0:"%1",args0:[{type:"field_variable_getter",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,
|
|
3124
3140
|
colour:"%{BKY_VARIABLES_HUE}",outputShape:Blockly.OUTPUT_SHAPE_ROUND,helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableReporter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",
|
|
3125
3141
|
extensions:["contextMenu_variableSetterGetter"]}]);
|
|
3126
|
-
Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if(!this.isCollapsed())if(!this.isInFlyout){if("variables_get"==this.type||"variables_get_reporter"==this.type)var b="variables_set",c=Blockly.Msg.VARIABLES_GET_CREATE_SET;else b="variables_get",c=Blockly.Msg.VARIABLES_SET_CREATE_GET;var d={enabled:0<this.workspace.remainingCapacity()},e=this.getField("VAR").getText();d.text=c.replace("%1",e);c=Blockly.utils.xml.createElement("field");
|
|
3127
|
-
"VAR");c.appendChild(Blockly.utils.xml.createTextNode(e));e=Blockly.utils.xml.createElement("block");e.setAttribute("type",b);e.appendChild(c);d.callback=Blockly.ContextMenu.callbackFactory(this,e);a.push(d)}else if("variables_get"==this.type||"variables_get_reporter"==this.type)b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!
|
|
3128
|
-
a.unshift(b),a.unshift(d)}};
|
|
3129
|
-
Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_REPORTER_MIXIN={customContextMenu:function(a){if(!this.isCollapsed()){var b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!
|
|
3130
|
-
b[c].getId());a.unshift(d)}}}}};Blockly.Constants.Variables.VARIABLE_OPTION_CALLBACK_FACTORY=function(a,b,c){return function(){var b=a.getField("VAR");b||console.log("Tried to get a variable field on the wrong type of block.");b.setValue(c)}};Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();Blockly.Variables.renameVariable(b,c)}};
|
|
3142
|
+
Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if(!this.isCollapsed())if(!this.isInFlyout){if("variables_get"==this.type||"variables_get_reporter"==this.type)var b="variables_set",c=Blockly.Msg.VARIABLES_GET_CREATE_SET;else b="variables_get",c=Blockly.Msg.VARIABLES_SET_CREATE_GET;var d={enabled:0<this.workspace.remainingCapacity()&&!this.inDebugWorkspace()},e=this.getField("VAR").getText();d.text=c.replace("%1",e);c=Blockly.utils.xml.createElement("field");
|
|
3143
|
+
c.setAttribute("name","VAR");c.appendChild(Blockly.utils.xml.createTextNode(e));e=Blockly.utils.xml.createElement("block");e.setAttribute("type",b);e.appendChild(c);d.callback=Blockly.ContextMenu.callbackFactory(this,e);a.push(d)}else if("variables_get"==this.type||"variables_get_reporter"==this.type)b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)},e=this.getField("VAR").getText(),d={text:Blockly.Msg.DELETE_VARIABLE.replace("%1",
|
|
3144
|
+
e),enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)},a.unshift(b),a.unshift(d)}};
|
|
3145
|
+
Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_REPORTER_MIXIN={customContextMenu:function(a){if(!this.isCollapsed()){var b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)};a.unshift(b);if(!this.isInFlyout){b=this.workspace.getVariablesOfType("");0<b.length&&a.unshift({separator:!0});for(var c=b.length-1;0<=c;c--){var d={enabled:!this.inDebugWorkspace()};d.text=b[c].name;d.callback=Blockly.Constants.Variables.VARIABLE_OPTION_CALLBACK_FACTORY(this,
|
|
3146
|
+
d.text,b[c].getId());a.unshift(d)}}}}};Blockly.Constants.Variables.VARIABLE_OPTION_CALLBACK_FACTORY=function(a,b,c){return function(){var b=a.getField("VAR");b||console.log("Tried to get a variable field on the wrong type of block.");b.setValue(c)}};Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();Blockly.Variables.renameVariable(b,c)}};
|
|
3131
3147
|
Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();b.deleteVariableById(c.getId());b.refreshToolboxSelection()}};Blockly.Extensions.registerMixin("contextMenu_variableSetterGetter",Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);Blockly.Extensions.registerMixin("contextMenu_variableReporter",Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_REPORTER_MIXIN);/*
|
|
3132
3148
|
|
|
3133
3149
|
Copyright 2017 Google LLC
|
|
@@ -3147,457 +3163,457 @@ Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY=function(a){return fu
|
|
|
3147
3163
|
Blockly.Constants.VariablesDynamic={};Blockly.Constants.VariablesDynamic.HUE=310;
|
|
3148
3164
|
Blockly.defineBlocksWithJsonArray([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",
|
|
3149
3165
|
name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]);
|
|
3150
|
-
Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getFieldValue("VAR");var c=this.workspace.getVariableById(b).type;if("variables_get_dynamic"==this.type){b="variables_set_dynamic";var d=Blockly.Msg.VARIABLES_GET_CREATE_SET}else b="variables_get_dynamic",d=Blockly.Msg.VARIABLES_SET_CREATE_GET;var e={enabled:0<this.workspace.remainingCapacity()},f=this.getField("VAR").getText();
|
|
3151
|
-
d=Blockly.utils.xml.createElement("field");d.setAttribute("name","VAR");d.setAttribute("variabletype",c);d.appendChild(Blockly.utils.xml.createTextNode(f));f=Blockly.utils.xml.createElement("block");f.setAttribute("type",b);f.appendChild(d);e.callback=Blockly.ContextMenu.callbackFactory(this,f);a.push(e)}else if("variables_get_dynamic"==this.type||"variables_get_reporter_dynamic"==this.type)b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!
|
|
3152
|
-
f=this.getField("VAR").getText(),e={text:Blockly.Msg.DELETE_VARIABLE.replace("%1",f),enabled:!
|
|
3166
|
+
Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if(this.inDebugWorkspace())if(!this.isInFlyout){var b=this.getFieldValue("VAR");var c=this.workspace.getVariableById(b).type;if("variables_get_dynamic"==this.type){b="variables_set_dynamic";var d=Blockly.Msg.VARIABLES_GET_CREATE_SET}else b="variables_get_dynamic",d=Blockly.Msg.VARIABLES_SET_CREATE_GET;var e={enabled:0<this.workspace.remainingCapacity()},f=this.getField("VAR").getText();
|
|
3167
|
+
e.text=d.replace("%1",f);d=Blockly.utils.xml.createElement("field");d.setAttribute("name","VAR");d.setAttribute("variabletype",c);d.appendChild(Blockly.utils.xml.createTextNode(f));f=Blockly.utils.xml.createElement("block");f.setAttribute("type",b);f.appendChild(d);e.callback=Blockly.ContextMenu.callbackFactory(this,f);a.push(e)}else if("variables_get_dynamic"==this.type||"variables_get_reporter_dynamic"==this.type)b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)},
|
|
3168
|
+
f=this.getField("VAR").getText(),e={text:Blockly.Msg.DELETE_VARIABLE.replace("%1",f),enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)},a.unshift(b),a.unshift(e)},onchange:function(a){a=this.getFieldValue("VAR");a=Blockly.Variables.getVariable(this.workspace,a);"variables_get_dynamic"==this.type?this.outputConnection.setCheck(a.type):this.getInput("VALUE").connection.setCheck(a.type)}};
|
|
3153
3169
|
Blockly.Constants.VariablesDynamic.RENAME_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();Blockly.Variables.renameVariable(b,c)}};Blockly.Constants.VariablesDynamic.DELETE_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();b.deleteVariableById(c.getId());b.refreshToolboxSelection()}};Blockly.Extensions.registerMixin("contextMenu_variableDynamicSetterGetter",Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);
|
|
3154
3170
|
|
|
3155
|
-
// This file was automatically generated. Do not modify.
|
|
3156
|
-
|
|
3157
|
-
'use strict';
|
|
3158
|
-
|
|
3159
|
-
Blockly.Msg["ADD_COMMENT"] = "Add Comment";
|
|
3160
|
-
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'";
|
|
3161
|
-
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Change value:";
|
|
3162
|
-
Blockly.Msg["CLEAN_UP"] = "Clean up Blocks";
|
|
3163
|
-
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings.";
|
|
3164
|
-
Blockly.Msg["COLLAPSE_ALL"] = "Collapse Blocks";
|
|
3165
|
-
Blockly.Msg["COLLAPSE_BLOCK"] = "Collapse Block";
|
|
3166
|
-
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "colour 1";
|
|
3167
|
-
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "colour 2";
|
|
3168
|
-
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp";
|
|
3169
|
-
Blockly.Msg["COLOUR_BLEND_RATIO"] = "ratio";
|
|
3170
|
-
Blockly.Msg["COLOUR_BLEND_TITLE"] = "blend";
|
|
3171
|
-
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Blends two colours together with a given ratio (0.0 - 1.0).";
|
|
3172
|
-
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color";
|
|
3173
|
-
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Choose a colour from the palette.";
|
|
3174
|
-
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com";
|
|
3175
|
-
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "random colour";
|
|
3176
|
-
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Choose a colour at random.";
|
|
3177
|
-
Blockly.Msg["COLOUR_RGB_BLUE"] = "blue";
|
|
3178
|
-
Blockly.Msg["COLOUR_RGB_GREEN"] = "green";
|
|
3179
|
-
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html";
|
|
3180
|
-
Blockly.Msg["COLOUR_RGB_RED"] = "red";
|
|
3181
|
-
Blockly.Msg["COLOUR_RGB_TITLE"] = "colour with";
|
|
3182
|
-
Blockly.Msg["COLOUR_RGB_TOOLTIP"] = "Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.";
|
|
3183
|
-
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";
|
|
3184
|
-
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "break out of loop";
|
|
3185
|
-
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "continue with next iteration of loop";
|
|
3186
|
-
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Break out of the containing loop.";
|
|
3187
|
-
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration.";
|
|
3188
|
-
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warning: This block may only be used within a loop.";
|
|
3189
|
-
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each";
|
|
3190
|
-
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2";
|
|
3191
|
-
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements.";
|
|
3192
|
-
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with";
|
|
3193
|
-
Blockly.Msg["CONTROLS_FOR_TITLE"] = "count with %1 from %2 to %3 by %4";
|
|
3194
|
-
Blockly.Msg["CONTROLS_FOR_TOOLTIP"] = "Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.";
|
|
3195
|
-
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Add a condition to the if block.";
|
|
3196
|
-
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block.";
|
|
3197
|
-
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse";
|
|
3198
|
-
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block.";
|
|
3199
|
-
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "else";
|
|
3200
|
-
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "else if";
|
|
3201
|
-
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "if";
|
|
3202
|
-
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "If a value is true, then do some statements.";
|
|
3203
|
-
Blockly.Msg["CONTROLS_IF_TOOLTIP_2"] = "If a value is true, then do the first block of statements. Otherwise, do the second block of statements.";
|
|
3204
|
-
Blockly.Msg["CONTROLS_IF_TOOLTIP_3"] = "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.";
|
|
3205
|
-
Blockly.Msg["CONTROLS_IF_TOOLTIP_4"] = "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.";
|
|
3206
|
-
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop";
|
|
3207
|
-
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "do";
|
|
3208
|
-
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "repeat %1 times";
|
|
3209
|
-
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Do some statements several times.";
|
|
3210
|
-
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat";
|
|
3211
|
-
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "repeat until";
|
|
3212
|
-
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while";
|
|
3213
|
-
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements.";
|
|
3214
|
-
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "While a value is true, then do some statements.";
|
|
3215
|
-
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Delete all %1 blocks?";
|
|
3216
|
-
Blockly.Msg["DELETE_BLOCK"] = "Delete Block";
|
|
3217
|
-
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable";
|
|
3218
|
-
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?";
|
|
3219
|
-
Blockly.Msg["DELETE_X_BLOCKS"] = "Delete %1 Blocks";
|
|
3220
|
-
Blockly.Msg["DISABLE_BLOCK"] = "Disable Block";
|
|
3221
|
-
Blockly.Msg["DUPLICATE_BLOCK"] = "Duplicate";
|
|
3222
|
-
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment";
|
|
3223
|
-
Blockly.Msg["ENABLE_BLOCK"] = "Enable Block";
|
|
3224
|
-
Blockly.Msg["EXPAND_ALL"] = "Expand Blocks";
|
|
3225
|
-
Blockly.Msg["EXPAND_BLOCK"] = "Expand Block";
|
|
3226
|
-
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs";
|
|
3227
|
-
Blockly.Msg["FUNCTIONS_CALL_TITLE"] = "call";
|
|
3228
|
-
Blockly.Msg["FUNCTIONS_DEFAULT_BOOLEAN_ARG_NAME"] = "bool";
|
|
3229
|
-
Blockly.Msg["FUNCTIONS_DEFAULT_CUSTOM_ARG_NAME"] = "arg";
|
|
3230
|
-
Blockly.Msg["FUNCTIONS_DEFAULT_FUNCTION_NAME"] = "do_something";
|
|
3231
|
-
Blockly.Msg["FUNCTIONS_DEFAULT_NUMBER_ARG_NAME"] = "num";
|
|
3232
|
-
Blockly.Msg["FUNCTIONS_DEFAULT_STRING_ARG_NAME"] = "text";
|
|
3233
|
-
Blockly.Msg["FUNCTIONS_EDIT_OPTION"] = "Edit";
|
|
3234
|
-
Blockly.Msg["FUNCTIONS_GO_TO_DEFINITION_OPTION"] = "Go to definition";
|
|
3235
|
-
Blockly.Msg["FUNCTION_CALL_TOOLTIP"] = "Call a function that was previously defined.";
|
|
3236
|
-
Blockly.Msg["FUNCTION_CREATE_NEW"] = "Create a Function";
|
|
3237
|
-
Blockly.Msg["FUNCTION_WARNING_ARG_NAME_IS_FUNCTION_NAME"] = "Argument names must not be the same as the function name.";
|
|
3238
|
-
Blockly.Msg["FUNCTION_WARNING_DUPLICATE_ARG"] = "Functions cannot use the same argument name more than once.";
|
|
3239
|
-
Blockly.Msg["FUNCTION_WARNING_EMPTY_NAME"] = "Function and argument names cannot be empty.";
|
|
3240
|
-
Blockly.Msg["HELP"] = "Help";
|
|
3241
|
-
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs";
|
|
3242
|
-
Blockly.Msg["IOS_CANCEL"] = "Cancel";
|
|
3243
|
-
Blockly.Msg["IOS_ERROR"] = "Error";
|
|
3244
|
-
Blockly.Msg["IOS_OK"] = "OK";
|
|
3245
|
-
Blockly.Msg["IOS_PROCEDURES_ADD_INPUT"] = "+ Add Input";
|
|
3246
|
-
Blockly.Msg["IOS_PROCEDURES_ALLOW_STATEMENTS"] = "Allow statements";
|
|
3247
|
-
Blockly.Msg["IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR"] = "This function has duplicate inputs.";
|
|
3248
|
-
Blockly.Msg["IOS_PROCEDURES_INPUTS"] = "INPUTS";
|
|
3249
|
-
Blockly.Msg["IOS_VARIABLES_ADD_BUTTON"] = "Add";
|
|
3250
|
-
Blockly.Msg["IOS_VARIABLES_ADD_VARIABLE"] = "+ Add Variable";
|
|
3251
|
-
Blockly.Msg["IOS_VARIABLES_DELETE_BUTTON"] = "Delete";
|
|
3252
|
-
Blockly.Msg["IOS_VARIABLES_EMPTY_NAME_ERROR"] = "You can't use an empty variable name.";
|
|
3253
|
-
Blockly.Msg["IOS_VARIABLES_RENAME_BUTTON"] = "Rename";
|
|
3254
|
-
Blockly.Msg["IOS_VARIABLES_VARIABLE_NAME"] = "Variable name";
|
|
3255
|
-
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
|
|
3256
|
-
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list";
|
|
3257
|
-
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records";
|
|
3258
|
-
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "list";
|
|
3259
|
-
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block.";
|
|
3260
|
-
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";
|
|
3261
|
-
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "create list with";
|
|
3262
|
-
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Add an item to the list.";
|
|
3263
|
-
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items.";
|
|
3264
|
-
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "first";
|
|
3265
|
-
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# from end";
|
|
3266
|
-
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#";
|
|
3267
|
-
Blockly.Msg["LISTS_GET_INDEX_GET"] = "get";
|
|
3268
|
-
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "get and remove";
|
|
3269
|
-
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "last";
|
|
3270
|
-
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "random";
|
|
3271
|
-
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "remove";
|
|
3272
|
-
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = "";
|
|
3273
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Returns the first item in a list.";
|
|
3274
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Returns the item at the specified position in a list.";
|
|
3275
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Returns the last item in a list.";
|
|
3276
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Returns a random item in a list.";
|
|
3277
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Removes and returns the first item in a list.";
|
|
3278
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Removes and returns the item at the specified position in a list.";
|
|
3279
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Removes and returns the last item in a list.";
|
|
3280
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Removes and returns a random item in a list.";
|
|
3281
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Removes the first item in a list.";
|
|
3282
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Removes the item at the specified position in a list.";
|
|
3283
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Removes the last item in a list.";
|
|
3284
|
-
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Removes a random item in a list.";
|
|
3285
|
-
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end";
|
|
3286
|
-
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "to #";
|
|
3287
|
-
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last";
|
|
3288
|
-
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist";
|
|
3289
|
-
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first";
|
|
3290
|
-
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end";
|
|
3291
|
-
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #";
|
|
3292
|
-
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = "";
|
|
3293
|
-
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified portion of a list.";
|
|
3294
|
-
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 is the last item.";
|
|
3295
|
-
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 is the first item.";
|
|
3296
|
-
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item";
|
|
3297
|
-
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";
|
|
3298
|
-
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item";
|
|
3299
|
-
Blockly.Msg["LISTS_INDEX_OF_TOOLTIP"] = "Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.";
|
|
3300
|
-
Blockly.Msg["LISTS_INLIST"] = "in list";
|
|
3301
|
-
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty";
|
|
3302
|
-
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 is empty";
|
|
3303
|
-
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Returns true if the list is empty.";
|
|
3304
|
-
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of";
|
|
3305
|
-
Blockly.Msg["LISTS_LENGTH_TITLE"] = "length of %1";
|
|
3306
|
-
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Returns the length of a list.";
|
|
3307
|
-
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";
|
|
3308
|
-
Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times";
|
|
3309
|
-
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times.";
|
|
3310
|
-
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list";
|
|
3311
|
-
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1";
|
|
3312
|
-
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list.";
|
|
3313
|
-
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set";
|
|
3314
|
-
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "as";
|
|
3315
|
-
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "insert at";
|
|
3316
|
-
Blockly.Msg["LISTS_SET_INDEX_SET"] = "set";
|
|
3317
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Inserts the item at the start of a list.";
|
|
3318
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Inserts the item at the specified position in a list.";
|
|
3319
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Append the item to the end of a list.";
|
|
3320
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Inserts the item randomly in a list.";
|
|
3321
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a list.";
|
|
3322
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list.";
|
|
3323
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list.";
|
|
3324
|
-
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list.";
|
|
3325
|
-
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
|
|
3326
|
-
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "ascending";
|
|
3327
|
-
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "descending";
|
|
3328
|
-
Blockly.Msg["LISTS_SORT_TITLE"] = "sort %1 %2 %3";
|
|
3329
|
-
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Sort a copy of a list.";
|
|
3330
|
-
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case";
|
|
3331
|
-
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numeric";
|
|
3332
|
-
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetic";
|
|
3333
|
-
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";
|
|
3334
|
-
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text";
|
|
3335
|
-
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "make text from list";
|
|
3336
|
-
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter.";
|
|
3337
|
-
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter.";
|
|
3338
|
-
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter";
|
|
3339
|
-
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "false";
|
|
3340
|
-
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values";
|
|
3341
|
-
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Returns either true or false.";
|
|
3342
|
-
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "true";
|
|
3343
|
-
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)";
|
|
3344
|
-
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Return true if both inputs equal each other.";
|
|
3345
|
-
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Return true if the first input is greater than the second input.";
|
|
3346
|
-
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Return true if the first input is greater than or equal to the second input.";
|
|
3347
|
-
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Return true if the first input is smaller than the second input.";
|
|
3348
|
-
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Return true if the first input is smaller than or equal to the second input.";
|
|
3349
|
-
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Return true if both inputs are not equal to each other.";
|
|
3350
|
-
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not";
|
|
3351
|
-
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "not %1";
|
|
3352
|
-
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Returns true if the input is false. Returns false if the input is true.";
|
|
3353
|
-
Blockly.Msg["LOGIC_NULL"] = "null";
|
|
3354
|
-
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type";
|
|
3355
|
-
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Returns null.";
|
|
3356
|
-
Blockly.Msg["LOGIC_OPERATION_AND"] = "and";
|
|
3357
|
-
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations";
|
|
3358
|
-
Blockly.Msg["LOGIC_OPERATION_OR"] = "or";
|
|
3359
|
-
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Return true if both inputs are true.";
|
|
3360
|
-
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Return true if at least one of the inputs is true.";
|
|
3361
|
-
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "test";
|
|
3362
|
-
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:";
|
|
3363
|
-
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "if false";
|
|
3364
|
-
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "if true";
|
|
3365
|
-
Blockly.Msg["LOGIC_TERNARY_TOOLTIP"] = "Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.";
|
|
3366
|
-
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+";
|
|
3367
|
-
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://en.wikipedia.org/wiki/Arithmetic";
|
|
3368
|
-
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Return the sum of the two numbers.";
|
|
3369
|
-
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Return the quotient of the two numbers.";
|
|
3370
|
-
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Return the difference of the two numbers.";
|
|
3371
|
-
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Return the product of the two numbers.";
|
|
3372
|
-
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Return the first number raised to the power of the second number.";
|
|
3373
|
-
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2";
|
|
3374
|
-
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2";
|
|
3375
|
-
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180.";
|
|
3376
|
-
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";
|
|
3377
|
-
Blockly.Msg["MATH_CHANGE_TITLE"] = "change %1 by %2";
|
|
3378
|
-
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Add a number to variable '%1'.";
|
|
3379
|
-
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant";
|
|
3380
|
-
Blockly.Msg["MATH_CONSTANT_TOOLTIP"] = "Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).";
|
|
3381
|
-
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)";
|
|
3382
|
-
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "constrain %1 low %2 high %3";
|
|
3383
|
-
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Constrain a number to be between the specified limits (inclusive).";
|
|
3384
|
-
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷";
|
|
3385
|
-
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "is divisible by";
|
|
3386
|
-
Blockly.Msg["MATH_IS_EVEN"] = "is even";
|
|
3387
|
-
Blockly.Msg["MATH_IS_NEGATIVE"] = "is negative";
|
|
3388
|
-
Blockly.Msg["MATH_IS_ODD"] = "is odd";
|
|
3389
|
-
Blockly.Msg["MATH_IS_POSITIVE"] = "is positive";
|
|
3390
|
-
Blockly.Msg["MATH_IS_PRIME"] = "is prime";
|
|
3391
|
-
Blockly.Msg["MATH_IS_TOOLTIP"] = "Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.";
|
|
3392
|
-
Blockly.Msg["MATH_IS_WHOLE"] = "is whole";
|
|
3393
|
-
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation";
|
|
3394
|
-
Blockly.Msg["MATH_MODULO_TITLE"] = "remainder of %1 ÷ %2";
|
|
3395
|
-
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Return the remainder from dividing the two numbers.";
|
|
3396
|
-
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×";
|
|
3397
|
-
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://en.wikipedia.org/wiki/Number";
|
|
3398
|
-
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "A number.";
|
|
3399
|
-
Blockly.Msg["MATH_ONLIST_HELPURL"] = "";
|
|
3400
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "average of list";
|
|
3401
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "max of list";
|
|
3402
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "median of list";
|
|
3403
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "min of list";
|
|
3404
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "modes of list";
|
|
3405
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "random item of list";
|
|
3406
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "standard deviation of list";
|
|
3407
|
-
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "sum of list";
|
|
3408
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Return the average (arithmetic mean) of the numeric values in the list.";
|
|
3409
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Return the largest number in the list.";
|
|
3410
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Return the median number in the list.";
|
|
3411
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Return the smallest number in the list.";
|
|
3412
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Return a list of the most common item(s) in the list.";
|
|
3413
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Return a random element from the list.";
|
|
3414
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Return the standard deviation of the list.";
|
|
3415
|
-
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Return the sum of all the numbers in the list.";
|
|
3416
|
-
Blockly.Msg["MATH_POWER_SYMBOL"] = "^";
|
|
3417
|
-
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
|
|
3418
|
-
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "random fraction";
|
|
3419
|
-
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).";
|
|
3420
|
-
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
|
|
3421
|
-
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "random integer from %1 to %2";
|
|
3422
|
-
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Return a random integer between the two specified limits, inclusive.";
|
|
3423
|
-
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding";
|
|
3424
|
-
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "round";
|
|
3425
|
-
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "round down";
|
|
3426
|
-
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "round up";
|
|
3427
|
-
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Round a number up or down.";
|
|
3428
|
-
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root";
|
|
3429
|
-
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "absolute";
|
|
3430
|
-
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "square root";
|
|
3431
|
-
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Return the absolute value of a number.";
|
|
3432
|
-
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Return e to the power of a number.";
|
|
3433
|
-
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Return the natural logarithm of a number.";
|
|
3434
|
-
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Return the base 10 logarithm of a number.";
|
|
3435
|
-
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Return the negation of a number.";
|
|
3436
|
-
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Return 10 to the power of a number.";
|
|
3437
|
-
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Return the square root of a number.";
|
|
3438
|
-
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-";
|
|
3439
|
-
Blockly.Msg["MATH_TRIG_ACOS"] = "acos";
|
|
3440
|
-
Blockly.Msg["MATH_TRIG_ASIN"] = "asin";
|
|
3441
|
-
Blockly.Msg["MATH_TRIG_ATAN"] = "atan";
|
|
3442
|
-
Blockly.Msg["MATH_TRIG_COS"] = "cos";
|
|
3443
|
-
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://en.wikipedia.org/wiki/Trigonometric_functions";
|
|
3444
|
-
Blockly.Msg["MATH_TRIG_SIN"] = "sin";
|
|
3445
|
-
Blockly.Msg["MATH_TRIG_TAN"] = "tan";
|
|
3446
|
-
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Return the arccosine of a number.";
|
|
3447
|
-
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Return the arcsine of a number.";
|
|
3448
|
-
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Return the arctangent of a number.";
|
|
3449
|
-
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Return the cosine of a degree (not radian).";
|
|
3450
|
-
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Return the sine of a degree (not radian).";
|
|
3451
|
-
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Return the tangent of a degree (not radian).";
|
|
3452
|
-
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable...";
|
|
3453
|
-
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable...";
|
|
3454
|
-
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable...";
|
|
3455
|
-
Blockly.Msg["NEW_VARIABLE"] = "Create variable...";
|
|
3456
|
-
Blockly.Msg["NEW_VARIABLE_TITLE"] = "New variable name:";
|
|
3457
|
-
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:";
|
|
3458
|
-
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = "";
|
|
3459
|
-
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "allow statements";
|
|
3460
|
-
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "with:";
|
|
3461
|
-
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3462
|
-
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Run the user-defined function '%1'.";
|
|
3463
|
-
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3464
|
-
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output.";
|
|
3465
|
-
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "with:";
|
|
3466
|
-
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Create '%1'";
|
|
3467
|
-
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Describe this function...";
|
|
3468
|
-
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = "";
|
|
3469
|
-
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3470
|
-
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "do something";
|
|
3471
|
-
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "to";
|
|
3472
|
-
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Creates a function with no output.";
|
|
3473
|
-
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3474
|
-
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "return";
|
|
3475
|
-
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Creates a function with an output.";
|
|
3476
|
-
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warning: This function has duplicate parameters.";
|
|
3477
|
-
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Highlight function definition";
|
|
3478
|
-
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause";
|
|
3479
|
-
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "If a value is true, then return a second value.";
|
|
3480
|
-
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Warning: This block may be used only within a function definition.";
|
|
3481
|
-
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "input name:";
|
|
3482
|
-
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Add an input to the function.";
|
|
3483
|
-
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "inputs";
|
|
3484
|
-
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Add, remove, or reorder inputs to this function.";
|
|
3485
|
-
Blockly.Msg["REDO"] = "Redo";
|
|
3486
|
-
Blockly.Msg["REMOVE_COMMENT"] = "Remove Comment";
|
|
3487
|
-
Blockly.Msg["RENAME_VARIABLE"] = "Rename variable...";
|
|
3488
|
-
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Rename all '%1' variables to:";
|
|
3489
|
-
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";
|
|
3490
|
-
Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2";
|
|
3491
|
-
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'.";
|
|
3492
|
-
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case";
|
|
3493
|
-
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case";
|
|
3494
|
-
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case";
|
|
3495
|
-
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE";
|
|
3496
|
-
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a different case.";
|
|
3497
|
-
Blockly.Msg["TEXT_CHARAT_FIRST"] = "get first letter";
|
|
3498
|
-
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "get letter # from end";
|
|
3499
|
-
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "get letter #";
|
|
3500
|
-
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text";
|
|
3501
|
-
Blockly.Msg["TEXT_CHARAT_LAST"] = "get last letter";
|
|
3502
|
-
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "get random letter";
|
|
3503
|
-
Blockly.Msg["TEXT_CHARAT_TAIL"] = "";
|
|
3504
|
-
Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2";
|
|
3505
|
-
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Returns the letter at the specified position.";
|
|
3506
|
-
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings";
|
|
3507
|
-
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2";
|
|
3508
|
-
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text.";
|
|
3509
|
-
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Add an item to the text.";
|
|
3510
|
-
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "join";
|
|
3511
|
-
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this text block.";
|
|
3512
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end";
|
|
3513
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "to letter #";
|
|
3514
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "to last letter";
|
|
3515
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";
|
|
3516
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "in text";
|
|
3517
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter";
|
|
3518
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end";
|
|
3519
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #";
|
|
3520
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = "";
|
|
3521
|
-
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Returns a specified portion of the text.";
|
|
3522
|
-
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text";
|
|
3523
|
-
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text";
|
|
3524
|
-
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text";
|
|
3525
|
-
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "in text %1 %2 %3";
|
|
3526
|
-
Blockly.Msg["TEXT_INDEXOF_TOOLTIP"] = "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.";
|
|
3527
|
-
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text";
|
|
3528
|
-
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 is empty";
|
|
3529
|
-
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Returns true if the provided text is empty.";
|
|
3530
|
-
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation";
|
|
3531
|
-
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "create text with";
|
|
3532
|
-
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items.";
|
|
3533
|
-
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";
|
|
3534
|
-
Blockly.Msg["TEXT_LENGTH_TITLE"] = "length of %1";
|
|
3535
|
-
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Returns the number of letters (including spaces) in the provided text.";
|
|
3536
|
-
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text";
|
|
3537
|
-
Blockly.Msg["TEXT_PRINT_TITLE"] = "print %1";
|
|
3538
|
-
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Print the specified text, number or other value.";
|
|
3539
|
-
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";
|
|
3540
|
-
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number.";
|
|
3541
|
-
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text.";
|
|
3542
|
-
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message";
|
|
3543
|
-
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message";
|
|
3544
|
-
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings";
|
|
3545
|
-
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3";
|
|
3546
|
-
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text.";
|
|
3547
|
-
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text";
|
|
3548
|
-
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1";
|
|
3549
|
-
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text.";
|
|
3550
|
-
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)";
|
|
3551
|
-
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "A letter, word, or line of text.";
|
|
3552
|
-
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";
|
|
3553
|
-
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of";
|
|
3554
|
-
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of";
|
|
3555
|
-
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of";
|
|
3556
|
-
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Return a copy of the text with spaces removed from one or both ends.";
|
|
3557
|
-
Blockly.Msg["TODAY"] = "Today";
|
|
3558
|
-
Blockly.Msg["UNDO"] = "Undo";
|
|
3559
|
-
Blockly.Msg["UNNAMED_KEY"] = "unnamed";
|
|
3560
|
-
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Create 'set %1'";
|
|
3561
|
-
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get";
|
|
3562
|
-
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Returns the value of this variable.";
|
|
3563
|
-
Blockly.Msg["VARIABLES_SET"] = "set %1 to %2";
|
|
3564
|
-
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'";
|
|
3565
|
-
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set";
|
|
3566
|
-
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input.";
|
|
3567
|
-
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "A variable named '%1' already exists.";
|
|
3568
|
-
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'.";
|
|
3569
|
-
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace";
|
|
3570
|
-
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something...";
|
|
3571
|
-
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3572
|
-
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3573
|
-
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
|
3574
|
-
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
|
3575
|
-
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
|
3576
|
-
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3577
|
-
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3578
|
-
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3579
|
-
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
|
3580
|
-
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3581
|
-
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3582
|
-
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3583
|
-
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3584
|
-
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3585
|
-
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
|
3586
|
-
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
|
3587
|
-
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
|
3588
|
-
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
|
3589
|
-
Blockly.Msg["TEXT_APPEND_VARIABLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3590
|
-
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3591
|
-
|
|
3592
|
-
Blockly.Msg["MATH_HUE"] = "230";
|
|
3593
|
-
Blockly.Msg["LOOPS_HUE"] = "120";
|
|
3594
|
-
Blockly.Msg["LISTS_HUE"] = "260";
|
|
3595
|
-
Blockly.Msg["LOGIC_HUE"] = "210";
|
|
3596
|
-
Blockly.Msg["VARIABLES_HUE"] = "330";
|
|
3597
|
-
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
|
3598
|
-
Blockly.Msg["TEXTS_HUE"] = "160";
|
|
3599
|
-
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
|
3600
|
-
Blockly.Msg["COLOUR_HUE"] = "20";
|
|
3171
|
+
// This file was automatically generated. Do not modify.
|
|
3172
|
+
|
|
3173
|
+
'use strict';
|
|
3174
|
+
|
|
3175
|
+
Blockly.Msg["ADD_COMMENT"] = "Add Comment";
|
|
3176
|
+
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'";
|
|
3177
|
+
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Change value:";
|
|
3178
|
+
Blockly.Msg["CLEAN_UP"] = "Clean up Blocks";
|
|
3179
|
+
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings.";
|
|
3180
|
+
Blockly.Msg["COLLAPSE_ALL"] = "Collapse Blocks";
|
|
3181
|
+
Blockly.Msg["COLLAPSE_BLOCK"] = "Collapse Block";
|
|
3182
|
+
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "colour 1";
|
|
3183
|
+
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "colour 2";
|
|
3184
|
+
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp";
|
|
3185
|
+
Blockly.Msg["COLOUR_BLEND_RATIO"] = "ratio";
|
|
3186
|
+
Blockly.Msg["COLOUR_BLEND_TITLE"] = "blend";
|
|
3187
|
+
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Blends two colours together with a given ratio (0.0 - 1.0).";
|
|
3188
|
+
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color";
|
|
3189
|
+
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Choose a colour from the palette.";
|
|
3190
|
+
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com";
|
|
3191
|
+
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "random colour";
|
|
3192
|
+
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Choose a colour at random.";
|
|
3193
|
+
Blockly.Msg["COLOUR_RGB_BLUE"] = "blue";
|
|
3194
|
+
Blockly.Msg["COLOUR_RGB_GREEN"] = "green";
|
|
3195
|
+
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html";
|
|
3196
|
+
Blockly.Msg["COLOUR_RGB_RED"] = "red";
|
|
3197
|
+
Blockly.Msg["COLOUR_RGB_TITLE"] = "colour with";
|
|
3198
|
+
Blockly.Msg["COLOUR_RGB_TOOLTIP"] = "Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.";
|
|
3199
|
+
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";
|
|
3200
|
+
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "break out of loop";
|
|
3201
|
+
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "continue with next iteration of loop";
|
|
3202
|
+
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Break out of the containing loop.";
|
|
3203
|
+
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration.";
|
|
3204
|
+
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warning: This block may only be used within a loop.";
|
|
3205
|
+
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each";
|
|
3206
|
+
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2";
|
|
3207
|
+
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements.";
|
|
3208
|
+
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with";
|
|
3209
|
+
Blockly.Msg["CONTROLS_FOR_TITLE"] = "count with %1 from %2 to %3 by %4";
|
|
3210
|
+
Blockly.Msg["CONTROLS_FOR_TOOLTIP"] = "Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.";
|
|
3211
|
+
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Add a condition to the if block.";
|
|
3212
|
+
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block.";
|
|
3213
|
+
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse";
|
|
3214
|
+
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block.";
|
|
3215
|
+
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "else";
|
|
3216
|
+
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "else if";
|
|
3217
|
+
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "if";
|
|
3218
|
+
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "If a value is true, then do some statements.";
|
|
3219
|
+
Blockly.Msg["CONTROLS_IF_TOOLTIP_2"] = "If a value is true, then do the first block of statements. Otherwise, do the second block of statements.";
|
|
3220
|
+
Blockly.Msg["CONTROLS_IF_TOOLTIP_3"] = "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.";
|
|
3221
|
+
Blockly.Msg["CONTROLS_IF_TOOLTIP_4"] = "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.";
|
|
3222
|
+
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop";
|
|
3223
|
+
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "do";
|
|
3224
|
+
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "repeat %1 times";
|
|
3225
|
+
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Do some statements several times.";
|
|
3226
|
+
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat";
|
|
3227
|
+
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "repeat until";
|
|
3228
|
+
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while";
|
|
3229
|
+
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements.";
|
|
3230
|
+
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "While a value is true, then do some statements.";
|
|
3231
|
+
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Delete all %1 blocks?";
|
|
3232
|
+
Blockly.Msg["DELETE_BLOCK"] = "Delete Block";
|
|
3233
|
+
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable";
|
|
3234
|
+
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?";
|
|
3235
|
+
Blockly.Msg["DELETE_X_BLOCKS"] = "Delete %1 Blocks";
|
|
3236
|
+
Blockly.Msg["DISABLE_BLOCK"] = "Disable Block";
|
|
3237
|
+
Blockly.Msg["DUPLICATE_BLOCK"] = "Duplicate";
|
|
3238
|
+
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment";
|
|
3239
|
+
Blockly.Msg["ENABLE_BLOCK"] = "Enable Block";
|
|
3240
|
+
Blockly.Msg["EXPAND_ALL"] = "Expand Blocks";
|
|
3241
|
+
Blockly.Msg["EXPAND_BLOCK"] = "Expand Block";
|
|
3242
|
+
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs";
|
|
3243
|
+
Blockly.Msg["FUNCTIONS_CALL_TITLE"] = "call";
|
|
3244
|
+
Blockly.Msg["FUNCTIONS_DEFAULT_BOOLEAN_ARG_NAME"] = "bool";
|
|
3245
|
+
Blockly.Msg["FUNCTIONS_DEFAULT_CUSTOM_ARG_NAME"] = "arg";
|
|
3246
|
+
Blockly.Msg["FUNCTIONS_DEFAULT_FUNCTION_NAME"] = "do_something";
|
|
3247
|
+
Blockly.Msg["FUNCTIONS_DEFAULT_NUMBER_ARG_NAME"] = "num";
|
|
3248
|
+
Blockly.Msg["FUNCTIONS_DEFAULT_STRING_ARG_NAME"] = "text";
|
|
3249
|
+
Blockly.Msg["FUNCTIONS_EDIT_OPTION"] = "Edit";
|
|
3250
|
+
Blockly.Msg["FUNCTIONS_GO_TO_DEFINITION_OPTION"] = "Go to definition";
|
|
3251
|
+
Blockly.Msg["FUNCTION_CALL_TOOLTIP"] = "Call a function that was previously defined.";
|
|
3252
|
+
Blockly.Msg["FUNCTION_CREATE_NEW"] = "Create a Function";
|
|
3253
|
+
Blockly.Msg["FUNCTION_WARNING_ARG_NAME_IS_FUNCTION_NAME"] = "Argument names must not be the same as the function name.";
|
|
3254
|
+
Blockly.Msg["FUNCTION_WARNING_DUPLICATE_ARG"] = "Functions cannot use the same argument name more than once.";
|
|
3255
|
+
Blockly.Msg["FUNCTION_WARNING_EMPTY_NAME"] = "Function and argument names cannot be empty.";
|
|
3256
|
+
Blockly.Msg["HELP"] = "Help";
|
|
3257
|
+
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs";
|
|
3258
|
+
Blockly.Msg["IOS_CANCEL"] = "Cancel";
|
|
3259
|
+
Blockly.Msg["IOS_ERROR"] = "Error";
|
|
3260
|
+
Blockly.Msg["IOS_OK"] = "OK";
|
|
3261
|
+
Blockly.Msg["IOS_PROCEDURES_ADD_INPUT"] = "+ Add Input";
|
|
3262
|
+
Blockly.Msg["IOS_PROCEDURES_ALLOW_STATEMENTS"] = "Allow statements";
|
|
3263
|
+
Blockly.Msg["IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR"] = "This function has duplicate inputs.";
|
|
3264
|
+
Blockly.Msg["IOS_PROCEDURES_INPUTS"] = "INPUTS";
|
|
3265
|
+
Blockly.Msg["IOS_VARIABLES_ADD_BUTTON"] = "Add";
|
|
3266
|
+
Blockly.Msg["IOS_VARIABLES_ADD_VARIABLE"] = "+ Add Variable";
|
|
3267
|
+
Blockly.Msg["IOS_VARIABLES_DELETE_BUTTON"] = "Delete";
|
|
3268
|
+
Blockly.Msg["IOS_VARIABLES_EMPTY_NAME_ERROR"] = "You can't use an empty variable name.";
|
|
3269
|
+
Blockly.Msg["IOS_VARIABLES_RENAME_BUTTON"] = "Rename";
|
|
3270
|
+
Blockly.Msg["IOS_VARIABLES_VARIABLE_NAME"] = "Variable name";
|
|
3271
|
+
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
|
|
3272
|
+
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list";
|
|
3273
|
+
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records";
|
|
3274
|
+
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "list";
|
|
3275
|
+
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block.";
|
|
3276
|
+
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";
|
|
3277
|
+
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "create list with";
|
|
3278
|
+
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Add an item to the list.";
|
|
3279
|
+
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items.";
|
|
3280
|
+
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "first";
|
|
3281
|
+
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# from end";
|
|
3282
|
+
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#";
|
|
3283
|
+
Blockly.Msg["LISTS_GET_INDEX_GET"] = "get";
|
|
3284
|
+
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "get and remove";
|
|
3285
|
+
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "last";
|
|
3286
|
+
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "random";
|
|
3287
|
+
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "remove";
|
|
3288
|
+
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = "";
|
|
3289
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Returns the first item in a list.";
|
|
3290
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Returns the item at the specified position in a list.";
|
|
3291
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Returns the last item in a list.";
|
|
3292
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Returns a random item in a list.";
|
|
3293
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Removes and returns the first item in a list.";
|
|
3294
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Removes and returns the item at the specified position in a list.";
|
|
3295
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Removes and returns the last item in a list.";
|
|
3296
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Removes and returns a random item in a list.";
|
|
3297
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Removes the first item in a list.";
|
|
3298
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Removes the item at the specified position in a list.";
|
|
3299
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Removes the last item in a list.";
|
|
3300
|
+
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Removes a random item in a list.";
|
|
3301
|
+
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end";
|
|
3302
|
+
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "to #";
|
|
3303
|
+
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last";
|
|
3304
|
+
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist";
|
|
3305
|
+
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first";
|
|
3306
|
+
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end";
|
|
3307
|
+
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #";
|
|
3308
|
+
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = "";
|
|
3309
|
+
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified portion of a list.";
|
|
3310
|
+
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 is the last item.";
|
|
3311
|
+
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 is the first item.";
|
|
3312
|
+
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item";
|
|
3313
|
+
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";
|
|
3314
|
+
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item";
|
|
3315
|
+
Blockly.Msg["LISTS_INDEX_OF_TOOLTIP"] = "Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.";
|
|
3316
|
+
Blockly.Msg["LISTS_INLIST"] = "in list";
|
|
3317
|
+
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty";
|
|
3318
|
+
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 is empty";
|
|
3319
|
+
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Returns true if the list is empty.";
|
|
3320
|
+
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of";
|
|
3321
|
+
Blockly.Msg["LISTS_LENGTH_TITLE"] = "length of %1";
|
|
3322
|
+
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Returns the length of a list.";
|
|
3323
|
+
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";
|
|
3324
|
+
Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times";
|
|
3325
|
+
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times.";
|
|
3326
|
+
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list";
|
|
3327
|
+
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1";
|
|
3328
|
+
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list.";
|
|
3329
|
+
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set";
|
|
3330
|
+
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "as";
|
|
3331
|
+
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "insert at";
|
|
3332
|
+
Blockly.Msg["LISTS_SET_INDEX_SET"] = "set";
|
|
3333
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Inserts the item at the start of a list.";
|
|
3334
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Inserts the item at the specified position in a list.";
|
|
3335
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Append the item to the end of a list.";
|
|
3336
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Inserts the item randomly in a list.";
|
|
3337
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a list.";
|
|
3338
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list.";
|
|
3339
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list.";
|
|
3340
|
+
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list.";
|
|
3341
|
+
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
|
|
3342
|
+
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "ascending";
|
|
3343
|
+
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "descending";
|
|
3344
|
+
Blockly.Msg["LISTS_SORT_TITLE"] = "sort %1 %2 %3";
|
|
3345
|
+
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Sort a copy of a list.";
|
|
3346
|
+
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case";
|
|
3347
|
+
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numeric";
|
|
3348
|
+
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetic";
|
|
3349
|
+
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";
|
|
3350
|
+
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text";
|
|
3351
|
+
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "make text from list";
|
|
3352
|
+
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter.";
|
|
3353
|
+
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter.";
|
|
3354
|
+
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter";
|
|
3355
|
+
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "false";
|
|
3356
|
+
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values";
|
|
3357
|
+
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Returns either true or false.";
|
|
3358
|
+
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "true";
|
|
3359
|
+
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)";
|
|
3360
|
+
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Return true if both inputs equal each other.";
|
|
3361
|
+
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Return true if the first input is greater than the second input.";
|
|
3362
|
+
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Return true if the first input is greater than or equal to the second input.";
|
|
3363
|
+
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Return true if the first input is smaller than the second input.";
|
|
3364
|
+
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Return true if the first input is smaller than or equal to the second input.";
|
|
3365
|
+
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Return true if both inputs are not equal to each other.";
|
|
3366
|
+
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not";
|
|
3367
|
+
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "not %1";
|
|
3368
|
+
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Returns true if the input is false. Returns false if the input is true.";
|
|
3369
|
+
Blockly.Msg["LOGIC_NULL"] = "null";
|
|
3370
|
+
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type";
|
|
3371
|
+
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Returns null.";
|
|
3372
|
+
Blockly.Msg["LOGIC_OPERATION_AND"] = "and";
|
|
3373
|
+
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations";
|
|
3374
|
+
Blockly.Msg["LOGIC_OPERATION_OR"] = "or";
|
|
3375
|
+
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Return true if both inputs are true.";
|
|
3376
|
+
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Return true if at least one of the inputs is true.";
|
|
3377
|
+
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "test";
|
|
3378
|
+
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:";
|
|
3379
|
+
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "if false";
|
|
3380
|
+
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "if true";
|
|
3381
|
+
Blockly.Msg["LOGIC_TERNARY_TOOLTIP"] = "Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.";
|
|
3382
|
+
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+";
|
|
3383
|
+
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://en.wikipedia.org/wiki/Arithmetic";
|
|
3384
|
+
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Return the sum of the two numbers.";
|
|
3385
|
+
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Return the quotient of the two numbers.";
|
|
3386
|
+
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Return the difference of the two numbers.";
|
|
3387
|
+
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Return the product of the two numbers.";
|
|
3388
|
+
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Return the first number raised to the power of the second number.";
|
|
3389
|
+
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2";
|
|
3390
|
+
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2";
|
|
3391
|
+
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180.";
|
|
3392
|
+
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";
|
|
3393
|
+
Blockly.Msg["MATH_CHANGE_TITLE"] = "change %1 by %2";
|
|
3394
|
+
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Add a number to variable '%1'.";
|
|
3395
|
+
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant";
|
|
3396
|
+
Blockly.Msg["MATH_CONSTANT_TOOLTIP"] = "Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).";
|
|
3397
|
+
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)";
|
|
3398
|
+
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "constrain %1 low %2 high %3";
|
|
3399
|
+
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Constrain a number to be between the specified limits (inclusive).";
|
|
3400
|
+
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷";
|
|
3401
|
+
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "is divisible by";
|
|
3402
|
+
Blockly.Msg["MATH_IS_EVEN"] = "is even";
|
|
3403
|
+
Blockly.Msg["MATH_IS_NEGATIVE"] = "is negative";
|
|
3404
|
+
Blockly.Msg["MATH_IS_ODD"] = "is odd";
|
|
3405
|
+
Blockly.Msg["MATH_IS_POSITIVE"] = "is positive";
|
|
3406
|
+
Blockly.Msg["MATH_IS_PRIME"] = "is prime";
|
|
3407
|
+
Blockly.Msg["MATH_IS_TOOLTIP"] = "Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.";
|
|
3408
|
+
Blockly.Msg["MATH_IS_WHOLE"] = "is whole";
|
|
3409
|
+
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation";
|
|
3410
|
+
Blockly.Msg["MATH_MODULO_TITLE"] = "remainder of %1 ÷ %2";
|
|
3411
|
+
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Return the remainder from dividing the two numbers.";
|
|
3412
|
+
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×";
|
|
3413
|
+
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://en.wikipedia.org/wiki/Number";
|
|
3414
|
+
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "A number.";
|
|
3415
|
+
Blockly.Msg["MATH_ONLIST_HELPURL"] = "";
|
|
3416
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "average of list";
|
|
3417
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "max of list";
|
|
3418
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "median of list";
|
|
3419
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "min of list";
|
|
3420
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "modes of list";
|
|
3421
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "random item of list";
|
|
3422
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "standard deviation of list";
|
|
3423
|
+
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "sum of list";
|
|
3424
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Return the average (arithmetic mean) of the numeric values in the list.";
|
|
3425
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Return the largest number in the list.";
|
|
3426
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Return the median number in the list.";
|
|
3427
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Return the smallest number in the list.";
|
|
3428
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Return a list of the most common item(s) in the list.";
|
|
3429
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Return a random element from the list.";
|
|
3430
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Return the standard deviation of the list.";
|
|
3431
|
+
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Return the sum of all the numbers in the list.";
|
|
3432
|
+
Blockly.Msg["MATH_POWER_SYMBOL"] = "^";
|
|
3433
|
+
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
|
|
3434
|
+
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "random fraction";
|
|
3435
|
+
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).";
|
|
3436
|
+
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
|
|
3437
|
+
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "random integer from %1 to %2";
|
|
3438
|
+
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Return a random integer between the two specified limits, inclusive.";
|
|
3439
|
+
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding";
|
|
3440
|
+
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "round";
|
|
3441
|
+
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "round down";
|
|
3442
|
+
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "round up";
|
|
3443
|
+
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Round a number up or down.";
|
|
3444
|
+
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root";
|
|
3445
|
+
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "absolute";
|
|
3446
|
+
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "square root";
|
|
3447
|
+
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Return the absolute value of a number.";
|
|
3448
|
+
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Return e to the power of a number.";
|
|
3449
|
+
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Return the natural logarithm of a number.";
|
|
3450
|
+
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Return the base 10 logarithm of a number.";
|
|
3451
|
+
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Return the negation of a number.";
|
|
3452
|
+
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Return 10 to the power of a number.";
|
|
3453
|
+
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Return the square root of a number.";
|
|
3454
|
+
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-";
|
|
3455
|
+
Blockly.Msg["MATH_TRIG_ACOS"] = "acos";
|
|
3456
|
+
Blockly.Msg["MATH_TRIG_ASIN"] = "asin";
|
|
3457
|
+
Blockly.Msg["MATH_TRIG_ATAN"] = "atan";
|
|
3458
|
+
Blockly.Msg["MATH_TRIG_COS"] = "cos";
|
|
3459
|
+
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://en.wikipedia.org/wiki/Trigonometric_functions";
|
|
3460
|
+
Blockly.Msg["MATH_TRIG_SIN"] = "sin";
|
|
3461
|
+
Blockly.Msg["MATH_TRIG_TAN"] = "tan";
|
|
3462
|
+
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Return the arccosine of a number.";
|
|
3463
|
+
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Return the arcsine of a number.";
|
|
3464
|
+
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Return the arctangent of a number.";
|
|
3465
|
+
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Return the cosine of a degree (not radian).";
|
|
3466
|
+
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Return the sine of a degree (not radian).";
|
|
3467
|
+
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Return the tangent of a degree (not radian).";
|
|
3468
|
+
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable...";
|
|
3469
|
+
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable...";
|
|
3470
|
+
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable...";
|
|
3471
|
+
Blockly.Msg["NEW_VARIABLE"] = "Create variable...";
|
|
3472
|
+
Blockly.Msg["NEW_VARIABLE_TITLE"] = "New variable name:";
|
|
3473
|
+
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:";
|
|
3474
|
+
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = "";
|
|
3475
|
+
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "allow statements";
|
|
3476
|
+
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "with:";
|
|
3477
|
+
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3478
|
+
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Run the user-defined function '%1'.";
|
|
3479
|
+
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3480
|
+
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output.";
|
|
3481
|
+
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "with:";
|
|
3482
|
+
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Create '%1'";
|
|
3483
|
+
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Describe this function...";
|
|
3484
|
+
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = "";
|
|
3485
|
+
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3486
|
+
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "do something";
|
|
3487
|
+
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "to";
|
|
3488
|
+
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Creates a function with no output.";
|
|
3489
|
+
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
3490
|
+
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "return";
|
|
3491
|
+
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Creates a function with an output.";
|
|
3492
|
+
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warning: This function has duplicate parameters.";
|
|
3493
|
+
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Highlight function definition";
|
|
3494
|
+
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause";
|
|
3495
|
+
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "If a value is true, then return a second value.";
|
|
3496
|
+
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Warning: This block may be used only within a function definition.";
|
|
3497
|
+
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "input name:";
|
|
3498
|
+
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Add an input to the function.";
|
|
3499
|
+
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "inputs";
|
|
3500
|
+
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Add, remove, or reorder inputs to this function.";
|
|
3501
|
+
Blockly.Msg["REDO"] = "Redo";
|
|
3502
|
+
Blockly.Msg["REMOVE_COMMENT"] = "Remove Comment";
|
|
3503
|
+
Blockly.Msg["RENAME_VARIABLE"] = "Rename variable...";
|
|
3504
|
+
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Rename all '%1' variables to:";
|
|
3505
|
+
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";
|
|
3506
|
+
Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2";
|
|
3507
|
+
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'.";
|
|
3508
|
+
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case";
|
|
3509
|
+
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case";
|
|
3510
|
+
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case";
|
|
3511
|
+
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE";
|
|
3512
|
+
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a different case.";
|
|
3513
|
+
Blockly.Msg["TEXT_CHARAT_FIRST"] = "get first letter";
|
|
3514
|
+
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "get letter # from end";
|
|
3515
|
+
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "get letter #";
|
|
3516
|
+
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text";
|
|
3517
|
+
Blockly.Msg["TEXT_CHARAT_LAST"] = "get last letter";
|
|
3518
|
+
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "get random letter";
|
|
3519
|
+
Blockly.Msg["TEXT_CHARAT_TAIL"] = "";
|
|
3520
|
+
Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2";
|
|
3521
|
+
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Returns the letter at the specified position.";
|
|
3522
|
+
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings";
|
|
3523
|
+
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2";
|
|
3524
|
+
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text.";
|
|
3525
|
+
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Add an item to the text.";
|
|
3526
|
+
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "join";
|
|
3527
|
+
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this text block.";
|
|
3528
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end";
|
|
3529
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "to letter #";
|
|
3530
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "to last letter";
|
|
3531
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";
|
|
3532
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "in text";
|
|
3533
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter";
|
|
3534
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end";
|
|
3535
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #";
|
|
3536
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = "";
|
|
3537
|
+
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Returns a specified portion of the text.";
|
|
3538
|
+
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text";
|
|
3539
|
+
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text";
|
|
3540
|
+
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text";
|
|
3541
|
+
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "in text %1 %2 %3";
|
|
3542
|
+
Blockly.Msg["TEXT_INDEXOF_TOOLTIP"] = "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.";
|
|
3543
|
+
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text";
|
|
3544
|
+
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 is empty";
|
|
3545
|
+
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Returns true if the provided text is empty.";
|
|
3546
|
+
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation";
|
|
3547
|
+
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "create text with";
|
|
3548
|
+
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items.";
|
|
3549
|
+
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";
|
|
3550
|
+
Blockly.Msg["TEXT_LENGTH_TITLE"] = "length of %1";
|
|
3551
|
+
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Returns the number of letters (including spaces) in the provided text.";
|
|
3552
|
+
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text";
|
|
3553
|
+
Blockly.Msg["TEXT_PRINT_TITLE"] = "print %1";
|
|
3554
|
+
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Print the specified text, number or other value.";
|
|
3555
|
+
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";
|
|
3556
|
+
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number.";
|
|
3557
|
+
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text.";
|
|
3558
|
+
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message";
|
|
3559
|
+
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message";
|
|
3560
|
+
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings";
|
|
3561
|
+
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3";
|
|
3562
|
+
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text.";
|
|
3563
|
+
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text";
|
|
3564
|
+
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1";
|
|
3565
|
+
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text.";
|
|
3566
|
+
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)";
|
|
3567
|
+
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "A letter, word, or line of text.";
|
|
3568
|
+
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";
|
|
3569
|
+
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of";
|
|
3570
|
+
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of";
|
|
3571
|
+
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of";
|
|
3572
|
+
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Return a copy of the text with spaces removed from one or both ends.";
|
|
3573
|
+
Blockly.Msg["TODAY"] = "Today";
|
|
3574
|
+
Blockly.Msg["UNDO"] = "Undo";
|
|
3575
|
+
Blockly.Msg["UNNAMED_KEY"] = "unnamed";
|
|
3576
|
+
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Create 'set %1'";
|
|
3577
|
+
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get";
|
|
3578
|
+
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Returns the value of this variable.";
|
|
3579
|
+
Blockly.Msg["VARIABLES_SET"] = "set %1 to %2";
|
|
3580
|
+
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'";
|
|
3581
|
+
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set";
|
|
3582
|
+
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input.";
|
|
3583
|
+
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "A variable named '%1' already exists.";
|
|
3584
|
+
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'.";
|
|
3585
|
+
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace";
|
|
3586
|
+
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something...";
|
|
3587
|
+
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3588
|
+
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3589
|
+
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
|
3590
|
+
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
|
3591
|
+
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
|
3592
|
+
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3593
|
+
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
3594
|
+
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3595
|
+
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
|
3596
|
+
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3597
|
+
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3598
|
+
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3599
|
+
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
3600
|
+
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3601
|
+
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
|
3602
|
+
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
|
3603
|
+
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
|
3604
|
+
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
|
3605
|
+
Blockly.Msg["TEXT_APPEND_VARIABLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3606
|
+
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
3607
|
+
|
|
3608
|
+
Blockly.Msg["MATH_HUE"] = "230";
|
|
3609
|
+
Blockly.Msg["LOOPS_HUE"] = "120";
|
|
3610
|
+
Blockly.Msg["LISTS_HUE"] = "260";
|
|
3611
|
+
Blockly.Msg["LOGIC_HUE"] = "210";
|
|
3612
|
+
Blockly.Msg["VARIABLES_HUE"] = "330";
|
|
3613
|
+
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
|
3614
|
+
Blockly.Msg["TEXTS_HUE"] = "160";
|
|
3615
|
+
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
|
3616
|
+
Blockly.Msg["COLOUR_HUE"] = "20";
|
|
3601
3617
|
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "item";
|
|
3602
3618
|
var __extends = (this && this.__extends) || (function () {
|
|
3603
3619
|
var extendStatics = function (d, b) {
|