suppress 'loop' arrow symbol where label text follow the C-slot in translations

pull/89/head
jmoenig 2019-01-16 08:51:45 +01:00
rodzic 4351187d41
commit 83aa4866e9
3 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -2,6 +2,9 @@
## in development
### 2019-01-16
* suppress 'loop' arrow symbol where label text follow the C-slot in translations
### 2019-01-15
* updated German translation
* updated all translations for the new %loop slot

Wyświetl plik

@ -6,7 +6,7 @@
<link rel="shortcut icon" href="src/favicon.ico">
<script type="text/javascript" src="src/morphic.js?version=2019-01-10"></script>
<script type="text/javascript" src="src/widgets.js?version=2018-10-02"></script>
<script type="text/javascript" src="src/blocks.js?version=2019-01-14"></script>
<script type="text/javascript" src="src/blocks.js?version=2019-01-16"></script>
<script type="text/javascript" src="src/threads.js?version=2019-01-12"></script>
<script type="text/javascript" src="src/objects.js?version=2019-01-14"></script>
<script type="text/javascript" src="src/gui.js?version=2019-01-14"></script>

Wyświetl plik

@ -148,7 +148,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2019-January-14';
modules.blocks = '2019-January-16';
var SyntaxElementMorph;
var BlockMorph;
@ -2218,6 +2218,7 @@ SyntaxElementMorph.prototype.endLayout = function () {
%bool - chameleon colored hexagonal slot (for predicates), static
%l - list icon
%c - C-shaped command slot, special form for primitives
%loop - C-shaped with loop arrow, special form for certain primitives
%cs - C-shaped, auto-reifying, accepts reporter drops
%cl - C-shaped, auto-reifying, rejects reporters
%clr - interactive color slot
@ -2386,7 +2387,7 @@ BlockMorph.prototype.setSpec = function (spec, silently, definition) {
if (this.isPrototype) {
this.add(this.placeHolder());
}
this.parseSpec(spec).forEach(function (word) {
this.parseSpec(spec).forEach(function (word, idx, arr) {
if (word[0] === '%' && (word !== '%br')) {
inputIdx += 1;
}
@ -2417,6 +2418,12 @@ BlockMorph.prototype.setSpec = function (spec, silently, definition) {
(definition || myself.definition).inputOptionsOfIdx(inputIdx)
);
}
if (part.isLoop && idx < arr.length - 1) {
// special case for primitive '%loop' slots:
// don't show the arrow if it is not the last symbol in the block
part.loop().destroy();
part.isLoop = false;
}
});
this.blockSpec = spec;
this.fixLayout(silently);