Merge pull request #1 from jmoenig/master

Обновление из оригинального репозитория
dev
temaps 2016-05-30 23:23:44 +04:00
commit 12035f0c01
2 zmienionych plików z 14 dodań i 10 usunięć

Wyświetl plik

@ -149,7 +149,7 @@ isSnapObject, copy*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2016-May-10';
modules.blocks = '2016-May-30';
var SyntaxElementMorph;
var BlockMorph;
@ -2227,7 +2227,8 @@ BlockMorph.prototype.userMenu = function () {
myself = this,
shiftClicked = world.currentKey === 16,
proc = this.activeProcess(),
vNames = proc ? proc.context.outerContext.variables.names() : [],
vNames = proc && proc.context && proc.context.outerContext ?
proc.context.outerContext.variables.names() : [],
alternatives,
top,
blck;
@ -3397,13 +3398,13 @@ BlockMorph.prototype.scriptPic = function () {
if (anchor) {
ctx.drawImage(
anchor.image,
anchor.left() - fb.left(),
anchor.left() - fb.left() - 4,
anchor.top() - fb.top()
);
}
ctx.drawImage(
comment.fullImageClassic(),
comment.left() - fb.left(),
comment.left() - fb.left() - 4,
comment.top() - fb.top()
);
});

15
gui.js
Wyświetl plik

@ -71,7 +71,7 @@ isRetinaSupported*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2016-May-13';
modules.gui = '2016-May-30';
// Declarations
@ -460,7 +460,7 @@ IDE_Morph.prototype.openIn = function (world) {
}
if (this.userLanguage) {
this.setLanguage(this.userLanguage, interpretUrlAnchors);
this.setLanguage(this.userLanguage, interpretUrlAnchors, true);
} else {
interpretUrlAnchors.call(this);
}
@ -4329,7 +4329,7 @@ IDE_Morph.prototype.languageMenu = function () {
menu.popup(world, pos);
};
IDE_Morph.prototype.setLanguage = function (lang, callback) {
IDE_Morph.prototype.setLanguage = function (lang, callback, forStartUp) {
var translation = document.getElementById('language'),
src = this.resourceURL('lang-' + lang + '.js'),
myself = this;
@ -4343,16 +4343,16 @@ IDE_Morph.prototype.setLanguage = function (lang, callback) {
translation = document.createElement('script');
translation.id = 'language';
translation.onload = function () {
myself.reflectLanguage(lang, callback);
myself.reflectLanguage(lang, callback, forStartUp);
};
document.head.appendChild(translation);
translation.src = src;
};
IDE_Morph.prototype.reflectLanguage = function (lang, callback) {
IDE_Morph.prototype.reflectLanguage = function (lang, callback, forStartUp) {
var projectData;
SnapTranslator.language = lang;
if (!this.loadNewProject) {
if (!this.loadNewProject && !forStartUp) {
if (Process.prototype.isCatchingErrors) {
try {
projectData = this.serializer.serialize(this.stage);
@ -4370,6 +4370,9 @@ IDE_Morph.prototype.reflectLanguage = function (lang, callback) {
this.fixLayout();
if (this.loadNewProject) {
this.newProject();
} else if (forStartUp) {
this.stage.setName(localize('Stage'));
this.currentSprite.setName(localize('Sprite'));
} else {
this.openProjectString(projectData);
}