kopia lustrzana https://github.com/backface/turtlestitch
added new extension prims (done)
rodzic
8565e8e92f
commit
6882b46021
|
@ -11,6 +11,7 @@
|
||||||
* new MOUSE POSITION primitive reporter in the SENSING category
|
* new MOUSE POSITION primitive reporter in the SENSING category
|
||||||
* new "position" choice in OF reporter's attribute dropdown, reports a list of XY coordinates
|
* new "position" choice in OF reporter's attribute dropdown, reports a list of XY coordinates
|
||||||
* new "categories" choice in MY reporter's dropdown, reports an ordered list of all category names whose indices match the "category" reported elsewhere
|
* new "categories" choice in MY reporter's dropdown, reports an ordered list of all category names whose indices match the "category" reported elsewhere
|
||||||
|
* new localization extension primitives (prefixed "loc_")
|
||||||
* new "Tad" costume series, thanks, Meghan and Brian!
|
* new "Tad" costume series, thanks, Meghan and Brian!
|
||||||
* **Notable Changes:**
|
* **Notable Changes:**
|
||||||
* exporting a library includes dependencies (auto-select all referenced blocks)
|
* exporting a library includes dependencies (auto-select all referenced blocks)
|
||||||
|
@ -37,6 +38,7 @@
|
||||||
* extensions: added more extension translation primitives, under construction
|
* extensions: added more extension translation primitives, under construction
|
||||||
* objects: tweaked ASK menu display distinction for FALSE Booleans
|
* objects: tweaked ASK menu display distinction for FALSE Booleans
|
||||||
* extensions: tweaked localization extension prims, under construction
|
* extensions: tweaked localization extension prims, under construction
|
||||||
|
* extensions, gui: added new extension prims (done)
|
||||||
|
|
||||||
### 2022-04-03
|
### 2022-04-03
|
||||||
* objects: added shortcut support for ASK menu items
|
* objects: added shortcut support for ASK menu items
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<script src="src/threads.js?version=2022-03-31"></script>
|
<script src="src/threads.js?version=2022-03-31"></script>
|
||||||
<script src="src/objects.js?version=2022-04-04"></script>
|
<script src="src/objects.js?version=2022-04-04"></script>
|
||||||
<script src="src/scenes.js?version=2022-03-03"></script>
|
<script src="src/scenes.js?version=2022-03-03"></script>
|
||||||
<script src="src/gui.js?version=2022-03-17"></script>
|
<script src="src/gui.js?version=2022-04-04"></script>
|
||||||
<script src="src/paint.js?version=2021-07-05"></script>
|
<script src="src/paint.js?version=2021-07-05"></script>
|
||||||
<script src="src/lists.js?version=2022-02-07"></script>
|
<script src="src/lists.js?version=2022-02-07"></script>
|
||||||
<script src="src/byob.js?version=2022-03-23"></script>
|
<script src="src/byob.js?version=2022-03-23"></script>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
/*global modules, List, StageMorph, Costume, SpeechSynthesisUtterance, Sound,
|
/*global modules, List, StageMorph, Costume, SpeechSynthesisUtterance, Sound,
|
||||||
IDE_Morph, CamSnapshotDialogMorph, SoundRecorderDialogMorph, isSnapObject, nop,
|
IDE_Morph, CamSnapshotDialogMorph, SoundRecorderDialogMorph, isSnapObject, nop,
|
||||||
Color, Process, contains, localize, SnapTranslator*/
|
Color, Process, contains, localize, SnapTranslator, isString*/
|
||||||
|
|
||||||
/*jshint esversion: 11, bitwise: false*/
|
/*jshint esversion: 11, bitwise: false*/
|
||||||
|
|
||||||
|
@ -806,16 +806,19 @@ SnapExtensions.primitives.set(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
SnapExtensions.primitives.set(
|
SnapExtensions.primitives.set(
|
||||||
'loc_set(language, [msg])',
|
'loc_set(language, [msg])',
|
||||||
function (lang, msg, proc) {
|
function (lang, msg, proc) {
|
||||||
if (arguments.length === 1) {
|
var ide = this.parentThatIsA(IDE_Morph),
|
||||||
return SnapTranslator.language;
|
disabled = ['receiveGo', 'receiveCondition', 'receiveMessage'],
|
||||||
|
callback = null;
|
||||||
|
ide.loadNewProject = false;
|
||||||
|
if (isString(msg) && !contains(disabled, proc.topBlock.selector)) {
|
||||||
|
callback = () => ide.broadcast(msg);
|
||||||
}
|
}
|
||||||
|
ide.setLanguage(lang, callback, true, true); // don't save, delay
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
*/
|
|
||||||
|
|
||||||
SnapExtensions.primitives.set(
|
SnapExtensions.primitives.set(
|
||||||
'loc_translations()',
|
'loc_translations()',
|
||||||
|
|
15
src/gui.js
15
src/gui.js
|
@ -86,7 +86,7 @@ BlockVisibilityDialogMorph, ThreadManager*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.gui = '2022-March-18';
|
modules.gui = '2022-April-04';
|
||||||
|
|
||||||
// Declarations
|
// Declarations
|
||||||
|
|
||||||
|
@ -6611,7 +6611,7 @@ IDE_Morph.prototype.languageMenu = function () {
|
||||||
menu.popup(world, pos);
|
menu.popup(world, pos);
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.setLanguage = function (lang, callback, noSave) {
|
IDE_Morph.prototype.setLanguage = function (lang, callback, noSave, delay) {
|
||||||
var translation = document.getElementById('language'),
|
var translation = document.getElementById('language'),
|
||||||
src = this.resourceURL('locale', 'lang-' + lang + '.js');
|
src = this.resourceURL('locale', 'lang-' + lang + '.js');
|
||||||
SnapTranslator.unload();
|
SnapTranslator.unload();
|
||||||
|
@ -6619,16 +6619,17 @@ IDE_Morph.prototype.setLanguage = function (lang, callback, noSave) {
|
||||||
document.head.removeChild(translation);
|
document.head.removeChild(translation);
|
||||||
}
|
}
|
||||||
if (lang === 'en') {
|
if (lang === 'en') {
|
||||||
return this.reflectLanguage('en', callback, noSave);
|
return this.reflectLanguage('en', callback, noSave, delay);
|
||||||
}
|
}
|
||||||
translation = document.createElement('script');
|
translation = document.createElement('script');
|
||||||
translation.id = 'language';
|
translation.id = 'language';
|
||||||
translation.onload = () => this.reflectLanguage(lang, callback, noSave);
|
translation.onload = () =>
|
||||||
|
this.reflectLanguage(lang, callback, noSave, delay);
|
||||||
document.head.appendChild(translation);
|
document.head.appendChild(translation);
|
||||||
translation.src = src;
|
translation.src = src;
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.reflectLanguage = function (lang, callback, noSave) {
|
IDE_Morph.prototype.reflectLanguage = function (lang, callback, noSave, delay) {
|
||||||
var projectData,
|
var projectData,
|
||||||
urlBar = location.hash;
|
urlBar = location.hash;
|
||||||
SnapTranslator.language = lang;
|
SnapTranslator.language = lang;
|
||||||
|
@ -6658,12 +6659,12 @@ IDE_Morph.prototype.reflectLanguage = function (lang, callback, noSave) {
|
||||||
this.newProject();
|
this.newProject();
|
||||||
location.hash = urlBar;
|
location.hash = urlBar;
|
||||||
} else {
|
} else {
|
||||||
this.openProjectString(projectData);
|
this.openProjectString(projectData, delay ? callback : null);
|
||||||
}
|
}
|
||||||
if (!noSave) {
|
if (!noSave) {
|
||||||
this.saveSetting('language', lang);
|
this.saveSetting('language', lang);
|
||||||
}
|
}
|
||||||
if (callback) {callback.call(this); }
|
if (callback && !delay) {callback.call(this); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// IDE_Morph blocks scaling
|
// IDE_Morph blocks scaling
|
||||||
|
|
Ładowanie…
Reference in New Issue