summaryrefslogtreecommitdiff
path: root/blocks.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-06-04 12:39:28 +0200
committerjmoenig <jens@moenig.org>2014-06-04 12:39:28 +0200
commitef3997cccf833aebd3d5d3fbecfdc2c13dab9631 (patch)
tree43da848528842b180d4b352277a9415b3489b545 /blocks.js
parent6a4b4afbe98fa99623a81a89e2f6505ff5704d38 (diff)
downloadsnap-yow-ef3997cccf833aebd3d5d3fbecfdc2c13dab9631.tar.gz
snap-yow-ef3997cccf833aebd3d5d3fbecfdc2c13dab9631.zip
Blocks: refactor “script pics” feature
Diffstat (limited to 'blocks.js')
-rw-r--r--blocks.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/blocks.js b/blocks.js
index 69ae610..3e8aa60 100644
--- a/blocks.js
+++ b/blocks.js
@@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/
// Global stuff ////////////////////////////////////////////////////////
-modules.blocks = '2014-May-02';
+modules.blocks = '2014-June-04';
var SyntaxElementMorph;
@@ -4957,6 +4957,14 @@ ScriptsMorph.prototype.cleanUp = function () {
};
ScriptsMorph.prototype.exportScriptsPicture = function () {
+ var pic = this.scriptsPicture();
+ if (pic) {
+ window.open(pic.toDataURL());
+ }
+};
+
+ScriptsMorph.prototype.scriptsPicture = function () {
+ // private - answer a canvas containing the pictures of all scripts
var boundingBox, pic, ctx;
if (this.children.length === 0) {return; }
boundingBox = this.children[0].fullBounds();
@@ -4977,7 +4985,7 @@ ScriptsMorph.prototype.exportScriptsPicture = function () {
);
}
});
- window.open(pic.toDataURL());
+ return pic;
};
ScriptsMorph.prototype.addComment = function () {