summaryrefslogtreecommitdiff
path: root/store.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-11-15 11:18:45 +0100
committerjmoenig <jens@moenig.org>2013-11-15 11:18:45 +0100
commit81654e72997c1577181d6729660c110ed1b9e20f (patch)
tree7a03fd5c340f72ca557cd3b6c93a87c0d19435cb /store.js
parentcc0bf15c1a9172c494fd527ad4c15a31014fee75 (diff)
downloadsnap-yow-81654e72997c1577181d6729660c110ed1b9e20f.tar.gz
snap-yow-81654e72997c1577181d6729660c110ed1b9e20f.zip
„read-only“ option for editable custom block input slots
also custom block input slots reverting to default now show their default value (useful in combination with the new "read-only" option
Diffstat (limited to 'store.js')
-rw-r--r--store.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/store.js b/store.js
index 0032919..5a5605f 100644
--- a/store.js
+++ b/store.js
@@ -61,7 +61,7 @@ SyntaxElementMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.store = '2013-November-12';
+modules.store = '2013-November-15';
// XML_Serializer ///////////////////////////////////////////////////////
@@ -749,7 +749,8 @@ SnapSerializer.prototype.loadCustomBlocks = function (
definition.declarations[names[i]] = [
child.attributes.type,
child.contents,
- options ? options.contents : undefined
+ options ? options.contents : undefined,
+ child.attributes.readonly === 'true'
];
});
}
@@ -1663,13 +1664,15 @@ CustomBlockDefinition.prototype.toXML = function (serializer) {
this.codeMapping || '',
Object.keys(this.declarations).reduce(function (xml, decl) {
return xml + serializer.format(
- '<input type="@">$%</input>',
+ '<input type="@"$>$%</input>',
myself.declarations[decl][0],
+ myself.declarations[decl][3] ?
+ ' readonly="true"' : '',
myself.declarations[decl][1],
myself.declarations[decl][2] ?
- '<options>' + myself.declarations[decl][2] +
- '</options>'
- : ''
+ '<options>' + myself.declarations[decl][2] +
+ '</options>'
+ : ''
);
}, ''),
this.body ? serializer.store(this.body.expression) : '',