From 18821f7bc1807b6ae199e2c207a865439ee6167f Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 3 Apr 2013 12:03:34 +0200 Subject: PrototypeHatBlocks accept anchored comments You can now "stick" comments to the prototype hat block in the block editor --- store.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'store.js') diff --git a/store.js b/store.js index 2dc43ca..3f3c1bf 100644 --- a/store.js +++ b/store.js @@ -61,7 +61,7 @@ SyntaxElementMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2013-March-19'; +modules.store = '2013-April-03'; // XML_Serializer /////////////////////////////////////////////////////// @@ -627,8 +627,9 @@ SnapSerializer.prototype.loadCustomBlocks = function ( isGlobal ) { // private + var myself = this; element.children.forEach(function (child) { - var definition, names, inputs, i; + var definition, names, inputs, comment, i; if (child.tag !== 'block-definition') { return; } @@ -665,6 +666,11 @@ SnapSerializer.prototype.loadCustomBlocks = function ( = [child.attributes.type, child.contents]; }); } + + comment = child.childNamed('comment'); + if (comment) { + definition.comment = myself.loadComment(comment); + } }); }; @@ -1482,11 +1488,13 @@ CustomBlockDefinition.prototype.toXML = function (serializer) { return serializer.format( '' + + '%' + '%%%' + '', this.spec, this.type, this.category || 'other', + this.comment ? this.comment.toXML(serializer) : '', Object.keys(this.declarations).reduce(function (xml, decl) { return xml + serializer.format( '$', -- cgit v1.3.1