summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-17 17:28:49 +0200
committerjmoenig <jens@moenig.org>2013-04-17 17:28:49 +0200
commit06d35dae6c6810c3db369b0cf6902c1af3e6f956 (patch)
treeb663e4aae943db63d6a0b7061e4e1daafefcc821
parent15718f44a30a022a5f45001f3fd2d506da504ff1 (diff)
downloadsnap-06d35dae6c6810c3db369b0cf6902c1af3e6f956.tar.gz
snap-06d35dae6c6810c3db369b0cf6902c1af3e6f956.zip
Export picture of all scripts
* new entry in the ScriptsMorph's userMenu lets you export a picture of all scripts, including comments. * place sticky comments on World layer on dragging their anchor block, fixes both #8 and #18 * additional settings for developing the backend
-rw-r--r--blocks.js31
-rw-r--r--cloud.js3
-rw-r--r--gui.js6
-rwxr-xr-xhistory.txt12
4 files changed, 48 insertions, 4 deletions
diff --git a/blocks.js b/blocks.js
index 061e176..b77a369 100644
--- a/blocks.js
+++ b/blocks.js
@@ -153,7 +153,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.blocks = '2013-April-05';
+modules.blocks = '2013-April-17';
var SyntaxElementMorph;
var BlockMorph;
@@ -4285,6 +4285,11 @@ ScriptsMorph.prototype.userMenu = function () {
}
menu.addItem('clean up', 'cleanUp', 'arrange scripts\nvertically');
menu.addItem('add comment', 'addComment');
+ menu.addItem(
+ 'scripts pic...',
+ 'exportScriptsPicture',
+ 'open a new window\nwith a picture of all scripts'
+ );
if (ide) {
menu.addLine();
menu.addItem(
@@ -4343,6 +4348,29 @@ ScriptsMorph.prototype.cleanUp = function () {
this.adjustBounds();
};
+ScriptsMorph.prototype.exportScriptsPicture = function () {
+ var boundingBox, pic, ctx;
+ if (this.children.length === 0) {return; }
+ boundingBox = this.children[0].fullBounds();
+ this.children.forEach(function (child) {
+ if (child.isVisible) {
+ boundingBox = boundingBox.merge(child.fullBounds());
+ }
+ });
+ pic = newCanvas(boundingBox.extent());
+ ctx = pic.getContext('2d');
+ this.children.forEach(function (child) {
+ var pos = child.position();
+ if (child.isVisible) {
+ ctx.drawImage(
+ child.fullImageClassic(),
+ pos.x - boundingBox.origin.x,
+ pos.y - boundingBox.origin.y
+ );
+ }
+ });
+ window.open(pic.toDataURL());
+};
ScriptsMorph.prototype.addComment = function () {
new CommentMorph().pickUp(this.world());
@@ -9057,6 +9085,7 @@ CommentMorph.prototype.align = function (topBlock, ignoreLayer) {
CommentMorph.prototype.startFollowing = function (topBlock) {
var myself = this;
this.align(topBlock);
+ this.world().add(this);
this.addShadow();
this.stickyOffset = this.position().subtract(this.block.position());
this.step = function () {
diff --git a/cloud.js b/cloud.js
index ccd9345..fab69ad 100644
--- a/cloud.js
+++ b/cloud.js
@@ -29,7 +29,7 @@
/*global modules, IDE_Morph, SnapSerializer, hex_sha512, alert, nop*/
-modules.cloud = '2013-April-08';
+modules.cloud = '2013-April-17';
// Global stuff
@@ -38,6 +38,7 @@ var Cloud;
var SnapCloud = new Cloud(
'https://snapcloud.miosoft.com/miocon/app/login?_app=SnapCloud'
//'192.168.2.108:8087/miocon/app/login?_app=SnapCloud'
+ //'192.168.186.167:8087/miocon/app/login?_app=SnapCloud'
// 'localhost/miocon/app/login?_app=SnapCloud'
);
diff --git a/gui.js b/gui.js
index d4320f2..7a0465e 100644
--- a/gui.js
+++ b/gui.js
@@ -68,7 +68,7 @@ sb, CommentMorph, CommandBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.gui = '2013-April-12';
+modules.gui = '2013-April-17';
// Declarations
@@ -3343,8 +3343,10 @@ IDE_Morph.prototype.setCloudURL = function () {
'Snap!Cloud' :
'https://snapcloud.miosoft.com/miocon/app/' +
'login?_app=SnapCloud',
- 'local network dev' :
+ 'local network lab' :
'192.168.2.108:8087/miocon/app/login?_app=SnapCloud',
+ 'local network office' :
+ '192.168.186.167:8087/miocon/app/login?_app=SnapCloud',
'localhost dev' :
'localhost/miocon/app/login?_app=SnapCloud'
}
diff --git a/history.txt b/history.txt
index 3654307..96b945c 100755
--- a/history.txt
+++ b/history.txt
@@ -1623,3 +1623,15 @@ ______
* Lists: fix for typecasting bug in CONTAINS
* BYOB: Tooltips for custom block templates (sitting in the palette): mousing over a custom block in the palette pops up its definition hat comment in a comment-colored speech bubble
* GUI: Sharing/Unsharing/Deleting now available in all version of the project dialog
+
+130415
+------
+* Blocks: place sticky comments on World layer on dragging their anchor block
+
+130416
+------
+* Cloud, GUI: additional dev settings
+
+130417
+------
+* Blocks: "scripts pic" option in the ScriptsMorph's userMenu lets you export a picture of all scripts (including comments) \ No newline at end of file