Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
d4a8012b
Commit
d4a8012b
authored
Aug 21, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Routine recompile.
parent
739918b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
blockly_compressed.js
blockly_compressed.js
+7
-7
core/blockly.js
core/blockly.js
+1
-1
No files found.
blockly_compressed.js
View file @
d4a8012b
...
@@ -963,10 +963,10 @@ Blockly.Trashcan.prototype.animateLid_=function(){this.lidOpen_+=this.isOpen?.2:
...
@@ -963,10 +963,10 @@ Blockly.Trashcan.prototype.animateLid_=function(){this.lidOpen_+=this.isOpen?.2:
Blockly.Trashcan.prototype.close=function(){this.setOpen_(!1)};
Blockly.Trashcan.prototype.close=function(){this.setOpen_(!1)};
// Copyright 2015 Google Inc. Apache License 2.0
// Copyright 2015 Google Inc. Apache License 2.0
Blockly.ZoomControls=function(a){this.workspace_=a};Blockly.ZoomControls.prototype.WIDTH_=32;Blockly.ZoomControls.prototype.HEIGHT_=110;Blockly.ZoomControls.prototype.MARGIN_BOTTOM_=100;Blockly.ZoomControls.prototype.MARGIN_SIDE_=35;Blockly.ZoomControls.prototype.svgGroup_=null;Blockly.ZoomControls.prototype.left_=0;Blockly.ZoomControls.prototype.top_=0;
Blockly.ZoomControls=function(a){this.workspace_=a};Blockly.ZoomControls.prototype.WIDTH_=32;Blockly.ZoomControls.prototype.HEIGHT_=110;Blockly.ZoomControls.prototype.MARGIN_BOTTOM_=100;Blockly.ZoomControls.prototype.MARGIN_SIDE_=35;Blockly.ZoomControls.prototype.svgGroup_=null;Blockly.ZoomControls.prototype.left_=0;Blockly.ZoomControls.prototype.top_=0;
Blockly.ZoomControls.prototype.createDom=function(){var a=this.workspace_;this.svgGroup_=Blockly.createSvgElement("g",{"class":"blocklyZoom"},null);var b=String(Math.random()).substring(2),c=Blockly.createSvgElement("clipPath",{id:"blocklyZoom
resetClipPath"+b},this.svgGroup_);Blockly.createSvgElement("rect",{width:32,height:32},c);var d=Blockly.createSvgElement("image",{width:Blockly.SPRITE.width,height:Blockly.SPRITE.height,y:-92,"clip-path":"url(#blocklyZoomrese
tClipPath"+b+")"},this.svgGroup_);
Blockly.ZoomControls.prototype.createDom=function(){var a=this.workspace_;this.svgGroup_=Blockly.createSvgElement("g",{"class":"blocklyZoom"},null);var b=String(Math.random()).substring(2),c=Blockly.createSvgElement("clipPath",{id:"blocklyZoom
outClipPath"+b},this.svgGroup_);Blockly.createSvgElement("rect",{width:32,height:32,y:77},c);var d=Blockly.createSvgElement("image",{width:Blockly.SPRITE.width,height:Blockly.SPRITE.height,x:-64,y:-15,"clip-path":"url(#blocklyZoomou
tClipPath"+b+")"},this.svgGroup_);
d.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a.options.pathToMedia+Blockly.SPRITE.url);c=Blockly.createSvgElement("clipPath",{id:"blocklyZoominClipPath"+b},this.svgGroup_);Blockly.createSvgElement("rect",{width:32,height:32,y:43},c);var e=Blockly.createSvgElement("image",{width:Blockly.SPRITE.width,height:Blockly.SPRITE.height,x:-32,y:-49,"clip-path":"url(#blocklyZoominClipPath"+b+")"},this.svgGroup_);e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a.options.pathToMedia+
d.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a.options.pathToMedia+Blockly.SPRITE.url);c=Blockly.createSvgElement("clipPath",{id:"blocklyZoominClipPath"+b},this.svgGroup_);Blockly.createSvgElement("rect",{width:32,height:32,y:43},c);var e=Blockly.createSvgElement("image",{width:Blockly.SPRITE.width,height:Blockly.SPRITE.height,x:-32,y:-49,"clip-path":"url(#blocklyZoominClipPath"+b+")"},this.svgGroup_);e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a.options.pathToMedia+
Blockly.SPRITE.url);c=Blockly.createSvgElement("clipPath",{id:"blocklyZoom
outClipPath"+b},this.svgGroup_);Blockly.createSvgElement("rect",{width:32,height:32,y:77},c);b=Blockly.createSvgElement("image",{width:Blockly.SPRITE.width,height:Blockly.SPRITE.height,x:-64,y:-15,"clip-path":"url(#blocklyZoomoutClipPath"+b+")"},this.svgGroup_);b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a.options.pathToMedia+Blockly.SPRITE.url);Blockly.bindEvent_(d
,"mousedown",a,a.zoomReset);Blockly.bindEvent_(e,
Blockly.SPRITE.url);c=Blockly.createSvgElement("clipPath",{id:"blocklyZoom
resetClipPath"+b},this.svgGroup_);Blockly.createSvgElement("rect",{width:32,height:32},c);b=Blockly.createSvgElement("image",{width:Blockly.SPRITE.width,height:Blockly.SPRITE.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+b+")"},this.svgGroup_);b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a.options.pathToMedia+Blockly.SPRITE.url);Blockly.bindEvent_(b
,"mousedown",a,a.zoomReset);Blockly.bindEvent_(e,
"mousedown",null,function(){a.zoomCenter(1)});Blockly.bindEvent_(
b
,"mousedown",null,function(){a.zoomCenter(-1)});return this.svgGroup_};Blockly.ZoomControls.prototype.init=function(){};Blockly.ZoomControls.prototype.dispose=function(){this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.workspace_=null};
"mousedown",null,function(){a.zoomCenter(1)});Blockly.bindEvent_(
d
,"mousedown",null,function(){a.zoomCenter(-1)});return this.svgGroup_};Blockly.ZoomControls.prototype.init=function(){};Blockly.ZoomControls.prototype.dispose=function(){this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.workspace_=null};
Blockly.ZoomControls.prototype.position=function(){var a=this.workspace_.getMetrics();a&&(this.left_=this.workspace_.RTL?this.MARGIN_SIDE_:a.viewWidth+a.absoluteLeft-this.WIDTH_-this.MARGIN_SIDE_,this.top_=a.viewHeight+a.absoluteTop-this.HEIGHT_-this.MARGIN_BOTTOM_,this.svgGroup_.setAttribute("transform","translate("+this.left_+","+this.top_+")"))};Blockly.Xml={};Blockly.Xml.workspaceToDom=function(a){var b;a.RTL&&(b=a.getWidth());for(var c=goog.dom.createDom("xml"),d=a.getTopBlocks(!0),e=0,f;f=d[e];e++){var g=Blockly.Xml.blockToDom_(f);f=f.getRelativeToSurfaceXY();g.setAttribute("x",Math.round(a.RTL?b-f.x:f.x));g.setAttribute("y",Math.round(f.y));c.appendChild(g)}return c};
Blockly.ZoomControls.prototype.position=function(){var a=this.workspace_.getMetrics();a&&(this.left_=this.workspace_.RTL?this.MARGIN_SIDE_:a.viewWidth+a.absoluteLeft-this.WIDTH_-this.MARGIN_SIDE_,this.top_=a.viewHeight+a.absoluteTop-this.HEIGHT_-this.MARGIN_BOTTOM_,this.svgGroup_.setAttribute("transform","translate("+this.left_+","+this.top_+")"))};Blockly.Xml={};Blockly.Xml.workspaceToDom=function(a){var b;a.RTL&&(b=a.getWidth());for(var c=goog.dom.createDom("xml"),d=a.getTopBlocks(!0),e=0,f;f=d[e];e++){var g=Blockly.Xml.blockToDom_(f);f=f.getRelativeToSurfaceXY();g.setAttribute("x",Math.round(a.RTL?b-f.x:f.x));g.setAttribute("y",Math.round(f.y));c.appendChild(g)}return c};
Blockly.Xml.blockToDom_=function(a){var b=goog.dom.createDom("block");b.setAttribute("type",a.type);b.setAttribute("id",a.id);if(a.mutationToDom){var c=a.mutationToDom();c&&(c.hasChildNodes()||c.hasAttributes())&&b.appendChild(c)}for(var c=0,d;d=a.inputList[c];c++)for(var e=0,f;f=d.fieldRow[e];e++)if(f.name&&f.EDITABLE){var g=goog.dom.createDom("field",null,f.getValue());g.setAttribute("name",f.name);b.appendChild(g)}if(c=a.getCommentText())c=goog.dom.createDom("comment",null,c),"object"==typeof a.comment&&
Blockly.Xml.blockToDom_=function(a){var b=goog.dom.createDom("block");b.setAttribute("type",a.type);b.setAttribute("id",a.id);if(a.mutationToDom){var c=a.mutationToDom();c&&(c.hasChildNodes()||c.hasAttributes())&&b.appendChild(c)}for(var c=0,d;d=a.inputList[c];c++)for(var e=0,f;f=d.fieldRow[e];e++)if(f.name&&f.EDITABLE){var g=goog.dom.createDom("field",null,f.getValue());g.setAttribute("name",f.name);b.appendChild(g)}if(c=a.getCommentText())c=goog.dom.createDom("comment",null,c),"object"==typeof a.comment&&
(c.setAttribute("pinned",a.comment.isVisible()),d=a.comment.getBubbleSize(),c.setAttribute("h",d.height),c.setAttribute("w",d.width)),b.appendChild(c);a.data&&(c=goog.dom.createDom("data",null,a.data),b.appendChild(c));for(c=0;d=a.inputList[c];c++){var h,e=!0;d.type!=Blockly.DUMMY_INPUT&&(f=d.connection.targetBlock(),d.type==Blockly.INPUT_VALUE?h=goog.dom.createDom("value"):d.type==Blockly.NEXT_STATEMENT&&(h=goog.dom.createDom("statement")),f&&(h.appendChild(Blockly.Xml.blockToDom_(f)),e=!1),h.setAttribute("name",
(c.setAttribute("pinned",a.comment.isVisible()),d=a.comment.getBubbleSize(),c.setAttribute("h",d.height),c.setAttribute("w",d.width)),b.appendChild(c);a.data&&(c=goog.dom.createDom("data",null,a.data),b.appendChild(c));for(c=0;d=a.inputList[c];c++){var h,e=!0;d.type!=Blockly.DUMMY_INPUT&&(f=d.connection.targetBlock(),d.type==Blockly.INPUT_VALUE?h=goog.dom.createDom("value"):d.type==Blockly.NEXT_STATEMENT&&(h=goog.dom.createDom("statement")),f&&(h.appendChild(Blockly.Xml.blockToDom_(f)),e=!1),h.setAttribute("name",
...
@@ -1316,10 +1316,10 @@ Blockly.OPPOSITE_TYPE=[];Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE]=Blockly.OUTP
...
@@ -1316,10 +1316,10 @@ Blockly.OPPOSITE_TYPE=[];Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE]=Blockly.OUTP
Blockly.mainWorkspace=null;Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.dragMode_=0;Blockly.onTouchUpWrapper_=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};
Blockly.mainWorkspace=null;Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.dragMode_=0;Blockly.onTouchUpWrapper_=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};
Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.options.svg,c=b.parentNode;if(c){var d=c.offsetWidth,c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}};
Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.options.svg,c=b.parentNode;if(c){var d=c.offsetWidth,c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}};
Blockly.onMouseUp_=function(a){a=Blockly.getMainWorkspace();Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);a.isScrolling=!1;Blockly.onTouchUpWrapper_&&(Blockly.unbindEvent_(Blockly.onTouchUpWrapper_),Blockly.onTouchUpWrapper_=null);Blockly.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.onMouseMoveWrapper_),Blockly.onMouseMoveWrapper_=null)};
Blockly.onMouseUp_=function(a){a=Blockly.getMainWorkspace();Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);a.isScrolling=!1;Blockly.onTouchUpWrapper_&&(Blockly.unbindEvent_(Blockly.onTouchUpWrapper_),Blockly.onTouchUpWrapper_=null);Blockly.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.onMouseMoveWrapper_),Blockly.onMouseMoveWrapper_=null)};
Blockly.onMouseMove_=function(a){
var b=Blockly.getMainWorkspace();if(b.isScrolling){Blockly.removeAllRanges();var c=a.clientX-b.startDragMouseX,d=a.clientY-b.startDragMouseY,e=b.startDragMetrics,f=b.startScrollX+c,g=b.startScrollY+d,f=Math.min(f,-e.contentLeft),g=Math.min(g,-e.contentTop),f=Math.max(f,e.viewWidth-e.contentLeft-e.contentWidth),g=Math.max(g,e.viewHeight-e.contentTop-e.contentHeight);b.scrollbar.set(-f-e.contentLeft,-g-e.contentTop);Math.sqrt(c*c+d*d)>Blockly.DRAG_RADIUS&&Blockly.longStop_();
Blockly.onMouseMove_=function(a){
if(!(event.touches&&2<=event.touches.length)){var b=Blockly.getMainWorkspace();if(b.isScrolling){Blockly.removeAllRanges();var c=a.clientX-b.startDragMouseX,d=a.clientY-b.startDragMouseY,e=b.startDragMetrics,f=b.startScrollX+c,g=b.startScrollY+d,f=Math.min(f,-e.contentLeft),g=Math.min(g,-e.contentTop),f=Math.max(f,e.viewWidth-e.contentLeft-e.contentWidth),g=Math.max(g,e.viewHeight-e.contentTop-e.contentHeight);b.scrollbar.set(-f-e.contentLeft,-g-e.contentTop);Math.sqrt(c*
a.stopPropagation()
}};
c+d*d)>Blockly.DRAG_RADIUS&&Blockly.longStop_();a.stopPropagation()}
}};
Blockly.onKeyDown_=function(a){if(!Blockly.isTargetInput_(a))if(27==a.keyCode)Blockly.hideChaff();else if(8==a.keyCode||46==a.keyCode)try{Blockly.selected&&Blockly.selected.isDeletable()&&(Blockly.hideChaff(),Blockly.selected.dispose(!0,!0))}finally{a.preventDefault()}else if(a.altKey||a.ctrlKey||a.metaKey)Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(Blockly.hideChaff(),67==a.keyCode?Blockly.copy_(Blockly.selected):88==a.keyCode&&(Blockly.copy_(Blockly.selected),
Blockly.selected.dispose(!0,
Blockly.onKeyDown_=function(a){if(!Blockly.isTargetInput_(a))if(27==a.keyCode)Blockly.hideChaff();else if(8==a.keyCode||46==a.keyCode)try{Blockly.selected&&Blockly.selected.isDeletable()&&(Blockly.hideChaff(),Blockly.selected.dispose(!0,!0))}finally{a.preventDefault()}else if(a.altKey||a.ctrlKey||a.metaKey)Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(Blockly.hideChaff(),67==a.keyCode?Blockly.copy_(Blockly.selected):88==a.keyCode&&(Blockly.copy_(Blockly.selected),
!0))),86==a.keyCode&&Blockly.clipboardXml_&&Blockly.clipboardSource_.paste(Blockly.clipboardXml_)};Blockly.terminateDrag_=function(){Blockly.BlockSvg.terminateDrag_();Blockly.Flyout.terminateDrag_()};Blockly.longPid_=0;Blockly.longStart_=function(a,b){Blockly.longStop_();Blockly.longPid_=setTimeout(function(){a.button=2;b.onMouseDown_(a)},Blockly.LONGPRESS)};Blockly.longStop_=function(){Blockly.longPid_&&(clearTimeout(Blockly.longPid_),Blockly.longPid_=0)};
Blockly.selected.dispose(!0,
!0))),86==a.keyCode&&Blockly.clipboardXml_&&Blockly.clipboardSource_.paste(Blockly.clipboardXml_)};Blockly.terminateDrag_=function(){Blockly.BlockSvg.terminateDrag_();Blockly.Flyout.terminateDrag_()};Blockly.longPid_=0;Blockly.longStart_=function(a,b){Blockly.longStop_();Blockly.longPid_=setTimeout(function(){a.button=2;b.onMouseDown_(a)},Blockly.LONGPRESS)};Blockly.longStop_=function(){Blockly.longPid_&&(clearTimeout(Blockly.longPid_),Blockly.longPid_=0)};
Blockly.copy_=function(a){var b=Blockly.Xml.blockToDom_(a);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.onContextMenu_=function(a){Blockly.isTargetInput_(a)||a.preventDefault()};Blockly.hideChaff=function(a){Blockly.Tooltip.hide();Blockly.WidgetDiv.hide();a||(a=Blockly.getMainWorkspace(),a.toolbox_&&a.toolbox_.flyout_&&a.toolbox_.flyout_.autoClose&&a.toolbox_.clearSelection())};
Blockly.copy_=function(a){var b=Blockly.Xml.blockToDom_(a);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.onContextMenu_=function(a){Blockly.isTargetInput_(a)||a.preventDefault()};Blockly.hideChaff=function(a){Blockly.Tooltip.hide();Blockly.WidgetDiv.hide();a||(a=Blockly.getMainWorkspace(),a.toolbox_&&a.toolbox_.flyout_&&a.toolbox_.flyout_.autoClose&&a.toolbox_.clearSelection())};
Blockly.getMainWorkspaceMetrics_=function(){var a=Blockly.svgSize(this.options.svg);this.toolbox_&&(a.width-=this.toolbox_.width);var b=a.width-Blockly.Scrollbar.scrollbarThickness,c=a.height-Blockly.Scrollbar.scrollbarThickness;try{var d=this.getCanvas().getBBox()}catch(e){return null}var f=d.width*this.scale,g=d.height*this.scale,h=d.x*this.scale,k=d.y*this.scale;if(this.scrollbar)var l=Math.min(h-b/2,h+f-b),b=Math.max(h+f+b/2,h+b),f=Math.min(k-c/2,k+g-c),c=Math.max(k+g+c/2,k+c);else l=d.x,b=l+
Blockly.getMainWorkspaceMetrics_=function(){var a=Blockly.svgSize(this.options.svg);this.toolbox_&&(a.width-=this.toolbox_.width);var b=a.width-Blockly.Scrollbar.scrollbarThickness,c=a.height-Blockly.Scrollbar.scrollbarThickness;try{var d=this.getCanvas().getBBox()}catch(e){return null}var f=d.width*this.scale,g=d.height*this.scale,h=d.x*this.scale,k=d.y*this.scale;if(this.scrollbar)var l=Math.min(h-b/2,h+f-b),b=Math.max(h+f+b/2,h+b),f=Math.min(k-c/2,k+g-c),c=Math.max(k+g+c/2,k+c);else l=d.x,b=l+
d.width,f=d.y,c=f+d.height;d=0;!this.RTL&&this.toolbox_&&(d=this.toolbox_.width);return{viewHeight:a.height,viewWidth:a.width,contentHeight:c-f,contentWidth:b-l,viewTop:-this.scrollY,viewLeft:-this.scrollX,contentTop:f,contentLeft:l,absoluteTop:0,absoluteLeft:d}};
d.width,f=d.y,c=f+d.height;d=0;!this.RTL&&this.toolbox_&&(d=this.toolbox_.width);return{viewHeight:a.height,viewWidth:a.width,contentHeight:c-f,contentWidth:b-l,viewTop:-this.scrollY,viewLeft:-this.scrollX,contentTop:f,contentLeft:l,absoluteTop:0,absoluteLeft:d}};
...
...
core/blockly.js
View file @
d4a8012b
...
@@ -295,7 +295,7 @@ Blockly.onMouseUp_ = function(e) {
...
@@ -295,7 +295,7 @@ Blockly.onMouseUp_ = function(e) {
*/
*/
Blockly
.
onMouseMove_
=
function
(
e
)
{
Blockly
.
onMouseMove_
=
function
(
e
)
{
if
(
event
.
touches
&&
event
.
touches
.
length
>=
2
)
{
if
(
event
.
touches
&&
event
.
touches
.
length
>=
2
)
{
return
// multi-touch gestures won't have e.clientX
return
;
// Multi-touch gestures won't have e.clientX.
}
}
var
workspace
=
Blockly
.
getMainWorkspace
();
var
workspace
=
Blockly
.
getMainWorkspace
();
if
(
workspace
.
isScrolling
)
{
if
(
workspace
.
isScrolling
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment