kopia lustrzana https://github.com/backface/turtlestitch
Cleanup filenames and references to `ide`
rodzic
888b0b97eb
commit
9490b65270
18
blocks.js
18
blocks.js
|
@ -1852,7 +1852,11 @@ SyntaxElementMorph.prototype.exportPictureWithResult = function (aBubble) {
|
||||||
ctx.drawImage(scr, 0, pic.height - scr.height);
|
ctx.drawImage(scr, 0, pic.height - scr.height);
|
||||||
ctx.drawImage(bub, scr.width + 2, 0);
|
ctx.drawImage(bub, scr.width + 2, 0);
|
||||||
// request to open pic in new window.
|
// request to open pic in new window.
|
||||||
ide.saveCanvasAs(pic, ide.projetName + ' ' + localize('script pic'), true);
|
ide.saveCanvasAs(
|
||||||
|
pic,
|
||||||
|
ide.projetName || localize('Untitled') + ' ' + localize('script pic'),
|
||||||
|
true
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// SyntaxElementMorph code mapping
|
// SyntaxElementMorph code mapping
|
||||||
|
@ -2324,7 +2328,8 @@ BlockMorph.prototype.userMenu = function () {
|
||||||
var ide = myself.parentThatIsA(IDE_Morph);
|
var ide = myself.parentThatIsA(IDE_Morph);
|
||||||
ide.saveCanvasAs(
|
ide.saveCanvasAs(
|
||||||
myself.topBlock().scriptPic(),
|
myself.topBlock().scriptPic(),
|
||||||
ide.projetName + ' ' + localize('script pic'),
|
ide.projetName || localize('Untitled') + ' ' +
|
||||||
|
localize('script pic'),
|
||||||
true // request new window
|
true // request new window
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -5415,11 +5420,13 @@ ScriptsMorph.prototype.cleanUp = function () {
|
||||||
|
|
||||||
ScriptsMorph.prototype.exportScriptsPicture = function () {
|
ScriptsMorph.prototype.exportScriptsPicture = function () {
|
||||||
var pic = this.scriptsPicture(),
|
var pic = this.scriptsPicture(),
|
||||||
ide = this.parentThatIsA(IDE_Morph);
|
ide = this.world().children[0];
|
||||||
|
console.log(this);
|
||||||
if (pic) {
|
if (pic) {
|
||||||
ide.saveCanvasAs(
|
ide.saveCanvasAs(
|
||||||
pic,
|
pic,
|
||||||
ide.projetName + ' ' + localize('script pic'),
|
ide.projetName || localize('Untitled') + ' ' +
|
||||||
|
localize('script pic'),
|
||||||
true // request new window
|
true // request new window
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -11098,7 +11105,8 @@ CommentMorph.prototype.userMenu = function () {
|
||||||
var ide = myself.parentThatIsA(IDE_Morph);
|
var ide = myself.parentThatIsA(IDE_Morph);
|
||||||
ide.saveCanvasAs(
|
ide.saveCanvasAs(
|
||||||
myself.fullImageClassic(),
|
myself.fullImageClassic(),
|
||||||
ide.projetName + ' ' + localize('comment pic'),
|
ide.projetName || localize('Untitled') + ' ' +
|
||||||
|
localize('comment pic'),
|
||||||
true // request new window
|
true // request new window
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
10
byob.js
10
byob.js
|
@ -766,10 +766,11 @@ CustomCommandBlockMorph.prototype.userMenu = function () {
|
||||||
menu.addItem(
|
menu.addItem(
|
||||||
"script pic...",
|
"script pic...",
|
||||||
function () {
|
function () {
|
||||||
var ide = this.parentThatIsA(IDE_Morph);
|
var ide = this.world().children[0];
|
||||||
ide.saveCanvasAs(
|
ide.saveCanvasAs(
|
||||||
this.topBlock().scriptPic(),
|
this.topBlock().scriptPic(),
|
||||||
ide.projectName + ' ' + localize('script pic'),
|
ide.projectName || localize('Untitled') + ' ' +
|
||||||
|
localize('script pic'),
|
||||||
true // request opening a new window
|
true // request opening a new window
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -3379,7 +3380,10 @@ BlockExportDialogMorph.prototype.exportBlocks = function () {
|
||||||
+ '">'
|
+ '">'
|
||||||
+ str
|
+ str
|
||||||
+ '</blocks>';
|
+ '</blocks>';
|
||||||
ide.saveXMLAs(str, ide.projectName + ' ' + localize('blocks'));
|
ide.saveXMLAs(
|
||||||
|
str,
|
||||||
|
ide.projectName || localize('Untitled') + ' ' + localize('blocks')
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
new DialogBoxMorph().inform(
|
new DialogBoxMorph().inform(
|
||||||
'Export blocks',
|
'Export blocks',
|
||||||
|
|
19
gui.js
19
gui.js
|
@ -3099,7 +3099,7 @@ IDE_Morph.prototype.exportSprite = function (sprite) {
|
||||||
+ '">'
|
+ '">'
|
||||||
+ str
|
+ str
|
||||||
+ '</sprites>';
|
+ '</sprites>';
|
||||||
ide.saveXMLAs(str, sprite.name);
|
this.saveXMLAs(str, sprite.name);
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.exportScriptsPicture = function () {
|
IDE_Morph.prototype.exportScriptsPicture = function () {
|
||||||
|
@ -3148,7 +3148,7 @@ IDE_Morph.prototype.exportScriptsPicture = function () {
|
||||||
y += padding;
|
y += padding;
|
||||||
y += each.height;
|
y += each.height;
|
||||||
});
|
});
|
||||||
this.saveCanvasAs(pic, this.ProjectName, true);
|
this.saveCanvasAs(pic, this.projectName || localize('Untitled'), true);
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.exportProjectSummary = function (useDropShadows) {
|
IDE_Morph.prototype.exportProjectSummary = function (useDropShadows) {
|
||||||
|
@ -3690,7 +3690,9 @@ IDE_Morph.prototype.saveFileAs = function (
|
||||||
blobIsSupported = !!new Blob;
|
blobIsSupported = !!new Blob;
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
if (newWindow) {
|
if (false) {
|
||||||
|
//if (newWindow) {
|
||||||
|
// Blob URIs need a custom URL to be displayed in a new window
|
||||||
if (contents instanceof Blob) {
|
if (contents instanceof Blob) {
|
||||||
dataURI = URL.createObjectURL(contents);
|
dataURI = URL.createObjectURL(contents);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3730,7 +3732,7 @@ IDE_Morph.prototype.saveFileAs = function (
|
||||||
|
|
||||||
IDE_Morph.prototype.saveCanvasAs = function (canvas, fileName, newWindow) {
|
IDE_Morph.prototype.saveCanvasAs = function (canvas, fileName, newWindow) {
|
||||||
// Export a Canvas object as a PNG image
|
// Export a Canvas object as a PNG image
|
||||||
// cavas.toBlob() is only supported in Firefox and IE, but is faster.
|
// cavas.toBlob() is currently only supported in Firefox and IE
|
||||||
var myself = this;
|
var myself = this;
|
||||||
if (canvas.toBlob) {
|
if (canvas.toBlob) {
|
||||||
canvas.toBlob(function (blob) {
|
canvas.toBlob(function (blob) {
|
||||||
|
@ -5905,7 +5907,7 @@ SpriteIconMorph.prototype.userMenu = function () {
|
||||||
var ide = myself.parentThatIsA(IDE_Morph);
|
var ide = myself.parentThatIsA(IDE_Morph);
|
||||||
ide.saveCanvasAs(
|
ide.saveCanvasAs(
|
||||||
myself.object.fullImageClassic(),
|
myself.object.fullImageClassic(),
|
||||||
this.name,
|
this.object.name,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -6270,9 +6272,10 @@ CostumeIconMorph.prototype.removeCostume = function () {
|
||||||
CostumeIconMorph.prototype.exportCostume = function () {
|
CostumeIconMorph.prototype.exportCostume = function () {
|
||||||
var ide = this.parentThatIsA(IDE_Morph);
|
var ide = this.parentThatIsA(IDE_Morph);
|
||||||
if (this.object instanceof SVG_Costume) {
|
if (this.object instanceof SVG_Costume) {
|
||||||
ide.saveFileAs(this.object.contents.src, 'text/svg', this.name);
|
// don't show SVG costumes in a new tab (shows text)
|
||||||
} else { // rastered Costume
|
ide.saveFileAs(this.object.contents.src, 'text/svg', this.object.name);
|
||||||
ide.saveCanvasAs(this.object.contents, this.name, true);
|
} else { // rasterized Costume
|
||||||
|
ide.saveCanvasAs(this.object.object.contents, this.object.name, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5739,7 +5739,7 @@ StageMorph.prototype.userMenu = function () {
|
||||||
function () {
|
function () {
|
||||||
ide.saveCanvasAs(
|
ide.saveCanvasAs(
|
||||||
myself.fullImageClassic(),
|
myself.fullImageClassic(),
|
||||||
localize('stage'),
|
myself.name,
|
||||||
true // open as new window
|
true // open as new window
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -7628,6 +7628,7 @@ WatcherMorph.prototype.userMenu = function () {
|
||||||
ide.saveFileAs(
|
ide.saveFileAs(
|
||||||
this.currentValue.toString(),
|
this.currentValue.toString(),
|
||||||
'text/plain;charset=utf-8',
|
'text/plain;charset=utf-8',
|
||||||
|
// TODO: Name!
|
||||||
'variable',
|
'variable',
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
Ładowanie…
Reference in New Issue