summaryrefslogtreecommitdiff
path: root/store.js
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2015-02-24 10:06:26 +0100
committerGubolin <gubolin@fantasymail.de>2015-02-24 10:06:26 +0100
commit6ff8e7e2d6c983bafe0658d17cbbb14118980e92 (patch)
treea7386af920e295b9b053b88315541399467aab26 /store.js
parent3c6380dfa5866cf3425f44b1d1eb08ef5c3baf1b (diff)
parent2ca378c50bf67b6af5e16ba72af81f4f84db308c (diff)
downloadsnap-6ff8e7e2d6c983bafe0658d17cbbb14118980e92.tar.gz
snap-6ff8e7e2d6c983bafe0658d17cbbb14118980e92.zip
Merge branch 'master' into github_backend
Diffstat (limited to 'store.js')
-rw-r--r--store.js34
1 files changed, 26 insertions, 8 deletions
diff --git a/store.js b/store.js
index bed1371..264f17b 100644
--- a/store.js
+++ b/store.js
@@ -7,7 +7,7 @@
written by Jens Mönig
jens@moenig.org
- Copyright (C) 2014 by Jens Mönig
+ Copyright (C) 2015 by Jens Mönig
This file is part of Snap!.
@@ -61,7 +61,7 @@ SyntaxElementMorph, Variable*/
// Global stuff ////////////////////////////////////////////////////////
-modules.store = '2014-December-06';
+modules.store = '2015-January-21';
// XML_Serializer ///////////////////////////////////////////////////////
@@ -267,7 +267,8 @@ SnapSerializer.prototype.watcherLabels = {
getTimer: 'timer',
getCostumeIdx: 'costume #',
reportMouseX: 'mouse x',
- reportMouseY: 'mouse y'
+ reportMouseY: 'mouse y',
+ reportThreadCount: 'processes'
};
// SnapSerializer instance creation:
@@ -305,16 +306,33 @@ XML_Serializer.prototype.mediaXML = function (name) {
return xml + '</media>';
};
-
// SnapSerializer loading:
-SnapSerializer.prototype.load = function (xmlString) {
+SnapSerializer.prototype.load = function (xmlString, ide) {
// public - answer a new Project represented by the given XML String
- return this.loadProjectModel(this.parse(xmlString));
+ return this.loadProjectModel(this.parse(xmlString), ide);
};
-SnapSerializer.prototype.loadProjectModel = function (xmlNode) {
+SnapSerializer.prototype.loadProjectModel = function (xmlNode, ide) {
// public - answer a new Project represented by the given XML top node
+ // show a warning if the origin apps differ
+
+ var appInfo = xmlNode.attributes.app,
+ app = appInfo ? appInfo.split(' ')[0] : null;
+
+ if (ide && app !== this.app.split(' ')[0]) {
+ ide.inform(
+ app + ' Project',
+ 'This project has been created by a different app:\n\n' +
+ app +
+ '\n\nand may be incompatible or fail to load here.'
+ );
+ }
+ return this.rawLoadProjectModel(xmlNode);
+};
+
+SnapSerializer.prototype.rawLoadProjectModel = function (xmlNode) {
+ // private
var myself = this,
project = {sprites: {}},
model,
@@ -843,7 +861,7 @@ SnapSerializer.prototype.loadScripts = function (scripts, model) {
// private
var myself = this,
scale = SyntaxElementMorph.prototype.scale;
- scripts.texture = 'scriptsPaneTexture.gif';
+ scripts.cachedTexture = IDE_Morph.prototype.scriptsPaneTexture;
model.children.forEach(function (child) {
var element;
if (child.tag === 'script') {