diff options
| author | Gubolin <gubolin@fantasymail.de> | 2014-12-07 11:54:58 +0100 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2014-12-07 11:54:58 +0100 |
| commit | 54d0194cd575724ff69526e707a02c5a0e3f2b73 (patch) | |
| tree | f6adf6913f449017590fe5770595c37b9ba25d0d /store.js | |
| parent | 4013e79a7421b9e6baacc8e34ae7a8ef188b38cb (diff) | |
| parent | 8338384bf572beb06ebd12a0c9af18029e99262a (diff) | |
| download | snap-issue_405.tar.gz snap-issue_405.zip | |
resolve merge conflictissue_405
Diffstat (limited to 'store.js')
| -rw-r--r-- | store.js | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -57,11 +57,11 @@ newCanvas, Costume, Sound, Audio, IDE_Morph, ScriptsMorph, BlockMorph, ArgMorph, InputSlotMorph, TemplateSlotMorph, CommandSlotMorph, FunctionSlotMorph, MultiArgMorph, ColorSlotMorph, nop, CommentMorph, isNil, localize, sizeOf, ArgLabelMorph, SVG_Costume, MorphicPreferences, -SyntaxElementMorph*/ +SyntaxElementMorph, Variable*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2014-July-29'; +modules.store = '2014-December-06'; // XML_Serializer /////////////////////////////////////////////////////// @@ -261,7 +261,9 @@ SnapSerializer.prototype.watcherLabels = { yPosition: 'y position', direction: 'direction', getScale: 'size', + getTempo: 'tempo', getLastAnswer: 'answer', + getLastMessage: 'message', getTimer: 'timer', getCostumeIdx: 'costume #', reportMouseX: 'mouse x', @@ -730,8 +732,8 @@ SnapSerializer.prototype.loadVariables = function (varFrame, element) { return; } value = child.children[0]; - varFrame.vars[child.attributes.name] = value ? - myself.loadValue(value) : 0; + varFrame.vars[child.attributes.name] = new Variable(value ? + myself.loadValue(value) : 0); }); }; @@ -1199,6 +1201,10 @@ SnapSerializer.prototype.loadValue = function (model) { if (el) { v.outerContext = this.loadValue(el); } + if (v.outerContext && v.receiver && + !v.outerContext.variables.parentFrame) { + v.outerContext.variables.parentFrame = v.receiver.variables; + } return v; case 'costume': center = new Point(); @@ -1393,7 +1399,7 @@ StageMorph.prototype.toXML = function (serializer) { '<blocks>%</blocks>' + '<variables>%</variables>' + '</project>', - (ide && ide.projectName) ? ide.projectName : 'Untitled', + (ide && ide.projectName) ? ide.projectName : localize('Untitled'), serializer.app, serializer.version, (ide && ide.projectNotes) ? ide.projectNotes : '', @@ -1509,7 +1515,7 @@ Sound.prototype.toXML = function (serializer) { VariableFrame.prototype.toXML = function (serializer) { var myself = this; return Object.keys(this.vars).reduce(function (vars, v) { - var val = myself.vars[v], + var val = myself.vars[v].value, dta; if (val === undefined || val === null) { dta = serializer.format('<variable name="@"/>', v); @@ -1824,9 +1830,8 @@ Context.prototype.toXML = function (serializer) { return ''; } return serializer.format( - '<context% ~><inputs>%</inputs><variables>%</variables>' + + '<context ~><inputs>%</inputs><variables>%</variables>' + '%<receiver>%</receiver>%</context>', - this.isLambda ? ' lambda="lambda"' : '', this.inputs.reduce( function (xml, input) { return xml + serializer.format('<input>$</input>', input); |
