summaryrefslogtreecommitdiff
path: root/store.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-03 12:03:34 +0200
committerjmoenig <jens@moenig.org>2013-04-03 12:03:34 +0200
commit18821f7bc1807b6ae199e2c207a865439ee6167f (patch)
treeea996b1b5e634bca04f756bdc9f93fadb51d5e3f /store.js
parent4804d8cfc82ecaad3e0906090994f6e804243b01 (diff)
downloadsnap-18821f7bc1807b6ae199e2c207a865439ee6167f.tar.gz
snap-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.js12
1 files changed, 10 insertions, 2 deletions
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(
'<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>',