diff --git a/HISTORY.md b/HISTORY.md
index 81bd6a3a..54ad9445 100755
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -43,6 +43,9 @@
* **Translation Updates:**
* German
+### 2022-04-25
+* morphic, gui, objects, extensions: renamed "embeddedCode" property of costumes to "embeddedData"
+
### 2022-04-24
* morphic: fixed an encoding bug for embedding blocks in PNG metadata
diff --git a/snap.html b/snap.html
index 88c4899d..e5915085 100755
--- a/snap.html
+++ b/snap.html
@@ -13,14 +13,14 @@
-
+
-
+
-
+
@@ -28,7 +28,7 @@
-
+
diff --git a/src/extensions.js b/src/extensions.js
index e2445b63..9c5c1446 100644
--- a/src/extensions.js
+++ b/src/extensions.js
@@ -34,7 +34,7 @@ SVG_Costume*/
/*jshint esversion: 11, bitwise: false*/
-modules.extensions = '2022-April-20';
+modules.extensions = '2022-April-25';
// Global stuff
@@ -673,15 +673,15 @@ SnapExtensions.primitives.set(
SnapExtensions.primitives.set(
// experimental, will probably be taken out again, don't rely on this
- 'cst_code(cst, code)',
- function (cst, code, proc) {
+ 'cst_embed(cst, data)',
+ function (cst, data, proc) {
var ide = this.parentThatIsA(IDE_Morph);
proc.assertType(cst, 'costume');
- proc.assertType(code, 'text');
+ proc.assertType(data, 'text');
if (cst instanceof SVG_Costume) {
throw new Error('option currently not supported for SVG costumes');
}
- cst.code = code || null;
+ cst.embeddedData = data || null;
cst.version = Date.now();
ide.recordUnsavedChanges();
}
diff --git a/src/gui.js b/src/gui.js
index 53edb72a..c00ffaaf 100644
--- a/src/gui.js
+++ b/src/gui.js
@@ -86,7 +86,7 @@ BlockVisibilityDialogMorph, ThreadManager*/
// Global stuff ////////////////////////////////////////////////////////
-modules.gui = '2022-April-22';
+modules.gui = '2022-April-25';
// Declarations
@@ -2471,7 +2471,7 @@ IDE_Morph.prototype.endBulkDrop = function () {
this.bulkDropInProgress = false;
};
-IDE_Morph.prototype.droppedImage = function (aCanvas, name, embeddedCode) {
+IDE_Morph.prototype.droppedImage = function (aCanvas, name, embeddedData) {
var costume = new Costume(
aCanvas,
this.currentSprite.newCostumeName(
@@ -2491,7 +2491,7 @@ IDE_Morph.prototype.droppedImage = function (aCanvas, name, embeddedCode) {
return;
}
- costume.code = embeddedCode || null;
+ costume.embeddedData = embeddedData || null;
this.currentSprite.addCostume(costume);
this.currentSprite.wearCostume(costume);
this.spriteBar.tabBar.tabTo('costumes');
@@ -9923,7 +9923,7 @@ CostumeIconMorph.prototype.createThumbnail = function () {
var watermark, txt;
SpriteIconMorph.prototype.createThumbnail.call(this);
watermark = this.object instanceof SVG_Costume ? 'svg'
- : (this.object.code ? '>' : null);
+ : (this.object.embeddedData ? '>' : null);
if (watermark) {
txt = new StringMorph(
watermark,
@@ -9973,8 +9973,8 @@ CostumeIconMorph.prototype.userMenu = function () {
menu.addItem("duplicate", "duplicateCostume");
menu.addItem("delete", "removeCostume");
menu.addLine();
- if (this.object.code) {
- menu.addItem("get blocks", "importCode");
+ if (this.object.embeddedData) {
+ menu.addItem("get blocks", "importEmbeddedData");
}
menu.addItem("export", "exportCostume");
return menu;
@@ -10055,8 +10055,8 @@ CostumeIconMorph.prototype.removeCostume = function () {
}
};
-CostumeIconMorph.prototype.importCode = function () {
- this.parentThatIsA(IDE_Morph).droppedText(this.object.code);
+CostumeIconMorph.prototype.importEmbeddedData = function () {
+ this.parentThatIsA(IDE_Morph).droppedText(this.object.embeddedData);
};
CostumeIconMorph.prototype.exportCostume = function () {
@@ -10064,8 +10064,8 @@ CostumeIconMorph.prototype.exportCostume = function () {
if (this.object instanceof SVG_Costume) {
// don't show SVG costumes in a new tab (shows text)
ide.saveFileAs(this.object.contents.src, 'text/svg', this.object.name);
- } else if (this.object.code) {
- // embed blocks code inside the PNG image data
+ } else if (this.object.embeddedData) {
+ // embed payload data (e.g blocks) inside the PNG image data
ide.saveFileAs(this.object.pngData(), 'image/png', this.object.name);
} else { // rasterized Costume
ide.saveCanvasAs(this.object.contents, this.object.name);
diff --git a/src/morphic.js b/src/morphic.js
index 2a989a95..fd688811 100644
--- a/src/morphic.js
+++ b/src/morphic.js
@@ -642,7 +642,7 @@
Drops of image elements from outside the world canvas are dispatched as
- droppedImage(aCanvas, name, embeddedCode)
+ droppedImage(aCanvas, name, embeddedData)
droppedSVG(anImage, name)
events to interested Morphs at the mouse pointer. If you want your Morph
@@ -664,13 +664,13 @@
SVG.
Note that PNG images provide for embedded text comments, which can be used
- to include code inside the image. Such a payload has to be identified by
- an agreed-upon marker. The default tag is stored in MorphicPreferences and
- can be overriden by apps wishing to make use of this feature. If such an
- embedded text-payload is found inside a PNG it is passed as the optional
- third "embeddedCode" parameter to the "droppedImage()" event. embedded text
- only applies to PNGs. You can embed a string into the PNG metadata of a PNG
- by calling
+ to include code or arbitrary data such as a CSV, JSON or XML file inside
+ the image. Such a payload has to be identified by an agreed-upon marker.
+ The default tag is stored in MorphicPreferences and can be overriden by
+ apps wishing to make use of this feature. If such an embedded text-payload
+ is found inside a PNG it is passed as the optional third "embeddedData"
+ parameter to the "droppedImage()" event. embedded text only applies to PNGs.
+ You can embed a string into the PNG metadata of a PNG by calling
embedMetadataPNG(aCanvas, aString)
@@ -1307,7 +1307,7 @@
/*jshint esversion: 11, bitwise: false*/
-var morphicVersion = '2022-April-24';
+var morphicVersion = '2022-April-25';
var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = true;
@@ -11697,7 +11697,7 @@ HandMorph.prototype.processDrop = function (event) {
onto the world canvas, turn it into an offscreen canvas or audio
element and dispatch the
- droppedImage(canvas, name, embeddedCode)
+ droppedImage(canvas, name, embeddedData)
droppedSVG(image, name)
droppedAudio(audio, name)
droppedText(text, name, type)
diff --git a/src/objects.js b/src/objects.js
index 6a30619c..580b1bb0 100644
--- a/src/objects.js
+++ b/src/objects.js
@@ -94,7 +94,7 @@ embedMetadataPNG*/
/*jshint esversion: 6*/
-modules.objects = '2022-April-22';
+modules.objects = '2022-April-25';
var SpriteMorph;
var StageMorph;
@@ -10404,7 +10404,9 @@ SpriteBubbleMorph.prototype.fixLayout = function () {
/*
I am a picture that's "wearable" by a sprite. My rotationCenter is
- relative to my contents position. I can also contain and share code.
+ relative to my contents position. I can also contain embedded data
+ (a string), e.g. for sharing a CSV or JSON or serialized blocks,
+ sprites, scenes in XML format.
*/
// Costume instance creation
@@ -10415,7 +10417,7 @@ function Costume(canvas, name, rotationCenter, noFit, maxExtent) {
if (!noFit) {this.shrinkToFit(maxExtent || this.maxExtent()); }
this.name = name || null;
this.rotationCenter = rotationCenter || this.center();
- this.code = null; // must be a string or null
+ this.embeddedData = null; // must be a string or null
this.version = Date.now(); // for observer optimization
this.loaded = null; // for de-serialization only
}
@@ -10780,7 +10782,7 @@ Costume.prototype.isTainted = function () {
// Costume storing blocks code in PNG exports
Costume.prototype.pngData = function () {
- return embedMetadataPNG(this.contents, this.code);
+ return embedMetadataPNG(this.contents, this.embeddedData);
};
// SVG_Costume /////////////////////////////////////////////////////////////