diff options
| author | jmoenig <jens@moenig.org> | 2013-04-03 12:03:34 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-04-03 12:03:34 +0200 |
| commit | 18821f7bc1807b6ae199e2c207a865439ee6167f (patch) | |
| tree | ea996b1b5e634bca04f756bdc9f93fadb51d5e3f /store.js | |
| parent | 4804d8cfc82ecaad3e0906090994f6e804243b01 (diff) | |
| download | snap-yow-18821f7bc1807b6ae199e2c207a865439ee6167f.tar.gz snap-yow-18821f7bc1807b6ae199e2c207a865439ee6167f.zip | |
PrototypeHatBlocks accept anchored comments
You can now "stick" comments to the prototype hat block in the block
editor
Diffstat (limited to 'store.js')
| -rw-r--r-- | store.js | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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( '<block-definition s="@" type="@" category="@">' + + '%' + '<inputs>%</inputs>%%' + '</block-definition>', 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( '<input type="@">$</input>', |
