diff options
| author | jmoenig <jens@moenig.org> | 2013-11-15 11:18:45 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-11-15 11:18:45 +0100 |
| commit | 81654e72997c1577181d6729660c110ed1b9e20f (patch) | |
| tree | 7a03fd5c340f72ca557cd3b6c93a87c0d19435cb /store.js | |
| parent | cc0bf15c1a9172c494fd527ad4c15a31014fee75 (diff) | |
| download | snap-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.js | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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) : '', |
