fix issues with current snap

pull/89/head
Michael Aschauer 2020-02-19 19:38:02 -08:00
rodzic 256c6a1e41
commit d6ede5949b
3 zmienionych plików z 17 dodań i 13 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TurtleStitch 3.0</title>
<title>TurtleStitch 2.6 dev</title>
<link rel="shortcut icon" href="stitchcode/favicon-32x32.png" type="image/png" />
<script type="text/javascript" src="src/morphic.js"></script>
<script type="text/javascript" src="src/widgets.js"></script>
@ -15,6 +15,7 @@
<script type="text/javascript" src="src/byob.js"></script>
<script type="text/javascript" src="src/tables.js"></script>
<script type="text/javascript" src="src/symbols.js"></script>
<script type="text/javascript" src="src/maps.js"></script>
<script type="text/javascript" src="src/xml.js"></script>
<script type="text/javascript" src="src/store.js"></script>
<script type="text/javascript" src="src/locale.js"></script>

Wyświetl plik

@ -20,7 +20,7 @@ IDE_Morph.prototype.init = function(isAutoFill) {
//this.isAnimating = false;
this.paletteWidth = 250; // initially same as logo width
//MorphicPreferences.globalFontFamily = 'Sans, Helvetica, Arial';
this.cloud = new BeetleCloud('/api');
this.cloud = new BeetleCloud('/api', this);
};
// change logo
@ -1000,7 +1000,7 @@ IDE_Morph.prototype.aboutTurtleStitch = function () {
pic = Morph.fromImageURL('stitchcode/assets/turtle-logo.png');
pic.setExtent(new Point(32, 32));
aboutTxt = 'TurtleStich! 3.0 dev\n\n'
aboutTxt = 'TurtleStich! 2.6 dev\n\n'
+ 'Copyright \u24B8 2019 Michael Aschauer\n\n'
+ 'TurtleStitch is developed by OSEDA - Association for\n'

Wyświetl plik

@ -1,12 +1,13 @@
// Beetle Blocks cloud
// Inspired in Snap! cloud
function BeetleCloud (url) {
this.init(url);
function BeetleCloud (url, ide) {
this.init(url, ide);
};
BeetleCloud.prototype.init = function (url) {
BeetleCloud.prototype.init = function (url, ide) {
this.url = url;
this.ide = ide;
this.checkCredentials();
};
@ -152,10 +153,10 @@ BeetleCloud.prototype.shareProject = function (shareOrNot, projectName, callBack
);
};
BeetleCloud.prototype.saveProject = function (ide, callBack, errorCall) {
BeetleCloud.prototype.saveProject = function (ignorethis, discardthis, callBack, errorCall) {
var myself = this;
ide.stage.reRender();
this,ide.stage.reRender();
this.checkCredentials(
function (user) {
@ -163,20 +164,22 @@ BeetleCloud.prototype.saveProject = function (ide, callBack, errorCall) {
var pdata = ide.serializer.serialize(ide.stage);
// check if serialized data can be parsed back again
try {
ide.serializer.parse(pdata);
myself.ide.serializer.parse(pdata);
} catch (err) {
ide.showMessage('Serialization of program data failed:\n' + err);
myself.ide.showMessage('Serialization of program data failed:\n' + err);
throw new Error('Serialization of program data failed:\n' + err);
}
myself.ide.showMessage('Uploading project...');
//(path, body, callBack, errorCall, errorMsg)
myself.post(
'/projects/save?projectname='
+ encodeURIComponent(ide.projectName)
+ encodeURIComponent(myself.ide.projectName)
+ '&username='
+ encodeURIComponent(myself.username)
+ '&tags='
+ encodeURIComponent(ide.tags)
+ encodeURIComponent(myself.ide.tags)
+ '&ispublic=true', // path
pdata, // body
callBack,
@ -481,7 +484,7 @@ IDE_Morph.prototype.openIn = function (world) {
SnapCloud.getPublicProject(
SnapCloud.encodeDict(dict),
function (projectData) {
var msg;
var msg;this
myself.nextSteps([
function () {
msg = myself.showMessage('Opening project...');