kopia lustrzana https://github.com/backface/turtlestitch
rodzic
d004543a32
commit
2ef9a8f720
33
gui.js
33
gui.js
|
@ -2497,23 +2497,6 @@ IDE_Morph.prototype.projectMenu = function () {
|
||||||
menu.addItem('New', 'createNewProject');
|
menu.addItem('New', 'createNewProject');
|
||||||
menu.addItem('Open...', 'openProjectsBrowser');
|
menu.addItem('Open...', 'openProjectsBrowser');
|
||||||
menu.addItem('Save', "save");
|
menu.addItem('Save', "save");
|
||||||
if (shiftClicked) {
|
|
||||||
menu.addItem(
|
|
||||||
'Save to disk',
|
|
||||||
function () {
|
|
||||||
if (myself.projectName) {
|
|
||||||
myself.exportProject(myself.projectName);
|
|
||||||
} else {
|
|
||||||
myself.prompt('Export Project As...', function (name) {
|
|
||||||
myself.exportProject(name);
|
|
||||||
}, null, 'exportProject');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'store this project\nin the downloads folder\n'
|
|
||||||
+ '(in supporting browsers)',
|
|
||||||
new Color(100, 0, 0)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
menu.addItem('Save As...', 'saveProjectsBrowser');
|
menu.addItem('Save As...', 'saveProjectsBrowser');
|
||||||
menu.addLine();
|
menu.addLine();
|
||||||
menu.addItem(
|
menu.addItem(
|
||||||
|
@ -2555,11 +2538,10 @@ IDE_Morph.prototype.projectMenu = function () {
|
||||||
'Export project as plain text...' : 'Export project...',
|
'Export project as plain text...' : 'Export project...',
|
||||||
function () {
|
function () {
|
||||||
if (myself.projectName) {
|
if (myself.projectName) {
|
||||||
// true requests that the browser try to display a new window.
|
myself.exportProject(myself.projectName, shiftClicked);
|
||||||
myself.exportProject(myself.projectName, true, shiftClicked);
|
|
||||||
} else {
|
} else {
|
||||||
myself.prompt('Export Project As...', function (name) {
|
myself.prompt('Export Project As...', function (name) {
|
||||||
myself.exportProject(name, true);
|
myself.exportProject(name, shiftClicked);
|
||||||
}, null, 'exportProject');
|
}, null, 'exportProject');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3007,9 +2989,8 @@ IDE_Morph.prototype.rawSaveProject = function (name) {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
IDE_Morph.prototype.exportProject = function (name, newWindow, plain) {
|
IDE_Morph.prototype.exportProject = function (name, plain) {
|
||||||
// Export project XML, newWindow opens a new tab if true
|
// Export project XML, saving a file to disk
|
||||||
// This is used both for "Save to Disk" and "Export project..."
|
|
||||||
var menu, str, dataPrefix;
|
var menu, str, dataPrefix;
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
|
@ -3020,7 +3001,7 @@ IDE_Morph.prototype.exportProject = function (name, newWindow, plain) {
|
||||||
menu = this.showMessage('Exporting');
|
menu = this.showMessage('Exporting');
|
||||||
str = this.serializer.serialize(this.stage)
|
str = this.serializer.serialize(this.stage)
|
||||||
this.setURL('#open:' + dataPrefix + encodeURIComponent(str));
|
this.setURL('#open:' + dataPrefix + encodeURIComponent(str));
|
||||||
this.saveXMLAs(str, name, newWindow);
|
this.saveXMLAs(str, name);
|
||||||
menu.destroy();
|
menu.destroy();
|
||||||
this.showMessage('Exported!', 1);
|
this.showMessage('Exported!', 1);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -3030,7 +3011,7 @@ IDE_Morph.prototype.exportProject = function (name, newWindow, plain) {
|
||||||
menu = this.showMessage('Exporting');
|
menu = this.showMessage('Exporting');
|
||||||
str = this.serializer.serialize(this.stage)
|
str = this.serializer.serialize(this.stage)
|
||||||
this.setURL('#open:' + dataPrefix + encodeURIComponent(str));
|
this.setURL('#open:' + dataPrefix + encodeURIComponent(str));
|
||||||
this.saveXMLAs(str, name, newWindow);
|
this.saveXMLAs(str, name);
|
||||||
menu.destroy();
|
menu.destroy();
|
||||||
this.showMessage('Exported!', 1);
|
this.showMessage('Exported!', 1);
|
||||||
}
|
}
|
||||||
|
@ -3428,7 +3409,7 @@ IDE_Morph.prototype.exportProjectSummary = function (useDropShadows) {
|
||||||
this.saveFileAs(
|
this.saveFileAs(
|
||||||
'<!DOCTYPE html>' + html.toString(),
|
'<!DOCTYPE html>' + html.toString(),
|
||||||
'text/html;charset=utf-8,',
|
'text/html;charset=utf-8,',
|
||||||
this.projectName,
|
pname,
|
||||||
true // request opening a new window.
|
true // request opening a new window.
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue