kopia lustrzana https://github.com/backface/turtlestitch
refactored more IDE menus
rodzic
f099a64a75
commit
2aed2e2ea4
22
src/gui.js
22
src/gui.js
|
@ -5225,11 +5225,10 @@ IDE_Morph.prototype.setPaletteWidth = function (newWidth) {
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.createNewProject = function () {
|
IDE_Morph.prototype.createNewProject = function () {
|
||||||
var myself = this;
|
|
||||||
this.confirm(
|
this.confirm(
|
||||||
'Replace the current project with a new one?',
|
'Replace the current project with a new one?',
|
||||||
'New Project',
|
'New Project',
|
||||||
function () {myself.newProject(); }
|
() => this.newProject()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5247,14 +5246,15 @@ IDE_Morph.prototype.openProjectsBrowser = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.saveProjectsBrowser = function () {
|
IDE_Morph.prototype.saveProjectsBrowser = function () {
|
||||||
var myself = this;
|
|
||||||
|
|
||||||
// temporary hack - only allow exporting projects to disk
|
// temporary hack - only allow exporting projects to disk
|
||||||
// when running Snap! locally without a web server
|
// when running Snap! locally without a web server
|
||||||
if (location.protocol === 'file:') {
|
if (location.protocol === 'file:') {
|
||||||
this.prompt('Export Project As...', function (name) {
|
this.prompt(
|
||||||
myself.exportProject(name, false);
|
'Export Project As...',
|
||||||
}, null, 'exportProject');
|
name => this.exportProject(name, false),
|
||||||
|
null,
|
||||||
|
'exportProject'
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5276,17 +5276,15 @@ IDE_Morph.prototype.microphoneMenu = function () {
|
||||||
if (microphone.isReady) {
|
if (microphone.isReady) {
|
||||||
menu.addItem(
|
menu.addItem(
|
||||||
'\u2611 ' + localize('Microphone'),
|
'\u2611 ' + localize('Microphone'),
|
||||||
function () {microphone.stop(); }
|
() => microphone.stop()
|
||||||
);
|
);
|
||||||
menu.addLine();
|
menu.addLine();
|
||||||
}
|
}
|
||||||
resolutions.forEach(function (res, i) {
|
resolutions.forEach((res, i) => {
|
||||||
menu.addItem(
|
menu.addItem(
|
||||||
(microphone.resolution === i + 1 ? '\u2713 ' : ' ') +
|
(microphone.resolution === i + 1 ? '\u2713 ' : ' ') +
|
||||||
localize(res),
|
localize(res),
|
||||||
function () {
|
() => microphone.setResolution(i + 1)
|
||||||
microphone.setResolution(i + 1);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
menu.popup(world, pos);
|
menu.popup(world, pos);
|
||||||
|
|
Ładowanie…
Reference in New Issue