diff --git a/byob.js b/byob.js index 9f09624a..8f035595 100644 --- a/byob.js +++ b/byob.js @@ -108,7 +108,7 @@ BooleanSlotMorph, XML_Serializer*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2017-September-26'; +modules.byob = '2017-October-04'; // Declarations @@ -3755,7 +3755,7 @@ BlockExportDialogMorph.prototype.selectNone = function () { // BlockExportDialogMorph ops BlockExportDialogMorph.prototype.exportBlocks = function () { - var str = this.serializer.serialize(this.blocks), + var str = this.serializer.serialize(this.blocks, true), // for library ide = this.world().children[0]; if (this.blocks.length > 0) { diff --git a/history.txt b/history.txt index 7cd21863..a0567ec7 100755 --- a/history.txt +++ b/history.txt @@ -3676,6 +3676,7 @@ Fixes: 171004 ------ * Objects: limited sprites' direction and coordinates to finite numbers +* Store, BYOB: made block vars transient for block libraries v4.1 Features: @@ -3726,3 +3727,4 @@ Fixes: * fixed occasional empty drop-down menu items named “close” * fixed some typos * limited sprites' direction and coordinates to finite numbers +* made block vars transient for block libraries diff --git a/store.js b/store.js index 566755da..997b4c4b 100644 --- a/store.js +++ b/store.js @@ -61,7 +61,7 @@ normalizeCanvas, contains*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2017-September-28'; +modules.store = '2017-October-04'; // XML_Serializer /////////////////////////////////////////////////////// @@ -79,6 +79,7 @@ function XML_Serializer() { this.contents = []; this.media = []; this.isCollectingMedia = false; + this.isExportingBlocksLibrary = false; } // XML_Serializer preferences settings: @@ -90,11 +91,12 @@ XML_Serializer.prototype.version = 1; // increment on structural change // XML_Serializer accessing: -XML_Serializer.prototype.serialize = function (object) { +XML_Serializer.prototype.serialize = function (object, forBlocksLibrary) { // public: answer an XML string representing the given object var xml; this.flush(); // in case an error occurred in an earlier attempt this.flushMedia(); + this.isExportingBlocksLibrary = forBlocksLibrary; xml = this.store(object); this.flush(); return xml; @@ -187,6 +189,7 @@ XML_Serializer.prototype.flushMedia = function () { }); } this.media = []; + this.isExportingBlocksLibrary = false; }; // XML_Serializer formatting: @@ -1925,7 +1928,9 @@ CustomCommandBlockMorph.prototype.toBlockXML = function (serializer) { this.isGlobal ? '' : serializer.format(' scope="@"', scope), serializer.store(this.inputs()), - this.isGlobal && this.definition.variableNames.length ? + this.isGlobal && + this.definition.variableNames.length && + !serializer.isExportingBlocksLibrary ? '' + this.variables.toXML(serializer) + ''