kopia lustrzana https://github.com/backface/turtlestitch
Merge tag '4.2.1' of https://github.com/jmoenig/Snap--Build-Your-Own-Blocks into upd4.2
commit
43a6237e87
|
@ -26,7 +26,7 @@ Snap! Build Your Own Blocks [http://snap.berkeley.edu] is a
|
|||
visual, blocks based programming language inspired by Scratch
|
||||
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig and Brian Harvey
|
||||
Copyright (C) 2018 by Jens Mönig and Brian Harvey
|
||||
|
||||
Snap! is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
|
|
271
blocks.js
271
blocks.js
|
@ -9,7 +9,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -144,11 +144,11 @@ fontHeight, TableFrameMorph, SpriteMorph, Context, ListWatcherMorph,
|
|||
CellMorph, DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph,
|
||||
Costume, IDE_Morph, BlockDialogMorph, BlockEditorMorph, localize, isNil,
|
||||
isSnapObject, PushButtonMorph, SpriteIconMorph, Process, AlignmentMorph,
|
||||
CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph*/
|
||||
CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
|
||||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.blocks = '2017-October-17';
|
||||
modules.blocks = '2018-June-08';
|
||||
|
||||
var SyntaxElementMorph;
|
||||
var BlockMorph;
|
||||
|
@ -613,6 +613,18 @@ SyntaxElementMorph.prototype.getVarNamesDict = function () {
|
|||
tempVars.forEach(function (name) {
|
||||
dict[name] = name;
|
||||
});
|
||||
if (block.selector === 'doSetVar') {
|
||||
// add settable object attributes
|
||||
dict['~'] = null;
|
||||
dict.my = {
|
||||
'anchor' : ['anchor'],
|
||||
'parent' : ['parent'],
|
||||
// 'temporary?' : ['temporary?'],
|
||||
'dangling?' : ['dangling?'],
|
||||
'rotation x' : ['rotation x'],
|
||||
'rotation y' : ['rotation y']
|
||||
};
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
return {};
|
||||
|
@ -647,7 +659,7 @@ SyntaxElementMorph.prototype.refactorVarInStack = function (
|
|||
|
||||
if (this instanceof CustomCommandBlockMorph
|
||||
&& this.definition.body
|
||||
&& isNil(this.definition.declarations[oldName])
|
||||
&& isNil(this.definition.declarations.get(oldName))
|
||||
&& !contains(this.definition.variableNames, oldName)) {
|
||||
this.definition.body.expression.refactorVarInStack(oldName, newName);
|
||||
}
|
||||
|
@ -737,7 +749,8 @@ SyntaxElementMorph.prototype.setColor = function (aColor, silently) {
|
|||
this.color = aColor;
|
||||
if (!silently) {this.drawNew(); }
|
||||
this.children.forEach(function (child) {
|
||||
if (!silently || child instanceof TemplateSlotMorph) {
|
||||
if ((!silently || child instanceof TemplateSlotMorph) &&
|
||||
!(child instanceof BlockHighlightMorph)) {
|
||||
child.drawNew();
|
||||
child.changed();
|
||||
}
|
||||
|
@ -933,10 +946,12 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
|||
null,
|
||||
true,
|
||||
{
|
||||
'§_dir': null,
|
||||
'(90) right' : 90,
|
||||
'(-90) left' : -90,
|
||||
'(0) up' : '0',
|
||||
'(180) down' : 180
|
||||
'(180) down' : 180,
|
||||
'random' : ['random']
|
||||
}
|
||||
);
|
||||
part.setContents(90);
|
||||
|
@ -992,7 +1007,10 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
|||
'pressed' : ['pressed'],
|
||||
'dropped' : ['dropped'],
|
||||
'mouse-entered' : ['mouse-entered'],
|
||||
'mouse-departed' : ['mouse-departed']
|
||||
'mouse-departed' : ['mouse-departed'],
|
||||
'scrolled-up' : ['scrolled-up'],
|
||||
'scrolled-down' : ['scrolled-down'],
|
||||
'stopped' : ['stopped'] // experimental
|
||||
},
|
||||
true // read-only
|
||||
);
|
||||
|
@ -1056,6 +1074,17 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
|||
);
|
||||
part.setContents(1);
|
||||
break;
|
||||
case '%rel':
|
||||
part = new InputSlotMorph(
|
||||
null, // text
|
||||
false, // numeric?
|
||||
{
|
||||
'distance' : ['distance'],
|
||||
'direction' : ['direction']
|
||||
},
|
||||
true // read-only
|
||||
);
|
||||
break;
|
||||
case '%spr':
|
||||
part = new InputSlotMorph(
|
||||
null,
|
||||
|
@ -1591,12 +1620,12 @@ SyntaxElementMorph.prototype.fixLayout = function (silently) {
|
|||
lines = [],
|
||||
space = this.isPrototype ?
|
||||
1 : Math.floor(fontHeight(this.fontSize) / 3),
|
||||
ico = this.isCustomBlock && !this.isGlobal ?
|
||||
this.methodIconExtent().x + space : 0,
|
||||
ico = this instanceof BlockMorph && this.hasLocationPin() ?
|
||||
this.methodIconExtent().x + space : 0,
|
||||
bottomCorrection,
|
||||
initialExtent = this.extent();
|
||||
|
||||
if ((this instanceof MultiArgMorph) && (this.slotSpec !== '%c')) {
|
||||
if ((this instanceof MultiArgMorph) && (this.slotSpec !== '%cs')) {
|
||||
blockWidth += this.arrows().width();
|
||||
} else if (this instanceof ReporterBlockMorph) {
|
||||
blockWidth += (this.rounding * 2) + (this.edge * 2);
|
||||
|
@ -1614,7 +1643,7 @@ SyntaxElementMorph.prototype.fixLayout = function (silently) {
|
|||
// determine lines
|
||||
parts.forEach(function (part) {
|
||||
if ((part instanceof CSlotMorph)
|
||||
|| (part.slotSpec === '%c')) {
|
||||
|| (part.slotSpec === '%cs')) {
|
||||
if (l.length > 0) {
|
||||
lines.push(l);
|
||||
lines.push([part]);
|
||||
|
@ -1659,6 +1688,9 @@ SyntaxElementMorph.prototype.fixLayout = function (silently) {
|
|||
} else if (this instanceof MultiArgMorph
|
||||
|| this instanceof ArgLabelMorph) {
|
||||
y = this.top();
|
||||
if (this.slotSpec === '%cs' && this.inputs().length > 0) {
|
||||
y -= this.rounding;
|
||||
}
|
||||
}
|
||||
lines.forEach(function (line) {
|
||||
x = myself.left() + ico + myself.edge + myself.labelPadding;
|
||||
|
@ -1681,6 +1713,13 @@ SyntaxElementMorph.prototype.fixLayout = function (silently) {
|
|||
part.setColor(myself.color);
|
||||
part.setPosition(new Point(x, y));
|
||||
lineHeight = part.height();
|
||||
} else if (part instanceof MultiArgMorph &&
|
||||
(part.slotSpec === '%cs')) {
|
||||
if (myself.isPredicate) {
|
||||
x += myself.corner;
|
||||
}
|
||||
part.setPosition(new Point(x, y));
|
||||
lineHeight = part.height();
|
||||
} else {
|
||||
part.setPosition(new Point(x, y));
|
||||
if (!part.isBlockLabelBreak) {
|
||||
|
@ -1737,7 +1776,7 @@ SyntaxElementMorph.prototype.fixLayout = function (silently) {
|
|||
blockWidth,
|
||||
maxX - this.left() + this.rounding
|
||||
);
|
||||
} else if (this instanceof MultiArgMorph
|
||||
} else if ((this instanceof MultiArgMorph && this.slotSpec !== '%cs')
|
||||
|| this instanceof ArgLabelMorph) {
|
||||
blockWidth = Math.max(
|
||||
blockWidth,
|
||||
|
@ -1764,13 +1803,22 @@ SyntaxElementMorph.prototype.fixLayout = function (silently) {
|
|||
|
||||
// adjust CSlots
|
||||
parts.forEach(function (part) {
|
||||
if (part instanceof CSlotMorph) {
|
||||
var adjustMultiWidth = 0;
|
||||
if (part instanceof CSlotMorph || (part.slotSpec === '%cs')) {
|
||||
if (myself.isPredicate) {
|
||||
part.setWidth(blockWidth - ico - myself.rounding * 2);
|
||||
part.setWidth(
|
||||
blockWidth - ico - myself.rounding * 2 - myself.corner
|
||||
);
|
||||
} else {
|
||||
part.setWidth(blockWidth - myself.edge - ico);
|
||||
adjustMultiWidth = myself.corner + myself.edge;
|
||||
}
|
||||
}
|
||||
if (part.slotSpec === '%cs') {
|
||||
part.inputs().forEach(function (slot) {
|
||||
slot.setWidth(part.right() - slot.left() - adjustMultiWidth);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// redraw in order to erase CSlot backgrounds
|
||||
|
@ -1826,8 +1874,8 @@ SyntaxElementMorph.prototype.fixHighlight = function () {
|
|||
SyntaxElementMorph.prototype.methodIconExtent = function () {
|
||||
// answer the span of the icon for the "local method" indicator
|
||||
var ico = this.fontSize * 1.2;
|
||||
return this.isCustomBlock && !this.isGlobal ?
|
||||
new Point(ico * 0.66, ico) : new Point(0, 0);
|
||||
return this.hasLocationPin() ? new Point(ico * 0.66, ico)
|
||||
: new Point(0, 0);
|
||||
};
|
||||
|
||||
// SyntaxElementMorph evaluating:
|
||||
|
@ -1938,7 +1986,7 @@ SyntaxElementMorph.prototype.showBubble = function (value, exportPic, target) {
|
|||
if (ide && (ide.currentSprite !== target)) {
|
||||
if (target instanceof StageMorph) {
|
||||
anchor = ide.corral.stageIcon;
|
||||
} else {
|
||||
} else if (target) {
|
||||
if (target.isTemporary) {
|
||||
target = detect(
|
||||
target.allExemplars(),
|
||||
|
@ -1949,6 +1997,8 @@ SyntaxElementMorph.prototype.showBubble = function (value, exportPic, target) {
|
|||
ide.corral.frame.contents.children,
|
||||
function (icon) {return icon.object === target; }
|
||||
);
|
||||
} else {
|
||||
target = ide;
|
||||
}
|
||||
pos = anchor.center();
|
||||
}
|
||||
|
@ -2074,6 +2124,7 @@ SyntaxElementMorph.prototype.endLayout = function () {
|
|||
%ida - white roundish type-in slot with drop-down for list indices
|
||||
%idx - white roundish type-in slot for indices incl. "any"
|
||||
%obj - specially drawn slot for object reporters
|
||||
%rel - chameleon colored rectangular drop-down for relation options
|
||||
%spr - chameleon colored rectangular drop-down for object-names
|
||||
%col - chameleon colored rectangular drop-down for collidables
|
||||
%dst - chameleon colored rectangular drop-down for distances
|
||||
|
@ -3461,10 +3512,12 @@ BlockMorph.prototype.doRefactorGlobalVar = function (
|
|||
true
|
||||
);
|
||||
stage.globalBlocks.forEach(function (eachBlock) {
|
||||
eachBlock.body.expression.refactorVarInStack(
|
||||
oldName,
|
||||
newName
|
||||
);
|
||||
if (eachBlock.body) {
|
||||
eachBlock.body.expression.refactorVarInStack(
|
||||
oldName,
|
||||
newName
|
||||
);
|
||||
}
|
||||
});
|
||||
stage.forAllChildren(function (child) {
|
||||
if (child instanceof SpriteMorph) {
|
||||
|
@ -3499,10 +3552,17 @@ BlockMorph.prototype.eraseHoles = function (context) {
|
|||
shift = this.edge * 0.5,
|
||||
gradient,
|
||||
rightX,
|
||||
holes = this.parts().filter(function (part) {
|
||||
return part.isHole;
|
||||
});
|
||||
|
||||
holes = [];
|
||||
|
||||
this.parts().forEach(function (part) {
|
||||
if (part.isHole) {
|
||||
holes.push(part);
|
||||
} else if (part instanceof MultiArgMorph) {
|
||||
holes.push.apply(holes, part.inputs().filter(function (inp) {
|
||||
return inp.isHole;
|
||||
}));
|
||||
}
|
||||
});
|
||||
if (this.isPredicate && (holes.length > 0)) {
|
||||
rightX = this.width() - this.rounding;
|
||||
context.clearRect(
|
||||
|
@ -3543,6 +3603,10 @@ BlockMorph.prototype.eraseHoles = function (context) {
|
|||
|
||||
};
|
||||
|
||||
BlockMorph.prototype.hasLocationPin = function () {
|
||||
return (this.isCustomBlock && !this.isGlobal) || this.isLocalVarTemplate;
|
||||
};
|
||||
|
||||
// BlockMorph highlighting
|
||||
|
||||
BlockMorph.prototype.addHighlight = function (oldHighlight) {
|
||||
|
@ -3834,6 +3898,11 @@ BlockMorph.prototype.fullCopy = function () {
|
|||
};
|
||||
|
||||
BlockMorph.prototype.reactToTemplateCopy = function () {
|
||||
if (this.isLocalVarTemplate) {
|
||||
this.isLocalVarTemplate = null;
|
||||
this.drawNew();
|
||||
this.fixLayout();
|
||||
}
|
||||
this.forceNormalColoring();
|
||||
};
|
||||
|
||||
|
@ -3856,7 +3925,7 @@ BlockMorph.prototype.mouseClickLeft = function () {
|
|||
return this.selectForEdit().focus(); // enable coopy-on-edit
|
||||
}
|
||||
if (top instanceof PrototypeHatBlockMorph) {
|
||||
return top.mouseClickLeft();
|
||||
return; // top.mouseClickLeft();
|
||||
}
|
||||
if (receiver) {
|
||||
stage = receiver.parentThatIsA(StageMorph);
|
||||
|
@ -4041,6 +4110,9 @@ BlockMorph.prototype.situation = function () {
|
|||
|
||||
BlockMorph.prototype.prepareToBeGrabbed = function (hand) {
|
||||
var myself = this;
|
||||
this.allInputs().forEach(function (input) {
|
||||
delete input.bindingID;
|
||||
});
|
||||
this.allComments().forEach(function (comment) {
|
||||
comment.startFollowing(myself, hand.world);
|
||||
});
|
||||
|
@ -4480,9 +4552,6 @@ CommandBlockMorph.prototype.snap = function (hand) {
|
|||
CommandBlockMorph.prototype.isStop = function () {
|
||||
return ([
|
||||
'doStopThis',
|
||||
'doStop',
|
||||
'doStopBlock',
|
||||
'doStopAll',
|
||||
'doForever',
|
||||
'doReport',
|
||||
'removeClone'
|
||||
|
@ -4612,8 +4681,8 @@ CommandBlockMorph.prototype.drawNew = function () {
|
|||
*/
|
||||
}
|
||||
|
||||
// draw method icon if applicable
|
||||
if (this.isCustomBlock && !this.isGlobal) {
|
||||
// draw location pin icon if applicable
|
||||
if (this.hasLocationPin()) {
|
||||
this.drawMethodIcon(context);
|
||||
}
|
||||
|
||||
|
@ -5167,6 +5236,7 @@ ReporterBlockMorph.prototype.init = function (isPredicate, silently) {
|
|||
this.isPredicate = isPredicate || false;
|
||||
this.setExtent(new Point(200, 80), silently);
|
||||
this.cachedSlotSpec = null; // don't serialize
|
||||
this.isLocalVarTemplate = null; // don't serialize
|
||||
};
|
||||
|
||||
// ReporterBlockMorph drag & drop:
|
||||
|
@ -5388,10 +5458,11 @@ ReporterBlockMorph.prototype.drawNew = function () {
|
|||
this.drawRounded(context);
|
||||
}
|
||||
|
||||
// draw method icon if applicable
|
||||
if (this.isCustomBlock && !this.isGlobal) {
|
||||
// draw location pin icon if applicable
|
||||
if (this.hasLocationPin()) {
|
||||
this.drawMethodIcon(context);
|
||||
}
|
||||
|
||||
// erase CommandSlots
|
||||
this.eraseHoles(context);
|
||||
};
|
||||
|
@ -5837,7 +5908,10 @@ RingMorph.prototype.vanishForSimilar = function () {
|
|||
return null;
|
||||
}
|
||||
if (block.selector === 'reportGetVar' ||
|
||||
// block.selector === 'reportListItem' ||
|
||||
block.selector === 'reportJSFunction' ||
|
||||
block.selector === 'reportAttributeOf' ||
|
||||
block.selector === 'reportCompiled' ||
|
||||
(block instanceof RingMorph)
|
||||
) {
|
||||
this.parent.silentReplaceInput(this, block);
|
||||
|
@ -8115,6 +8189,8 @@ InputSlotMorph.prototype.init = function (
|
|||
contents.isShowingBlanks = true;
|
||||
contents.drawNew();
|
||||
|
||||
this.selectedBlock = null;
|
||||
|
||||
this.isUnevaluated = false;
|
||||
this.choices = choiceDict || null; // object, function or selector
|
||||
this.oldContentsExtent = contents.extent();
|
||||
|
@ -8160,13 +8236,22 @@ InputSlotMorph.prototype.arrow = function () {
|
|||
);
|
||||
};
|
||||
|
||||
InputSlotMorph.prototype.setContents = function (aStringOrFloat) {
|
||||
InputSlotMorph.prototype.setContents = function (data) {
|
||||
// data can be a String, Float, or "wish" Block
|
||||
var cnts = this.contents(),
|
||||
dta = aStringOrFloat,
|
||||
dta = data,
|
||||
isConstant = dta instanceof Array;
|
||||
|
||||
if (this.selectedBlock) {
|
||||
this.selectedBlock = null;
|
||||
}
|
||||
|
||||
if (isConstant) {
|
||||
dta = localize(dta[0]);
|
||||
cnts.isItalic = !this.isReadOnly;
|
||||
} else if (dta instanceof BlockMorph) {
|
||||
this.selectedBlock = dta;
|
||||
dta = ''; // make sure the contents text emptied
|
||||
} else { // assume dta is a localizable choice if it's a key in my choices
|
||||
cnts.isItalic = false;
|
||||
if (!isNil(this.choices) && this.choices[dta] instanceof Array) {
|
||||
|
@ -8187,7 +8272,7 @@ InputSlotMorph.prototype.setContents = function (aStringOrFloat) {
|
|||
}
|
||||
|
||||
// remember the constant, if any
|
||||
this.constant = isConstant ? aStringOrFloat : null;
|
||||
this.constant = isConstant ? data : null;
|
||||
};
|
||||
|
||||
InputSlotMorph.prototype.userSetContents = function (aStringOrFloat) {
|
||||
|
@ -8217,7 +8302,8 @@ InputSlotMorph.prototype.menuFromDict = function (
|
|||
noEmptyOption,
|
||||
enableKeyboard)
|
||||
{
|
||||
var key,
|
||||
var key, dial,
|
||||
myself = this,
|
||||
menu = new MenuMorph(
|
||||
this.userSetContents,
|
||||
null,
|
||||
|
@ -8225,6 +8311,11 @@ InputSlotMorph.prototype.menuFromDict = function (
|
|||
this.fontSize
|
||||
);
|
||||
|
||||
function update (num) {
|
||||
myself.setContents(num);
|
||||
myself.reactToSliderEdit();
|
||||
}
|
||||
|
||||
if (choices instanceof Function) {
|
||||
choices = choices.call(this);
|
||||
} else if (isString(choices)) {
|
||||
|
@ -8240,8 +8331,19 @@ InputSlotMorph.prototype.menuFromDict = function (
|
|||
if (Object.prototype.hasOwnProperty.call(choices, key)) {
|
||||
if (key[0] === '~') {
|
||||
menu.addLine();
|
||||
// } else if (key.indexOf('§_def') === 0) {
|
||||
// menu.addItem(choices[key].blockInstance(), choices[key]);
|
||||
} else if (key.indexOf('§_def') === 0) {
|
||||
menu.addItem(choices[key], choices[key]);
|
||||
} else if (key.indexOf('§_dir') === 0) {
|
||||
dial = new DialMorph();
|
||||
dial.rootForGrab = function () {return this; };
|
||||
dial.target = this;
|
||||
dial.action = update;
|
||||
dial.fillColor = this.parent.color;
|
||||
dial.setRadius(this.fontSize * 3);
|
||||
dial.setValue(this.evaluate(), false, true);
|
||||
menu.addLine();
|
||||
menu.items.push(dial);
|
||||
menu.addLine();
|
||||
} else if (choices[key] instanceof Object &&
|
||||
!(choices[key] instanceof Array) &&
|
||||
(typeof choices[key] !== 'function')) {
|
||||
|
@ -8345,13 +8447,18 @@ InputSlotMorph.prototype.collidablesMenu = function () {
|
|||
};
|
||||
|
||||
InputSlotMorph.prototype.distancesMenu = function () {
|
||||
var dict = {
|
||||
'mouse-pointer' : ['mouse-pointer']
|
||||
},
|
||||
var block = this.parentThatIsA(BlockMorph),
|
||||
dict = {},
|
||||
rcvr = this.parentThatIsA(BlockMorph).scriptTarget(),
|
||||
stage = rcvr.parentThatIsA(StageMorph),
|
||||
allNames = [];
|
||||
|
||||
if (block && (block.selector !== 'reportRelationTo')) {
|
||||
dict['random position'] = ['random position'];
|
||||
}
|
||||
dict['mouse-pointer'] = ['mouse-pointer'];
|
||||
dict.center = ['center'];
|
||||
|
||||
stage.children.forEach(function (morph) {
|
||||
if (morph instanceof SpriteMorph && !morph.isTemporary) {
|
||||
if (morph.name !== rcvr.name) {
|
||||
|
@ -8505,11 +8612,9 @@ InputSlotMorph.prototype.attributesMenu = function () {
|
|||
dict[name] = name;
|
||||
});
|
||||
}
|
||||
/*
|
||||
obj.customBlocks.forEach(function (def, i) {
|
||||
dict['§_def' + i] = def
|
||||
obj.allBlocks(true).forEach(function (def, i) {
|
||||
dict['§_def' + i] = def.blockInstance(true); // include translations
|
||||
});
|
||||
*/
|
||||
return dict;
|
||||
};
|
||||
|
||||
|
@ -8655,26 +8760,36 @@ InputSlotMorph.prototype.fixLayout = function () {
|
|||
}
|
||||
arrowWidth = arrow.isVisible ? arrow.width() : 0;
|
||||
|
||||
height = contents.height() + this.edge * 2; // + this.typeInPadding * 2
|
||||
if (this.isNumeric) {
|
||||
width = contents.width()
|
||||
+ Math.floor(arrowWidth * 0.5)
|
||||
+ height
|
||||
// determine slot dimensions
|
||||
if (this.selectedBlock) { // a "wish" in the OF-block's left slot
|
||||
height = this.selectedBlock.height() + this.edge * 2;
|
||||
width = this.selectedBlock.width()
|
||||
+ arrowWidth
|
||||
+ this.edge * 2
|
||||
+ this.typeInPadding * 2;
|
||||
} else {
|
||||
width = Math.max(
|
||||
contents.width()
|
||||
+ arrowWidth
|
||||
+ this.edge * 2
|
||||
+ this.typeInPadding * 2,
|
||||
contents.rawHeight ? // single vs. multi-line contents
|
||||
contents.rawHeight() + arrowWidth
|
||||
: fontHeight(contents.fontSize) / 1.3
|
||||
+ arrowWidth,
|
||||
this.minWidth // for text-type slots
|
||||
);
|
||||
} else {
|
||||
height = contents.height() + this.edge * 2; // + this.typeInPadding * 2
|
||||
if (this.isNumeric) {
|
||||
width = contents.width()
|
||||
+ Math.floor(arrowWidth * 0.5)
|
||||
+ height
|
||||
+ this.typeInPadding * 2;
|
||||
} else {
|
||||
width = Math.max(
|
||||
contents.width()
|
||||
+ arrowWidth
|
||||
+ this.edge * 2
|
||||
+ this.typeInPadding * 2,
|
||||
contents.rawHeight ? // single vs. multi-line contents
|
||||
contents.rawHeight() + arrowWidth
|
||||
: fontHeight(contents.fontSize) / 1.3
|
||||
+ arrowWidth,
|
||||
this.minWidth // for text-type slots
|
||||
);
|
||||
}
|
||||
}
|
||||
this.setExtent(new Point(width, height));
|
||||
|
||||
if (this.isNumeric) {
|
||||
contents.setPosition(new Point(
|
||||
Math.floor(height / 2),
|
||||
|
@ -8836,16 +8951,21 @@ InputSlotMorph.prototype.mappedCode = function () {
|
|||
|
||||
InputSlotMorph.prototype.evaluate = function () {
|
||||
/*
|
||||
answer my content's text string. If I am numerical convert that
|
||||
string to a number. If the conversion fails answer the string
|
||||
answer my contents, which can be a "wish", i.e. a block that refers to
|
||||
another sprite's local method, or a text string. If I am numerical convert
|
||||
that string to a number. If the conversion fails answer the string
|
||||
(e.g. for special choices like 'any', 'all' or 'last') otherwise
|
||||
the numerical value.
|
||||
*/
|
||||
var num,
|
||||
contents = this.contents();
|
||||
var num, contents;
|
||||
|
||||
if (this.selectedBlock) {
|
||||
return this.selectedBlock;
|
||||
}
|
||||
if (this.constant) {
|
||||
return this.constant;
|
||||
}
|
||||
contents = this.contents();
|
||||
if (this.isNumeric) {
|
||||
num = parseFloat(contents.text || '0');
|
||||
if (!isNaN(num)) {
|
||||
|
@ -8943,6 +9063,16 @@ InputSlotMorph.prototype.drawNew = function () {
|
|||
this.drawRoundBorder(context);
|
||||
}
|
||||
}
|
||||
|
||||
// draw my "wish" block, if any
|
||||
if (this.selectedBlock) {
|
||||
context.drawImage(
|
||||
this.selectedBlock.fullImageClassic(),
|
||||
this.edge + this.typeInPadding,
|
||||
this.edge
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
InputSlotMorph.prototype.drawRectBorder = function (context) {
|
||||
|
@ -9136,10 +9266,6 @@ InputSlotMorph.prototype.drawRoundBorder = function (context) {
|
|||
context.stroke();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// TemplateSlotMorph ///////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
|
@ -10470,7 +10596,8 @@ MultiArgMorph.prototype.removeInput = function () {
|
|||
if (this.children.length > 1) {
|
||||
oldPart = this.children[this.children.length - 2];
|
||||
this.removeChild(oldPart);
|
||||
if (oldPart instanceof BlockMorph) {
|
||||
if (oldPart instanceof BlockMorph &&
|
||||
!(oldPart instanceof RingMorph && !oldPart.contents())) {
|
||||
scripts = this.parentThatIsA(ScriptsMorph);
|
||||
if (scripts) {
|
||||
scripts.add(oldPart);
|
||||
|
|
203
byob.js
203
byob.js
|
@ -9,7 +9,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -95,7 +95,7 @@
|
|||
|
||||
*/
|
||||
|
||||
/*global modules, CommandBlockMorph, SpriteMorph, TemplateSlotMorph,
|
||||
/*global modules, CommandBlockMorph, SpriteMorph, TemplateSlotMorph, Map,
|
||||
StringMorph, Color, DialogBoxMorph, ScriptsMorph, ScrollFrameMorph,
|
||||
Point, HandleMorph, HatBlockMorph, BlockMorph, detect, List, Process,
|
||||
AlignmentMorph, ToggleMorph, InputFieldMorph, ReporterBlockMorph,
|
||||
|
@ -104,11 +104,11 @@ contains, InputSlotMorph, ToggleButtonMorph, IDE_Morph, MenuMorph, copy,
|
|||
ToggleElementMorph, Morph, fontHeight, StageMorph, SyntaxElementMorph,
|
||||
SnapSerializer, CommentMorph, localize, CSlotMorph, MorphicPreferences,
|
||||
SymbolMorph, isNil, CursorMorph, VariableFrame, WatcherMorph, Variable,
|
||||
BooleanSlotMorph, XML_Serializer*/
|
||||
BooleanSlotMorph, XML_Serializer, SnapTranslator*/
|
||||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.byob = '2017-October-09';
|
||||
modules.byob = '2018-June-15';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -140,22 +140,28 @@ function CustomBlockDefinition(spec, receiver) {
|
|||
this.isGlobal = false;
|
||||
this.type = 'command';
|
||||
this.spec = spec || '';
|
||||
// format: {'inputName' : [type, default, options, readonly]}
|
||||
this.declarations = {};
|
||||
this.declarations = new Map();
|
||||
// key: inputName
|
||||
// value: [type, default, options, isReadOnly]
|
||||
this.variableNames = [];
|
||||
this.comment = null;
|
||||
this.codeMapping = null; // experimental, generate text code
|
||||
this.codeHeader = null; // experimental, generate text code
|
||||
this.translations = {}; // experimental, format: {lang : spec}
|
||||
|
||||
// don't serialize (not needed for functionality):
|
||||
this.receiver = receiver || null; // for serialization only (pointer)
|
||||
this.editorDimensions = null; // a rectangle, last bounds of the editor
|
||||
this.cachedIsRecursive = null; // for automatic yielding
|
||||
this.cachedTranslation = null; // for localized block specs
|
||||
|
||||
// transient - for "wishes"
|
||||
this.storedSemanticSpec = null;
|
||||
}
|
||||
|
||||
// CustomBlockDefinition instantiating blocks
|
||||
|
||||
CustomBlockDefinition.prototype.blockInstance = function () {
|
||||
CustomBlockDefinition.prototype.blockInstance = function (storeTranslations) {
|
||||
var block;
|
||||
if (this.type === 'command') {
|
||||
block = new CustomCommandBlockMorph(this);
|
||||
|
@ -166,6 +172,9 @@ CustomBlockDefinition.prototype.blockInstance = function () {
|
|||
);
|
||||
}
|
||||
block.isDraggable = true;
|
||||
if (storeTranslations) { // only for "wishes"
|
||||
block.storedTranslations = this.translationsAsText();
|
||||
}
|
||||
return block;
|
||||
};
|
||||
|
||||
|
@ -195,7 +204,7 @@ CustomBlockDefinition.prototype.prototypeInstance = function () {
|
|||
// assign slot declarations to prototype inputs
|
||||
block.parts().forEach(function (part) {
|
||||
if (part instanceof BlockInputFragmentMorph) {
|
||||
slot = myself.declarations[part.fragment.labelString];
|
||||
slot = myself.declarations.get(part.fragment.labelString);
|
||||
if (slot) {
|
||||
part.fragment.type = slot[0];
|
||||
part.fragment.defaultValue = slot[1];
|
||||
|
@ -215,7 +224,13 @@ CustomBlockDefinition.prototype.copyAndBindTo = function (sprite, headerOnly) {
|
|||
|
||||
delete c[XML_Serializer.prototype.idProperty];
|
||||
c.receiver = sprite; // only for (kludgy) serialization
|
||||
c.declarations = copy(this.declarations); // might have to go deeper
|
||||
|
||||
// copy declarations
|
||||
c.declarations = new Map();
|
||||
for (var [key, val] of this.declarations) {
|
||||
c.declarations.set(key, val);
|
||||
}
|
||||
|
||||
if (headerOnly) { // for serializing inherited method signatures
|
||||
c.body = null;
|
||||
return c;
|
||||
|
@ -234,6 +249,10 @@ CustomBlockDefinition.prototype.copyAndBindTo = function (sprite, headerOnly) {
|
|||
// CustomBlockDefinition accessing
|
||||
|
||||
CustomBlockDefinition.prototype.blockSpec = function () {
|
||||
if (this.storedSemanticSpec) {
|
||||
return this.storedSemanticSpec; // for "wishes"
|
||||
}
|
||||
|
||||
var myself = this,
|
||||
ans = [],
|
||||
parts = this.parseSpec(this.spec),
|
||||
|
@ -264,15 +283,15 @@ CustomBlockDefinition.prototype.helpSpec = function () {
|
|||
};
|
||||
|
||||
CustomBlockDefinition.prototype.typeOf = function (inputName) {
|
||||
if (this.declarations[inputName]) {
|
||||
return this.declarations[inputName][0];
|
||||
if (this.declarations.has(inputName)) {
|
||||
return this.declarations.get(inputName)[0];
|
||||
}
|
||||
return '%s';
|
||||
};
|
||||
|
||||
CustomBlockDefinition.prototype.defaultValueOf = function (inputName) {
|
||||
if (this.declarations[inputName]) {
|
||||
return this.declarations[inputName][1];
|
||||
if (this.declarations.has(inputName)) {
|
||||
return this.declarations.get(inputName)[1];
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
@ -298,8 +317,9 @@ CustomBlockDefinition.prototype.inputOptionsOfIdx = function (idx) {
|
|||
};
|
||||
|
||||
CustomBlockDefinition.prototype.dropDownMenuOf = function (inputName) {
|
||||
if (this.declarations[inputName] && this.declarations[inputName][2]) {
|
||||
return this.parseChoices(this.declarations[inputName][2]);
|
||||
if (this.declarations.has(inputName) &&
|
||||
this.declarations.get(inputName)[2]) {
|
||||
return this.parseChoices(this.declarations.get(inputName)[2]);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
@ -324,8 +344,8 @@ CustomBlockDefinition.prototype.parseChoices = function (string) {
|
|||
};
|
||||
|
||||
CustomBlockDefinition.prototype.isReadOnlyInput = function (inputName) {
|
||||
return this.declarations[inputName] &&
|
||||
this.declarations[inputName][3] === true;
|
||||
return this.declarations.has(inputName) &&
|
||||
this.declarations.get(inputName)[3] === true;
|
||||
};
|
||||
|
||||
CustomBlockDefinition.prototype.inputOptionsOf = function (inputName) {
|
||||
|
@ -383,6 +403,82 @@ CustomBlockDefinition.prototype.isDirectlyRecursive = function () {
|
|||
return this.cachedIsRecursive;
|
||||
};
|
||||
|
||||
// CustomBlockDefinition localizing, highly experimental
|
||||
|
||||
CustomBlockDefinition.prototype.localizedSpec = function () {
|
||||
if (this.cachedTranslation) {return this.cachedTranslation; }
|
||||
|
||||
var loc = this.translations[SnapTranslator.language],
|
||||
sem = this.blockSpec(),
|
||||
locParts,
|
||||
inputs,
|
||||
i = -1;
|
||||
|
||||
function isInput(str) {
|
||||
return (str.length > 1) && (str[0] === '%');
|
||||
}
|
||||
|
||||
if (isNil(loc)) {return sem; }
|
||||
inputs = BlockMorph.prototype.parseSpec(sem).filter(function (str) {
|
||||
return (isInput(str));
|
||||
});
|
||||
locParts = BlockMorph.prototype.parseSpec(loc);
|
||||
|
||||
// perform a bunch of sanity checks on the localized spec
|
||||
if (locParts.some(function (str) {return isInput(str); }) ||
|
||||
(locParts.filter(function (str) {return str === '_'; }).length !==
|
||||
inputs.length)
|
||||
) {
|
||||
this.cachedTranslation = sem;
|
||||
} else {
|
||||
// substitute each input place holder with its semantic spec part
|
||||
locParts = locParts.map(function (str) {
|
||||
if (str === '_') {
|
||||
i += 1;
|
||||
return inputs[i];
|
||||
}
|
||||
return str;
|
||||
});
|
||||
this.cachedTranslation = locParts.join(' ');
|
||||
}
|
||||
return this.cachedTranslation;
|
||||
};
|
||||
|
||||
CustomBlockDefinition.prototype.abstractBlockSpec = function () {
|
||||
// answer the semantic block spec substituting each input
|
||||
// with an underscore
|
||||
return BlockMorph.prototype.parseSpec(this.blockSpec()).map(
|
||||
function (str) {
|
||||
return (str.length > 1 && (str[0]) === '%') ? '_' : str;
|
||||
}
|
||||
).join(' ');
|
||||
};
|
||||
|
||||
CustomBlockDefinition.prototype.translationsAsText = function () {
|
||||
var myself = this,
|
||||
txt = '';
|
||||
Object.keys(this.translations).forEach(function (lang) {
|
||||
txt += (lang + ':' + myself.translations[lang] + '\n');
|
||||
});
|
||||
return txt;
|
||||
};
|
||||
|
||||
CustomBlockDefinition.prototype.updateTranslations = function (text) {
|
||||
var myself = this,
|
||||
lines = text.split('\n').filter(function (txt) {
|
||||
return txt.length;
|
||||
});
|
||||
this.translations = {};
|
||||
lines.forEach(function (txt) {
|
||||
var idx = txt.indexOf(':'),
|
||||
key = txt.slice(0, idx).trim(),
|
||||
val = txt.slice(idx + 1).trim();
|
||||
if (idx) {
|
||||
myself.translations[key] = val;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// CustomBlockDefinition picturing
|
||||
|
||||
CustomBlockDefinition.prototype.scriptsPicture = function () {
|
||||
|
@ -465,12 +561,14 @@ function CustomCommandBlockMorph(definition, isProto) {
|
|||
|
||||
CustomCommandBlockMorph.prototype.init = function (definition, isProto) {
|
||||
this.definition = definition; // mandatory
|
||||
this.semanticSpec = '';
|
||||
this.isGlobal = definition ? definition.isGlobal : false;
|
||||
this.isPrototype = isProto || false; // optional
|
||||
CustomCommandBlockMorph.uber.init.call(this, true); // silently
|
||||
this.category = definition.category;
|
||||
this.selector = 'evaluateCustomBlock';
|
||||
this.variables = null;
|
||||
this.storedTranslations = null; // transient - only for "wishes"
|
||||
this.initializeVariables();
|
||||
if (definition) { // needed for de-serializing
|
||||
this.refresh();
|
||||
|
@ -495,9 +593,11 @@ CustomCommandBlockMorph.prototype.initializeVariables = function (oldVars) {
|
|||
CustomCommandBlockMorph.prototype.refresh = function (aDefinition, silently) {
|
||||
var def = aDefinition || this.definition,
|
||||
newSpec = this.isPrototype ?
|
||||
def.spec : def.blockSpec(),
|
||||
def.spec : def.localizedSpec(),
|
||||
oldInputs;
|
||||
|
||||
this.semanticSpec = def.blockSpec();
|
||||
|
||||
// make sure local custom blocks don't hold on to a method.
|
||||
// future performance optimization plan:
|
||||
// null out the definition for local blocks here,
|
||||
|
@ -738,17 +838,22 @@ CustomCommandBlockMorph.prototype.blockSpecFromFragments = function () {
|
|||
};
|
||||
|
||||
CustomCommandBlockMorph.prototype.declarationsFromFragments = function () {
|
||||
// format for type declarations: {inputName : [type, default]}
|
||||
var ans = {};
|
||||
// returns a Map object for type declarations:
|
||||
// key: inputName
|
||||
// value: [type, default, options, isReadOnly]
|
||||
var ans = new Map();
|
||||
|
||||
this.parts().forEach(function (part) {
|
||||
if (part instanceof BlockInputFragmentMorph) {
|
||||
ans[part.fragment.labelString] = [
|
||||
part.fragment.type,
|
||||
part.fragment.defaultValue,
|
||||
part.fragment.options,
|
||||
part.fragment.isReadOnly
|
||||
];
|
||||
ans.set(
|
||||
part.fragment.labelString,
|
||||
[
|
||||
part.fragment.type,
|
||||
part.fragment.defaultValue,
|
||||
part.fragment.options,
|
||||
part.fragment.isReadOnly
|
||||
]
|
||||
);
|
||||
}
|
||||
});
|
||||
return ans;
|
||||
|
@ -809,7 +914,7 @@ CustomCommandBlockMorph.prototype.edit = function () {
|
|||
this.duplicateBlockDefinition();
|
||||
return;
|
||||
}
|
||||
def = rcvr.getMethod(this.blockSpec);
|
||||
def = rcvr.getMethod(this.semanticSpec);
|
||||
}
|
||||
Morph.prototype.trackChanges = false;
|
||||
editor = new BlockEditorMorph(def, rcvr);
|
||||
|
@ -946,6 +1051,13 @@ CustomCommandBlockMorph.prototype.userMenu = function () {
|
|||
},
|
||||
'open a new window\nwith a picture of this script'
|
||||
);
|
||||
menu.addItem(
|
||||
"translations...",
|
||||
function () {
|
||||
hat.parentThatIsA(BlockEditorMorph).editTranslations();
|
||||
},
|
||||
'experimental -\nunder construction'
|
||||
);
|
||||
if (this.isGlobal) {
|
||||
if (hat.inputs().length < 2) {
|
||||
menu.addItem(
|
||||
|
@ -1193,10 +1305,12 @@ CustomReporterBlockMorph.prototype.init = function (
|
|||
isProto
|
||||
) {
|
||||
this.definition = definition; // mandatory
|
||||
this.semanticSpec = ''; // used for translations
|
||||
this.isGlobal = definition ? definition.isGlobal : false;
|
||||
this.isPrototype = isProto || false; // optional
|
||||
CustomReporterBlockMorph.uber.init.call(this, isPredicate, true); // sil.
|
||||
this.category = definition.category;
|
||||
this.storedTranslations = null; // transient - only for "wishes"
|
||||
this.variables = new VariableFrame();
|
||||
this.initializeVariables();
|
||||
this.selector = 'evaluateCustomBlock';
|
||||
|
@ -1942,6 +2056,7 @@ BlockEditorMorph.prototype.init = function (definition, target) {
|
|||
|
||||
// additional properties:
|
||||
this.definition = definition;
|
||||
this.translations = definition.translationsAsText();
|
||||
this.handle = null;
|
||||
|
||||
// initialize inherited properties:
|
||||
|
@ -2086,11 +2201,13 @@ BlockEditorMorph.prototype.close = function () {
|
|||
block = detect(
|
||||
this.body.contents.allChildren(),
|
||||
function (morph) {
|
||||
return morph.definition && !morph.definition.isGlobal;
|
||||
return morph.isCustomBlock && !morph.isGlobal;
|
||||
}
|
||||
);
|
||||
if (block) {
|
||||
block = block.definition.blockInstance();
|
||||
block = block.scriptTarget()
|
||||
.getMethod(block.semanticSpec)
|
||||
.blockInstance();
|
||||
block.addShadow();
|
||||
new DialogBoxMorph().inform(
|
||||
'Local Block(s) in Global Definition',
|
||||
|
@ -2161,6 +2278,8 @@ BlockEditorMorph.prototype.updateDefinition = function () {
|
|||
this.definition.declarations = this.prototypeSlots();
|
||||
this.definition.variableNames = this.variableNames();
|
||||
this.definition.scripts = [];
|
||||
this.definition.updateTranslations(this.translations);
|
||||
this.definition.cachedTranslation = null;
|
||||
this.definition.editorDimensions = this.bounds.copy();
|
||||
this.definition.cachedIsRecursive = null; // flush the cache, don't update
|
||||
|
||||
|
@ -2247,6 +2366,32 @@ BlockEditorMorph.prototype.variableNames = function () {
|
|||
).variableNames();
|
||||
};
|
||||
|
||||
// BlockEditorMorph translation
|
||||
|
||||
BlockEditorMorph.prototype.editTranslations = function () {
|
||||
var myself = this,
|
||||
block = this.definition.blockInstance();
|
||||
block.addShadow(new Point(3, 3));
|
||||
new DialogBoxMorph(
|
||||
myself,
|
||||
function (text) {
|
||||
myself.translations = text;
|
||||
},
|
||||
myself
|
||||
).promptCode(
|
||||
'Custom Block Translations',
|
||||
myself.translations,
|
||||
myself.world(),
|
||||
block.fullImage(),
|
||||
myself.definition.abstractBlockSpec() +
|
||||
'\n\n' +
|
||||
localize('Enter one translation per line. ' +
|
||||
'use colon (":") as lang/spec delimiter\n' +
|
||||
'and underscore ("_") as placeholder for an input, ' +
|
||||
'e.g.:\n\nen:say _ for _ secs')
|
||||
);
|
||||
};
|
||||
|
||||
// BlockEditorMorph layout
|
||||
|
||||
BlockEditorMorph.prototype.setInitialDimensions = function () {
|
||||
|
|
Plik diff jest za duży
Load Diff
Przed Szerokość: | Wysokość: | Rozmiar: 9.2 KiB Po Szerokość: | Wysokość: | Rozmiar: 9.2 KiB |
496
history.txt
496
history.txt
|
@ -1,4 +1,4 @@
|
|||
BYOB4 (Snap) history
|
||||
BYOB4 (Snap!) history
|
||||
---------------------
|
||||
110511
|
||||
------
|
||||
|
@ -1626,7 +1626,7 @@ ______
|
|||
|
||||
130415
|
||||
------
|
||||
* Blocks: place sticky comments on World layer on dragging their anchor block
|
||||
* Blocks: place sticky comments on World layer on dragging their anchor block
|
||||
|
||||
130416
|
||||
------
|
||||
|
@ -1704,7 +1704,7 @@ ______
|
|||
130514
|
||||
------
|
||||
* paint.js: Paint editor, first version, contributed by Kartik Chandra, Yay!!
|
||||
* Threads, Objects, Blocks: Broadcast & message enhancements: When I receive <any msg>, and getLastMessage reporter + watcher
|
||||
* Threads, Objects, Blocks: Broadcast & message enhancements: When I receive <any msg>, and getLastMessage reporter + watcher
|
||||
|
||||
130515
|
||||
------
|
||||
|
@ -1726,7 +1726,7 @@ ______
|
|||
|
||||
130605
|
||||
------
|
||||
* Objects: fix for hiding 'getLastAnswer' and 'getTimer' primitives
|
||||
* Objects: fix for hiding 'getLastAnswer' and 'getTimer' primitives
|
||||
|
||||
130606
|
||||
------
|
||||
|
@ -1837,7 +1837,7 @@ ______
|
|||
130801
|
||||
------
|
||||
* Blocks, Threads: "whitespace" & other options in SPLIT reporter's dropdown
|
||||
* Blocks: Italicize editable input options (e.g. for the SPLT block)
|
||||
* Blocks: Italicize editable input options (e.g. for the SPLT block)
|
||||
* Blocks: Undrop Reporters feature (in script areas' context menus)
|
||||
|
||||
130802
|
||||
|
@ -2245,7 +2245,7 @@ ______
|
|||
* Objects, GUI: duplicate and clone nested sprites
|
||||
* GUI, Store: export and import nested sprites
|
||||
* Objects: double clicking on a sprite in the stage selects it in the IDE
|
||||
* Objects: added ‘move’ option to the sprite context menu, lets the user move (nested) sprites in edit mode without changing their layering, and also sprites marked “undraggable”
|
||||
* Objects: added ‘move’ option to the sprite context menu, lets the user move (nested) sprites in edit mode without changing their layering, and also sprites marked “undraggable”
|
||||
* updated Portuguese translation, thanks, Manuel!
|
||||
* updated German translation
|
||||
* Morphic: fixed #497 (prevent bubble shadows from getting cut-off)
|
||||
|
@ -2285,7 +2285,7 @@ ______
|
|||
|
||||
140930
|
||||
------
|
||||
* Objects: fixed #593 match broadcast numbers with event hat blocks containing strings that can be parsed as numbers
|
||||
* Objects: fixed #593 match broadcast numbers with event hat blocks containing strings that can be parsed as numbers
|
||||
* BYOB: allow percent symbols in custom block texts (fix #361), thanks, @Gubolin!!
|
||||
* Morphic: allow negative min/max values for sliders (fix #285), thanks, @Gubolin!!
|
||||
* Objects: fixed #378 (disable context menus for boolean representations)
|
||||
|
@ -2927,7 +2927,7 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
|
|||
* Updated Simplified Chinese translation, thanks to @ubertao!
|
||||
* Media import dialog with thumbnail, thanks to @ubertao!
|
||||
|
||||
== v4.0.7.2 ====
|
||||
== v4.0.7.2 ====
|
||||
|
||||
160714
|
||||
------
|
||||
|
@ -3050,7 +3050,7 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
|
|||
|
||||
160924
|
||||
------
|
||||
* don’t update the recursion cache when updating a custom block definition
|
||||
* don’t update the recursion cache when updating a custom block definition
|
||||
|
||||
160929
|
||||
------
|
||||
|
@ -3167,7 +3167,7 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
|
|||
|
||||
161206
|
||||
------
|
||||
* GUI: Switch to asynchronous loading of resources (costumes, sounds, libraries etc.)
|
||||
* GUI: Switch to asynchronous loading of resources (costumes, sounds, libraries etc.)
|
||||
* Morphic: Added support for dropping links to SVGs from other web pages onto the World
|
||||
* GUI: Support importing unrasterized SVG_Costumes from the “Costumes” and “Backgrounds” dialog
|
||||
|
||||
|
@ -3348,7 +3348,7 @@ Fixes:
|
|||
|
||||
170201
|
||||
------
|
||||
* GUI: let costume icons indicate svg costumes
|
||||
* GUI: let costume icons indicate svg costumes
|
||||
|
||||
170202
|
||||
------
|
||||
|
@ -3508,7 +3508,7 @@ Fixes:
|
|||
170707
|
||||
------
|
||||
* Objects, GUI, Store: tweak naming of instantiating to “clone”, enable inheritance by default
|
||||
* Objects, GUI: run “When I start as clone” scripts when manually cloning a sprite, only position at hand pointer if no such scripts exist
|
||||
* Objects, GUI: run “When I start as clone” scripts when manually cloning a sprite, only position at hand pointer if no such scripts exist
|
||||
* Morphic, Objects: confine turtle direction readout to 0-360 degrees, thanks, Cynthia for the bug report!!
|
||||
|
||||
170708
|
||||
|
@ -3518,7 +3518,7 @@ Fixes:
|
|||
|
||||
170709
|
||||
------
|
||||
* Objects, Threads: added experimental (only shown in dev mode) “tell ... to ..." and “ask ... for ...” primitives
|
||||
* Objects, Threads: added experimental (only shown in dev mode) “tell ... to ..." and “ask ... for ...” primitives
|
||||
|
||||
170711
|
||||
------
|
||||
|
@ -3759,14 +3759,14 @@ v4.1 Features:
|
|||
|
||||
Fixes:
|
||||
* changed keyboard shortcut indicator for “find blocks” to “^”
|
||||
* prevent Snap from “hanging” when encountering certain errors in visible stepping
|
||||
* prevent Snap from “hanging” when encountering certain errors in visible stepping
|
||||
* only mark implicit parameters if no formal ones exist
|
||||
* optimized thread-launch and script highlighting to a single frame instead of formerly two
|
||||
* changed direction attribute of sprites to automatically confine to 0-360 degrees
|
||||
* fixed rotation-bug when flipping costumes in "only turn left/right" mode"
|
||||
* fixed variable renaming (“refactoring”) bugs, thanks, Bernat!
|
||||
* fixed “fill” block crash when applying the same color twice
|
||||
* fixed occasional empty drop-down menu items named “close”
|
||||
* fixed occasional empty drop-down menu items named “close”
|
||||
* fixed some typos
|
||||
* limited sprites' direction and coordinates to finite numbers
|
||||
* made block vars transient for block libraries
|
||||
|
@ -3787,3 +3787,469 @@ Fixes:
|
|||
|
||||
=== v4.1.0.2 maintenance release ===
|
||||
|
||||
171115
|
||||
------
|
||||
* Portuguese & Polish translation updates, thanks, Witek and Manuel!!
|
||||
* escape xml attribute contents, thanks, Brian Broll!
|
||||
* changed minimum stage width to 240
|
||||
* new Audio Comp library for Guzdial-style sound samples fun
|
||||
|
||||
=== v4.1.0.3 maintenance release ===
|
||||
|
||||
171116
|
||||
------
|
||||
* Threads: suppress "exit" context when forking a process while single-stepping, this avoids a false "reporter didn't report" error message
|
||||
* Blocks: avoid coloring the block-highlight when re-coloring a syntax element, this prevents highlighted blocks inside LAUNCH statements to expand when repeatedly single-stepped.
|
||||
|
||||
=== v4.1.0.4 maintenance release ===
|
||||
|
||||
171126
|
||||
------
|
||||
* GUI: fixed #1933 - avoid creating "obsolete" blocks by not copying method blocks into sprites that don't understand them
|
||||
* Store: fixed #1937 - allow stage width to be a minimum of 240 pixels
|
||||
|
||||
=== v4.1.0.5 maintenance release ===
|
||||
|
||||
171201
|
||||
------
|
||||
* GUI: started development on v 4.1.1
|
||||
* BYOB, Store, Threads: Localization support for custom blocks (experimental)
|
||||
* Tools: German translation of tools (experimental)
|
||||
|
||||
171212
|
||||
------
|
||||
* fixed #1963
|
||||
|
||||
180102
|
||||
------
|
||||
* new "direction to..." primitive as variant of "distance to..." in "Sensing"
|
||||
|
||||
180104
|
||||
------
|
||||
* Morphic: scroll menus if they are taller than the world
|
||||
* Morphic: added keyboard navigation for menus that scroll
|
||||
* added "width" and "height" selectors to Pixels library
|
||||
|
||||
180104
|
||||
------
|
||||
* Objects: fixed #1979 - make sure to always re-focus the world-canvas
|
||||
|
||||
180117
|
||||
------
|
||||
* Objects: made keyboard events always be thread safe (same as in Scratch nowadays)
|
||||
|
||||
180118
|
||||
------
|
||||
* Blocks, Threads, BYOB, Store: included local methods in the OF-block's left drop-down menu
|
||||
|
||||
180119
|
||||
------
|
||||
* merged a bunch of pull requests (unicode support for emojis, translation updates)
|
||||
|
||||
180121
|
||||
------
|
||||
* Threads: fixed a scope-glitch in the new OF-block's drop-down mechanism
|
||||
* Blocks: made the OF-block auto-unringify when dropped on ring-slots
|
||||
* Blocks: disabled firing the Custom-Block-Dialog when accidentall clicking on a custom block definition script
|
||||
|
||||
180122
|
||||
------
|
||||
* Morphic: fixed occasional stuck cursors, thanks, Bernat!
|
||||
* Paint: fixed a flood-fill alpha issue, thanks, Bernat!I
|
||||
* Blocks, GUI: minor fixes, contributed by the community
|
||||
* various Translation updates, contributed by the community
|
||||
* Blocks, Objects, Threads: separated global and local variables in the palette, marked local ones with location pin
|
||||
* Blocks, Objects: added scroll events, thanks, Bernat!
|
||||
|
||||
180123
|
||||
------
|
||||
* fixed #1972, thanks, Joan!
|
||||
* Objects, GUI: When deleting a temporary clone, detach all its parts and delete the temporary ones
|
||||
|
||||
180125
|
||||
------
|
||||
* Morphic: new DialMorph widget
|
||||
* Blocks: added dial widget to POINT IN DIRECTION's drop-down menu
|
||||
* Objects: added "rotate" option to Sprite context menu
|
||||
* Threads, Blocks: fixed Joan's fix for #1972, because it broke HOFs
|
||||
* new Sound Recorder, yay!! Thanks, Bernat!
|
||||
* Blocks: fixed a glitch in the error-bubble handling mechanism
|
||||
|
||||
180201
|
||||
------
|
||||
* GUI: encode recorded sounds to base64
|
||||
* snap.html: added version queries to script urls
|
||||
|
||||
180202
|
||||
------
|
||||
* Libraries: Crayons library, thanks, Brian!
|
||||
|
||||
180205
|
||||
------
|
||||
* Russian translation update, thanks, temap!
|
||||
* release
|
||||
|
||||
=== v4.1.1 minor release ===
|
||||
|
||||
v4.1.1 New Features:
|
||||
* translation support for custom blocks
|
||||
* new "direction to..." primitive as variant of "distance to..." in "Sensing"
|
||||
* included local methods in the OF-block's left drop-down menu
|
||||
* added "width" and "height" selectors to Pixels library
|
||||
* added scroll events, thanks, Bernat!
|
||||
* new dial widget POINT IN DIRECTION's drop-down menu
|
||||
* new "rotate" option for sprite context menu
|
||||
* new sound recorder, thanks, Bernat!
|
||||
* new "Crayons" library, thanks, Brian!
|
||||
|
||||
Notable Changes:
|
||||
* global and local variables are now separat in the palette, each sorted alphabetically, local vars marked with location pin (only in palette)
|
||||
* keyboard events are now always thread safe (the same as in Scratch nowadays)
|
||||
* the OF-block auto-unringifies when being dropped on ring-slots, such as in CALL
|
||||
* accidentally clicking on a custom block definition no longer fires up the Block Dialog
|
||||
|
||||
Notable Fixes:
|
||||
* scroll menus if they are taller than the world
|
||||
* enabled color picker for pen trails on stage
|
||||
* track keyboard events after accepting ASK using the keyboard
|
||||
* improved support for emojis, thanks, Michael!
|
||||
* avoid occasional stuck text cursors, thanks, Bernat!
|
||||
* paint editor flood fill alpha issue, thanks, Bernat!
|
||||
* implicit parameter binding in visible stepping, thanks, Joan!
|
||||
* when deleting a temporary clone, detach all its parts and delete the temporary ones
|
||||
* new release protocol to avoid browser caching related version conflicts
|
||||
|
||||
Translation Updates:
|
||||
* German
|
||||
* Greek
|
||||
* Turkish
|
||||
* Chinese
|
||||
* Spanish
|
||||
* Russian
|
||||
|
||||
180206
|
||||
------
|
||||
* GUI: start developing v4.1.2
|
||||
* Morphic: roll back temporary rectangle filling workaround for a bug in Chrome v57
|
||||
|
||||
180208
|
||||
------
|
||||
* Cloud, GUI, Widgets: New Cloud API, thanks, Bernat!
|
||||
* GUI: fixed a url-bar refresh bug introduced by the new cloud mechanism
|
||||
* GUI: made sure user names are lower case when sent to the cloud
|
||||
* Cloud: made sure project thumbnails are normalized when saved
|
||||
* Cloud: warn user if overwriting an existing project with another one
|
||||
|
||||
180209
|
||||
------
|
||||
* Store, GUI: small tweaks
|
||||
* new Valencian Catalan translation, thanks, Jose A. Múrcia!!
|
||||
|
||||
180212
|
||||
------
|
||||
* Threads: Allow JS-functions for invoke()
|
||||
* Threads, Objects: Small compilation experiment
|
||||
|
||||
180215
|
||||
------
|
||||
* Threads, Blocks, Objects: experimental JIT compiler
|
||||
|
||||
180217
|
||||
------
|
||||
release
|
||||
|
||||
=== v4.1.2 minor release ===
|
||||
|
||||
v4.1.2 Notable Changes:
|
||||
* new cloud backend
|
||||
|
||||
New Features:
|
||||
* experimental JIT compiler (in progress)
|
||||
|
||||
Translation Updates:
|
||||
* new Catalan-Valencia translation
|
||||
* Catalan
|
||||
* German
|
||||
|
||||
180219
|
||||
------
|
||||
* GUI, snap.html: started v4.1.2.1 development
|
||||
* Threads: optimized "broadcast and wait" for atomic subroutines
|
||||
* Spanish translation update
|
||||
|
||||
180220
|
||||
------
|
||||
* Libraries: Changed LeapMotion library source to https
|
||||
* account verification
|
||||
* release
|
||||
|
||||
=== v4.1.2.1 maintenance release ===
|
||||
|
||||
v4.1.2.1 Notable Changes:
|
||||
* account verification
|
||||
* optimized "broadcast and wait" for atomic subroutines
|
||||
* changed leap motion library to https
|
||||
|
||||
Translation Updates:
|
||||
* Spanish
|
||||
|
||||
180222
|
||||
------
|
||||
* crayons library: fixed "nearest crayon to" reporter
|
||||
* release
|
||||
|
||||
=== v4.1.2.2 maintenance release ===
|
||||
|
||||
180305
|
||||
------
|
||||
* cloud tweaks, thanks, Bernat and Michael!
|
||||
* fixed "join words" in the tools, library, thanks, Brian, for reporting the bug!
|
||||
* added new "text to speech" library
|
||||
* made sure sound data is always stored in the project (not referenced)
|
||||
* added capability to compile input slot options to experimental JIT
|
||||
* Spanish and German translation updates
|
||||
|
||||
=== v4.1.2.3 maintenance release ===
|
||||
|
||||
180308
|
||||
------
|
||||
* Objects: fixed #2053
|
||||
* GUI: fixed #2052
|
||||
|
||||
180309
|
||||
------
|
||||
* Blocks, Objects, Threads: added "random" option for "go to", "point towards" and "point in direction" primitives
|
||||
|
||||
=== v4.1.2.4 maintenance release ===
|
||||
|
||||
180313
|
||||
------
|
||||
* Objects: draw a "dot" pentrail when moving zero steps while the pen is down
|
||||
|
||||
=== v4.1.2.5 maintenance release ===
|
||||
|
||||
180314
|
||||
------
|
||||
* Threads: changed testing order for type inferral, speeds up list operations significantly
|
||||
* Cloud: remix project method, thanks, Bernat!
|
||||
|
||||
=== v4.1.2.6 maintenance release ===
|
||||
|
||||
180316
|
||||
------
|
||||
* Threads: experimental JIT compiler support for multi-word formal parameters and a single implicit formal parameter mapped to all empty input slots
|
||||
|
||||
180319
|
||||
------
|
||||
* Threads: initialize Process>>gensyms with null (because it's hardly ever needed)
|
||||
* Objects: remove obsolete STOP primitive from the stage's palette
|
||||
|
||||
=== v4.1.2.7 maintenance release ===
|
||||
|
||||
180319
|
||||
------
|
||||
* new Vector Paint Editor, thanks, Carles Paredes and Bernat Romagosa!
|
||||
|
||||
180320
|
||||
------
|
||||
* Threads: refactored experimental JS-compiler
|
||||
* Threads: enabled variables access for experimental JS-compiler
|
||||
|
||||
180322
|
||||
------
|
||||
* Threads: extended implicit parameters handling for experimental JS-Compiler
|
||||
* Threads: new experimental atomic HOFs utilizing JIT compilation (MAP, KEEP, SORT)
|
||||
* new experimental "Big Data" library using JIT compiler
|
||||
|
||||
180323
|
||||
------
|
||||
* Threads: new experimental atomic COMBINE utilizing JIT compiler
|
||||
* added atomic COMBINE to new experimental "Bigger Data" library
|
||||
* removed unused blocks from the audio comp library
|
||||
* added and removed atomic FOR EACH to new experimental "Bigger Data" library
|
||||
|
||||
180412
|
||||
------
|
||||
* Threads: disable detecting collision with hidden sprites
|
||||
|
||||
180413
|
||||
------
|
||||
* Objects: added implicit parameter count to experimental JIT compile reporter
|
||||
|
||||
180416
|
||||
------
|
||||
* Blocks: only preserve filled rings when collapsing ring-typed multi-arg-slots
|
||||
* Blocks: minor tweaks
|
||||
|
||||
180424
|
||||
------
|
||||
* added 'name' selector to pixel library
|
||||
|
||||
180425
|
||||
------
|
||||
* GUI: fixed rearranging sound icons in the jukebox
|
||||
* GUI: fixed scrolling for the jukebox (updating the sounds list version)
|
||||
* GUI: only randomize position when shift-clicking on new turtle-sprite button
|
||||
|
||||
180427
|
||||
------
|
||||
* GUI: when creating a new sprite only randomize color and direction when shift-clicking
|
||||
|
||||
180502
|
||||
------
|
||||
* Blocks, Threads: added "center" to drop-down options of location blocks (GO TO, POINT TOWARDS, DISTANCE TO and DIRECTION TO)
|
||||
* updated German translation
|
||||
* disabled keyboard shortcuts for green-flag (cmd-enter) and stop (esc) in presentation mode
|
||||
* Blocks, Threads: added options for sprite attributes to the SET block
|
||||
|
||||
180503
|
||||
------
|
||||
* GUI: (again) randomize pen color when creating a new sprite
|
||||
|
||||
180508
|
||||
------
|
||||
* Threads: tweaked JS-Compiler to better handle process related ops
|
||||
|
||||
180524
|
||||
------
|
||||
* Blocks: fixed rendering and layout of variadic C-shaped input slots
|
||||
|
||||
180604
|
||||
------
|
||||
* Blocks: tweaked layout of variadic C-shaped input slots
|
||||
|
||||
180605
|
||||
------
|
||||
* VectorPaint: fixed rotation center editing for existing costumes
|
||||
* VectorPaint: fixed initial rendering, so costumes can be re-opened after saving
|
||||
* Symbols: fixed 'polygon' symbol rendering
|
||||
|
||||
180606
|
||||
------
|
||||
* updated German translation, thanks, Jadga!
|
||||
* updated Portuguese translation, thanks, Manuel!
|
||||
* new Project Cloud Backups feature, thanks, Bernat!
|
||||
* BYOB, Blocks, Threads, Store: fixed support for numerical custom block input names
|
||||
|
||||
180608
|
||||
------
|
||||
* Blocks, Objects: new experimental "When I am stopped" event option
|
||||
* Threads: Prevent terminated threads from forking new ones and from cloning
|
||||
|
||||
180609
|
||||
------
|
||||
* Objects, Threads: Also trigger "When I am stopped" when programmatically calling "stop all"
|
||||
|
||||
180611
|
||||
------
|
||||
* Objects, Threads: fixed #2108 (added drop-down menu to "letter _ of _ ")
|
||||
* German translation update
|
||||
|
||||
180612
|
||||
------
|
||||
* Renamed vectorPaint.js to sketch.js
|
||||
* GUI: updated credits for Carles Paredes
|
||||
* "Pixels" library: Enabled multiple references to the same pixel (variable)
|
||||
|
||||
180614
|
||||
------
|
||||
* Threads: Prevent terminated threads from launching new ones
|
||||
* prepared v4.2 rc
|
||||
|
||||
180615
|
||||
------
|
||||
* BYOB: fixed #2043 (regression)
|
||||
|
||||
180617
|
||||
------
|
||||
* GUI: fixed cloud scope issues
|
||||
|
||||
180618
|
||||
------
|
||||
* Threads: added capability to JIT-compile command scripts to JS
|
||||
|
||||
180620
|
||||
------
|
||||
* Sketch: enable right-click to select secondary color in vector paint editor
|
||||
* GUI: allow only one instance of Camera and Sound Recorder to open
|
||||
* new "webcam snap" reporter in the "Pixels" library
|
||||
* new "record" reporter in the "Audio Comp" library
|
||||
|
||||
180621
|
||||
------
|
||||
* Threads, Objects: made "When I am stopped" scripts atomic, so you can use loops
|
||||
|
||||
=== v4.2 major release ===
|
||||
|
||||
v4.2 New Features:
|
||||
* "recover project" feature, (cloud backups), thanks, Bernat Romagosa!
|
||||
* vector paint editor, thanks, Carles Paredes and Bernat Romagosa!
|
||||
* "When I am stopped" event option, runs one atomic frame before terminating, use-case: stop robots when a user hits the stop button
|
||||
* experimental JIT compiler for atomic HOFs, used in new "Bigger Data" library
|
||||
* new library for programmatically creating variables, thanks, Brian Harvey!
|
||||
* added options for sprite attributes to the SET block
|
||||
* new "webcam snap" reporter in the "Pixels" library
|
||||
* new "record" reporter in the "Audio Comp" library
|
||||
* added "name" selector to the "Pixels" library
|
||||
* added drop-down menu to "letter _ of _ ", adjusted all translations (thanks, Joan!)
|
||||
|
||||
Notable Changes:
|
||||
* hidden sprites can no longer be collision detected (but can test for other sprites)
|
||||
* new sprites created by pressing the arrow button no point in random directions (unless you hold down the shift-key)
|
||||
* new "center" option for location blocks (GO TO, POINT TOWARDS, DISTANCE TO and DIRECTION TO)
|
||||
* disabled keyboard shortcuts for green-flag (cmd-enter) and stop (esc) in presentation mode
|
||||
|
||||
Notable Fixes:
|
||||
* rearranging and scrolling sound icons
|
||||
* rendering and layout of variadic C-shaped input slots
|
||||
* when collapsing ring-typed multi-arg slots only filled rings are preserved
|
||||
* support for numerical custom block input names
|
||||
* no more "leftover" clones when pressing the stop button or executing the STOP block
|
||||
|
||||
Translation Updates:
|
||||
* German, thanks, Jadga!
|
||||
* Portuguese, thanks, Manuel!
|
||||
* Catalan, thanks, Joan!
|
||||
|
||||
=== in development ===
|
||||
|
||||
180703
|
||||
------
|
||||
* speed up HTTP based hardware APIs (by not waiting for the result if the URL reporter is used inside a REPORT block within a custom COMMAND block definition)
|
||||
|
||||
180705
|
||||
------
|
||||
* Threads: added JIT compiler support for "change variable" primitive
|
||||
* Threads: optimized RUN with reportURL (fire-and-forget)
|
||||
|
||||
180706
|
||||
------
|
||||
* Objects: fixed #2142 - search and keyboard entry support for custom block translations
|
||||
|
||||
180709
|
||||
------
|
||||
* Portuguese translation update, thanks, Manuel!
|
||||
* New Basque translation, thanks, Asier Iturralde Sarasola!
|
||||
* French translation update, thanks, Nathalie and Joan!
|
||||
* Spanish, Catalan and French translations of the tools library, thanks, Joan!
|
||||
* New JSON library, thanks, Bernat!
|
||||
* URL cache issue fix, thanks, Joan!
|
||||
|
||||
=== v4.2.1 minor release ===
|
||||
|
||||
v4.2.1 New Features:
|
||||
* new libraries for parallelization and JSON support
|
||||
* new "loudness" reporter in audio comp library, thanks, Bernat!
|
||||
|
||||
Notable Changes:
|
||||
* significant speed-up for HTTP based robot APIs such as the Hummingbird kit
|
||||
|
||||
Notable Fixes:
|
||||
* "When I am stopped" hat block now also works for stacks of HTTP based robot commands
|
||||
* resolved name conflicts in pixels and audio comp libraries
|
||||
|
||||
Translation Updates:
|
||||
* New Basque translation, thanks, Asier Iturralde Sarasola!
|
||||
* Portuguese, thanks, Manuel!
|
||||
* French, thanks, Nathalie and Joan!
|
||||
* Spanish, Catalan and French translations of the tools library, thanks, Nathalie and Joan!
|
||||
|
|
|
@ -565,8 +565,8 @@ SnapTranslator.dict.ar = {
|
|||
'مرحبا',
|
||||
'world':
|
||||
'ايها العالم',
|
||||
'letter %n of %s':
|
||||
'%n الحرف أوجد %s العبارة من',
|
||||
'letter %idx of %s':
|
||||
'%idx الحرف أوجد %s العبارة من',
|
||||
'length of %s':
|
||||
'%s أحرف عدد',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -519,8 +519,8 @@ SnapTranslator.dict.bg = {
|
|||
'здравейте',
|
||||
'world':
|
||||
'хора',
|
||||
'letter %n of %s':
|
||||
'буква %n от %s',
|
||||
'letter %idx of %s':
|
||||
'буква %idx от %s',
|
||||
'length of %s':
|
||||
'дължина на %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -552,8 +552,8 @@ SnapTranslator.dict.bn = {
|
|||
'হ্যালো',
|
||||
'world':
|
||||
'পৃথিবী',
|
||||
'letter %n of %s':
|
||||
'%n -তম বর্ণ %s এর',
|
||||
'letter %idx of %s':
|
||||
'%idx -তম বর্ণ %s এর',
|
||||
'length of %s':
|
||||
'%s এর বর্ণদৈর্ঘ্য ',
|
||||
'unicode of %s':
|
||||
|
|
64
lang-ca.js
64
lang-ca.js
|
@ -183,9 +183,9 @@ SnapTranslator.dict.ca = {
|
|||
'language_translator':
|
||||
'Bernat Romagosa Carrasquer, Joan Guillén i Pelegay', // your name for the Translators tab
|
||||
'translator_e-mail':
|
||||
'bernat@arduino.org, jguille2@xtec.cat', // optional
|
||||
'bernat@snap4arduino.rocks, jguille2@xtec.cat', // optional
|
||||
'last_changed':
|
||||
'2017-01-09', // this, too, will appear in the Translators tab
|
||||
'2018-06-16', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -590,8 +590,8 @@ SnapTranslator.dict.ca = {
|
|||
'hola',
|
||||
'world':
|
||||
'món',
|
||||
'letter %n of %s':
|
||||
'lletra %n de %s',
|
||||
'letter %idx of %s':
|
||||
'lletra %idx de %s',
|
||||
'length of %s':
|
||||
'longitud de %s',
|
||||
'unicode of %s':
|
||||
|
@ -1074,6 +1074,12 @@ SnapTranslator.dict.ca = {
|
|||
'Segur que vols esborrar',
|
||||
'rename...':
|
||||
'canvia el nom...',
|
||||
'Recover':
|
||||
'Recupera',
|
||||
'Today, ':
|
||||
'Avui, ',
|
||||
'Yesterday, ':
|
||||
'Ahir, ',
|
||||
|
||||
// costume editor
|
||||
'Costume Editor':
|
||||
|
@ -1578,7 +1584,7 @@ SnapTranslator.dict.ca = {
|
|||
'Logout':
|
||||
'Surt',
|
||||
'Change Password...':
|
||||
'Canvia la contrassenya…',
|
||||
'Canvia la contrasenya…',
|
||||
'Change Password':
|
||||
'Canvia la contrasenya',
|
||||
'Account created.':
|
||||
|
@ -2238,5 +2244,51 @@ SnapTranslator.dict.ca = {
|
|||
'take a camera snapshot and\nimport it as a new sprite':
|
||||
'pren una imatge amb la càmera\ni importa-la com un nou vestit',
|
||||
'Import a new costume from your webcam':
|
||||
'Importa un nou vestit amb la webcam'
|
||||
'Importa un nou vestit amb la webcam',
|
||||
'random':
|
||||
'qualsevol',
|
||||
'random position':
|
||||
'qualsevol posició',
|
||||
'center':
|
||||
'centre',
|
||||
'%rel to %dst':
|
||||
'%rel a %dst',
|
||||
'distance':
|
||||
'distància',
|
||||
'costume':
|
||||
'vestit',
|
||||
'sound':
|
||||
'so',
|
||||
'Record a new sound':
|
||||
'Grava un so nou',
|
||||
'Sound Recorder':
|
||||
'Gravadora de So',
|
||||
'recording':
|
||||
'gravació',
|
||||
'JIT compiler support':
|
||||
'Suport a la compilació JIT',
|
||||
'EXPERIMENTAL! uncheck to disable live\nsupport for compiling':
|
||||
'EXPERIMENTAL! Desmarqueu per deshabilitar el\nsuport a la compilació dinàmica',
|
||||
'EXPERIMENTAL! check to enable\nsupport for compiling':
|
||||
'EXPERIMENTAL! Marqueu per habilitar\nel suport a la compilació',
|
||||
'compile %repRing for %n args':
|
||||
'compila %repRing per %n arguments',
|
||||
'rotate':
|
||||
'gira',
|
||||
'stopped':
|
||||
'pari',
|
||||
'scrolled-up':
|
||||
'faci scroll amunt',
|
||||
'scrolled-down':
|
||||
'faci scroll avall',
|
||||
'Resend Verification Email...':
|
||||
'Torna a enviar l\'email de verificació...',
|
||||
'Resend verification email':
|
||||
'Reenviament del mail',
|
||||
'User name:':
|
||||
'Nom d\'usuari:',
|
||||
'Camera not supported':
|
||||
'Webcam no disponible',
|
||||
'Please make sure your web browser is up to date\nand your camera is properly configured. \n\nSome browsers also require you to access Snap!\nthrough HTTPS to use the camera.\n\nPlase replace the "http://" part of the address\nin your browser by "https://" and try again.':
|
||||
'Comproveu que el navegador està actualitzat\ni la webcam ben configurada. \n\nAlguns navegadors també requereixen\nHTTPS per a utilitzar la càmera.\n\nPodeu provar canviant a l\'adreça el "http://"\nper "https://".'
|
||||
};
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -576,8 +576,8 @@ SnapTranslator.dict.cs = {
|
|||
'světe',
|
||||
'split %s by %delim':
|
||||
'rozděl %s podle %delim',
|
||||
'letter %n of %s':
|
||||
'písmeno %n z %s',
|
||||
'letter %idx of %s':
|
||||
'písmeno %idx z %s',
|
||||
'length of %s':
|
||||
'délka %s',
|
||||
'unicode of %s':
|
||||
|
|
231
lang-de.js
231
lang-de.js
|
@ -6,7 +6,7 @@
|
|||
|
||||
written by Jens Mönig
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -181,11 +181,11 @@ SnapTranslator.dict.de = {
|
|||
'language_name':
|
||||
'Deutsch', // the name as it should appear in the language menu
|
||||
'language_translator':
|
||||
'Jens M\u00F6nig', // your name for the Translators tab
|
||||
'Jens M\u00F6nig, Jadga H\u00fcgle', // your name for the Translators tab
|
||||
'translator_e-mail':
|
||||
'jens@moenig.org', // optional
|
||||
'jens@moenig.org, jadga.huegle@sap.com', // optional
|
||||
'last_changed':
|
||||
'2017-10-20', // this, too, will appear in the Translators tab
|
||||
'2018-06-08', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -247,13 +247,20 @@ SnapTranslator.dict.de = {
|
|||
// new sprite button:
|
||||
'add a new sprite':
|
||||
'ein neues Objekt\nhinzuf\u00fcgen',
|
||||
'add a new Turtle sprite':
|
||||
'neues Objekt hinzufügen',
|
||||
'paint a new sprite':
|
||||
'neues Objekt zeichnen',
|
||||
'take a camera snapshot and\nimport it as a new sprite':
|
||||
'neues Objekt mit Webcam-Kostüm hinzufügen',
|
||||
|
||||
|
||||
// tab help
|
||||
'costumes tab help':
|
||||
'Bilder durch hereinziehen von einer anderen\n'
|
||||
+ 'Webseite or vom Computer importieren',
|
||||
'Bilder durch Hereinziehen von einer anderen\n'
|
||||
+ 'Webseite oder vom Computer importieren',
|
||||
'import a sound from your computer\nby dragging it into here':
|
||||
'Kl\u00e4nge durch hereinziehen importieren',
|
||||
'Kl\u00e4nge durch Hereinziehen importieren',
|
||||
|
||||
// primitive blocks:
|
||||
|
||||
|
@ -445,6 +452,12 @@ SnapTranslator.dict.de = {
|
|||
'vom Mauszeiger betreten',
|
||||
'mouse-departed':
|
||||
'vom Mauszeiger verlassen',
|
||||
'scrolled-down':
|
||||
'nach unten gescrollt',
|
||||
'scrolled-up':
|
||||
'nach oben gescrollt',
|
||||
'stopped':
|
||||
'gestoppt',
|
||||
'when %b':
|
||||
'Wenn %b',
|
||||
'when I receive %msgHat':
|
||||
|
@ -539,8 +552,10 @@ SnapTranslator.dict.de = {
|
|||
'Maustaste gedr\u00fcckt?',
|
||||
'key %key pressed?':
|
||||
'Taste %key gedr\u00fcckt?',
|
||||
'distance to %dst':
|
||||
'Entfernung von %dst',
|
||||
'%rel to %dst':
|
||||
'%rel zu %dst',
|
||||
'distance':
|
||||
'Entfernung',
|
||||
'reset timer':
|
||||
'starte Stoppuhr neu',
|
||||
'timer':
|
||||
|
@ -608,8 +623,8 @@ SnapTranslator.dict.de = {
|
|||
'Hallo',
|
||||
'world':
|
||||
'Welt',
|
||||
'letter %n of %s':
|
||||
'Zeichen %n von %s',
|
||||
'letter %idx of %s':
|
||||
'Zeichen %idx von %s',
|
||||
'length of %s':
|
||||
'L\u00e4nge von %s',
|
||||
'unicode of %s':
|
||||
|
@ -622,6 +637,8 @@ SnapTranslator.dict.de = {
|
|||
'ist %s identisch mit %s ?',
|
||||
'JavaScript function ( %mult%s ) { %code }':
|
||||
'JavaScript Funktion ( %mult%s ) { %code }',
|
||||
'compile %repRing':
|
||||
'kompiliere %repRing',
|
||||
|
||||
'type of %s':
|
||||
'Typ von %s',
|
||||
|
@ -716,12 +733,14 @@ SnapTranslator.dict.de = {
|
|||
'Importieren...',
|
||||
'file menu import hint':
|
||||
'l\u00e4dt ein exportiertes Projekt,\neine Bibliothek mit '
|
||||
+ 'Bl\u00f6cken\n'
|
||||
+ 'Bl\u00f6cken,\n'
|
||||
+ 'ein Kost\u00fcm oder einen Klang',
|
||||
'Export project as plain text...':
|
||||
'Projekt als normalen Text exportieren...',
|
||||
'Export project...':
|
||||
'Projekt exportieren...',
|
||||
'save project data as XML\nto your downloads folder':
|
||||
'Projekt als XML-Datei in den Download-\nOrdner des Browsers speichern',
|
||||
'show project data as XML\nin a new browser window':
|
||||
'zeigt das Projekt als XML\nin einem neuen Browserfenster an',
|
||||
'Export blocks...':
|
||||
|
@ -729,19 +748,19 @@ SnapTranslator.dict.de = {
|
|||
'show global custom block definitions as XML\nin a new browser window':
|
||||
'zeigt globale Benutzerblockdefinitionen\nals XML im Browser an',
|
||||
'Unused blocks...':
|
||||
'Ungebrauchte Bl\u00f6cke...',
|
||||
'nicht verwendete Bl\u00f6cke...',
|
||||
'find unused global custom blocks\nand remove their definitions':
|
||||
'nicht verwendete Bl\u00f6cke finden\nund entfernen',
|
||||
'Remove unused blocks':
|
||||
'Ungebrauchte Bl\u00f6cke entfernen',
|
||||
'nicht verwendete Bl\u00f6cke entfernen',
|
||||
'there are currently no unused\nglobal custom blocks in this project':
|
||||
'momentan keine nicht verwendeten\nBl\u00f6cke in diesem Projekt',
|
||||
'unused block(s) removed':
|
||||
'ungebrauchte Bl\u00f6cke entfernt',
|
||||
'nicht verwendete Bl\u00f6cke entfernt',
|
||||
'Export summary...':
|
||||
'Zusammenfassung exportieren...',
|
||||
'open a new browser browser window\n with a summary of this project':
|
||||
'eine Zusammenfassung diese Projects\nin einem neuen Browserfenster'
|
||||
'eine Zusammenfassung dieses Projekts\nin einem neuen Browserfenster'
|
||||
+ 'anzeigen',
|
||||
'Contents':
|
||||
'Inhalt',
|
||||
|
@ -761,14 +780,65 @@ SnapTranslator.dict.de = {
|
|||
'das offizielle Modul mit\nm\u00e4chtigen Bl\u00f6cken laden',
|
||||
'Libraries...':
|
||||
'Module...',
|
||||
'Select categories of additional blocks to add to this project.':
|
||||
'Zusätzliche Auswahl thematisch gruppierter\nBlöcke zu diesem Projekt hinzufügen',
|
||||
'Select a costume from the media library':
|
||||
'Kostüm aus der Medienbibliothek auswählen',
|
||||
'Select a sound from the media library':
|
||||
'Klang aus der Medienbibliothek auswählen',
|
||||
|
||||
//Libraries
|
||||
'Import library':
|
||||
'Modul laden',
|
||||
'Loading':
|
||||
'Lädt',
|
||||
'Imported':
|
||||
'Importiert',
|
||||
'Iteration, composition':
|
||||
'Iteration, Komposition',
|
||||
'List utilities':
|
||||
'Listen bearbeiten',
|
||||
'Variadic reporters':
|
||||
'Variadische Funktionen',
|
||||
'Web services access (https)':
|
||||
'Zugriff auf Webservices',
|
||||
'Multi-branched conditional (switch)':
|
||||
'Mehrfach verzweigte Conditionals (Switch)',
|
||||
'LEAP Motion controller':
|
||||
'LEAP Motion Controller',
|
||||
'Words, sentences':
|
||||
'Wörter, Sätze',
|
||||
'Catch errors in a script':
|
||||
'Fehlerhandhabung im Skript',
|
||||
'Set RGB or HSV pen color':
|
||||
'Stiftfarbe auf RGB oder HSV Werte setzen',
|
||||
'Text to speech':
|
||||
'Sprachausgabe',
|
||||
'Provide 100 selected colors':
|
||||
'100 ausgewählte Farben',
|
||||
'Infinite precision integers, exact rationals, complex':
|
||||
'Beliebig präzise Ganzzahlen, exakte rationale Zahlen, komplexe Zahlen',
|
||||
'Provide getters and setters for all GUI-controlled global settings':
|
||||
'GUI Elemente programmatisch bearbeiten',
|
||||
'Allow multi-line text input to a block':
|
||||
'Mehrzeiliger Text als Eingabe für Blöcke',
|
||||
'create variables in program':
|
||||
'Variablen im Skript erstellen',
|
||||
|
||||
// cloud menu
|
||||
'Login...':
|
||||
'Anmelden...',
|
||||
'Signup...':
|
||||
'Benutzerkonto einrichten...',
|
||||
'Logout':
|
||||
'Abmelden',
|
||||
'Change Password...':
|
||||
'Passwort ändern...',
|
||||
'Reset Password...':
|
||||
'Passwort zurücksetzen...',
|
||||
'Resend Verification Email...':
|
||||
'Bestätigungsmail nochmal senden...',
|
||||
|
||||
|
||||
// settings menu
|
||||
'Language...':
|
||||
|
@ -811,6 +881,10 @@ SnapTranslator.dict.de = {
|
|||
'uncheck to allow dropped\nreporters to kick out others':
|
||||
'ausschalten um das "Rauskicken"\nvon platzierten Bl\u00f6cken\n'
|
||||
+ 'zu erm\u00f6glichen',
|
||||
'check to turn on\n visible stepping (slow)':
|
||||
'einschalten um Programmausführung\nzu verfolgen (schrittweise)',
|
||||
'uncheck to turn off\nvisible stepping':
|
||||
'ausschalten um Programmausführung\nnicht mehr zu verfolgen',
|
||||
'Long form input dialog':
|
||||
'Ausf\u00fchrlicher Input-Dialog',
|
||||
'Plain prototype labels':
|
||||
|
@ -839,6 +913,10 @@ SnapTranslator.dict.de = {
|
|||
'einschalten um Schieber\nin Eingabefeldern zu aktivieren',
|
||||
'Retina display support':
|
||||
'Retina Bildschirmauflösung',
|
||||
'uncheck for lower resolution,\nsaves computing resources':
|
||||
'ausschalten um eine niedrigere Auflösung zu erhalten\nund weniger Rechenleistung zu benötigen',
|
||||
'check for higher resolution,\nuses more computing resources':
|
||||
'einschalten um eine höhere Auflösung zu erhalten,\nbenötigt mehr Rechenleistung',
|
||||
'Codification support':
|
||||
'Kodifikation',
|
||||
'Clicking sound':
|
||||
|
@ -861,6 +939,10 @@ SnapTranslator.dict.de = {
|
|||
'einschalten um IDE-\nAnimationen zu erlauben',
|
||||
'Flat design':
|
||||
'Helles Design',
|
||||
'check for alternative\nGUI design':
|
||||
'einschalten für alternative Nutzeroberfläche',
|
||||
'uncheck for default\nGUI design':
|
||||
'ausschalten für Standard-Nutzeroberfläche',
|
||||
'Nested auto-wrapping':
|
||||
'Automatisches Umklammern',
|
||||
'Keyboard Editing':
|
||||
|
@ -963,6 +1045,8 @@ SnapTranslator.dict.de = {
|
|||
'Angelpunkt',
|
||||
'edit the costume\'s\nrotation center':
|
||||
'Drehpunkt des Kostüms\nanzeigen und verschieben',
|
||||
'rotate':
|
||||
'Drehen',
|
||||
'detach from':
|
||||
'Abtrennen von',
|
||||
'detach all parts':
|
||||
|
@ -985,6 +1069,10 @@ SnapTranslator.dict.de = {
|
|||
'Bild exportieren...',
|
||||
'open a new window\nwith a picture of the stage':
|
||||
'ein neues Browserfenster mit einem\nBild der B\u00fchne \u00f6ffnen',
|
||||
'turn all pen trails and stamps\ninto a new background for the stage':
|
||||
'Hintergrund aus allen Malspuren und\nStempelabdrücken auf der Bühne erstellen',
|
||||
'turn all pen trails and stamps\ninto a new costume for the\ncurrently selected sprite':
|
||||
'aus allen Malspuren und Stempelabdrücken ein\nKostüm für die momentan ausgewählte Figur erstellen',
|
||||
|
||||
// scripting area
|
||||
'clean up':
|
||||
|
@ -1085,7 +1173,9 @@ SnapTranslator.dict.de = {
|
|||
'Untitled':
|
||||
'Unbenannt',
|
||||
'Open Project':
|
||||
'Project \u00f6ffnen',
|
||||
'Projekt \u00f6ffnen',
|
||||
'Open':
|
||||
'\u00d6ffnen',
|
||||
'(empty)':
|
||||
'(leer)',
|
||||
'Saved!':
|
||||
|
@ -1096,12 +1186,90 @@ SnapTranslator.dict.de = {
|
|||
'Wirklich l\u00f6schen?',
|
||||
'rename...':
|
||||
'Umbenennen...',
|
||||
'Examples':
|
||||
'Beispiele',
|
||||
'Share':
|
||||
'Teilen',
|
||||
'Updating\nproject list...':
|
||||
'Projektliste laden',
|
||||
'Recover':
|
||||
'Wiederherstellen',
|
||||
'Today':
|
||||
'Heute',
|
||||
'Yesterday':
|
||||
'Gestern',
|
||||
|
||||
// costume editor
|
||||
'Costume Editor':
|
||||
'Kost\u00fcmeditor',
|
||||
'Paint Editor':
|
||||
'Kostümeditor',
|
||||
'click or drag crosshairs to move the rotation center':
|
||||
'Fadenkreuz anklicken oder bewegen um den Drehpunkt zu setzen',
|
||||
'undo':
|
||||
'rückgängig',
|
||||
'Vector':
|
||||
'Vektor',
|
||||
'Paintbrush tool\n(free draw)':
|
||||
'Pinsel\n(freies Zeichnen)',
|
||||
'Stroked Rectangle\n(shift: square)':
|
||||
'Rechteck\n(Shift: Quadrat)',
|
||||
'Stroked Ellipse\n(shift: circle)':
|
||||
'Ellipse\n(Shift: Kreis)',
|
||||
'Eraser tool':
|
||||
'Radiergummi',
|
||||
'Set the rotation center':
|
||||
'Drehpunkt setzen',
|
||||
'Line tool\n(shift: vertical/horizontal)':
|
||||
'Linie\n(Shift: vertikal/horizontal)',
|
||||
'Filled Rectangle\n(shift: square)':
|
||||
'gefülltes Rechteck\n(Shift: Quadrat)',
|
||||
'Filled Ellipse\n(shift: circle)':
|
||||
'gefüllte Ellipse\n(Shift: Kreis)',
|
||||
'Fill a region':
|
||||
'fülle einen Bereich mit\nder gewählten Farbe',
|
||||
'Pipette tool\n(pick a color anywhere)':
|
||||
'Pipette (klicke irgendwo auf die gewünschte\nFarbe, um sie aufzunehmen)',
|
||||
'Brush size':
|
||||
'Pinselstärke',
|
||||
'Constrain proportions of shapes?\n(you can also hold shift)':
|
||||
'Proportionen festlegen\n(auch über Shift-Taste)',
|
||||
//'grow':
|
||||
// 'größer',
|
||||
//'shrink':
|
||||
// 'kleiner',
|
||||
//'flip ↔':
|
||||
// 'drehen ↔',
|
||||
//'flip ↕':
|
||||
// 'drehen ↕',
|
||||
|
||||
'Vector Paint Editor':
|
||||
'Vektor-Editor',
|
||||
'Rectangle\n(shift: square)':
|
||||
'Rechteck\n(Shift: Quadrat)',
|
||||
'Ellipse\n(shift: circle)':
|
||||
'Ellipse\n(Shift: Kreis)',
|
||||
'Selection tool':
|
||||
'Auswählen',
|
||||
'Line tool\n(shift: constrain to 45º)':
|
||||
'Linie\n(Shift: Vielfache von 45°)',
|
||||
'Closed brush\n(free draw)':
|
||||
'geschlossene, gefüllte Form\n(freies Zeichnen)',
|
||||
'Paint a shape\n(shift: secondary color)':
|
||||
'fülle einen Bereich mit der gewählten Farbe\n(Shift: Sekundärfarbe)',
|
||||
'Pipette tool\n(pick a color from anywhere\nshift: secondary color)':
|
||||
'Pipette\nklicke irgendwo auf die gewünschte Farbe\n um sie aufzunehmen (Shift: Sekundärfarbe)',
|
||||
'Primary color Secondary color':
|
||||
'Primärfarbe Sekundärfarbe',
|
||||
// 'Top':
|
||||
// 'oben',
|
||||
// 'Bottom':
|
||||
// 'unten',
|
||||
// 'Up':
|
||||
// 'nach oben',
|
||||
// 'Down':
|
||||
// 'nach unten',
|
||||
|
||||
|
||||
// project notes
|
||||
'Project Notes':
|
||||
|
@ -1116,6 +1284,8 @@ SnapTranslator.dict.de = {
|
|||
// save project
|
||||
'Save Project As...':
|
||||
'Projekt Sichern Als...',
|
||||
'Save Project':
|
||||
'Projekt sichern',
|
||||
|
||||
// export blocks
|
||||
'Export blocks':
|
||||
|
@ -1255,9 +1425,13 @@ SnapTranslator.dict.de = {
|
|||
'length: ':
|
||||
'L\u00e4nge: ',
|
||||
|
||||
// coments
|
||||
// comments
|
||||
'add comment here...':
|
||||
'Anmerkung hier hinzuf\u00fcgen',
|
||||
'comment pic...':
|
||||
'Kommentarbild',
|
||||
'open a new window\nwith a picture of this comment':
|
||||
'neues Fenster mit dem Bild\ndieses Kommentars öffnen',
|
||||
|
||||
// drow downs
|
||||
// directions
|
||||
|
@ -1269,6 +1443,10 @@ SnapTranslator.dict.de = {
|
|||
'(0) oben',
|
||||
'(180) down':
|
||||
'(180) unten',
|
||||
'random':
|
||||
'zufällig',
|
||||
'random position':
|
||||
'zufällige Position',
|
||||
|
||||
// collision detection
|
||||
'mouse-pointer':
|
||||
|
@ -1277,12 +1455,27 @@ SnapTranslator.dict.de = {
|
|||
'Kante',
|
||||
'pen trails':
|
||||
'Malspuren',
|
||||
'center':
|
||||
'Mitte',
|
||||
|
||||
// costumes
|
||||
'Turtle':
|
||||
'Richtungszeiger',
|
||||
'Empty':
|
||||
'Leer',
|
||||
'Paint a new costume':
|
||||
'neues Kostüm zeichnen',
|
||||
'Import a new costume from your webcam':
|
||||
'neues Kostüm mit der Webcam aufnehmen',
|
||||
'Please make sure your web browser is up to date\nand your camera is properly configured. \n\nSome browsers also require you to access Snap!\nthrough HTTPS to use the camera.\n\nPlase replace the "http://" part of the address\nin your browser by "https://" and try again.':
|
||||
'Überprüfe, ob der Browser auf dem aktuellsten Stand \nund die Webcam korrekt konfiguriert ist.\n\nFür einige Browser muss Snap! mit HTTPS geöffnet\nwerden, um auf die Kamera zuzugreifen.\n\nErsetze dafür den "http://"-Teil in der Adresszeile mit"https://"',
|
||||
'Camera':
|
||||
'Kamera',
|
||||
|
||||
// sounds
|
||||
'Record a new sound':
|
||||
'neuen Klang aufnehmen',
|
||||
|
||||
|
||||
// graphical effects
|
||||
'color':
|
||||
|
@ -1465,6 +1658,8 @@ SnapTranslator.dict.de = {
|
|||
'beliebig',
|
||||
|
||||
// attributes
|
||||
'my':
|
||||
'Attribut',
|
||||
'neighbors':
|
||||
'Nachbarn',
|
||||
'self':
|
||||
|
|
|
@ -547,8 +547,8 @@ SnapTranslator.dict.dk = {
|
|||
'hej',
|
||||
'world':
|
||||
'verden',
|
||||
'letter %n of %s':
|
||||
'bogstav %n af %s',
|
||||
'letter %idx of %s':
|
||||
'bogstav %idx af %s',
|
||||
'length of %s':
|
||||
'l\u00E6ngde af %s',
|
||||
'unicode of %s':
|
||||
|
|
10
lang-el.js
10
lang-el.js
|
@ -185,7 +185,7 @@ SnapTranslator.dict.el = {
|
|||
'translator_e-mail':
|
||||
'ino.samaras@berkeley.edu', // optional
|
||||
'last_changed':
|
||||
'2013-09-16', // this, too, will appear in the Translators tab
|
||||
'2018-01-19', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -497,7 +497,7 @@ SnapTranslator.dict.el = {
|
|||
'key %key pressed?':
|
||||
'είναι το πλήκτρο %key πατημένο;',
|
||||
'distance to %dst':
|
||||
'αποόσταση από %dst',
|
||||
'απόσταση από %dst',
|
||||
'reset timer':
|
||||
'επανέφερε το χρονόμετρο',
|
||||
'timer':
|
||||
|
@ -543,8 +543,8 @@ SnapTranslator.dict.el = {
|
|||
'γεια',
|
||||
'world':
|
||||
'κόσμος',
|
||||
'letter %n of %s':
|
||||
'γράμμα %n του %s',
|
||||
'letter %idx of %s':
|
||||
'γράμμα %idx του %s',
|
||||
'length of %s':
|
||||
'μήκος του %s',
|
||||
'unicode of %s':
|
||||
|
@ -633,7 +633,7 @@ SnapTranslator.dict.el = {
|
|||
'New':
|
||||
'Νέο',
|
||||
'Open...':
|
||||
'Άμοιγα...',
|
||||
'Άνοιγμα...',
|
||||
'Save':
|
||||
'Αποθήκευση',
|
||||
'Save As...':
|
||||
|
|
|
@ -571,8 +571,8 @@ SnapTranslator.dict.eo = {
|
|||
'saluton',
|
||||
'world':
|
||||
'mondo',
|
||||
'letter %n of %s':
|
||||
'litero %n el %s',
|
||||
'letter %idx of %s':
|
||||
'litero %idx el %s',
|
||||
'length of %s':
|
||||
'longeco de %s',
|
||||
'unicode of %s':
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -390,8 +390,8 @@ SnapTranslator.dict.et = {
|
|||
'Tere',
|
||||
'world':
|
||||
'maailm',
|
||||
'letter %n of %s':
|
||||
'sümbol nr %n tekstis %s',
|
||||
'letter %idx of %s':
|
||||
'sümbol nr %idx tekstis %s',
|
||||
'length of %s':
|
||||
'teksti %s pikkus',
|
||||
'unicode of %s':
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -556,8 +556,8 @@ SnapTranslator.dict.fi = {
|
|||
'Hei',
|
||||
'world':
|
||||
'maailma',
|
||||
'letter %n of %s':
|
||||
'kirjain nro %n tekstist\u00e4 %s',
|
||||
'letter %idx of %s':
|
||||
'kirjain nro %idx tekstist\u00e4 %s',
|
||||
'length of %s':
|
||||
'tekstin %s pituus',
|
||||
'unicode of %s':
|
||||
|
|
14
lang-fr.js
14
lang-fr.js
|
@ -391,8 +391,8 @@ SnapTranslator.dict.fr = {
|
|||
'arr\u00EAter tous les sons',
|
||||
'rest for %n beats':
|
||||
'faire une pause pour %n temps',
|
||||
'play note %n for %n beats':
|
||||
'jouer la note %n pour %n temps',
|
||||
'play note %note for %n beats':
|
||||
'jouer la note %note pour %n temps',
|
||||
'change tempo by %n':
|
||||
'ajouter %n au tempo',
|
||||
'set tempo to %n bpm':
|
||||
|
@ -475,6 +475,10 @@ SnapTranslator.dict.fr = {
|
|||
'lance %cmdRing %inputs',
|
||||
'call %repRing %inputs':
|
||||
'appelle %repRing %inputs',
|
||||
'tell %spr to %cmdRing %inputs':
|
||||
'dis à %spr de %cmdRing %inputs',
|
||||
'ask %spr for %repRing %inputs':
|
||||
'demande à %spr sa %repRing %inputs',
|
||||
'run %cmdRing w/continuation':
|
||||
'ex\u00E9cute %cmdRing avec continuation',
|
||||
'call %cmdRing w/continuation':
|
||||
|
@ -485,6 +489,8 @@ SnapTranslator.dict.fr = {
|
|||
'Quand je commence comme clone',
|
||||
'create a clone of %cln':
|
||||
'Clone %cln',
|
||||
'a new clone of %cln':
|
||||
'un nouveau clone de %cln',
|
||||
'myself':
|
||||
'moi-m\u00EAme',
|
||||
'delete this clone':
|
||||
|
@ -572,8 +578,8 @@ SnapTranslator.dict.fr = {
|
|||
'Bonjour',
|
||||
'world':
|
||||
'Monde',
|
||||
'letter %n of %s':
|
||||
'lettre %n de %s',
|
||||
'letter %idx of %s':
|
||||
'lettre %idx de %s',
|
||||
'length of %s':
|
||||
'longueur de %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -571,8 +571,8 @@ SnapTranslator.dict.gl = {
|
|||
'Ola',
|
||||
'world':
|
||||
'mundo!',
|
||||
'letter %n of %s':
|
||||
'letra %n de %s',
|
||||
'letter %idx of %s':
|
||||
'letra %idx de %s',
|
||||
'length of %s':
|
||||
'lonxitude de %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -566,8 +566,8 @@ SnapTranslator.dict.hr = {
|
|||
'pozdrav',
|
||||
'world':
|
||||
'svijet',
|
||||
'letter %n of %s':
|
||||
'znak %n od %s',
|
||||
'letter %idx of %s':
|
||||
'znak %idx od %s',
|
||||
'length of %s':
|
||||
'duljina od %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -562,8 +562,8 @@ SnapTranslator.dict.hu = {
|
|||
'szia',
|
||||
'world':
|
||||
'világ',
|
||||
'letter %n of %s':
|
||||
'%n karaktere ennek: %s',
|
||||
'letter %idx of %s':
|
||||
'%idx karaktere ennek: %s',
|
||||
'length of %s':
|
||||
'%s hossza',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -574,8 +574,8 @@ SnapTranslator.dict.ia = {
|
|||
'Hallo',
|
||||
'world':
|
||||
'Mundo',
|
||||
'letter %n of %s':
|
||||
'character %n de %s',
|
||||
'letter %idx of %s':
|
||||
'character %idx de %s',
|
||||
'length of %s':
|
||||
'longor de %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -568,8 +568,8 @@ SnapTranslator.dict.id = {
|
|||
'halo',
|
||||
'world':
|
||||
'dunia',
|
||||
'letter %n of %s':
|
||||
'huruf %n dari %s',
|
||||
'letter %idx of %s':
|
||||
'huruf %idx dari %s',
|
||||
'length of %s':
|
||||
'panjang dari %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -598,8 +598,8 @@ SnapTranslator.dict.it = {
|
|||
'ciao',
|
||||
'world':
|
||||
'mondo',
|
||||
'letter %n of %s':
|
||||
'lettera in posizione %n di %s',
|
||||
'letter %idx of %s':
|
||||
'lettera in posizione %idx di %s',
|
||||
'length of %s':
|
||||
'lunghezza di %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -535,8 +535,8 @@ SnapTranslator.dict.ja = {
|
|||
'ハロー',
|
||||
'world':
|
||||
'ワールド',
|
||||
'letter %n of %s':
|
||||
'%n 文字目の文字 %s',
|
||||
'letter %idx of %s':
|
||||
'%idx 文字目の文字 %s',
|
||||
'length of %s':
|
||||
'%s の長さ',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -535,8 +535,8 @@ SnapTranslator.dict.ja_HIRA = {
|
|||
'ハロー',
|
||||
'world':
|
||||
'ワールド',
|
||||
'letter %n of %s':
|
||||
'%n もじめのもじ %s',
|
||||
'letter %idx of %s':
|
||||
'%idx もじめのもじ %s',
|
||||
'length of %s':
|
||||
'%s のながさ',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -546,8 +546,8 @@ SnapTranslator.dict.kn = {
|
|||
'\u0CA8\u0CAE\u0CB8\u0CCD\u0C95\u0CBE\u0CB0',
|
||||
'world':
|
||||
'\u0CAA\u0CCD\u0CB0\u0CAA\u0C82\u0C9A',
|
||||
'letter %n of %s':
|
||||
'\u0C85\u0C95\u0CCD\u0CB7\u0CB0 %n \u0CB0\u0CB2\u0CCD\u0CB2\u0CBF %s',
|
||||
'letter %idx of %s':
|
||||
'\u0C85\u0C95\u0CCD\u0CB7\u0CB0 %idx \u0CB0\u0CB2\u0CCD\u0CB2\u0CBF %s',
|
||||
'length of %s':
|
||||
'\u0CA8\u0020\u0C89\u0CA6\u0CCD\u0CA6 %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -580,8 +580,8 @@ SnapTranslator.dict.ko = {
|
|||
'안녕',
|
||||
'world':
|
||||
'세상',
|
||||
'letter %n of %s':
|
||||
'%n 번째 글자 ( %s 에 대한)',
|
||||
'letter %idx of %s':
|
||||
'%idx 번째 글자 ( %s 에 대한)',
|
||||
'length of %s':
|
||||
'%s 의 길이',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -553,8 +553,8 @@ SnapTranslator.dict.ml = {
|
|||
'ഹലോ',
|
||||
'world':
|
||||
'ലോകം',
|
||||
'letter %n of %s':
|
||||
'%s ന്റെ %n മത്തെ അക്ഷരം',
|
||||
'letter %idx of %s':
|
||||
'%idx ന്റെ %n മത്തെ അക്ഷരം',
|
||||
'length of %s':
|
||||
'%s ന്റെ നീള',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -564,8 +564,8 @@ SnapTranslator.dict.nl = {
|
|||
'hallo',
|
||||
'world':
|
||||
'wereld',
|
||||
'letter %n of %s':
|
||||
'letter %n van %s',
|
||||
'letter %idx of %s':
|
||||
'letter %idx van %s',
|
||||
'length of %s':
|
||||
'lengte van %s',
|
||||
'unicode of %s':
|
||||
|
|
File diff suppressed because one or more lines are too long
441
lang-pl.js
441
lang-pl.js
|
@ -170,11 +170,11 @@ SnapTranslator.dict.pl = {
|
|||
|
||||
/*
|
||||
Special characters: (see <http://0xcc.net/jsescape/>)
|
||||
Ą, ą \u0104, \u0105
|
||||
Ą, ą \u0104,
|
||||
Ć, ć \u0106, \u0107
|
||||
Ę, ę \u0118, \u0119
|
||||
Ł, ł \u0141, \u0142
|
||||
Ń, ń \u0143, \u0144
|
||||
Ń, ń \u0143, \u0144\u0105
|
||||
Ś, ś \u015A, \u015B
|
||||
Ó, ó \u00D3, \u00F3
|
||||
Ź, ź \u0179, \u017A
|
||||
|
@ -186,11 +186,11 @@ SnapTranslator.dict.pl = {
|
|||
'language_name':
|
||||
'Polski', // the name as it should appear in the language menu
|
||||
'language_translator':
|
||||
'Witek Kranas & deKrain', // your name for the Translators tab
|
||||
'Witek Kranas & deKrain & AB', // your name for the Translators tab
|
||||
'translator_e-mail':
|
||||
'witek@oeiizk.waw.pl', // optional
|
||||
'last_changed':
|
||||
'2016-11-14', // this, too, will appear in the Translators tab
|
||||
'2017-11-09', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -230,7 +230,9 @@ SnapTranslator.dict.pl = {
|
|||
'Skrypty',
|
||||
'Costumes':
|
||||
'Kostiumy',
|
||||
'Sounds':
|
||||
'Backgrounds':
|
||||
'T\u0142a',
|
||||
'Sounds':
|
||||
'D\u017Awi\u0119ki',
|
||||
|
||||
// names:
|
||||
|
@ -243,7 +245,7 @@ SnapTranslator.dict.pl = {
|
|||
'don\'t rotate':
|
||||
'nie obracaj',
|
||||
'can rotate':
|
||||
'dowolny obrót',
|
||||
'dowolny obr\u00F3t',
|
||||
'only face left/right':
|
||||
'tylko lewo/prawo',
|
||||
|
||||
|
@ -383,16 +385,28 @@ SnapTranslator.dict.pl = {
|
|||
'zatrzymaj wszystkie d\u017Awi\u0119ki',
|
||||
'rest for %n beats':
|
||||
'pauzuj przez %n takt\u00F3w',
|
||||
'play note %n for %n beats':
|
||||
'zagraj nut\u0119 %n przez %n takt\u00F3w',
|
||||
'change tempo by %n':
|
||||
'play note %note for %n beats':
|
||||
'zagraj nut\u0119 %note przez %n takt\u00F3w',
|
||||
'set instrument to %inst':
|
||||
'ustaw instrument (fal\u0119) na %inst',
|
||||
'change tempo by %n':
|
||||
'zmie\u0144 tempo o %n',
|
||||
'set tempo to %n bpm':
|
||||
'ustaw tempo na %n takt\u00F3w na min.',
|
||||
'tempo':
|
||||
'tempo',
|
||||
|
||||
// pisak:
|
||||
// "instrumenty", i.e. wave forms
|
||||
'(1) sine':
|
||||
'(1) sinusoidalna',
|
||||
'(2) square':
|
||||
'(2) prostok\u0105tna',
|
||||
'(3) sawtooth':
|
||||
'(3) pi\u0142okszta\u0142tna',
|
||||
'(4) triangle':
|
||||
'(4) tr\u00F3jk\u0105tna',
|
||||
|
||||
// pisak:
|
||||
'clear':
|
||||
'wyczy\u015B\u0107',
|
||||
'pen down':
|
||||
|
@ -400,7 +414,7 @@ SnapTranslator.dict.pl = {
|
|||
'pen up':
|
||||
'podnie\u015B pisak',
|
||||
'set pen color to %clr':
|
||||
'ustaw kolor piaka na %clr',
|
||||
'ustaw kolor pisaka %clr',
|
||||
'change pen color by %n':
|
||||
'zmie\u0144 kolor pisaka o %n',
|
||||
'set pen color to %n':
|
||||
|
@ -444,7 +458,7 @@ SnapTranslator.dict.pl = {
|
|||
'broadcast %msg and wait':
|
||||
'nadaj %msg do wszystkich i czekaj',
|
||||
'Message name':
|
||||
'nazwa wiadomo\u015Bci',
|
||||
'Nazwa wiadomo\u015Bci',
|
||||
'message':
|
||||
'wiadomo\u015B\u0107',
|
||||
'any message':
|
||||
|
@ -466,7 +480,7 @@ SnapTranslator.dict.pl = {
|
|||
'if %b %c else %c':
|
||||
'je\u017Celi %b to %c w przeciwnym razie %c',
|
||||
'report %s':
|
||||
'zwr\u00F3\u0107 %s',
|
||||
'wynik %s',
|
||||
'stop %stopChoices':
|
||||
'zatrzymaj %stopChoices',
|
||||
'all':
|
||||
|
@ -497,10 +511,16 @@ SnapTranslator.dict.pl = {
|
|||
'kiedy zaczynam jako klon',
|
||||
'create a clone of %cln':
|
||||
'sklonuj %cln',
|
||||
'myself':
|
||||
'a new clone of %cln':
|
||||
'nowy klon %cln',
|
||||
'myself':
|
||||
'ja',
|
||||
'delete this clone':
|
||||
'usu\u0144 tego klona',
|
||||
'tell %spr to %cmdRing %inputs':
|
||||
'powiedz %spr do %cmdRing %inputs',
|
||||
'ask %spr for %repRing %inputs':
|
||||
'zapytaj %spr o %repRing %inputs',
|
||||
|
||||
// sensing:
|
||||
'touching %col ?':
|
||||
|
@ -532,13 +552,31 @@ SnapTranslator.dict.pl = {
|
|||
'%att of %spr':
|
||||
'%att z %spr',
|
||||
'my %get':
|
||||
'atrybut %get',
|
||||
'ja %get',
|
||||
'http:// %s':
|
||||
'http:// %s',
|
||||
'turbo mode?':
|
||||
'tryb turbo?',
|
||||
'set turbo mode to %b':
|
||||
'ustaw tryb turbo na %b',
|
||||
'current %dates':
|
||||
'obecnie %dates',
|
||||
'year':
|
||||
'rok',
|
||||
'month':
|
||||
'miesi\u0105c',
|
||||
'date':
|
||||
'dzie\u0144',
|
||||
'day of week':
|
||||
'dzie\u0144 tygodnia',
|
||||
'hour':
|
||||
'godzina',
|
||||
'minute':
|
||||
'minuta',
|
||||
'second':
|
||||
'sekunda',
|
||||
'time in milliseconds':
|
||||
'czas w milisekundach',
|
||||
|
||||
'filtered for %clr':
|
||||
'przefiltrowane dla %clr',
|
||||
|
@ -568,12 +606,14 @@ SnapTranslator.dict.pl = {
|
|||
'fa\u0142sz',
|
||||
'join %words':
|
||||
'po\u0142\u0105cz %words',
|
||||
'hello':
|
||||
'split %s by %delim':
|
||||
'podziel %s na %delim',
|
||||
'hello':
|
||||
'witaj',
|
||||
'world':
|
||||
'świecie',
|
||||
'letter %n of %s':
|
||||
'litera %n z %s',
|
||||
'letter %idx of %s':
|
||||
'litera %idx z %s',
|
||||
'length of %s':
|
||||
'd\u0142ugo\u015B\u0107 %s',
|
||||
'unicode of %s':
|
||||
|
@ -584,19 +624,23 @@ SnapTranslator.dict.pl = {
|
|||
'jest %s typu %typ ?',
|
||||
'is %s identical to %s ?':
|
||||
'jest %s identyczne z %s ?',
|
||||
'JavaScript function ( %mult%s ) { %code }':
|
||||
'funkcja JavaScript ( %mult%s ) { %code }',
|
||||
|
||||
'type of %s':
|
||||
'typ %s',
|
||||
|
||||
// variables:
|
||||
'Make a variable':
|
||||
'Stw\u00F3rz zmienn\u0105',
|
||||
'Utw\u00F3rz zmienn\u0105',
|
||||
'Variable name':
|
||||
'nazwa zmiennej',
|
||||
'Script variable name':
|
||||
'nazwa zmiennej skryptu',
|
||||
'Delete a variable':
|
||||
'usu\u0144 zmienn\u0105',
|
||||
'inherit %shd':
|
||||
'dziedzicz %shd',
|
||||
'Delete a variable':
|
||||
'Usu\u0144 zmienn\u0105',
|
||||
|
||||
'set %var to %s':
|
||||
'ustaw %var na %s',
|
||||
|
@ -635,7 +679,7 @@ SnapTranslator.dict.pl = {
|
|||
|
||||
// other
|
||||
'Make a block':
|
||||
'nowy blok',
|
||||
'Nowy blok',
|
||||
|
||||
// menus
|
||||
// snap menu
|
||||
|
@ -650,11 +694,11 @@ SnapTranslator.dict.pl = {
|
|||
'Switch back to user mode':
|
||||
'Prze\u0142\u0105cz do trybu u\u017Cytkownika',
|
||||
'disable deep-Morphic\ncontext menus\nand show user-friendly ones':
|
||||
'disable Morphic',
|
||||
'wy\u0142\u0105cz menu kontekstowe\ndeep-Morphic\ni poka\u017C przyjazne dla u\u017Cytkownika',
|
||||
'Switch to dev mode':
|
||||
'do trybu budowania',
|
||||
'enable Morphic\ncontext menus\nand inspectors,\nnot user-friendly!':
|
||||
'enable Morphic',
|
||||
'w\u0142\u0105z Morphic\nmenu kontekstowe\ni inspectors,\nniezbyt przyjazne dla u\u017Cytkownika!',
|
||||
|
||||
// project menu
|
||||
'Project notes...':
|
||||
|
@ -665,7 +709,12 @@ SnapTranslator.dict.pl = {
|
|||
'Otw\u00F3rz...',
|
||||
'Save':
|
||||
'Zapisz',
|
||||
'Save As...':
|
||||
'Save to disk':
|
||||
'Zapisz na dysku',
|
||||
'store this project\nin the downloads folder\n(in supporting browsers)':
|
||||
'pobierz ten projekt\ni zapisz go lokalnie\n'
|
||||
+ '(nieobs\u0142ugiwane przez wszystkie przegl\u0105darki)',
|
||||
'Save As...':
|
||||
'Zapisz jako...',
|
||||
'Import...':
|
||||
'Importuj...',
|
||||
|
@ -678,17 +727,45 @@ SnapTranslator.dict.pl = {
|
|||
'Export project...':
|
||||
'Eksportuj projekt...',
|
||||
'show project data as XML\nin a new browser window':
|
||||
'poka\u017C projekt jako XML\nin w nowej karcie',
|
||||
'Export blocks...':
|
||||
'poka\u017C projekt jako XML\nw nowej karcie',
|
||||
'save project data as XML\nto your downloads folder':
|
||||
'zapisz dane projektu jako XML\nw folderze \u0142adowania',
|
||||
'Export blocks...':
|
||||
'Eksportuj bloki...',
|
||||
'show global custom block definitions as XML\nin a new browser window':
|
||||
'poka\u017C definicje blok\u00F3w jako XML/min w nowej karcie',
|
||||
'Import tools':
|
||||
'poka\u017C definicje blok\u00F3w jako XML/mw nowej karcie',
|
||||
'Unused blocks...':
|
||||
'Niewykorzystane bloki...',
|
||||
'find unused global custom blocks\nand remove their definitions':
|
||||
'znajdź i usuń\nniewykorzystane bloki',
|
||||
'Remove unused blocks':
|
||||
'Usu\u0144 niewykorzystane bloki',
|
||||
'there are currently no unused\nglobal custom blocks in this project':
|
||||
'obecnie nie ma niewykorzystanych\nbloków w tym projekcie',
|
||||
'unused block(s) removed':
|
||||
'usunięto niewykorzystane bloki',
|
||||
'Export summary...':
|
||||
'Eksport podsumowania...',
|
||||
'open a new browser browser window\n with a summary of this project':
|
||||
'otwórz podsumowanie tego projektu\nw nowym oknie przeglądarki',
|
||||
'Contents':
|
||||
'Zawartość',
|
||||
'Kind of':
|
||||
'Rodzaj',
|
||||
'Part of':
|
||||
'Część',
|
||||
'Parts':
|
||||
'Części',
|
||||
'Blocks':
|
||||
'Bloki',
|
||||
'For all Sprites':
|
||||
'Dla wszystkich duszków',
|
||||
'Import tools':
|
||||
'Importuj narz\u0119dzia',
|
||||
'load the official library of\npowerful blocks':
|
||||
'za\u0142aduj oficjaln\u0105 bibliotek\u0119 blok\u00F3w',
|
||||
'Libraries...':
|
||||
'Biblioteka...',
|
||||
'Biblioteki...',
|
||||
'Import library':
|
||||
'Importuj bibliotek\u0119',
|
||||
|
||||
|
@ -705,7 +782,17 @@ SnapTranslator.dict.pl = {
|
|||
'J\u0119zyk...',
|
||||
'Zoom blocks...':
|
||||
'Powi\u0119ksz bloki...',
|
||||
'Blurred shadows':
|
||||
'Stage size...':
|
||||
'Rozmiar sceny...',
|
||||
'Stage size':
|
||||
'Rozmiar sceny',
|
||||
'Stage width':
|
||||
'Szeroko\u015B\u0107 sceny',
|
||||
'Stage height':
|
||||
'Wysoko\u015B\u0107 sceny',
|
||||
'Default':
|
||||
'Domy\u015Blny',
|
||||
'Blurred shadows':
|
||||
'Rozmyte cienie',
|
||||
'uncheck to use solid drop\nshadows and highlights':
|
||||
'Odznacz, aby uzyska\u0107\nmocne cienie i granice',
|
||||
|
@ -720,9 +807,9 @@ SnapTranslator.dict.pl = {
|
|||
'Dynamic input labels':
|
||||
'Dynamiczne opisy parametr\u00F3w',
|
||||
'uncheck to disable dynamic\nlabels for variadic inputs':
|
||||
'odznacz to disable dynamic\nlabels for variadic inputs',
|
||||
'odznacz, aby wy\u0142\u0105czy\u0107 dynamiczne\nopisy dla wej\u015B\u0107 variadic',
|
||||
'check to enable dynamic\nlabels for variadic inputs':
|
||||
'zaznacz to enable dynamic\nlabels for variadic inputs',
|
||||
'zaznacz, aby w\u0142\u0105czy\u0107 dynamiczne\nopisy dla wej\u015B\u0107 variadic',
|
||||
'Prefer empty slot drops':
|
||||
'Preferuj empty slot drops',
|
||||
'settings menu prefer empty slots hint':
|
||||
|
@ -731,21 +818,47 @@ SnapTranslator.dict.pl = {
|
|||
'odznacz to allow dropped\nreporters to kick out others',
|
||||
'Long form input dialog':
|
||||
'D\u0142uga forma dialogu wej\u015Bcia',
|
||||
'check to always show slot\ntypes in the input dialog':
|
||||
'zaznacz to always show slot\ntypes in the input dialog',
|
||||
'Plain prototype labels':
|
||||
'Prosta etykieta prototypu',
|
||||
'uncheck to always show (+) symbols\nin block prototype labels':
|
||||
'odznacz, aby pokazywać symbol (+)\nna etykietach prototypowych bloków',
|
||||
'check to hide (+) symbols\nin block prototype labels':
|
||||
'zaznacz, aby ukryć symbol (+)\nna etykietach prototypowych bloków',
|
||||
'check to always show slot\ntypes in the input dialog':
|
||||
'zaznacz, aby włączyć długą\nformę dialogu wejścia',
|
||||
'uncheck to use the input\ndialog in short form':
|
||||
'odznacz to use the input\ndialog in short form',
|
||||
'odznacz, aby używać dialogu\nwejścia w krótkiej formie',
|
||||
'Virtual keyboard':
|
||||
'Witualna klawiatura',
|
||||
'uncheck to disable\nvirtual keyboard support\nfor mobile devices':
|
||||
'odznacz, aby nie u\u017Cywa\u0107 klawiatury\nwirtualnej dla urzdze\u0144 mobilnych',
|
||||
'check to enable\nvirtual keyboard support\nfor mobile devices':
|
||||
'zaznacz, aby u\u017Cywa\u0107 klawiatury\nwirtualnej dla urzdze\u0144 mobilnych',
|
||||
'uncheck to disable\ninput sliders for\nentry fields':
|
||||
'Input sliders':
|
||||
'Suwaki wej\u015Bciowe',
|
||||
'uncheck to disable\ninput sliders for\nentry fields':
|
||||
'odznacz, aby nie pozwoli\u0107 na suwaki w polach wej\u015Bciowych',
|
||||
'check to enable\ninput sliders for\nentry fields':
|
||||
'zaznacz, aby pozwoli\u0107 na suwaki w polach wej\u015Bciowych',
|
||||
'Clicking sound':
|
||||
'Retina display support':
|
||||
'Wsparcie wy\u015Bwietlacza Retina',
|
||||
'Codification support':
|
||||
'Kodowanie bloków',
|
||||
'uncheck to disable\nblock to text mapping features':
|
||||
'odznacz, aby wyłączy\u0107\nfunkcje mapowania tekstu',
|
||||
'check for block\nto text mapping features':
|
||||
'zaznacz, aby włączy\u0107\nfunkcje mapowania tekstu',
|
||||
'header mapping...':
|
||||
'mapowanie nagłówka...',
|
||||
'Header mapping':
|
||||
'Mapowanie nagłówka',
|
||||
'Enter code that corresponds to the block\'s definition. Choose your own\nformal parameter names (ignoring the ones shown).':
|
||||
'Wprowadź kod odpowiadający definicji bloków. ' +
|
||||
'Wybierz własne\nformalne nazwy parametrów (ignorując te, ' +
|
||||
'które są wyświetlane).',
|
||||
'Enter code that corresponds to the block\'s definition. Use the formal parameter\nnames as shown and <body> to reference the definition body\'s generated text code.':
|
||||
'Wprowadź kod odpowiadający definicji bloków. Use the formal parameter\nnames as shown and <body> to reference the definition body\'s generated text code.',
|
||||
'Clicking sound':
|
||||
'D\u017Awi\u0119k klikni\u0119cia',
|
||||
'uncheck to turn\nblock clicking\nsound off':
|
||||
'odznacz, aby wy\u0142\u0105czy\u0107 \nd\u017Awi\u0119k klikni\u0119cia',
|
||||
|
@ -779,7 +892,9 @@ SnapTranslator.dict.pl = {
|
|||
'Edytowanie Klawiatur\u0105',
|
||||
'Table support':
|
||||
'Tablice 2D',
|
||||
'Visible stepping':
|
||||
'Table lines':
|
||||
'Tabele z liniami',
|
||||
'Visible stepping':
|
||||
'Debugowanie krokowe',
|
||||
'check to turn on\n visible stepping (slow)':
|
||||
'zaznacz, aby widzie\u0107 poszczeg\u00F3lne\nkroki skrypt\u00F3w (wolne)',
|
||||
|
@ -797,6 +912,20 @@ SnapTranslator.dict.pl = {
|
|||
'odznacz, aby pozwoli\u0107na\nwi\u0119ksz pr\u0119dko\u015B\u0107 ramek animacji',
|
||||
'check for smooth, predictable\nanimations across computers':
|
||||
'zaznacz, aby zapewni\u0107na\njednakowe, g\u0142adkie animacje',
|
||||
'Flat line ends':
|
||||
'P\u0142askie ko\u0144ce linii',
|
||||
'check for flat ends of lines':
|
||||
'zaznacz, aby końce linii\nbyły płaskie',
|
||||
'uncheck for round ends of lines':
|
||||
'odznacz, aby końce linii\nbyły zaokrąglone',
|
||||
'Ternary Boolean slots':
|
||||
'Ternäre Bool\'sche Inputs',
|
||||
'Inheritance support':
|
||||
'Podtrzymywanie dziedziczenia',
|
||||
'check for sprite\ninheritance features':
|
||||
'zaznacz, aby włączyć\nfunkcje dziedziczenia duszka',
|
||||
'uncheck to disable\nsprite inheritance features':
|
||||
'odznacz, aby wyłączyć\nfunkcje dziedziczenia duszka',
|
||||
|
||||
// inputs
|
||||
'with inputs':
|
||||
|
@ -813,7 +942,9 @@ SnapTranslator.dict.pl = {
|
|||
'pomoc',
|
||||
|
||||
// palette:
|
||||
'hide primitives':
|
||||
'find blocks':
|
||||
'znajd\u017A bloki',
|
||||
'hide primitives':
|
||||
'ukryj pierwotne',
|
||||
'show primitives':
|
||||
'poka\u017C pierwotne',
|
||||
|
@ -839,6 +970,14 @@ SnapTranslator.dict.pl = {
|
|||
'obwiednia',
|
||||
'unringify':
|
||||
'bez obwiedni',
|
||||
'transient':
|
||||
'chwilowo',
|
||||
'uncheck to save contents\nin the project':
|
||||
'odznacz, aby zapisać\nzawartość w projekcie',
|
||||
'check to prevent contents\nfrom being saved':
|
||||
'zaznacz, aby zapobiec\nzapisaniu zawartości',
|
||||
'new line':
|
||||
'nowa linia',
|
||||
|
||||
// custom blocks:
|
||||
'delete block definition...':
|
||||
|
@ -849,8 +988,28 @@ SnapTranslator.dict.pl = {
|
|||
// sprites:
|
||||
'edit':
|
||||
'edytuj',
|
||||
'export...':
|
||||
'clone':
|
||||
'klonuj',
|
||||
'move':
|
||||
'porusz',
|
||||
'pivot':
|
||||
'oś',
|
||||
'edit the costume\'s\nrotation center':
|
||||
'edytuj środek\nobrotu kostiumu',
|
||||
'detach from':
|
||||
'odłącz od',
|
||||
'detach all parts':
|
||||
'odłącz wszystkie części',
|
||||
'export...':
|
||||
'eksportuj...',
|
||||
'parent...':
|
||||
'pierwowzór...',
|
||||
'current parent':
|
||||
'aktualny pierwowzór',
|
||||
'release':
|
||||
'wydanie',
|
||||
'make temporary and\nhide in the sprite corral':
|
||||
'zr\u00F3b tymczasowy\ni ukryj ikonę',
|
||||
|
||||
// stage:
|
||||
'show all':
|
||||
|
@ -864,13 +1023,17 @@ SnapTranslator.dict.pl = {
|
|||
'clean up':
|
||||
'wyczy\u015B\u0107',
|
||||
'arrange scripts\nvertically':
|
||||
'ustaw skrypty pionowo',
|
||||
'ustaw skrypty w pionie',
|
||||
'add comment':
|
||||
'dodaj komentarz',
|
||||
'undrop':
|
||||
'odklej',
|
||||
'undo the last\nblock drop\nin this pane':
|
||||
'cofnij ostatnie upuszczenie\nbloku na tej planszy',
|
||||
'redrop':
|
||||
'ponownie upuść',
|
||||
'use the keyboard\nto enter blocks':
|
||||
'użyj klawiatury,\naby wprowadzić bloki',
|
||||
'scripts pic...':
|
||||
'obrazek skryptu...',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
|
@ -898,6 +1061,18 @@ SnapTranslator.dict.pl = {
|
|||
'rename sound':
|
||||
'zmie\u0144 nazw\u0119 d\u017Cwi\u0119ku',
|
||||
|
||||
// lists and tables
|
||||
'list view...':
|
||||
'widok listy...',
|
||||
'table view...':
|
||||
'widok tabeli...',
|
||||
'open in dialog...':
|
||||
'otwórz w nowym oknie dialogowym',
|
||||
'reset columns':
|
||||
'zresetuj szerokość kolumn',
|
||||
'items':
|
||||
'pozycje',
|
||||
|
||||
// dialogs
|
||||
// buttons
|
||||
'OK':
|
||||
|
@ -1003,7 +1178,7 @@ SnapTranslator.dict.pl = {
|
|||
'Costume Editor':
|
||||
'Edytor kostium\u00F3w',
|
||||
'click or drag crosshairs to move the rotation center':
|
||||
'Kliknij lub przeci\u0105gnij krzy\u017Cyk, aby ustawi\u0107 centrum obrotu',
|
||||
'Kliknij lub przeci\u0105gnij krzy\u017Cyk, aby ustawi\u0107 środek obrotu',
|
||||
|
||||
// project notes
|
||||
'Project Notes':
|
||||
|
@ -1039,6 +1214,14 @@ SnapTranslator.dict.pl = {
|
|||
'for this sprite only':
|
||||
'tylko dla tego duszka',
|
||||
|
||||
// variables refactoring
|
||||
'rename only\nthis reporter':
|
||||
'zmie\u0144 nazw\u0119\ntylko tej zmiennej',
|
||||
'rename all...':
|
||||
'zmie\u0144 nazwy wszystkich...',
|
||||
'rename all blocks that\naccess this variable':
|
||||
'zmie\u0144 nazwy wszystkich blok\u00F3w,z nazw\u0105 tej zmiennej',
|
||||
|
||||
// block dialog
|
||||
'Change block':
|
||||
'Zmie\u0144 blok',
|
||||
|
@ -1052,7 +1235,9 @@ SnapTranslator.dict.pl = {
|
|||
// block editor
|
||||
'Block Editor':
|
||||
'Edytor blok\u00F3w',
|
||||
'Apply':
|
||||
'Method Editor':
|
||||
'Methodeneditor',
|
||||
'Apply':
|
||||
'Zastosuj',
|
||||
|
||||
// block deletion dialog
|
||||
|
@ -1070,7 +1255,7 @@ SnapTranslator.dict.pl = {
|
|||
'Edit label fragment':
|
||||
'Edytuj opis parametru',
|
||||
'Title text':
|
||||
'Tekst tutu\u0142owy',
|
||||
'Tekst tytu\u0142owy',
|
||||
'Input name':
|
||||
'Nazwa',
|
||||
'Delete':
|
||||
|
@ -1146,7 +1331,7 @@ SnapTranslator.dict.pl = {
|
|||
|
||||
// list watchers
|
||||
'length: ':
|
||||
'du\u0142go\u015B\u0107: ',
|
||||
'd\u0142ugo\u015B\u0107: ',
|
||||
|
||||
// coments
|
||||
'add comment here...':
|
||||
|
@ -1178,21 +1363,95 @@ SnapTranslator.dict.pl = {
|
|||
'Pusty',
|
||||
|
||||
// graphical effects
|
||||
'ghost':
|
||||
'color':
|
||||
'kolor',
|
||||
'fisheye':
|
||||
'rybie oko',
|
||||
'whirl':
|
||||
'wir',
|
||||
'pixelate':
|
||||
'pikselizacja',
|
||||
'mosaic':
|
||||
'mozaika',
|
||||
'saturation':
|
||||
'nasycenie',
|
||||
'brightness':
|
||||
'jasność',
|
||||
'ghost':
|
||||
'duch',
|
||||
'negative':
|
||||
'negatyw',
|
||||
'comic':
|
||||
'mora ',
|
||||
'confetti':
|
||||
'konfetti',
|
||||
|
||||
// keys
|
||||
// paint editor
|
||||
'paint a new sprite':
|
||||
'namaluj nowego duszka',
|
||||
'Paint Editor':
|
||||
'Edytor obrazów',
|
||||
'Paintbrush tool\n(free draw)':
|
||||
'Narzędzie pędzel\n(swobodne malowanie)',
|
||||
'Stroked Rectangle\n(shift: square)':
|
||||
'Prostokąt\n(+shift: kwadrat)',
|
||||
'Stroked Ellipse\n(shift: circle)':
|
||||
'Elipsa\n(+shift: okrąg)',
|
||||
'Eraser tool':
|
||||
'Narzędzie gumka',
|
||||
'Set the rotation center':
|
||||
'Ustaw środek obrotu',
|
||||
'Line tool\n(shift: vertical/horizontal)':
|
||||
'Narzędzie linia\n(+shift: pionowa/pozioma)',
|
||||
'Filled Rectangle\n(shift: square)':
|
||||
'Wypełniony prostokąt\n(+shift: kwadrat)',
|
||||
'Filled Ellipse\n(shift: circle)':
|
||||
'Wypełniona elipsa\n(+shift: koło)',
|
||||
'Fill a region':
|
||||
'Wypełnij obszar',
|
||||
'Pipette tool\n(pick a color anywhere)':
|
||||
'Narzędzie pipeta\n(wybierz kolor z obrazu)',
|
||||
'undo':
|
||||
'cofnij',
|
||||
'clear':
|
||||
'wyczyść',
|
||||
'grow':
|
||||
'powiększ',
|
||||
'shrink':
|
||||
'zmniejsz',
|
||||
'flip ↔':
|
||||
'przerzuć ↔',
|
||||
'flip ↕':
|
||||
'przerzuć ↕',
|
||||
'Constrain proportions of shapes?\n(you can also hold shift)':
|
||||
'Ograniczyć proporcje kształtów?\n(można również przytrzymać shift)',
|
||||
'Brush size':
|
||||
'Rozmiar pędzla',
|
||||
'Paint a new costume':
|
||||
'namaluj nowy kostium',
|
||||
|
||||
// camera
|
||||
'take a camera snapshot and\nimport it as a new sprite':
|
||||
'nowy duszek z kamery',
|
||||
'Camera':
|
||||
'Kamera',
|
||||
'Import a new costume from your webcam':
|
||||
'nowy kostium z kamery',
|
||||
|
||||
// keys
|
||||
'space':
|
||||
'spacja',
|
||||
'up arrow':
|
||||
'strz\u0142aka w g\u00F3r\u0119',
|
||||
'strza\u0142ka w g\u00F3r\u0119',
|
||||
'down arrow':
|
||||
'strz\u0142aka w d\u00F3\u0142',
|
||||
'strza\u0142ka w d\u00F3\u0142',
|
||||
'right arrow':
|
||||
'strz\u0142aka w prawo',
|
||||
'strza\u0142ka w prawo',
|
||||
'left arrow':
|
||||
'strz\u0142aka w lewo',
|
||||
'a':
|
||||
'strza\u0142ka w lewo',
|
||||
'any key':
|
||||
'dowolny klawisz',
|
||||
'a':
|
||||
'a',
|
||||
'b':
|
||||
'b',
|
||||
|
@ -1272,8 +1531,10 @@ SnapTranslator.dict.pl = {
|
|||
// math functions
|
||||
'abs':
|
||||
'modu\u0142',
|
||||
'floor':
|
||||
'pod\u0142oga',
|
||||
'ceiling':
|
||||
'zaokr\u0105glenie w g\u00F3r\u0119',
|
||||
'floor':
|
||||
'zaokr\u0105glenie w d\u00F3\u0142',
|
||||
'sqrt':
|
||||
'pierwiastek kwadratowy',
|
||||
'sin':
|
||||
|
@ -1293,6 +1554,22 @@ SnapTranslator.dict.pl = {
|
|||
'e^':
|
||||
'e^',
|
||||
|
||||
// Boolean expressions keyboard entry
|
||||
'not':
|
||||
'nie',
|
||||
|
||||
// delimiters
|
||||
'letter':
|
||||
'litera',
|
||||
'whitespace':
|
||||
'spacja',
|
||||
'line':
|
||||
'linia',
|
||||
'tab':
|
||||
'tabulator',
|
||||
'cr':
|
||||
'koniec linii',
|
||||
|
||||
// data types
|
||||
'number':
|
||||
'liczba',
|
||||
|
@ -1308,6 +1585,12 @@ SnapTranslator.dict.pl = {
|
|||
'funkcja',
|
||||
'predicate':
|
||||
'predykat',
|
||||
'sprite':
|
||||
'duszek',
|
||||
'costume':
|
||||
'kostium',
|
||||
'sound':
|
||||
'dźwięk',
|
||||
|
||||
// list indices
|
||||
'last':
|
||||
|
@ -1315,6 +1598,54 @@ SnapTranslator.dict.pl = {
|
|||
'any':
|
||||
'dowolny',
|
||||
|
||||
// attributes
|
||||
'neighbors':
|
||||
'sąsiedzi',
|
||||
'self':
|
||||
'sam',
|
||||
'other sprites':
|
||||
'inne duszki',
|
||||
'parts':
|
||||
'części',
|
||||
'anchor':
|
||||
'kotwica',
|
||||
'parent':
|
||||
'rodzic',
|
||||
'children':
|
||||
'potomstwo',
|
||||
'clones':
|
||||
'klony',
|
||||
'other clones':
|
||||
'inne klony',
|
||||
'dangling?':
|
||||
'wiszący?',
|
||||
'rotation x':
|
||||
'obrót x',
|
||||
'rotation y':
|
||||
'obrót y',
|
||||
'center x':
|
||||
'x środka',
|
||||
'center y':
|
||||
'y środka',
|
||||
'name':
|
||||
'nazwa',
|
||||
'stage':
|
||||
'scena',
|
||||
'costumes':
|
||||
'kostiumy',
|
||||
'sounds':
|
||||
'dźwięki',
|
||||
'scripts':
|
||||
'skrypty',
|
||||
|
||||
// inheritance
|
||||
'inherited':
|
||||
'odziedziczone',
|
||||
'check to inherit\nfrom':
|
||||
'zaznacz, żeby dziedziczyć\nod',
|
||||
'uncheck to\ndisinherit':
|
||||
'odznacz, żeby\nnie dziedziczyć',
|
||||
|
||||
// Sign up dialog
|
||||
'Sign up':
|
||||
'Rejestracja',
|
||||
|
|
195
lang-pt.js
195
lang-pt.js
|
@ -185,7 +185,7 @@ SnapTranslator.dict.pt = {
|
|||
'translator_e-mail':
|
||||
'mmsequeira@gmail.com',
|
||||
'last_changed':
|
||||
'2016-10-30',
|
||||
'2017-10-30',
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -381,8 +381,10 @@ SnapTranslator.dict.pt = {
|
|||
'pára todos os sons',
|
||||
'rest for %n beats':
|
||||
'faz uma pausa de %n tempos',
|
||||
'play note %n for %n beats':
|
||||
'toca a nota %n durante %n tempos',
|
||||
'play note %note for %n beats':
|
||||
'toca a nota %note durante %n tempos',
|
||||
'set instrument to %inst':
|
||||
'altera o teu instrumento para %inst',
|
||||
'change tempo by %n':
|
||||
'adiciona %n bpm ao teu andamento',
|
||||
'set tempo to %n bpm':
|
||||
|
@ -390,6 +392,16 @@ SnapTranslator.dict.pt = {
|
|||
'tempo':
|
||||
'o andamento',
|
||||
|
||||
// "instrumento", i.e. formas de onda:
|
||||
'(1) sine':
|
||||
'(1) sinusoisal',
|
||||
'(2) square':
|
||||
'(2) quadrada',
|
||||
'(3) sawtooth':
|
||||
'(3) dente de serra',
|
||||
'(4) triangle':
|
||||
'(4) triangular',
|
||||
|
||||
// caneta:
|
||||
'clear':
|
||||
'apaga tudo do palco',
|
||||
|
@ -433,6 +445,10 @@ SnapTranslator.dict.pt = {
|
|||
'entrar em ti',
|
||||
'mouse-departed':
|
||||
'sair de ti',
|
||||
'scrolled-down':
|
||||
'rolar para baixo',
|
||||
'scrolled-up':
|
||||
'rolar para cima',
|
||||
'when %b':
|
||||
'Quando %b',
|
||||
'when I receive %msgHat':
|
||||
|
@ -494,11 +510,17 @@ SnapTranslator.dict.pt = {
|
|||
'when I start as a clone':
|
||||
'Quando fores criado como clone',
|
||||
'create a clone of %cln':
|
||||
'clona %cln',
|
||||
'cria um novo clone de %cln',
|
||||
'a new clone of %cln':
|
||||
'um novo clone de %cln',
|
||||
'myself':
|
||||
'-te',
|
||||
'ti',
|
||||
'delete this clone':
|
||||
'remove-te',
|
||||
'tell %spr to %cmdRing %inputs':
|
||||
'diz a %spr para executar %cmdRing %inputs',
|
||||
'ask %spr for %repRing %inputs':
|
||||
'o resultado de %spr invocar %repRing %inputs',
|
||||
|
||||
// sensores:
|
||||
'touching %col ?':
|
||||
|
@ -521,8 +543,10 @@ SnapTranslator.dict.pt = {
|
|||
'o botão do rato está pressionado',
|
||||
'key %key pressed?':
|
||||
'a tecla %key está a ser pressionada',
|
||||
'distance to %dst':
|
||||
'a distância até %dst',
|
||||
'%rel to %dst':
|
||||
'%rel até %dst',
|
||||
'distance':
|
||||
'a distância',
|
||||
'reset timer':
|
||||
'reinicia o cronómetro',
|
||||
'timer':
|
||||
|
@ -537,6 +561,24 @@ SnapTranslator.dict.pt = {
|
|||
'o modo turbo está activo',
|
||||
'set turbo mode to %b':
|
||||
'alterar o modo turbo para %b',
|
||||
'current %dates':
|
||||
'%dates corrente',
|
||||
'year':
|
||||
'o ano',
|
||||
'month':
|
||||
'o mês',
|
||||
'date':
|
||||
'o dia',
|
||||
'day of week':
|
||||
'o dia da semana',
|
||||
'hour':
|
||||
'a hora',
|
||||
'minute':
|
||||
'o minuto',
|
||||
'second':
|
||||
'o segundo',
|
||||
'time in milliseconds':
|
||||
'o tempo (em milisegundos)',
|
||||
|
||||
'filtered for %clr':
|
||||
'filtrado para %clr',
|
||||
|
@ -572,8 +614,8 @@ SnapTranslator.dict.pt = {
|
|||
'Olá',
|
||||
'world':
|
||||
'mundo!',
|
||||
'letter %n of %s':
|
||||
'o caractere %n de %s',
|
||||
'letter %idx of %s':
|
||||
'o caractere %idx de %s',
|
||||
'length of %s':
|
||||
'o comprimento de %s',
|
||||
'unicode of %s':
|
||||
|
@ -584,6 +626,10 @@ SnapTranslator.dict.pt = {
|
|||
'%s é um/uma %typ',
|
||||
'is %s identical to %s ?':
|
||||
'%s é idêntico a %s',
|
||||
'JavaScript function ( %mult%s ) { %code }':
|
||||
'função JavaScript ( %mult%s ) { %code }',
|
||||
'compile %repRing':
|
||||
'a compilação de %repRing',
|
||||
|
||||
'type of %s':
|
||||
'o tipo de %s',
|
||||
|
@ -595,6 +641,8 @@ SnapTranslator.dict.pt = {
|
|||
'Qual o nome da variável?',
|
||||
'Script variable name':
|
||||
'Qual o nome da variável de guião?',
|
||||
'inherit %shd':
|
||||
'herda %shd do teu progenitor',
|
||||
'Delete a variable':
|
||||
'Remover uma variável',
|
||||
|
||||
|
@ -797,12 +845,16 @@ SnapTranslator.dict.pt = {
|
|||
'Desassinalar para desactivar\ndeslizadores nas ranhuras dos blocos.',
|
||||
'check to enable\ninput sliders for\nentry fields':
|
||||
'Assinalar para activar deslizadores\nnas ranhuras dos blocos.',
|
||||
'Retina display support':
|
||||
'Suporte para o ecrã retina',
|
||||
'Codification support':
|
||||
'Suportar produção de código',
|
||||
'Clicking sound':
|
||||
'Som de cliques',
|
||||
'uncheck to turn\nblock clicking\nsound off':
|
||||
'Desassinalar para desactivar o som\nproduzido ao clicar nos blocos.',
|
||||
'check to turn\nblock clicking\nsound on':
|
||||
'Assinar para activar o som\nproduzido ao clicar nos blocos.',
|
||||
'Assinalar para activar o som\nproduzido ao clicar nos blocos.',
|
||||
'Animations':
|
||||
'Animações',
|
||||
'uncheck to disable\nIDE animations':
|
||||
|
@ -845,6 +897,8 @@ SnapTranslator.dict.pt = {
|
|||
'Assinalar para que os extremos das linhas\ndesenhadas pela caneta sejam planos.',
|
||||
'uncheck for round ends of lines':
|
||||
'Desassinalar para que os extremos das linhas\ndesenhadas pela caneta sejam redondos.',
|
||||
'Ternary Boolean slots':
|
||||
'Ranhuras booleanas ternárias',
|
||||
'Inheritance support':
|
||||
'Suporte para herança',
|
||||
|
||||
|
@ -863,6 +917,8 @@ SnapTranslator.dict.pt = {
|
|||
'ajuda',
|
||||
|
||||
// palette:
|
||||
'find blocks':
|
||||
'procurar blocos',
|
||||
'hide primitives':
|
||||
'esconder blocos primitivos',
|
||||
'show primitives':
|
||||
|
@ -895,6 +951,8 @@ SnapTranslator.dict.pt = {
|
|||
'Desassinalar para guardar\no conteúdo no projecto',
|
||||
'check to prevent contents\nfrom being saved':
|
||||
'Assinalar para não guardar\no conteúdo no projecto',
|
||||
'new line':
|
||||
'nova linha',
|
||||
|
||||
// blocos personalizados:
|
||||
'delete block definition...':
|
||||
|
@ -905,14 +963,30 @@ SnapTranslator.dict.pt = {
|
|||
// actores:
|
||||
'edit':
|
||||
'editar',
|
||||
'clone':
|
||||
'clonar',
|
||||
'move':
|
||||
'mover',
|
||||
'pivot':
|
||||
'editar centro de rotação',
|
||||
'edit the costume\'s\nrotation center':
|
||||
'Drehpunkt des Kostüms\nanzeigen und verschieben',
|
||||
'rotate':
|
||||
'rodar',
|
||||
'detach from':
|
||||
'soltar de',
|
||||
'detach all parts':
|
||||
'soltar todas as partes',
|
||||
'export...':
|
||||
'exportar…',
|
||||
'parent...':
|
||||
'progenitor…',
|
||||
'current parent':
|
||||
'progenitor actual',
|
||||
'release':
|
||||
'tornar clone temporário',
|
||||
'make temporary and\nhide in the sprite corral':
|
||||
'tornar temporário e\nesconder da lista de actores',
|
||||
|
||||
// palco:
|
||||
'show all':
|
||||
|
@ -935,6 +1009,8 @@ SnapTranslator.dict.pt = {
|
|||
'Desfazer a última largada de um bloco\nneste separador.',
|
||||
'redrop':
|
||||
'refazer última largada',
|
||||
'use the keyboard\nto enter blocks':
|
||||
'usar o teclado\npara introduzir blocos',
|
||||
'scripts pic...':
|
||||
'fotografia dos guiões…',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
|
@ -1020,6 +1096,8 @@ SnapTranslator.dict.pt = {
|
|||
'Sem título',
|
||||
'Open Project':
|
||||
'Abrir Projecto',
|
||||
'Open':
|
||||
'Abrir',
|
||||
'(empty)':
|
||||
'(nada)',
|
||||
'Saved!':
|
||||
|
@ -1069,6 +1147,15 @@ SnapTranslator.dict.pt = {
|
|||
'for this sprite only':
|
||||
'apenas para este objecto',
|
||||
|
||||
// refactorização de variáveis
|
||||
'rename only\nthis reporter':
|
||||
'alterar o nome\napenas neste repórter',
|
||||
'rename all...':
|
||||
'alterar o nome em todo o lado…',
|
||||
'rename all blocks that\naccess this variable':
|
||||
'alterar todos os blocos que\nusam esta variável',
|
||||
|
||||
|
||||
// caixa de diálogo de blocos
|
||||
'Change block':
|
||||
'Alterar tipo de bloco',
|
||||
|
@ -1082,6 +1169,8 @@ SnapTranslator.dict.pt = {
|
|||
// editor de blocos
|
||||
'Block Editor':
|
||||
'Editor de Blocos',
|
||||
'Method Editor':
|
||||
'Editor de Métodos',
|
||||
'Apply':
|
||||
'Aplicar',
|
||||
|
||||
|
@ -1192,6 +1281,10 @@ SnapTranslator.dict.pt = {
|
|||
'0° (cima)',
|
||||
'(180) down':
|
||||
'180° (baixo)',
|
||||
'random':
|
||||
'um valor ao acaso',
|
||||
'random position':
|
||||
'um ponto ao acaso',
|
||||
|
||||
// detecção de colisões
|
||||
'mouse-pointer':
|
||||
|
@ -1199,7 +1292,9 @@ SnapTranslator.dict.pt = {
|
|||
'edge':
|
||||
'a borda',
|
||||
'pen trails':
|
||||
'traços da caneta',
|
||||
'os traços da caneta',
|
||||
'center':
|
||||
'o centro',
|
||||
|
||||
// trajes
|
||||
'Turtle':
|
||||
|
@ -1347,6 +1442,10 @@ SnapTranslator.dict.pt = {
|
|||
'e^':
|
||||
'a exponencial',
|
||||
|
||||
// Introdução pelo teclado de expressões booleanas
|
||||
'not':
|
||||
'é falso que',
|
||||
|
||||
// delimitadores
|
||||
'letter':
|
||||
'letra',
|
||||
|
@ -1384,6 +1483,8 @@ SnapTranslator.dict.pt = {
|
|||
'um item ao acaso',
|
||||
|
||||
// attributes
|
||||
'my':
|
||||
'próprios',
|
||||
'neighbors':
|
||||
'os vizinhos',
|
||||
'self':
|
||||
|
@ -1416,12 +1517,28 @@ SnapTranslator.dict.pt = {
|
|||
'o nome',
|
||||
'stage':
|
||||
'o palco',
|
||||
'costumes':
|
||||
'os trajes',
|
||||
'sounds':
|
||||
'os sons',
|
||||
'scripts':
|
||||
'os guiões',
|
||||
|
||||
// herança
|
||||
'inherited':
|
||||
'herdado',
|
||||
'check to inherit\nfrom':
|
||||
'assinalar para\nherdar de',
|
||||
'uncheck to\ndisinherit':
|
||||
'desassinalar para\nnão herdar',
|
||||
|
||||
// em falta no ficheiro lang-de.js
|
||||
'log':
|
||||
'o logaritmo',
|
||||
'url %s':
|
||||
'o recurso http:// %s',
|
||||
'delete %shd':
|
||||
'remove %shd',
|
||||
'Retina display support':
|
||||
'Suporte para o ecrã retina',
|
||||
'uncheck for lower resolution,\nsaves computing resources':
|
||||
'Desassinalar para menor resolução;\npoupa recursos computacionais.',
|
||||
'check for higher resolution,\nuses more computing resources':
|
||||
|
@ -1456,30 +1573,10 @@ SnapTranslator.dict.pt = {
|
|||
'Exportar todos os guiões como fotografia…',
|
||||
'show a picture of all scripts\nand block definitions':
|
||||
'Mostra uma imagem com todos\nos guiões e definições de blocos',
|
||||
'current %dates':
|
||||
'%dates corrente',
|
||||
'year':
|
||||
'o ano',
|
||||
'month':
|
||||
'o mês',
|
||||
'date':
|
||||
'o dia',
|
||||
'day of week':
|
||||
'o dia da semana',
|
||||
'hour':
|
||||
'a hora',
|
||||
'minute':
|
||||
'o minuto',
|
||||
'second':
|
||||
'o segundo',
|
||||
'time in milliseconds':
|
||||
'o tempo (em milisegundos)',
|
||||
'find blocks...':
|
||||
'procurar blocos…',
|
||||
'costume name':
|
||||
'o nome do traje',
|
||||
'Open':
|
||||
'Abrir',
|
||||
'Share':
|
||||
'Partilhar',
|
||||
'Snap!Cloud':
|
||||
|
@ -1600,8 +1697,6 @@ SnapTranslator.dict.pt = {
|
|||
'Actores compostos',
|
||||
'uncheck to disable\nsprite composition':
|
||||
'Desassinalar para desactivar\na composição de actores.',
|
||||
'Codification support':
|
||||
'Suportar produção de código',
|
||||
'check for block\nto text mapping features':
|
||||
'Assinalar para funcionalidades\nde mapeamento entre blocos e texto.',
|
||||
'saved.':
|
||||
|
@ -1781,8 +1876,6 @@ SnapTranslator.dict.pt = {
|
|||
'fotografia do guião incluindo resultado…',
|
||||
'open a new window\nwith a picture of both\nthis script and its result':
|
||||
'Abrir uma nova janela com\numa fotografia tanto deste guião\ncomo do seu resultado.',
|
||||
'JavaScript function ( %mult%s ) { %code }':
|
||||
'função JavaScript ( %mult%s ) { %code }',
|
||||
'Select categories of additional blocks to add to this project.':
|
||||
'Seleccionar categorias de blocos adicionais a acrescentar a este projecto.',
|
||||
'Import sound':
|
||||
|
@ -1807,10 +1900,6 @@ SnapTranslator.dict.pt = {
|
|||
'esperavam-se',
|
||||
'input(s), but getting':
|
||||
'argumento(s), mas foram passados',
|
||||
'parent...':
|
||||
'progenitor…',
|
||||
'current parent':
|
||||
'progenitor actual',
|
||||
'Dragging threshold...':
|
||||
'Limiar de arrastamento…',
|
||||
'Cache Inputs':
|
||||
|
@ -1870,12 +1959,14 @@ SnapTranslator.dict.pt = {
|
|||
// produção de código
|
||||
'map %cmdRing to %codeKind %code':
|
||||
'mapear %cmdRing no %codeKind %code',
|
||||
'map String to code %code':
|
||||
'mapear texto no código %code',
|
||||
'map %mapValue to code %code':
|
||||
'mapear %mapValue no código %code',
|
||||
'map %codeListPart of %codeListKind to code %code':
|
||||
'mapear %codeListPart de %codeListKind no código %code',
|
||||
'code of %cmdRing':
|
||||
'o código de %cmdRing',
|
||||
'String':
|
||||
'texto',
|
||||
'delimiter':
|
||||
'delimitador',
|
||||
'collection':
|
||||
|
@ -1909,6 +2000,24 @@ SnapTranslator.dict.pt = {
|
|||
'Desassinalar para desactivar\na edição usando o teclado.',
|
||||
'check to enable\nkeyboard editing support':
|
||||
'Assinalar para activar\na edição usando o teclado.',
|
||||
'check to turn on\nvisible stepping (slow)':
|
||||
'assinalar para activar\nexecução passo a passo visível (lento)',
|
||||
'uncheck to turn off\nvisible stepping':
|
||||
'desassinalar para desactivar\nexecução passo a passo visível',
|
||||
'check to allow\nempty Boolean slots':
|
||||
'assinalar para permitir\nranhuras booleanas vazias',
|
||||
'uncheck to limit\nBoolean slots to true / false':
|
||||
'desassinalar para limitar\nas ranhuras booleanas aos valores verdadeiro / falso',
|
||||
'Camera support':
|
||||
'Suporte para câmara',
|
||||
'check to enable\ncamera support':
|
||||
'assinalar para activar\no suporte para a câmara',
|
||||
'uncheck to disable\ncamera support':
|
||||
'desassinalar para desactivar\no suporte para a câmara',
|
||||
'check to enable auto-wrapping\ninside nested block stacks':
|
||||
'assinalar para activar as quebras de linha\nem pilhas de blocos aninhadas',
|
||||
'uncheck to confine auto-wrapping\nto top-level block stacks':
|
||||
'desassinalar para limitar as quebras de linha\nàs pilhas de blocos do nível de topo',
|
||||
'uncheck to disable\nsprite inheritance features':
|
||||
'Desassinalar para desactivar\nfuncionalidades de herança de actores.',
|
||||
'check for sprite\ninheritance features':
|
||||
|
|
|
@ -554,8 +554,8 @@ SnapTranslator.dict.pt_BR = {
|
|||
'Olá',
|
||||
'world':
|
||||
'mundo',
|
||||
'letter %n of %s':
|
||||
'o caractere %n de %s',
|
||||
'letter %idx of %s':
|
||||
'o caractere %idx de %s',
|
||||
'length of %s':
|
||||
'o comprimento de %s',
|
||||
'unicode of %s':
|
||||
|
@ -752,7 +752,7 @@ SnapTranslator.dict.pt_BR = {
|
|||
'check to prioritize\nscript execution':
|
||||
'Marque para priorizar\na execução de roteiros.',
|
||||
'uncheck to run scripts\nat normal speed':
|
||||
'Desmarque para executar os roteiros\nna velocidade normal.',
|
||||
'Desmarque para executar os roteiros\nna velocidade normal.',
|
||||
'check to enable\nIDE animations':
|
||||
'Marque para ativar\nas animações da interface de usuário.',
|
||||
'Thread safe scripts':
|
||||
|
@ -935,7 +935,7 @@ SnapTranslator.dict.pt_BR = {
|
|||
'click or drag crosshairs to move the rotation center':
|
||||
'Clique ou arraste a mira para mudar o centro de rotação.',
|
||||
|
||||
// Anotações de projeto
|
||||
// Anotaes de projeto
|
||||
'Project Notes':
|
||||
'Notas do Projeto',
|
||||
|
||||
|
|
|
@ -562,8 +562,8 @@ SnapTranslator.dict.ro = {
|
|||
'salut',
|
||||
'world':
|
||||
'lume',
|
||||
'letter %n of %s':
|
||||
'litera %n din %s',
|
||||
'letter %idx of %s':
|
||||
'litera %idx din %s',
|
||||
'length of %s':
|
||||
'lungimea lui %s',
|
||||
'unicode of %s':
|
||||
|
|
303
lang-ru.js
303
lang-ru.js
|
@ -182,7 +182,7 @@ SnapTranslator.dict.ru = {
|
|||
'translator_e-mail':
|
||||
'svetlanap@berkeley.edu, tema@school830.ru', // optional
|
||||
'last_changed':
|
||||
'2017-09-01', // this, too, will appear in the Translators tab
|
||||
'2017-12-29', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -247,9 +247,9 @@ SnapTranslator.dict.ru = {
|
|||
|
||||
// tab help
|
||||
'costumes tab help':
|
||||
'импортируйте изображение с другого веб-сайта\nили со своего компьютера, скопировав его сюда',
|
||||
'Вы можете перенести и бросить сюда изображение со своего компьютера',
|
||||
'import a sound from your computer\nby dragging it into here':
|
||||
'импортируйте звук со своего компьютера\nскопировав его сюда',
|
||||
'Вы можете перенести и бросить сюда звуковой файл со своего компьютера',
|
||||
|
||||
// primitive blocks:
|
||||
|
||||
|
@ -375,19 +375,37 @@ SnapTranslator.dict.ru = {
|
|||
'stop all sounds':
|
||||
'остановить все звуки',
|
||||
'rest for %n beats':
|
||||
'пауза %n тактов',
|
||||
'play note %n for %n beats':
|
||||
'сыграть ноту %n %n тактов',
|
||||
'пауза в тактах %n',
|
||||
'play note %note for %n beats':
|
||||
'играть ноту %note длит. %n',
|
||||
'change tempo by %n':
|
||||
'изменить темп на %n',
|
||||
'set tempo to %n bpm':
|
||||
'устан. темп %n ударов в мин.',
|
||||
'уст. темп %n такт/мин',
|
||||
'set instrument to %inst':
|
||||
'инструмент %inst',
|
||||
'tempo':
|
||||
'темп',
|
||||
'sine':
|
||||
'синус (sine)',
|
||||
'square':
|
||||
'квадрат (square)',
|
||||
'sawtooth':
|
||||
'пила (sawtooth)',
|
||||
'triangle':
|
||||
'треугольник (triangle)',
|
||||
'(1) sine':
|
||||
'(1) синус (sine)',
|
||||
'(2) square':
|
||||
'(2) квадрат (square)',
|
||||
'(3) sawtooth':
|
||||
'(3) пила (sawtooth)',
|
||||
'(4) triangle':
|
||||
'(4) треугольник (triangle)',
|
||||
|
||||
// pen:
|
||||
'clear':
|
||||
'убрать все',
|
||||
'очистить всё',
|
||||
'pen down':
|
||||
'опустить перо',
|
||||
'pen up':
|
||||
|
@ -473,21 +491,27 @@ SnapTranslator.dict.ru = {
|
|||
'other scripts in sprite':
|
||||
'все другие мои скрипты',
|
||||
'run %cmdRing %inputs':
|
||||
'выполнять %cmdRing %inputs',
|
||||
'выполнить %cmdRing %inputs',
|
||||
'launch %cmdRing %inputs':
|
||||
'запустить %cmdRing %inputs',
|
||||
'call %repRing %inputs':
|
||||
'вызвать %repRing %inputs',
|
||||
'run %cmdRing w/continuation':
|
||||
'выполнять %cmdRing с продолжением',
|
||||
'выполнить %cmdRing с продолжением',
|
||||
'call %cmdRing w/continuation':
|
||||
'вызвать %cmdRing с продолжением',
|
||||
'tell %spr to %cmdRing %inputs':
|
||||
'передать %spr команды %cmdRing %inputs',
|
||||
'ask %spr for %repRing %inputs':
|
||||
'запросить у %spr информацию %cmdRing %inputs',
|
||||
'warp %c':
|
||||
'сразу %c',
|
||||
'when I start as a clone':
|
||||
'когда я создан как клон',
|
||||
'create a clone of %cln':
|
||||
'клонировать %cln',
|
||||
'a new clone of %cln':
|
||||
'новый клон %cln',
|
||||
'myself':
|
||||
'меня',
|
||||
'delete this clone':
|
||||
|
@ -565,8 +589,8 @@ SnapTranslator.dict.ru = {
|
|||
'Привет',
|
||||
'world':
|
||||
'мир',
|
||||
'letter %n of %s':
|
||||
'%n буква слова %s',
|
||||
'letter %idx of %s':
|
||||
'%idx буква слова %s',
|
||||
'length of %s':
|
||||
'длина %s',
|
||||
'unicode of %s':
|
||||
|
@ -601,6 +625,8 @@ SnapTranslator.dict.ru = {
|
|||
'спрятать переменную %var',
|
||||
'script variables %scriptVars':
|
||||
'переменные скрипта %scriptVars',
|
||||
'inherit %shd':
|
||||
'наследовать %shd',
|
||||
|
||||
// lists:
|
||||
'list %exp':
|
||||
|
@ -631,15 +657,17 @@ SnapTranslator.dict.ru = {
|
|||
// other
|
||||
'Make a block':
|
||||
'Новый блок',
|
||||
'find blocks...':
|
||||
'Найти блоки...',
|
||||
|
||||
// menus
|
||||
// snap menu
|
||||
'About...':
|
||||
'Snap! Реквизиты',
|
||||
'О программе...',
|
||||
'Snap! website':
|
||||
'Snap! веб-сайт',
|
||||
'Веб-сайт программы Snap!',
|
||||
'Download source':
|
||||
'Загрузить материалы источника',
|
||||
'Загрузить исходники программы',
|
||||
'Switch back to user mode':
|
||||
'Вернуться в режим пользователя',
|
||||
'disable deep-Morphic\ncontext menus\nand show user-friendly ones':
|
||||
|
@ -704,6 +732,12 @@ SnapTranslator.dict.ru = {
|
|||
'Увеличение блоков кода...',
|
||||
'Stage size...':
|
||||
'Размер сцены...',
|
||||
'Retina display support':
|
||||
'Поддержка технологии Retina display',
|
||||
'uncheck for lower resolution,\nsaves computing resources':
|
||||
'снимите флажок для использования низкого разрешения\nэто уменьшит нагрузку на ресурсы компьютера',
|
||||
'check for higher resolution,\nuses more computing resources':
|
||||
'отметьте, чтобы использовать высокое разрешение\nэто увеличит нагрузку на ресурсы компьютера',
|
||||
'Stage size':
|
||||
'Размер сцены',
|
||||
'Stage width':
|
||||
|
@ -713,57 +747,57 @@ SnapTranslator.dict.ru = {
|
|||
'Blurred shadows':
|
||||
'Контрастность тени',
|
||||
'uncheck to use solid drop\nshadows and highlights':
|
||||
'убрать метку - использовать сплошные\nтени и подсветки',
|
||||
'снимите флажок, чтобы использовать сплошные\nтени и подсветки',
|
||||
'check to use blurred drop\nshadows and highlights':
|
||||
'поставить метку - использовать размытые\nтени и подсветки',
|
||||
'отметьте, чтобы использовать размытые\nтени и подсветки',
|
||||
'Zebra coloring':
|
||||
'Использование альтернативных цветов',
|
||||
'check to enable alternating\ncolors for nested blocks':
|
||||
'поставить метку - разрешить использование\nперемежающихся цветов для вложенных блоков',
|
||||
'отметьте, чтобы разрешить использование\nперемежающихся цветов для вложенных блоков',
|
||||
'uncheck to disable alternating\ncolors for nested block':
|
||||
'убрать метку - отключить использование\nперемежающихся цветов для вложенных блоков',
|
||||
'снимите флажок, чтобы отключить использование\nперемежающихся цветов для вложенных блоков',
|
||||
'Dynamic input labels':
|
||||
'Использование динамических обозначений',
|
||||
'uncheck to disable dynamic\nlabels for variadic inputs':
|
||||
'убрать метку - отключить использование динамических обозначений\nпри вводе с переменным числом аргументов',
|
||||
'снимите флажок, чтобы отключить использование динамических обозначений\nпри вводе с переменным числом аргументов',
|
||||
'check to enable dynamic\nlabels for variadic inputs':
|
||||
'поставить метку - разрешить использование динамических обозначений\nпри вводе с переменным числом аргументов',
|
||||
'отметьте, чтобы разрешить использование динамических обозначений\nпри вводе с переменным числом аргументов',
|
||||
'Prefer empty slot drops':
|
||||
'Использование незанятых ячеек ввода',
|
||||
'settings menu prefer empty slots hint':
|
||||
'поставить метку - помещать генераторы значений\nтолько в незанятые ячейки ввода',
|
||||
'отметьте, чтобы помещать генераторы значений\nтолько в незанятые ячейки ввода',
|
||||
'uncheck to allow dropped\nreporters to kick out others':
|
||||
'убрать метку - разрешить помещать генераторы значений\nв занятые ячейки ввода',
|
||||
'снимите флажок, чтобы разрешить помещать генераторы значений\nв занятые ячейки ввода',
|
||||
'Long form input dialog':
|
||||
'Расширенная форма диалога ввода',
|
||||
'check to always show slot\ntypes in the input dialog':
|
||||
'поставить метку - указывать типы ячеек ввода\nв диалоге ввода',
|
||||
'отметьте, чтобы указывать типы ячеек ввода\nв диалоге ввода',
|
||||
'uncheck to use the input\ndialog in short form':
|
||||
'убрать метку - использовать краткую форму\nдиалога ввода',
|
||||
'снимите флажок, чтобы использовать краткую форму\nдиалога ввода',
|
||||
'Virtual keyboard':
|
||||
'Виртуальная клавиатура',
|
||||
'uncheck to disable\nvirtual keyboard support\nfor mobile devices':
|
||||
'убрать метку - отключить использование виртуальной клавиатуры\nдля мобильных устройств',
|
||||
'снимите флажок, чтобы отключить использование виртуальной клавиатуры\nдля мобильных устройств',
|
||||
'check to enable\nvirtual keyboard support\nfor mobile devices':
|
||||
'поставить метку - разрешить использование виртуальной клавиатуры\nдля мобильных устройств',
|
||||
'отметьте, чтобы разрешить использование виртуальной клавиатуры\nдля мобильных устройств',
|
||||
'Input sliders':
|
||||
'Использование бегунков ввода',
|
||||
'uncheck to disable\ninput sliders for\nentry fields':
|
||||
'убрать метку - отключить использование бегунков\nпри заполнении полей ввода',
|
||||
'снимите флажок, чтобы отключить использование бегунков\nпри заполнении полей ввода',
|
||||
'check to enable\ninput sliders for\nentry fields':
|
||||
'поставить метку - разрешить использование бегунков\nпри заполнении полей ввода',
|
||||
'отметьте, чтобы разрешить использование бегунков\nпри заполнении полей ввода',
|
||||
'Clicking sound':
|
||||
'Звук щелчка',
|
||||
'uncheck to turn\nblock clicking\nsound off':
|
||||
'убрать метку - выключить звук\nпри щелчке на блок',
|
||||
'снимите флажок, чтобы выключить звук\nпри щелчке на блок',
|
||||
'check to turn\nblock clicking\nsound on':
|
||||
'поставить метку - включить звук\nпри щелчке на блок',
|
||||
'отметьте, чтобы включить звук\nпри щелчке на блок',
|
||||
'Animations':
|
||||
'Aнимация',
|
||||
'uncheck to disable\nIDE animations':
|
||||
'убрать метку - отключить\nIDE aнимацию',
|
||||
'снимите флажок, чтобы отключить\nIDE aнимацию',
|
||||
'check to enable\nIDE animations':
|
||||
'поставить метку - разрешить\nIDE aнимацию',
|
||||
'отметьте, чтобы разрешить\nIDE aнимацию',
|
||||
'Turbo mode':
|
||||
'Режим Турбо',
|
||||
'check to prioritize\nscript execution':
|
||||
|
@ -797,17 +831,41 @@ SnapTranslator.dict.ru = {
|
|||
'check for higher contrast\ntable views':
|
||||
'отметьте, чтобы линии таблицы в окне отображения таблиц\nстали более контрасными',
|
||||
'Visible stepping':
|
||||
'Отбражение шагов выполнения',
|
||||
'Отображение шагов выполнения',
|
||||
'check to turn on\n visible stepping (slow)':
|
||||
'отметьте, чтобы отображались\nшаги выполнения скрипта (медленно)',
|
||||
'uncheck to turn off\nvisible stepping':
|
||||
'снимите флажок, чтобы отключить отображение\nшагов выполнения скрипта',
|
||||
'Thread safe scripts':
|
||||
'Защищенность скрипта в многопоточном режиме',
|
||||
'uncheck to allow\nscript reentrancy':
|
||||
'убрать метку - разрешить\nповторное вхождение в скрипт',
|
||||
'check to disallow\nscript reentrancy':
|
||||
'поставить метку - отключить\nповторное вхождение в скрипт',
|
||||
'uncheck to allow\nscript reentrance':
|
||||
'снимите флажок, чтобы разрешить\nповторный вход в скрипт',
|
||||
'check to disallow\nscript reentrance':
|
||||
'отметьте, чтобы отключить\nповторный вход в скрипт',
|
||||
'Plain prototype labels':
|
||||
'Простые заголовки блоков',
|
||||
'uncheck to always show (+) symbols\nin block prototype labels':
|
||||
'снимите флажок, чтобы показывать (+)\nпри редактировании заголовка в редакторе блоков',
|
||||
'check to hide (+) symbols\nin block prototype labels':
|
||||
'отметьте, чтобы отключить (+)\nпри редактировании заголовка в редакторе блоков',
|
||||
'Flat line ends':
|
||||
'Прямоугольные завершения линий',
|
||||
'uncheck for round ends of lines':
|
||||
'снимите флажок, чтобы\nконцы нарисованных линий закруглялись',
|
||||
'check for flat ends of lines':
|
||||
'отметьте, чтобы отключить\nзакругления на концах нарисованных линий',
|
||||
'Codification support':
|
||||
'Поддержка кодификации блоков',
|
||||
'uncheck to disable\nblock to text mapping features':
|
||||
'снимите флажок, чтобы убрать блоки\nтрансляции в текст на другой язык программирования',
|
||||
'check for block\nto text mapping features':
|
||||
'отметьте, чтобы добавить блоки\nтрансляции в текст на другой язык программирования',
|
||||
'Inheritance support':
|
||||
'Поддержка наследования',
|
||||
'uncheck to disable\nsprite inheritance features':
|
||||
'снимите флажок, чтобы отключить\nнаследование свойств спрайтов',
|
||||
'check for sprite\ninheritance features':
|
||||
'отметьте, чтобы включить\nнаследование свойств спрайтов',
|
||||
|
||||
// inputs
|
||||
'with inputs':
|
||||
|
@ -844,6 +902,12 @@ SnapTranslator.dict.ru = {
|
|||
'обвести',
|
||||
'unringify':
|
||||
'убрать обводку',
|
||||
'find blocks':
|
||||
'найти блоки',
|
||||
'hide primitives':
|
||||
'скрыть стандартные блоки',
|
||||
'show primitives':
|
||||
'отобразить стандартные блоки',
|
||||
|
||||
// custom blocks:
|
||||
'delete block definition...':
|
||||
|
@ -854,12 +918,38 @@ SnapTranslator.dict.ru = {
|
|||
// sprites:
|
||||
'edit':
|
||||
'редактировать',
|
||||
'move':
|
||||
'переместить',
|
||||
'clone':
|
||||
'клонировать',
|
||||
'export...':
|
||||
'экспорт...',
|
||||
'parent...':
|
||||
'родитель...',
|
||||
'release':
|
||||
'освободить',
|
||||
'make temporary and\nhide in the sprite corral':
|
||||
'сделать временным и\nубрать отдельный спрайт',
|
||||
'current parent':
|
||||
'родитель спрайта',
|
||||
'add a new Turtle sprite':
|
||||
'создать новый стандартный спрайт',
|
||||
'paint a new sprite':
|
||||
'нарисовать новый спрайт',
|
||||
'take a camera snapshot and\nimport it as a new sprite':
|
||||
'сделать фотографию камерой и\nиспользовать изображение как новый спрайт',
|
||||
'pivot':
|
||||
'центр вращения',
|
||||
'edit the costume\'s\nrotation center':
|
||||
'указать центр вращения для костюма',
|
||||
|
||||
// stage:
|
||||
'show all':
|
||||
'показать все',
|
||||
'pic...':
|
||||
'картинка...',
|
||||
'open a new window\nwith a picture of the stage':
|
||||
'преобразовать вид текущей сцены\nв картинку',
|
||||
|
||||
// scripting area
|
||||
'clean up':
|
||||
|
@ -868,8 +958,22 @@ SnapTranslator.dict.ru = {
|
|||
'размещать скрипты\nвертикально',
|
||||
'add comment':
|
||||
'добавить комментарий',
|
||||
'scripts pic...':
|
||||
'скрипты в картинку...',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
'преобразовать скрипты на листе\nв картинку',
|
||||
'make a block...':
|
||||
'новый блок...',
|
||||
'use the keyboard\nto enter blocks':
|
||||
'использовать клавиатуру\nдля работы с блоками',
|
||||
'undrop':
|
||||
'отменить',
|
||||
'undo the last\nblock drop\nin this pane':
|
||||
'отменить последнее\nдействие с блоком',
|
||||
'redrop':
|
||||
'вернуть',
|
||||
'redo the last undone\nblock drop\nin this pane':
|
||||
'повторить отменённое\nдействие с блоком',
|
||||
|
||||
// costumes
|
||||
'rename':
|
||||
|
@ -877,7 +981,7 @@ SnapTranslator.dict.ru = {
|
|||
'export':
|
||||
'экспорт',
|
||||
'rename costume':
|
||||
'переименовать маску',
|
||||
'переименовать костюм',
|
||||
|
||||
// sounds
|
||||
'Play sound':
|
||||
|
@ -923,6 +1027,8 @@ SnapTranslator.dict.ru = {
|
|||
'Открыть',
|
||||
'Empty':
|
||||
'Пусто',
|
||||
'Import':
|
||||
'Импортировать',
|
||||
|
||||
// help
|
||||
'Help':
|
||||
|
@ -973,16 +1079,14 @@ SnapTranslator.dict.ru = {
|
|||
'У этого проекта пока нет глобальных\nпользовательских блоков',
|
||||
'select':
|
||||
'выделить',
|
||||
'all':
|
||||
'все',
|
||||
'none':
|
||||
'ничего',
|
||||
|
||||
// variable dialog
|
||||
'for all sprites':
|
||||
'применительно ко всем Образам',
|
||||
'для всех спрайтов',
|
||||
'for this sprite only':
|
||||
'применительно только к данному Образу',
|
||||
'только для текущего спрайта',
|
||||
|
||||
// block dialog
|
||||
'Change block':
|
||||
|
@ -999,6 +1103,18 @@ SnapTranslator.dict.ru = {
|
|||
'Редактор Блоков',
|
||||
'Apply':
|
||||
'Применить',
|
||||
'translations...':
|
||||
'переводы',
|
||||
'block variables...':
|
||||
'переменные блока...',
|
||||
'rename all...':
|
||||
'переименовать все...',
|
||||
'block variables':
|
||||
'переменные блока',
|
||||
'Block variable name':
|
||||
'Имя переменной блока',
|
||||
'remove block variables...':
|
||||
'убрать переменные блока',
|
||||
|
||||
// block deletion dialog
|
||||
'Delete Custom Block':
|
||||
|
@ -1050,7 +1166,7 @@ SnapTranslator.dict.ru = {
|
|||
|
||||
// About Snap
|
||||
'About Snap':
|
||||
'О Snap!',
|
||||
'О программе',
|
||||
'Back...':
|
||||
'Bозврат...',
|
||||
'License...':
|
||||
|
@ -1069,6 +1185,8 @@ SnapTranslator.dict.ru = {
|
|||
'Участники',
|
||||
'Translations':
|
||||
'Переводы',
|
||||
'Reference manual':
|
||||
'Инструкция пользователя',
|
||||
|
||||
// variable watchers
|
||||
'normal':
|
||||
|
@ -1091,6 +1209,14 @@ SnapTranslator.dict.ru = {
|
|||
// list watchers
|
||||
'length: ':
|
||||
'длина: ',
|
||||
'list view...':
|
||||
'в виде списка...',
|
||||
'table view...':
|
||||
'в виде таблицы...',
|
||||
'open in dialog...':
|
||||
'открыть в отдельном окне...',
|
||||
'open in another dialog...':
|
||||
'открыть в ещё одном окне...',
|
||||
|
||||
// coments
|
||||
'add comment here...':
|
||||
|
@ -1117,11 +1243,43 @@ SnapTranslator.dict.ru = {
|
|||
|
||||
// costumes
|
||||
'Turtle':
|
||||
'Черепашка',
|
||||
'Стрела',
|
||||
'Opening Costumes...':
|
||||
'Загрузка костюмов...',
|
||||
'pen':
|
||||
'перо',
|
||||
'tip':
|
||||
'на острие',
|
||||
'middle':
|
||||
'посередине',
|
||||
'Paint a new costume':
|
||||
'Нарисовать новый костюм',
|
||||
'Import a new costume from your webcam':
|
||||
'Сделать костюм из фотографии вебкамерой',
|
||||
|
||||
// graphical effects
|
||||
'ghost':
|
||||
'прозрачность',
|
||||
'color':
|
||||
'цвет',
|
||||
'fisheye':
|
||||
'рыбий глаз',
|
||||
'whirl':
|
||||
'вихрь',
|
||||
'pixelate':
|
||||
'пикселизация',
|
||||
'mosaic':
|
||||
'мозаика',
|
||||
'negative':
|
||||
'негатив',
|
||||
'comic':
|
||||
'комикс',
|
||||
'confetti':
|
||||
'конфетти',
|
||||
'saturation':
|
||||
'насыщенность',
|
||||
'brightness':
|
||||
'яркость',
|
||||
|
||||
// keys
|
||||
'space':
|
||||
|
@ -1268,6 +1426,10 @@ SnapTranslator.dict.ru = {
|
|||
'предикат',
|
||||
'sprite':
|
||||
'спрайт',
|
||||
'costume':
|
||||
'костюм',
|
||||
'sound':
|
||||
'звук',
|
||||
|
||||
// list indices
|
||||
'last':
|
||||
|
@ -1275,7 +1437,7 @@ SnapTranslator.dict.ru = {
|
|||
'any':
|
||||
'любой',
|
||||
'now connected':
|
||||
'вы вошли в систему',
|
||||
'соединение установлено',
|
||||
'undo':
|
||||
'отменить',
|
||||
|
||||
|
@ -1312,7 +1474,56 @@ SnapTranslator.dict.ru = {
|
|||
'имя',
|
||||
'stage':
|
||||
'сцена',
|
||||
'costumes':
|
||||
'костюмы',
|
||||
'sounds':
|
||||
'звуки',
|
||||
|
||||
//Paint editor
|
||||
'Paint Editor':
|
||||
'Графический редактор',
|
||||
'flip \u2194':
|
||||
'отраж. \u2194',
|
||||
'flip \u2195':
|
||||
'отраж. \u2195',
|
||||
'grow':
|
||||
'увел.',
|
||||
'shrink':
|
||||
'умен.',
|
||||
'Brush size':
|
||||
'Размер кисти',
|
||||
'Constrain proportions of shapes?\n(you can also hold shift)':
|
||||
'Сохранять пропорции фигур (круг, квадрат)?\nТак же можно использовать Shift',
|
||||
'Paintbrush tool\n(free draw)':
|
||||
'Кисть (свободное рисование)',
|
||||
'Stroked Rectangle\n(shift: square)':
|
||||
'Прямоугольник\n(shift: квадрат)',
|
||||
'Stroked Ellipse\n(shift: circle)':
|
||||
'Эллипс\n(shift: окружность)',
|
||||
'Eraser tool':
|
||||
'Ластик',
|
||||
'Set the rotation center':
|
||||
'Установка центра вращения',
|
||||
'Line tool\n(shift: vertical/horizontal)':
|
||||
'Линия\n(shift: вертикальная/горизонтальная)',
|
||||
'Filled Rectangle\n(shift: square)':
|
||||
'Закрашенный прямоугольник\n(shift: квадрат)',
|
||||
'Filled Ellipse\n(shift: circle)':
|
||||
'Закрашенный эллипс\n(shift: окружность)',
|
||||
'Fill a region':
|
||||
'Заливка',
|
||||
'Pipette tool\n(pick a color anywhere)':
|
||||
'Пипетка\n(взять цвет кликом на любую точку)',
|
||||
|
||||
//Переводы найденых в программе, но не в файле перевода
|
||||
'experimental -\nunder construction':
|
||||
'экспериментальная возможность -\nв разработке',
|
||||
'Camera':
|
||||
'Камера',
|
||||
'Camera not supported':
|
||||
'Камера не поддерживается',
|
||||
'Please make sure your web browser is up to date\nand your camera is properly configured. \n\nSome browsers also require you to access Snap!\nthrough HTTPS to use the camera.\n\nPlase replace the "http://" part of the address\nin your browser by "https://" and try again.':
|
||||
'Пожалуйста, проверьте, что Ваш браузер обновлён до последней версии\nи Ваша камера правильно сконфигурирована. \n\nНекоторые браузеры требуют протокола HTTPS\nдля доступа к СНАП к камере.\n\nПопробуйте заменить "http://" в адресной строке\nВашего браузера на "https://" и попробуйте ещё раз.',
|
||||
'current %dates':
|
||||
'сейчас %dates',
|
||||
'year':
|
||||
|
|
|
@ -583,8 +583,8 @@ SnapTranslator.dict.si = {
|
|||
'Halo',
|
||||
'world':
|
||||
'Svet',
|
||||
'letter %n of %s':
|
||||
'\u010Drka %n od %s',
|
||||
'letter %idx of %s':
|
||||
'\u010Drka %idx od %s',
|
||||
'length of %s':
|
||||
'dol\u017Eina %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -595,8 +595,8 @@ SnapTranslator.dict.sv = {
|
|||
'hej',
|
||||
'world':
|
||||
'v\u00E4rlden',
|
||||
'letter %n of %s':
|
||||
'bokstav %n av %s',
|
||||
'letter %idx of %s':
|
||||
'bokstav %idx av %s',
|
||||
'length of %s':
|
||||
'l\u00E4ngden av %s',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -554,8 +554,8 @@ SnapTranslator.dict.ta = {
|
|||
'வணக்கம்',
|
||||
'world':
|
||||
'உலகம்',
|
||||
'letter %n of %s':
|
||||
'%s ன் %n வது எழுத்து',
|
||||
'letter %idx of %s':
|
||||
'%idx வது எழுத்து , %s ன்',
|
||||
'length of %s':
|
||||
'%s ன் நீளம்',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -554,8 +554,8 @@ SnapTranslator.dict.te = {
|
|||
'హలో',
|
||||
'world':
|
||||
'ప్రపంచం',
|
||||
'letter %n of %s':
|
||||
'Zeichen %n von %s',
|
||||
'letter %idx of %s':
|
||||
'Zeichen %idx von %s',
|
||||
'length of %s':
|
||||
'L\u00e4nge von %s',
|
||||
'unicode of %s':
|
||||
|
|
162
lang-tr.js
162
lang-tr.js
|
@ -179,13 +179,13 @@ SnapTranslator.dict.tr = {
|
|||
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'Türkçe', // the name as it should appear in the language menu
|
||||
'Türkçe', // the name as it should appear in the language menu (Dil menüsünde görünmesi gereken isim)
|
||||
'language_translator':
|
||||
'Hakan Atas', // your name for the Translators tab
|
||||
'Hakan Atas, www.3drobolab.com', // your name for the Translators tab (Çevirenlerin isimleri)
|
||||
'translator_e-mail':
|
||||
'hakanatas@gmail.com', // optional
|
||||
'hakanatas@gmail.com, mustafaipekbayrak@gmail.com', // optional (Mail adresleri)
|
||||
'last_changed':
|
||||
'2015-7-26', // this, too, will appear in the Translators tab
|
||||
'2018-01-22', // this, too, will appear in the Translators tab (Son güncelleme tarihi)
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -303,7 +303,7 @@ SnapTranslator.dict.tr = {
|
|||
'go to %dst':
|
||||
'%dst git',
|
||||
'glide %n secs to x: %n y: %n':
|
||||
'x: %n y: %n noktasına %n saniyede süzül',
|
||||
'%n saniyede x: %n y: %n noktasına git',
|
||||
'change x by %n':
|
||||
'x\'i %n değiştir',
|
||||
'set x to %n':
|
||||
|
@ -417,6 +417,8 @@ SnapTranslator.dict.tr = {
|
|||
'%keyHat tuşu basılınca',
|
||||
'when I am clicked':
|
||||
'bu kukla tıklanınca',
|
||||
'when I am %interaction':
|
||||
'kukla %interaction zaman',
|
||||
'when I receive %msgHat':
|
||||
'%msgHat haberi gelince',
|
||||
'broadcast %msg':
|
||||
|
@ -552,14 +554,14 @@ SnapTranslator.dict.tr = {
|
|||
'merhaba',
|
||||
'world':
|
||||
'dünya',
|
||||
'letter %n of %s':
|
||||
'%n in harfleri %s',
|
||||
'letter %idx of %s':
|
||||
'%idx in harfleri %s',
|
||||
'length of %s':
|
||||
'%s in uzunluğu',
|
||||
'unicode of %s':
|
||||
'%s in unicode hali',
|
||||
'unicode %n as letter':
|
||||
'harf olarak %n in unicode hali',
|
||||
'unicode %n in harf hali',
|
||||
'is %s a %typ ?':
|
||||
'%s bir %typ mi?',
|
||||
'is %s identical to %s ?':
|
||||
|
@ -1271,5 +1273,147 @@ SnapTranslator.dict.tr = {
|
|||
'last':
|
||||
'son',
|
||||
'any':
|
||||
'herhangi'
|
||||
'herhangi',
|
||||
|
||||
// miscellaneous
|
||||
'find blocks...':
|
||||
'blokları bul...',
|
||||
'hide primitives':
|
||||
'temelleri sakla',
|
||||
'show primitives':
|
||||
'temelleri göster',
|
||||
'Login...':
|
||||
'Bağlan...',
|
||||
'Signup...':
|
||||
'Giriş Yap...',
|
||||
'Reset Password...':
|
||||
'Şifre Değiştir...',
|
||||
'show all':
|
||||
'tümünü göster',
|
||||
'pic...':
|
||||
'görüntü...',
|
||||
'open a new window\nwith a picture of the stage':
|
||||
'yeni pencere aç\nyeni bölüm ile',
|
||||
'scripts pic...':
|
||||
'görüntü betikleri...',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
'yeni pencere aç\ntüm görüntü betikleri ile',
|
||||
'Stage size...':
|
||||
'Bölüm Boyutu...',
|
||||
'Zoom blocks...':
|
||||
'Blokları yakınlaştır...',
|
||||
|
||||
'Plain prototype labels':
|
||||
'Düz prototip isimleri',
|
||||
'uncheck to always show (+) symbols\nin block prototype labels':
|
||||
'daima göster (+) sembollerini kapat\nblok prototip isimleri içinde',
|
||||
'check to hide (+) symbols\nin block prototype labels':
|
||||
'gizle (+) sembollerini işaretle\nblok prototip isimleri içinde',
|
||||
|
||||
'check for flat ends of lines':
|
||||
'çizgilerin düz sonları için işaretle',
|
||||
'uncheck for round ends of lines':
|
||||
'çizgilerin yuvarlatılmış sonları için işareti kaldır',
|
||||
'Flat line ends':
|
||||
'Fiz çizgi sonları',
|
||||
|
||||
'Codification support':
|
||||
'Kodlaştırma desteği',
|
||||
'uncheck to disable\nblock to text mapping features':
|
||||
'etkisizleştirmeyi kaldır\nbloktan metine haritalandırma özellikleri',
|
||||
'check for block\nto text mapping features':
|
||||
'blok için kontrol et\nmetine dönüştürme özellikleri ',
|
||||
|
||||
'Inheritance support':
|
||||
'Miras Desteği',
|
||||
|
||||
'current %dates':
|
||||
'mevcut %dates',
|
||||
'year':
|
||||
'yıl',
|
||||
'month':
|
||||
'ay',
|
||||
'date':
|
||||
'tarih',
|
||||
'hour':
|
||||
'saat',
|
||||
'minute':
|
||||
'dakika',
|
||||
'second':
|
||||
'saniye',
|
||||
'time in milliseconds':
|
||||
'milisaniye zaman',
|
||||
'day of week':
|
||||
'haftanın günü',
|
||||
|
||||
'brightness':
|
||||
'parlaklık',
|
||||
'transparence':
|
||||
'transparant',
|
||||
'negative':
|
||||
'negatif',
|
||||
'comic':
|
||||
'dergi',
|
||||
|
||||
'clicked':
|
||||
'tıklandığı',
|
||||
'pressed':
|
||||
'basıldığı',
|
||||
'dropped':
|
||||
'hareket ettiği',
|
||||
'mouse-entered':
|
||||
'fare geldiği',
|
||||
'mouse-departed':
|
||||
'fare gittiği',
|
||||
'when %b':
|
||||
'%b olduğunda',
|
||||
|
||||
'JavaScript function ( %mult%s ) { %code }':
|
||||
'fonction JavaScript ( %mult%s ) { %code }',
|
||||
|
||||
|
||||
// Copy / Paste
|
||||
'Press CTRL+C one more time to effectively copy to clipboard.':
|
||||
'CTRL+C tuşuna bir kez daha basarak panoya kopyala',
|
||||
'Press CTRL+V one more time to effectively paste from clipboard.':
|
||||
'CTRL+V tuşuna bir kez daha basarak tabloya yapıştır',
|
||||
'Press CTRL+X one more time to effectively cut to clipboard.':
|
||||
'CTRL+X tuşuna bir kezdaha basarak panodan kes',
|
||||
|
||||
// Paint.js
|
||||
'undo':
|
||||
'geri',
|
||||
'Paintbrush tool\n(free draw)':
|
||||
'fırça\n(serbest çizim)',
|
||||
'Stroked Rectangle\n(shift: square)':
|
||||
'dikdörtgen\n(shift: kare)',
|
||||
'Stroked Ellipse\n(shift: circle)':
|
||||
'ekips\n(shift : cercle)',
|
||||
'Eraser tool':
|
||||
'silgi',
|
||||
'Set the rotation center':
|
||||
'döndürme merkezini ayarla',
|
||||
'Line tool\n(shift: vertical/horizontal)':
|
||||
'çizgi çizme\n(shift: yatay/dikey)',
|
||||
'Filled Rectangle\n(shift: square)':
|
||||
'içi dolu dikdörtgen\n(shift: kare)',
|
||||
'Filled Ellipse\n(shift: circle)':
|
||||
'içi dolu elips\n(shift: daire)',
|
||||
'Fill a region':
|
||||
'bölgenin içini doldur',
|
||||
'Pipette tool\n(pick a color anywhere)':
|
||||
'pipet\n(herhangibir yerden renk seç)',
|
||||
'grow':
|
||||
'büyüt',
|
||||
'shrink':
|
||||
'küçült',
|
||||
'flip \u2194':
|
||||
'ayna görüntüsü \u2194',
|
||||
'flip \u2195':
|
||||
'ayna görüntüsü \u2195',
|
||||
'Brush size':
|
||||
'fırça boyutu',
|
||||
'Constrain proportions of shapes?\n(you can also hold shift)':
|
||||
'şekil bölümleri içerir mi?\n(shift tuşuna basabilirsiniz)'
|
||||
|
||||
};
|
||||
|
|
|
@ -185,7 +185,7 @@ SnapTranslator.dict.zh_CN = {
|
|||
'translator_e-mail':
|
||||
'ubertao@qq.com/djh@rhjxx.cn',
|
||||
'last_changed':
|
||||
'2016-5-6',
|
||||
'2018-01-22',
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -846,8 +846,8 @@ SnapTranslator.dict.zh_CN = {
|
|||
'你好',
|
||||
'world':
|
||||
'世界',
|
||||
'letter %n of %s':
|
||||
'第 %n 个字符在文字 %s 中',
|
||||
'letter %idx of %s':
|
||||
'第 %idx 个字符在文字 %s 中',
|
||||
'length of %s':
|
||||
'%s 的长度',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -536,8 +536,8 @@ SnapTranslator.dict.zh_TW = {
|
|||
'歡迎',
|
||||
'world':
|
||||
'光臨',
|
||||
'letter %n of %s':
|
||||
'第 %n 位元在文字 %s 中',
|
||||
'letter %idx of %s':
|
||||
'第 %idx 位元在文字 %s 中',
|
||||
'length of %s':
|
||||
'%s 的長度',
|
||||
'unicode of %s':
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="setting %'which'" type="reporter" category="sensing"><header></header><code></code><inputs><input type="%s" readonly="true"><options>Project notes
|
||||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="setting %'which'" type="reporter" category="sensing"><header></header><code></code><translations></translations><inputs><input type="%s" readonly="true"><options>Project notes
|
||||
Project name
|
||||
User
|
||||
Presentation mode
|
||||
|
@ -20,7 +20,8 @@ Thread safe scripts
|
|||
Prefer smooth animations
|
||||
Flat line ends
|
||||
Codification support
|
||||
Inheritance support</options></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>which</l></list><l>var stage = this.parentThatIsA(StageMorph),
 ide = stage.parentThatIsA(IDE_Morph),
 world = stage.parentThatIsA(WorldMorph);

switch (which) {
 case 'Project notes':
 return ide.projectNotes;
 case 'Project name':
 return ide.projectName;
 case 'User':
 return SnapCloud.username;
 case 'Presentation mode':
 return ide.isAppMode;
 case 'Language':
 return SnapTranslator.language;
 case 'Zoom blocks':
 return SyntaxElementMorph.prototype.scale;
 case 'Stage size':
 return new List([StageMorph.prototype.dimensions.x,
 StageMorph.prototype.dimensions.y]);
 case 'Stage scale':
 return stage.scale;
 case 'Retina display support':
 return isRetinaEnabled();
 case 'Long form input dialog':
 return InputSlotDialogMorph.prototype.isLaunchingExpanded;
 case 'Plain prototype labels':
 return BlockLabelPlaceHolderMorph.prototype.plainLabel;
 case 'Input sliders':
 return MorphicPreferences.useSliderForInput;
 case 'Execute on slider change':
 return ArgMorph.prototype.executeOnSliderEdit;
 case 'Clicking sound':
 return !!BlockMorph.prototype.snapSound;
 case 'Turbo mode':
 return stage.isFastTracked;
 case 'Flat design':
 return MorphicPreferences.isFlat;
 case 'Keyboard editing':
 return world.keyboardReceiver instanceof ScriptFocusMorph;
 case 'Visible stepping':
 return Process.prototype.enableSingleStepping;
 case 'Thread safe scripts':
 return stage.isThreadSafe;
 case 'Prefer smooth animations':
 return StageMorph.prototype.frameRate > 0;
 case 'Flat line ends':
 return SpriteMorph.prototype.useFlatLineEnds;
 case 'Codification support':
 return StageMorph.prototype.enableCodeMapping;
 case 'Inheritance support':
 return StageMorph.prototype.enableInheritance;
 default: return which;
}</l></block><list><block var="which"/></list></block></block></script></block-definition><block-definition s="set flag %'which' to %'tf'" type="command" category="sensing"><header></header><code></code><inputs><input type="%s" readonly="true"><options>Presentation mode
|
||||
Inheritance support
|
||||
Visible palette</options></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>which</l></list><l>var stage = this.parentThatIsA(StageMorph),
 ide = stage.parentThatIsA(IDE_Morph),
 world = stage.parentThatIsA(WorldMorph);

switch (which) {
 case 'Project notes':
 return ide.projectNotes;
 case 'Project name':
 return ide.projectName;
 case 'User':
 return ide.cloud.username;
 case 'Presentation mode':
 return ide.isAppMode;
 case 'Language':
 return SnapTranslator.language;
 case 'Zoom blocks':
 return SyntaxElementMorph.prototype.scale;
 case 'Stage size':
 return new List([StageMorph.prototype.dimensions.x,
 StageMorph.prototype.dimensions.y]);
 case 'Stage scale':
 return stage.scale;
 case 'Retina display support':
 return isRetinaEnabled();
 case 'Long form input dialog':
 return InputSlotDialogMorph.prototype.isLaunchingExpanded;
 case 'Plain prototype labels':
 return BlockLabelPlaceHolderMorph.prototype.plainLabel;
 case 'Input sliders':
 return MorphicPreferences.useSliderForInput;
 case 'Execute on slider change':
 return ArgMorph.prototype.executeOnSliderEdit;
 case 'Clicking sound':
 return !!BlockMorph.prototype.snapSound;
 case 'Turbo mode':
 return stage.isFastTracked;
 case 'Flat design':
 return MorphicPreferences.isFlat;
 case 'Keyboard editing':
 return world.keyboardReceiver instanceof ScriptFocusMorph;
 case 'Visible stepping':
 return Process.prototype.enableSingleStepping;
 case 'Thread safe scripts':
 return stage.isThreadSafe;
 case 'Prefer smooth animations':
 return StageMorph.prototype.frameRate > 0;
 case 'Flat line ends':
 return SpriteMorph.prototype.useFlatLineEnds;
 case 'Codification support':
 return StageMorph.prototype.enableCodeMapping;
 case 'Inheritance support':
 return StageMorph.prototype.enableInheritance;
 default: return which;
 case 'Visible palette':
 return ide.currentCategory;
}</l></block><list><block var="which"/></list></block></block></script></block-definition><block-definition s="set flag %'which' to %'tf'" type="command" category="sensing"><header></header><code></code><translations></translations><inputs><input type="%s" readonly="true"><options>Presentation mode
|
||||
Retina display support
|
||||
Long form input dialog
|
||||
Plain prototype labels
|
||||
|
@ -35,9 +36,10 @@ Thread safe scripts
|
|||
Prefer smooth animations
|
||||
Flat line ends
|
||||
Codification support
|
||||
Inheritance support</options></input><input type="%b"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>which</l><l>tf</l></list><l>var stage = this.parentThatIsA(StageMorph),
 ide = stage.parentThatIsA(IDE_Morph),
 world = stage.parentThatIsA(WorldMorph),
 thisObj = this;

if (tf != !!tf) return;

try{
ide.savingPreferences = false;

switch (which) {
 case 'Presentation mode':
 if (tf != ide.isAppMode) ide.toggleAppMode();
 break;
 case 'Retina display support':
 if (tf != isRetinaEnabled()) ide.toggleRetina();
 break;
 case 'Long form input dialog':
 if (tf != InputSlotDialogMorph.prototype.isLaunchingExpanded)
 ide.toggleLongFormInputDialog();
 break;
 case 'Plain prototype labels':
 if (tf != BlockLabelPlaceHolderMorph.prototype.plainLabel)
 ide.togglePlainPrototypeLabels();
 break;
 case 'Input sliders':
 MorphicPreferences.useSliderForInput = tf;
 break;
 case 'Execute on slider change':
 ArgMorph.prototype.executeOnSliderEdit = tf;
 break;
 case 'Clicking sound':
 if (tf != !!BlockMorph.prototype.snapSound)
 BlockMorph.prototype.toggleSnapSound();
 break;
 case 'Turbo mode':
 if (tf != stage.isFastTracked)
 ide.toggleFastTracking();
 break;
 case 'Flat design':
 if (tf == MorphicPreferences.isFlat) break;
 if (tf)
 ide.flatDesign();
 else
 ide.defaultDesign();
 break;
 case 'Keyboard editing':
 if (tf != (world.keyboardReceiver instanceof ScriptFocusMorph)) {
 thisObj.scripts.toggleKeyboardEntry();
 };
 break;
 case 'Visible stepping':
 if (tf != Process.prototype.enableSingleStepping)
 ide.toggleSingleStepping();
 break;
 case 'Thread safe scripts':
 stage.isThreadSafe = tf;
 break;
 case 'Prefer smooth animations':
 if (tf != (StageMorph.prototype.frameRate > 0))
 ide.toggleVariableFrameRate();
 break;
 case 'Flat line ends':
 SpriteMorph.prototype.useFlatLineEnds = tf;
 break;
 case 'Codification support':
 if (tf != StageMorph.prototype.enableCodeMapping) {
 StageMorph.prototype.enableCodeMapping = tf;
 ide.currentSprite.blocksCache.variables = null;
 ide.currentSprite.paletteCache.variables = null;
 ide.refreshPalette();
 }
 break;
 case 'Inheritance support':
 if (tf != StageMorph.prototype.enableInheritance) {
 StageMorph.prototype.enableInheritance = tf;
 ide.currentSprite.blocksCache.variables = null;
 ide.currentSprite.paletteCache.variables = null;
 ide.refreshPalette();
 }
 break;
};
}
finally {
ide.savingPreferences = false;
};
</l></block><list><block var="which"/><block var="tf"/></list></block></script></block-definition><block-definition s="set value %'which' to %'value'" type="command" category="sensing"><header></header><code></code><inputs><input type="%s" readonly="true"><options>Project notes
|
||||
Inheritance support</options></input><input type="%b"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>which</l><l>tf</l></list><l>var stage = this.parentThatIsA(StageMorph),
 ide = stage.parentThatIsA(IDE_Morph),
 world = stage.parentThatIsA(WorldMorph),
 thisObj = this;

if (tf != !!tf) return;

try{
ide.savingPreferences = false;

switch (which) {
 case 'Presentation mode':
 if (tf != ide.isAppMode) ide.toggleAppMode();
 break;
 case 'Retina display support':
 if (tf != isRetinaEnabled()) ide.toggleRetina();
 break;
 case 'Long form input dialog':
 if (tf != InputSlotDialogMorph.prototype.isLaunchingExpanded)
 ide.toggleLongFormInputDialog();
 break;
 case 'Plain prototype labels':
 if (tf != BlockLabelPlaceHolderMorph.prototype.plainLabel)
 ide.togglePlainPrototypeLabels();
 break;
 case 'Input sliders':
 MorphicPreferences.useSliderForInput = tf;
 break;
 case 'Execute on slider change':
 ArgMorph.prototype.executeOnSliderEdit = tf;
 break;
 case 'Clicking sound':
 if (tf != !!BlockMorph.prototype.snapSound)
 BlockMorph.prototype.toggleSnapSound();
 break;
 case 'Turbo mode':
 if (tf != stage.isFastTracked)
 ide.toggleFastTracking();
 break;
 case 'Flat design':
 if (tf == MorphicPreferences.isFlat) break;
 if (tf)
 ide.flatDesign();
 else
 ide.defaultDesign();
 break;
 case 'Keyboard editing':
 if (tf != (world.keyboardReceiver instanceof ScriptFocusMorph)) {
 thisObj.scripts.toggleKeyboardEntry();
 };
 break;
 case 'Visible stepping':
 if (tf != Process.prototype.enableSingleStepping)
 ide.toggleSingleStepping();
 break;
 case 'Thread safe scripts':
 stage.isThreadSafe = tf;
 break;
 case 'Prefer smooth animations':
 if (tf != (StageMorph.prototype.frameRate > 0))
 ide.toggleVariableFrameRate();
 break;
 case 'Flat line ends':
 SpriteMorph.prototype.useFlatLineEnds = tf;
 break;
 case 'Codification support':
 if (tf != StageMorph.prototype.enableCodeMapping) {
 StageMorph.prototype.enableCodeMapping = tf;
 ide.currentSprite.blocksCache.variables = null;
 ide.currentSprite.paletteCache.variables = null;
 ide.refreshPalette();
 }
 break;
 case 'Inheritance support':
 if (tf != StageMorph.prototype.enableInheritance) {
 StageMorph.prototype.enableInheritance = tf;
 ide.currentSprite.blocksCache.variables = null;
 ide.currentSprite.paletteCache.variables = null;
 ide.refreshPalette();
 }
 break;
};
}
finally {
ide.savingPreferences = false;
};
</l></block><list><block var="which"/><block var="tf"/></list></block></script></block-definition><block-definition s="set value %'which' to %'value'" type="command" category="sensing"><header></header><code></code><translations></translations><inputs><input type="%s" readonly="true"><options>Project notes
|
||||
Project name
|
||||
Language
|
||||
Zoom blocks
|
||||
Stage size
|
||||
Stage scale</options></input><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>which</l><l>value</l></list><l>var stage = this.parentThatIsA(StageMorph),
 ide = stage.parentThatIsA(IDE_Morph),
 world = stage.parentThatIsA(WorldMorph);

try {
ide.savingPreferences = false;

switch (which) {
 case 'Project notes':
 ide.projectNotes = value;
 break;
 case 'Project name':
 ide.setProjectName(value);
 break;
 case 'Language':
 ide.setLanguage(value);
 break;
 case 'Zoom blocks':
 if (!isNaN(value)) ide.setBlocksScale(Math.min(value, 12));
 break;
 case 'Stage size':
 if ((value instanceof List) && value.length()==2
 && !isNaN(value.at(1)) && !isNaN(value.at(2)))
 ide.setStageExtent(new Point(value.at(1), value.at(2)));
 break;
 case 'Stage scale':
 ide.toggleStageSize(value != 1, Math.max(0.1, value));
 break;
};
}
finally {ide.savingPreferences = true;
};</l></block><list><block var="which"/><block var="value"/></list></block></script></block-definition></blocks>
|
||||
Stage scale
|
||||
Visible palette</options></input><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>which</l><l>value</l></list><l>var stage = this.parentThatIsA(StageMorph),
 ide = stage.parentThatIsA(IDE_Morph),
 world = stage.parentThatIsA(WorldMorph);

try {
ide.savingPreferences = false;

switch (which) {
 case 'Project notes':
 ide.projectNotes = value;
 break;
 case 'Project name':
 ide.setProjectName(value);
 break;
 case 'Language':
 ide.setLanguage(value);
 break;
 case 'Zoom blocks':
 if (!isNaN(value)) ide.setBlocksScale(Math.min(value, 12));
 break;
 case 'Stage size':
 if ((value instanceof List) && value.length()==2
 && !isNaN(value.at(1)) && !isNaN(value.at(2)))
 ide.setStageExtent(new Point(value.at(1), value.at(2)));
 break;
 case 'Stage scale':
 ide.toggleStageSize(value != 1, Math.max(0.1, value));
 break;
 case 'Visible palette':
 ide.currentCategory = value.toLowerCase();
 ide.categories.children.forEach(function (each) {
 each.refresh();
 });
 ide.refreshPalette(true);
 break;
};
}
finally {ide.savingPreferences = true;
};</l></block><list><block var="which"/><block var="value"/></list></block></script></block-definition></blocks>
|
|
@ -7,10 +7,17 @@ httpBlocks.xml Web services access (https) An extended version of the HTTP:// bl
|
|||
word-sentence.xml Words, sentences One of the big ideas in Logo that they left out of Scratch is thinking of text as structured into words and sentences, rather than just a string of characters. This library (along with the JOIN WORDS block in the Tools library) brings back that idea.
|
||||
cases.xml Multi-branched conditional (switch) Like "switch" in C-like languages or "cond" in Lisp. Thanks to Nathan Dinsmore for inventing the idea of a separate block for each branch!
|
||||
leap-library.xml LEAP Motion controller Report hand positions from LEAP Motion controller (leapmotion.com).
|
||||
setrgb.xml Set RGB or HSV pen color Set or report pen color as RGB (red, blue, green) or HSV (hue, saturation, value).
|
||||
setrgb.xml Set RGB or HSV pen color Set or report pen color as RGB (red, green, blue) or HSV (hue, saturation, value).
|
||||
try-catch.xml Catch errors in a script Run a script; if an error happens, instead of stopping the script with a red halo, run another script to handle the error. Also includes a block to cause an error with a message given as input. Also includes a block to create a script variable and give it a value.
|
||||
multiline.xml Allow multi-line text input to a block In general, text inputs allow only a single line. The MULTILINE block accepts multi-line text input and can be used in text input slots of other blocks.
|
||||
Eisenbergification.xml Provide getters and setters for all GUI-controlled global settings Eisenberg's Law: Anything that can be done from the GUI should be doable from the programming language, and vice versa.
|
||||
bignumbers.xml Infinite precision integers, exact rationals, complex The full Scheme numeric tower. "USE BIGNUMS <True>" to enable.
|
||||
crayons.xml Provide 100 selected colors to use instead of hue for better selection
|
||||
speech_module.xml Text to speech output text using speech synthesis.
|
||||
animation_module.xml Animation glide, grow and rotate using easing functions.
|
||||
pixel_module.xml Pixels manipulate costumes pixel-wise.
|
||||
audioComp_module.xml Audio Comp analyze, manipulate and generate sound samples.
|
||||
atomic_HOFs_module.xml "Bigger" Data [EXPERIMENTAL] crunch large lists very fast
|
||||
make-variables.xml create variables in program declare global or sprite-local variables in a script
|
||||
json.xml Deal with JSON data Turn JSON strings into lists with the listify block, then retrieve data out of them by using the value at key block.
|
||||
parallel_module.xml Parallelization Run several scripts in parallel and wait until all are done.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="$flash map %'fn' over %'data'" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>fn</l><l>data</l><l>proc</l></list><l>return proc.reportAtomicMap(fn, data);</l></block><list><block var="fn"/><block var="data"/></list></block></block></script></block-definition><block-definition s="$flash keep %'test' from %'data'" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>fn</l><l>data</l><l>proc</l></list><l>return proc.reportAtomicKeep(fn, data);</l></block><list><block var="test"/><block var="data"/></list></block></block></script></block-definition><block-definition s="$flash combine %'fn' with %'data'" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>fn</l><l>data</l><l>proc</l></list><l>return proc.reportAtomicCombine(fn, data);</l></block><list><block var="fn"/><block var="data"/></list></block></block></script></block-definition><block-definition s="$flash sort %'data' by %'fn'" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%predRing"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>data</l><l>fn</l><l>proc</l></list><l>return proc.reportAtomicSort(data, fn);</l></block><list><block var="data"/><block var="fn"/></list></block></block></script></block-definition><block-definition s="$flash reverse %'list'" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>list</l></list><l>return new List(list.asArray().slice().reverse());</l></block><list><block var="list"/></list></block></block></script></block-definition></blocks>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="listify %'jsonString'" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>jsonString</l></list><l>return listify(JSON.parse(jsonString));

function listify(jsonObject) {
 if (jsonObject instanceof Array) {
 return new List(jsonObject.map(function(eachElement) { return listify(eachElement)}));
 } else if (jsonObject instanceof Object) {
 return new List(Object.keys(jsonObject).map(function(eachKey) { return new List([eachKey,listify(jsonObject[eachKey])])} ))
 } else {
 return jsonObject
 }
}</l></block><list><block var="jsonString"/></list></block></block></script></block-definition><block-definition s="value at key %'key' of %'lst'" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doForEach"><l>each item</l><block var="lst"/><script><block s="doIf"><block s="reportEquals"><block s="reportListItem"><l>1</l><block var="each item"/></block><block var="key"/></block><script><block s="doReport"><block s="reportListItem"><l>2</l><block var="each item"/></block></block></script></block></script></block></script></block><block s="doReport"><l></l></block></script></block-definition></blocks>
|
|
@ -1,7 +1,7 @@
|
|||
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="Leap number of hands" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list></list><l>return window.controller.frame(0).hands.length;</l></block><list></list></block></block></script></block-definition><block-definition s="Leap %'pos' position of hand %'num'" type="reporter" category="other"><header></header><code></code><inputs><input type="%txt" readonly="true">x<options>x
|
||||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="Leap number of hands" type="reporter" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list></list><l>return window.controller.frame(0).hands.length;</l></block><list></list></block></block></script></block-definition><block-definition s="Leap %'pos' position of hand %'num'" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%txt" readonly="true">x<options>x
|
||||
y
|
||||
z</options></input><input type="%n">1</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>pos</l><l>num</l></list><l>var a = {x:0, y:1, z:2}[pos]; return window.controller.frame(0).hands[num-1].stabilizedPalmPosition[a];</l></block><list><block var="pos"/><block var="num"/></list></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap %'pos' rotation of hand %'num'" type="reporter" category="other"><header></header><code></code><inputs><input type="%txt" readonly="true">yaw<options>yaw
|
||||
z</options></input><input type="%n">1</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>pos</l><l>num</l></list><l>var a = {x:0, y:1, z:2}[pos]; return window.controller.frame(0).hands[num-1].stabilizedPalmPosition[a];</l></block><list><block var="pos"/><block var="num"/></list></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap %'pos' rotation of hand %'num'" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%txt" readonly="true">yaw<options>yaw
|
||||
pitch
|
||||
roll</options></input><input type="%n">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>pos</l><l>num</l></list><l>var f = window.controller.frame(0);
switch (pos){
 case "yaw":
 return f.hands[num-1].yaw();
 case "pitch":
 return f.hands[num-1].pitch();
 case "roll":
 return f.hands[num-1].roll();
};
 
 </l></block><list><block var="pos"/><block var="num"/></list></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap %'pos' position of finger %'num'" type="reporter" category="other"><header></header><code></code><inputs><input type="%txt" readonly="true">x<options>x
|
||||
roll</options></input><input type="%n">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>pos</l><l>num</l></list><l>var f = window.controller.frame(0);
switch (pos){
 case "yaw":
 return f.hands[num-1].yaw();
 case "pitch":
 return f.hands[num-1].pitch();
 case "roll":
 return f.hands[num-1].roll();
};
 
 </l></block><list><block var="pos"/><block var="num"/></list></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap %'pos' position of finger %'num'" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%txt" readonly="true">x<options>x
|
||||
y
|
||||
z</options></input><input type="%n">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><block s="evaluate"><block s="reportJSFunction"><list></list><l>return window.controller.frame(0).fingers.length;</l></block><list></list></block></block></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>pos</l><l>num</l></list><l>var a = {x:0, y:1, z:2}[pos]; return window.controller.frame(0).fingers[num-1].stabilizedTipPosition[a];</l></block><list><block var="pos"/><block var="num"/></list></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap hand %'num' is pinching" type="predicate" category="other"><header></header><code></code><inputs><input type="%s">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="reportGreaterThan"><block s="evaluate"><block s="reportJSFunction"><list><l>num</l></list><l>return window.controller.frame(0).hands[num-1].pinchStrength;</l></block><list><block var="num"/></list></block><l>0.75</l></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block-definition><block-definition s="Leap pinch strength of hand %'num'" type="reporter" category="other"><header></header><code></code><inputs><input type="%n">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="reportProduct"><block s="evaluate"><block s="reportJSFunction"><list><l>num</l></list><l>return window.controller.frame(0).hands[num-1].pinchStrength;</l></block><list><block var="num"/></list></block><l>100</l></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap $flag" type="command" category="other"><header></header><code></code><inputs></inputs><script><block s="doIf"><block s="evaluate"><block s="reportJSFunction"><list></list><l>return window.controller !== undefined</l></block><list></list></block><script><block s="doStopThis"><l><option>this block</option></l></block></script></block><block s="doDeclareVariables"><list><l>test</l></list></block><block s="doSetVar"><l>test</l><block s="evaluate"><block s="reportJSFunction"><list></list><l>var leapScript,
 done = false;
leapScript = document.createElement('script'),
leapScript.onload = function () {
 done = true;
 console.log('leap is ready');
};
document.head.appendChild(leapScript);
leapScript.src = 'http://js.leapmotion.com/leap-0.6.4.min.js';
return function () {return done; }</l></block><list></list></block></block><block s="doWaitUntil"><block s="evaluate"><block var="test"/><list></list></block></block><block s="doRun"><block s="reportJSFunction"><list></list><l>window.controller = new Leap.Controller({enableGestures: true, background: true}); window.controller.connect();</l></block><list></list></block></script></block-definition></blocks>
|
||||
z</options></input><input type="%n">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><block s="evaluate"><block s="reportJSFunction"><list></list><l>return window.controller.frame(0).fingers.length;</l></block><list></list></block></block></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>pos</l><l>num</l></list><l>var a = {x:0, y:1, z:2}[pos]; return window.controller.frame(0).fingers[num-1].stabilizedTipPosition[a];</l></block><list><block var="pos"/><block var="num"/></list></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap hand %'num' is pinching" type="predicate" category="other"><header></header><code></code><translations></translations><inputs><input type="%s">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="reportGreaterThan"><block s="evaluate"><block s="reportJSFunction"><list><l>num</l></list><l>return window.controller.frame(0).hands[num-1].pinchStrength;</l></block><list><block var="num"/></list></block><l>0.75</l></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block-definition><block-definition s="Leap pinch strength of hand %'num'" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%n">1</input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportGreaterThan"><block var="num"/><custom-block s="Leap number of hands"></custom-block></block></block><script><block s="doReport"><block s="reportProduct"><block s="evaluate"><block s="reportJSFunction"><list><l>num</l></list><l>return window.controller.frame(0).hands[num-1].pinchStrength;</l></block><list><block var="num"/></list></block><l>100</l></block></block></script><script><block s="doReport"><l>0</l></block></script></block></script></block-definition><block-definition s="Leap $flag" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doIf"><block s="evaluate"><block s="reportJSFunction"><list></list><l>return window.controller !== undefined</l></block><list></list></block><script><block s="doStopThis"><l><option>this block</option></l></block></script></block><block s="doDeclareVariables"><list><l>test</l></list></block><block s="doSetVar"><l>test</l><block s="evaluate"><block s="reportJSFunction"><list></list><l>var leapScript,
 done = false;
leapScript = document.createElement('script'),
leapScript.onload = function () {
 done = true;
 console.log('leap is ready');
};
document.head.appendChild(leapScript);
leapScript.src = 'https://js.leapmotion.com/leap-0.6.4.min.js';
return function () {return done; }</l></block><list></list></block></block><block s="doWaitUntil"><block s="evaluate"><block var="test"/><list></list></block></block><block s="doRun"><block s="reportJSFunction"><list></list><l>window.controller = new Leap.Controller({enableGestures: true, background: true}); window.controller.connect();</l></block><list></list></block></script></block-definition></blocks>
|
|
@ -0,0 +1 @@
|
|||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="global variables %'names'" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if (name != "") this.addVariable(name, true);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);
ide.flushBlocksCache('variables'); // b/c of inheritance
ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="sprite-local variables %'names'" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if (name != "") this.addVariable(name, false);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);
ide.flushBlocksCache('variables'); // b/c of inheritance
ide.refreshPalette();</l></block><list></list></block></script></block-definition></blocks>
|
|
@ -0,0 +1 @@
|
|||
<blocks app="Snap! 4.2, http://snap.berkeley.edu" version="1"><block-definition s="do in parallel %'actions' and wait" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%mult%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>threads</l></list></block><block s="doSetVar"><l>threads</l><custom-block s="map %repRing over %l"><block s="reifyReporter"><autolambda><block s="evaluate"><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>is running?</l></list></block><block s="doSetVar"><l>is running?</l><block s="reportBoolean"><l><bool>true</bool></l></block></block><block s="fork"><block s="reifyScript"><script><block s="doRun"><block var="each script"/><list></list></block><block s="doSetVar"><l>is running?</l><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><list></list></block><block s="doReport"><block s="reifyScript"><script><block s="doReport"><block var="is running?"/></block></script><list></list></block></block></script><list></list></block><list></list></block></autolambda><list><l>each script</l></list></block><block var="actions"/></custom-block></block><block s="doWaitUntil"><custom-block s="empty? %l"><custom-block s="keep items such that %predRing from %l"><block s="reifyPredicate"><autolambda><block s="evaluate"><block var="test"/><list></list></block></autolambda><list><l>test</l></list></block><block var="threads"/></custom-block></custom-block></block></script></block-definition><block-definition s="empty? %'data'" type="predicate" category="lists"><header></header><code></code><translations>de:ist _ leer?
</translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportEquals"><block var="data"/><block s="reportNewList"><list></list></block></block></block></script></block-definition><block-definition s="keep items such that %'pred' from %'data'" type="reporter" category="lists"><header></header><code></code><translations>de:behalte Elemente, die _ aus _
</translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doIfElse"><block s="evaluate"><block var="pred"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><script><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="data"/></block><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></block></script><script><block s="doReport"><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></script></block></script></block-definition><block-definition s="map %'func' over %'data'" type="reporter" category="lists"><header></header><code></code><translations>de:wende _ an auf _
</translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block var="data"/></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="func"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><custom-block s="map %repRing over %l"><block var="func"/><block s="reportCDR"><block var="data"/></block></custom-block></block></block></script></block-definition><block-definition s="do in parallel %'actions'" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%mult%cs"></input></inputs><script><block s="doIf"><block s="reportGreaterThan"><block s="reportListLength"><block var="actions"/></block><l>0</l></block><script><block s="fork"><block s="reportListItem"><l>1</l><block var="actions"/></block><list></list></block><custom-block s="do in parallel %mult%cs"><block s="reportCDR"><block var="actions"/></block></custom-block></script></block></script></block-definition></blocks>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,43 @@
|
|||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="speak %'text' with %'lang' accent $nl and pitch %'pitch' rate %'rate'" type="command" category="sound"><header></header><code></code><translations>de:sprich _ mit _ Aussprache _ und Höhe _ Geschwindigkeit _
</translations><inputs><input type="%s">Hello, World!</input><input type="%txt">en-US<options>American=en-US
|
||||
Arabic=ar
|
||||
British=en-GB
|
||||
Chinese=zh
|
||||
Czech=cs
|
||||
Dutch=nl
|
||||
Estonian=et
|
||||
Finish=fi
|
||||
French=fr
|
||||
German=de
|
||||
Greek=el
|
||||
Hungarian=hu
|
||||
Indonesian=id
|
||||
Italian=it
|
||||
Japanese=ja
|
||||
Korean=ko
|
||||
Portuguese=pt
|
||||
Romanian=ro
|
||||
Russian=ru
|
||||
Spanish=es
|
||||
Swedish=sv
|
||||
Turkish=tr</options></input><input type="%n">1</input><input type="%n">1</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>msg</l><l>accent</l><l>pitch</l><l>rate</l></list><l>var utter = new SpeechSynthesisUtterance(msg);
utter.lang = accent;
utter.pitch = pitch;
utter.rate = rate;
window.speechSynthesis.speak(utter);</l></block><list><block var="text"/><block var="lang"/><block var="pitch"/><block var="rate"/></list></block></script></block-definition><block-definition s="speak %'text' with %'lang' accent $nl and pitch %'pitch' rate %'rate' and wait" type="command" category="sound"><header></header><code></code><translations>de:sprich _ mit _ Aussprache _ und Höhe _ Geschwindigkeit _ und warte
</translations><inputs><input type="%s">Hello, World!</input><input type="%txt">en-US<options>American=en-US
|
||||
Arabic=ar
|
||||
British=en-GB
|
||||
Chinese=zh
|
||||
Czech=cs
|
||||
Dutch=nl
|
||||
Estonian=et
|
||||
Finish=fi
|
||||
French=fr
|
||||
German=de
|
||||
Greek=el
|
||||
Hungarian=hu
|
||||
Indonesian=id
|
||||
Italian=it
|
||||
Japanese=ja
|
||||
Korean=ko
|
||||
Portuguese=pt
|
||||
Romanian=ro
|
||||
Russian=ru
|
||||
Spanish=es
|
||||
Swedish=sv
|
||||
Turkish=tr</options></input><input type="%n">1</input><input type="%n">1</input></inputs><script><block s="doDeclareVariables"><list><l>test</l></list></block><block s="doSetVar"><l>test</l><block s="evaluate"><block s="reportJSFunction"><list><l>msg</l><l>accent</l><l>pitch</l><l>rate</l></list><l>var utter = new SpeechSynthesisUtterance(msg),
 isDone = false;
utter.lang = accent;
utter.pitch = pitch;
utter.rate = rate;
utter.onend = function () {isDone = true; };
window.speechSynthesis.speak(utter);
return function () {return isDone; };</l></block><list><block var="text"/><block var="lang"/><block var="pitch"/><block var="rate"/></list></block></block><block s="doWaitUntil"><block s="evaluate"><block var="test"/><list></list></block></block></script></block-definition></blocks>
|
File diff suppressed because one or more lines are too long
6
lists.js
6
lists.js
|
@ -7,7 +7,7 @@
|
|||
written by Jens Mönig and Brian Harvey
|
||||
jens@moenig.org, bh@cs.berkeley.edu
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig and Brian Harvey
|
||||
Copyright (C) 2018 by Jens Mönig and Brian Harvey
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -62,7 +62,7 @@ CellMorph, ArrowMorph, MenuMorph, snapEquals, Morph, isNil, localize,
|
|||
MorphicPreferences, TableDialogMorph, SpriteBubbleMorph, SpeechBubbleMorph,
|
||||
TableFrameMorph, TableMorph, Variable, isSnapObject*/
|
||||
|
||||
modules.lists = '2017-September-01';
|
||||
modules.lists = '2018-March-08';
|
||||
|
||||
var List;
|
||||
var ListWatcherMorph;
|
||||
|
@ -120,7 +120,7 @@ List.prototype.enableTables = false; // default, to not confuse NYC teachers
|
|||
// List printing
|
||||
|
||||
List.prototype.toString = function () {
|
||||
return 'a List [' + this.length + ' elements]';
|
||||
return 'a List [' + this.length() + ' elements]';
|
||||
};
|
||||
|
||||
// List updating:
|
||||
|
|
54
locale.js
54
locale.js
|
@ -6,7 +6,7 @@
|
|||
|
||||
written by Jens Mönig
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
/*global modules, contains*/
|
||||
|
||||
modules.locale = '2017-October-28';
|
||||
modules.locale = '2018-July-09';
|
||||
|
||||
// Global stuff
|
||||
|
||||
|
@ -156,11 +156,11 @@ SnapTranslator.dict.de = {
|
|||
'language_name':
|
||||
'Deutsch',
|
||||
'language_translator':
|
||||
'Jens M\u00F6nig',
|
||||
'Jens M\u00F6nig, Jadga H\u00fcgle',
|
||||
'translator_e-mail':
|
||||
'jens@moenig.org',
|
||||
'jens@moenig.org, jadga.huegle@sap.com',
|
||||
'last_changed':
|
||||
'2017-10-20'
|
||||
'2018-06-08'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.it = {
|
||||
|
@ -215,7 +215,7 @@ SnapTranslator.dict.pt = {
|
|||
'translator_e-mail':
|
||||
'mmsequeira@gmail.com',
|
||||
'last_changed':
|
||||
'2016-10-30'
|
||||
'2018-05-20'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.cs = {
|
||||
|
@ -237,7 +237,7 @@ SnapTranslator.dict.zh_CN = {
|
|||
'translator_e-mail':
|
||||
'ubertao@qq.com/djh@rhjxx.cn',
|
||||
'last_changed':
|
||||
'2017-10-28'
|
||||
'2018-01-22'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.eo = {
|
||||
|
@ -281,18 +281,18 @@ SnapTranslator.dict.ru = {
|
|||
'translator_e-mail':
|
||||
'svetlanap@berkeley.edu, tema@school830.ru',
|
||||
'last_changed':
|
||||
'2017-09-01'
|
||||
'2018-02-05'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.es = {
|
||||
'language_name':
|
||||
'Espa\u00F1ol',
|
||||
'language_translator':
|
||||
'V\u00EDctor Manuel Muratalla Morales',
|
||||
'V\u00EDctor Manuel Muratalla Morales / Cristi\u00E1n Rizzi Iribarren / Alfonso Ruzafa',
|
||||
'translator_e-mail':
|
||||
'victor.muratalla@yahoo.com',
|
||||
'victor.muratalla@yahoo.com / rizzi.cristian@gmail.com',
|
||||
'last_changed':
|
||||
'2013-03-25'
|
||||
'2018-02-19'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.nl = {
|
||||
|
@ -314,7 +314,7 @@ SnapTranslator.dict.pl = {
|
|||
'translator_e-mail':
|
||||
'witek@oeiizk.waw.pl',
|
||||
'last_changed':
|
||||
'2016-11-14'
|
||||
'2017-11-09'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.zh_TW = {
|
||||
|
@ -358,7 +358,7 @@ SnapTranslator.dict.el = {
|
|||
'translator_e-mail':
|
||||
'ino.samaras@berkeley.edu',
|
||||
'last_changed':
|
||||
'2013-09-16'
|
||||
'2018-01-19'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.ca = {
|
||||
|
@ -367,9 +367,20 @@ SnapTranslator.dict.ca = {
|
|||
'language_translator':
|
||||
'Bernat Romagosa Carrasquer, Joan Guillén i Pelegay',
|
||||
'translator_e-mail':
|
||||
'bernat@arduino.org, jguille2@xtec.cat',
|
||||
'bernat@snap4arduino.rocks, jguille2@xtec.cat',
|
||||
'last_changed':
|
||||
'2017-10-28'
|
||||
'2018-06-16'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.ca_VA = {
|
||||
'language_name':
|
||||
'Català - Valencià',
|
||||
'language_translator':
|
||||
'Bernat Romagosa Carrasquer, Joan Guillén i Pelegay, Pilar Embid',
|
||||
'translator_e-mail':
|
||||
'bernat@snap4arduino.rocks, jguille2@xtec.cat, embid_mar@gva.es',
|
||||
'last_changed':
|
||||
'2018-02-08'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.fi = {
|
||||
|
@ -468,7 +479,7 @@ SnapTranslator.dict.tr = {
|
|||
'translator_e-mail':
|
||||
'hakanatas@gmail.com',
|
||||
'last_changed':
|
||||
'2015-7-27'
|
||||
'2018-01-22'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.hu = {
|
||||
|
@ -569,3 +580,14 @@ SnapTranslator.dict.gl = {
|
|||
'last_changed':
|
||||
'2016-11-09'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.eu = {
|
||||
'language_name':
|
||||
'Euskara',
|
||||
'language_translator':
|
||||
'Asier Iturralde Sarasola',
|
||||
'translator_e-mail':
|
||||
'aiturralde@iametza.eus',
|
||||
'last_changed':
|
||||
'2018-06-26'
|
||||
};
|
||||
|
|
523
morphic.js
523
morphic.js
|
@ -8,7 +8,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -85,6 +85,7 @@
|
|||
ColorPaletteMorph
|
||||
GrayPaletteMorph
|
||||
ColorPickerMorph
|
||||
DialMorph
|
||||
FrameMorph
|
||||
ScrollFrameMorph
|
||||
ListMorph
|
||||
|
@ -126,6 +127,7 @@
|
|||
CursorMorph
|
||||
BoxMorph
|
||||
SpeechBubbleMorph
|
||||
DialMorph
|
||||
CircleBoxMorph
|
||||
SliderButtonMorph
|
||||
SliderMorph
|
||||
|
@ -1161,7 +1163,7 @@
|
|||
|
||||
/*global window, HTMLCanvasElement, FileReader, Audio, FileList*/
|
||||
|
||||
var morphicVersion = '2017-September-26';
|
||||
var morphicVersion = '2018-March-19';
|
||||
var modules = {}; // keep track of additional loaded modules
|
||||
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug
|
||||
|
||||
|
@ -1919,6 +1921,19 @@ Color.prototype.toString = function () {
|
|||
this.a + ')';
|
||||
};
|
||||
|
||||
Color.prototype.toRGBstring = function () {
|
||||
return 'rgb(' +
|
||||
Math.round(this.r) + ',' +
|
||||
Math.round(this.g) + ',' +
|
||||
Math.round(this.b) + ')';
|
||||
};
|
||||
|
||||
Color.fromString = function (aString) {
|
||||
// I parse rgb/rgba strings into a Color object
|
||||
var components = aString.split(/[\(),]/).slice(1,5);
|
||||
return new Color(components[0], components[1], components[2], components[3]);
|
||||
};
|
||||
|
||||
// Color copying:
|
||||
|
||||
Color.prototype.copy = function () {
|
||||
|
@ -3135,22 +3150,22 @@ Morph.prototype.setFullCenter = function (aPoint) {
|
|||
Morph.prototype.keepWithin = function (aMorph) {
|
||||
// make sure I am completely within another Morph's bounds
|
||||
var leftOff, rightOff, topOff, bottomOff;
|
||||
leftOff = this.fullBounds().left() - aMorph.left();
|
||||
if (leftOff < 0) {
|
||||
this.moveBy(new Point(-leftOff, 0));
|
||||
}
|
||||
rightOff = this.fullBounds().right() - aMorph.right();
|
||||
if (rightOff > 0) {
|
||||
this.moveBy(new Point(-rightOff, 0));
|
||||
}
|
||||
topOff = this.fullBounds().top() - aMorph.top();
|
||||
if (topOff < 0) {
|
||||
this.moveBy(new Point(0, -topOff));
|
||||
leftOff = this.fullBounds().left() - aMorph.left();
|
||||
if (leftOff < 0) {
|
||||
this.moveBy(new Point(-leftOff, 0));
|
||||
}
|
||||
bottomOff = this.fullBounds().bottom() - aMorph.bottom();
|
||||
if (bottomOff > 0) {
|
||||
this.moveBy(new Point(0, -bottomOff));
|
||||
}
|
||||
topOff = this.fullBounds().top() - aMorph.top();
|
||||
if (topOff < 0) {
|
||||
this.moveBy(new Point(0, -topOff));
|
||||
}
|
||||
};
|
||||
|
||||
Morph.prototype.scrollIntoView = function () {
|
||||
|
@ -3249,31 +3264,7 @@ Morph.prototype.drawNew = function () {
|
|||
this.image = newCanvas(this.extent());
|
||||
var context = this.image.getContext('2d');
|
||||
context.fillStyle = this.color.toString();
|
||||
|
||||
/*
|
||||
Chrome issue:
|
||||
|
||||
when filling a rectangular area, versions of Chrome beginning with
|
||||
57.0.2987.133 start introducing vertical transparent stripes
|
||||
to the right of the rectangle.
|
||||
The following code replaces the original fillRect() call with
|
||||
an explicit almost-rectangular path that miraculously makes
|
||||
sure the whole rectangle gets filled correctly.
|
||||
|
||||
Important: This needs to be monitored in the future so we can
|
||||
revert to sane code once this Chrome issue has been resolved again.
|
||||
*/
|
||||
|
||||
// context.fillRect(0, 0, this.width(), this.height()); // taken out
|
||||
|
||||
context.beginPath();
|
||||
context.moveTo(0, 0);
|
||||
context.lineTo(this.image.width, 0);
|
||||
context.lineTo(this.image.width, this.image.height);
|
||||
context.lineTo(0, this.image.height + 0.0001); // yeah, I luv Chrome!
|
||||
context.closePath();
|
||||
context.fill();
|
||||
|
||||
context.fillRect(0, 0, this.width(), this.height());
|
||||
if (this.cachedTexture) {
|
||||
this.drawCachedTexture();
|
||||
} else if (this.texture) {
|
||||
|
@ -4843,6 +4834,52 @@ PenMorph.prototype.setHeading = function (degrees) {
|
|||
this.changed();
|
||||
};
|
||||
|
||||
PenMorph.prototype.numericalSetters = function () {
|
||||
// for context menu demo purposes
|
||||
return [
|
||||
'setLeft',
|
||||
'setTop',
|
||||
'setWidth',
|
||||
'setHeight',
|
||||
'setAlphaScaled',
|
||||
'setHeading'
|
||||
];
|
||||
};
|
||||
|
||||
// PenMorph menu:
|
||||
|
||||
PenMorph.prototype.developersMenu = function () {
|
||||
var menu = PenMorph.uber.developersMenu.call(this);
|
||||
menu.addLine();
|
||||
menu.addItem(
|
||||
'set rotation',
|
||||
"setRotation",
|
||||
'interactively turn this morph\nusing a dial widget'
|
||||
);
|
||||
return menu;
|
||||
};
|
||||
|
||||
PenMorph.prototype.setRotation = function () {
|
||||
var menu, dial,
|
||||
name = this.name || this.constructor.name;
|
||||
if (name.length > 10) {
|
||||
name = name.slice(0, 9) + '...';
|
||||
}
|
||||
menu = new MenuMorph(this, name);
|
||||
dial = new DialMorph(null, null, this.heading);
|
||||
dial.rootForGrab = function () {return this; };
|
||||
dial.target = this;
|
||||
dial.action = 'setHeading';
|
||||
menu.items.push(dial);
|
||||
menu.addLine();
|
||||
menu.addItem('(90) right', function () {this.setHeading(90); });
|
||||
menu.addItem('(-90) left', function () {this.setHeading(-90); });
|
||||
menu.addItem('(0) up', function () {this.setHeading(0); });
|
||||
menu.addItem('(180) down', function () {this.setHeading(180); });
|
||||
menu.isDraggable = true;
|
||||
menu.popUpAtHand(this.world());
|
||||
};
|
||||
|
||||
// PenMorph drawing:
|
||||
|
||||
PenMorph.prototype.drawLine = function (start, dest) {
|
||||
|
@ -6245,6 +6282,315 @@ SpeechBubbleMorph.prototype.fixLayout = function () {
|
|||
this.addShadow(new Point(2, 2), 80);
|
||||
};
|
||||
|
||||
// DialMorph //////////////////////////////////////////////////////
|
||||
|
||||
// I am a knob than can be turned to select a number
|
||||
|
||||
var DialMorph;
|
||||
|
||||
// DialMorph inherits from Morph:
|
||||
|
||||
DialMorph.prototype = new Morph();
|
||||
DialMorph.prototype.constructor = DialMorph;
|
||||
DialMorph.uber = Morph.prototype;
|
||||
|
||||
function DialMorph(min, max, value, tick, radius) {
|
||||
this.init(min, max, value, tick, radius);
|
||||
}
|
||||
|
||||
DialMorph.prototype.init = function (min, max, value, tick, radius) {
|
||||
this.target = null;
|
||||
this.action = null;
|
||||
this.min = min || 0;
|
||||
this.max = max || 360;
|
||||
this.value = Math.max(this.min, (value || 0) % this.max);
|
||||
this.tick = tick || 15;
|
||||
this.fillColor = null;
|
||||
|
||||
DialMorph.uber.init.call(this);
|
||||
|
||||
this.color = new Color(230, 230, 230);
|
||||
this.noticesTransparentClick = true;
|
||||
this.setRadius(radius || MorphicPreferences.menuFontSize * 4);
|
||||
};
|
||||
|
||||
DialMorph.prototype.setRadius = function (radius) {
|
||||
this.radius = radius;
|
||||
this.setExtent(new Point(this.radius * 2, this.radius * 2));
|
||||
};
|
||||
|
||||
DialMorph.prototype.setValue = function (value, snapToTick, noUpdate) {
|
||||
var range = this.max - this.min;
|
||||
value = value || 0;
|
||||
this.value = this.min + (((+value % range) + range) % range);
|
||||
if (snapToTick) {
|
||||
if (this.value < this.tick) {
|
||||
this.value = this.min;
|
||||
} else {
|
||||
this.value -= this.value % this.tick % this.value;
|
||||
}
|
||||
}
|
||||
this.drawNew();
|
||||
this.changed();
|
||||
if (noUpdate) {return; }
|
||||
this.updateTarget();
|
||||
};
|
||||
|
||||
DialMorph.prototype.getValueOf = function (point) {
|
||||
var range = this.max - this.min,
|
||||
center = this.center(),
|
||||
deltaX = point.x - center.x,
|
||||
deltaY = center.y - point.y,
|
||||
angle = Math.abs(deltaX) < 0.001 ? (deltaY < 0 ? 90 : 270)
|
||||
: Math.round(
|
||||
(deltaX >= 0 ? 0 : 180)
|
||||
- (Math.atan(deltaY / deltaX) * 57.2957795131)
|
||||
),
|
||||
value = angle + 90 % 360,
|
||||
ratio = value / 360;
|
||||
return range * ratio + this.min;
|
||||
};
|
||||
|
||||
DialMorph.prototype.setExtent = function (aPoint) {
|
||||
var size = Math.min(aPoint.x, aPoint.y);
|
||||
this.radius = size / 2;
|
||||
DialMorph.uber.setExtent.call(this, new Point(size, size));
|
||||
};
|
||||
|
||||
DialMorph.prototype.drawNew = function () {
|
||||
var ctx, i, angle, x1, y1, x2, y2,
|
||||
light = this.color.lighter().toString(),
|
||||
range = this.max - this.min,
|
||||
ticks = range / this.tick,
|
||||
face = this.radius * 0.75,
|
||||
inner = face * 0.85,
|
||||
outer = face * 0.95;
|
||||
|
||||
this.image = newCanvas(this.extent());
|
||||
ctx = this.image.getContext('2d');
|
||||
|
||||
// draw a light border:
|
||||
ctx.fillStyle = light;
|
||||
ctx.beginPath();
|
||||
ctx.arc(
|
||||
this.radius,
|
||||
this.radius,
|
||||
face + Math.min(1, this.radius - face),
|
||||
0,
|
||||
2 * Math.PI,
|
||||
false
|
||||
);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
|
||||
// fill circle:
|
||||
ctx.fillStyle = this.color.toString();
|
||||
ctx.beginPath();
|
||||
ctx.arc(
|
||||
this.radius,
|
||||
this.radius,
|
||||
face,
|
||||
0,
|
||||
2 * Math.PI,
|
||||
false
|
||||
);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
|
||||
// fill value
|
||||
angle = (this.value - this.min) * (Math.PI * 2) / range - Math.PI / 2;
|
||||
ctx.fillStyle = (this.fillColor || this.color.darker()).toString();
|
||||
ctx.beginPath();
|
||||
ctx.arc(
|
||||
this.radius,
|
||||
this.radius,
|
||||
face,
|
||||
Math.PI / -2,
|
||||
angle,
|
||||
false
|
||||
);
|
||||
ctx.lineTo(this.radius, this.radius);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
|
||||
// draw ticks:
|
||||
ctx.strokeStyle = new Color(35, 35, 35).toString();
|
||||
ctx.lineWidth = 1;
|
||||
for (i = 0; i < ticks; i += 1) {
|
||||
angle = (i - 3) * (Math.PI * 2) / ticks - Math.PI / 2;
|
||||
ctx.beginPath();
|
||||
x1 = this.radius + Math.cos(angle) * inner;
|
||||
y1 = this.radius + Math.sin(angle) * inner;
|
||||
x2 = this.radius + Math.cos(angle) * outer;
|
||||
y2 = this.radius + Math.sin(angle) * outer;
|
||||
ctx.moveTo(x1, y1);
|
||||
ctx.lineTo(x2, y2);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
// draw a filled center:
|
||||
inner = face * 0.05;
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.beginPath();
|
||||
ctx.arc(
|
||||
this.radius,
|
||||
this.radius,
|
||||
inner,
|
||||
0,
|
||||
2 * Math.PI,
|
||||
false
|
||||
);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
|
||||
// draw the inner hand:
|
||||
ctx.strokeStyle = 'black';
|
||||
ctx.lineWidth = 1;
|
||||
angle = (this.value - this.min) * (Math.PI * 2) / range - Math.PI / 2;
|
||||
outer = face * 0.8;
|
||||
x1 = this.radius + Math.cos(angle) * inner;
|
||||
y1 = this.radius + Math.sin(angle) * inner;
|
||||
x2 = this.radius + Math.cos(angle) * outer;
|
||||
y2 = this.radius + Math.sin(angle) * outer;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x1, y1);
|
||||
ctx.lineTo(x2, y2);
|
||||
ctx.stroke();
|
||||
|
||||
// draw a read-out circle:
|
||||
inner = inner * 2;
|
||||
x2 = this.radius + Math.cos(angle) * (outer + inner);
|
||||
y2 = this.radius + Math.sin(angle) * (outer + inner);
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.beginPath();
|
||||
ctx.arc(
|
||||
x2,
|
||||
y2,
|
||||
inner,
|
||||
0,
|
||||
2 * Math.PI,
|
||||
false
|
||||
);
|
||||
ctx.closePath();
|
||||
ctx.stroke();
|
||||
|
||||
// draw the outer hand:
|
||||
angle = (this.value - this.min) * (Math.PI * 2) / range - Math.PI / 2;
|
||||
x1 = this.radius + Math.cos(angle) * face;
|
||||
y1 = this.radius + Math.sin(angle) * face;
|
||||
x2 = this.radius + Math.cos(angle) * (this.radius - 1);
|
||||
y2 = this.radius + Math.sin(angle) * (this.radius - 1);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x1, y1);
|
||||
ctx.lineTo(x2, y2);
|
||||
ctx.lineWidth = 3;
|
||||
ctx.strokeStyle = light;
|
||||
ctx.stroke();
|
||||
ctx.lineWidth = 1;
|
||||
ctx.strokeStyle = 'black';
|
||||
ctx.stroke();
|
||||
|
||||
// draw arrow tip:
|
||||
angle = radians(degrees(angle) - 4);
|
||||
x1 = this.radius + Math.cos(angle) * this.radius * 0.9;
|
||||
y1 = this.radius + Math.sin(angle) * this.radius * 0.9;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x1, y1);
|
||||
angle = radians(degrees(angle) + 8);
|
||||
x1 = this.radius + Math.cos(angle) * this.radius * 0.9;
|
||||
y1 = this.radius + Math.sin(angle) * this.radius * 0.9;
|
||||
ctx.lineTo(x1, y1);
|
||||
ctx.lineTo(x2, y2);
|
||||
ctx.closePath();
|
||||
ctx.lineWidth = 3;
|
||||
ctx.strokeStyle = light;
|
||||
ctx.stroke();
|
||||
ctx.lineWidth = 1;
|
||||
ctx.strokeStyle = 'black';
|
||||
ctx.stroke();
|
||||
ctx.fill();
|
||||
};
|
||||
|
||||
// DialMorph stepping:
|
||||
|
||||
DialMorph.prototype.step = null;
|
||||
|
||||
DialMorph.prototype.mouseDownLeft = function (pos) {
|
||||
var world, myself = this;
|
||||
world = this.root();
|
||||
this.step = function () {
|
||||
if (world.hand.mouseButton) {
|
||||
myself.setValue(
|
||||
myself.getValueOf(world.hand.bounds.origin),
|
||||
world.currentKey !== 16 // snap to tick
|
||||
);
|
||||
} else {
|
||||
this.step = null;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// DialMorph menu:
|
||||
|
||||
DialMorph.prototype.developersMenu = function () {
|
||||
var menu = DialMorph.uber.developersMenu.call(this);
|
||||
menu.addLine();
|
||||
menu.addItem(
|
||||
'set target',
|
||||
"setTarget",
|
||||
'select another morph\nwhose numerical property\nwill be ' +
|
||||
'controlled by this one'
|
||||
);
|
||||
return menu;
|
||||
};
|
||||
|
||||
DialMorph.prototype.setTarget = function () {
|
||||
var choices = this.overlappedMorphs(),
|
||||
menu = new MenuMorph(this, 'choose target:'),
|
||||
myself = this;
|
||||
|
||||
choices.push(this.world());
|
||||
choices.forEach(function (each) {
|
||||
menu.addItem(each.toString().slice(0, 50), function () {
|
||||
myself.target = each;
|
||||
myself.setTargetSetter();
|
||||
});
|
||||
});
|
||||
if (choices.length === 1) {
|
||||
this.target = choices[0];
|
||||
this.setTargetSetter();
|
||||
} else if (choices.length > 0) {
|
||||
menu.popUpAtHand(this.world());
|
||||
}
|
||||
};
|
||||
|
||||
DialMorph.prototype.setTargetSetter = function () {
|
||||
var choices = this.target.numericalSetters(),
|
||||
menu = new MenuMorph(this, 'choose target property:'),
|
||||
myself = this;
|
||||
|
||||
choices.forEach(function (each) {
|
||||
menu.addItem(each, function () {
|
||||
myself.action = each;
|
||||
});
|
||||
});
|
||||
if (choices.length === 1) {
|
||||
this.action = choices[0];
|
||||
} else if (choices.length > 0) {
|
||||
menu.popUpAtHand(this.world());
|
||||
}
|
||||
};
|
||||
|
||||
DialMorph.prototype.updateTarget = function () {
|
||||
if (this.action) {
|
||||
if (typeof this.action === 'function') {
|
||||
this.action.call(this.target, this.value);
|
||||
} else { // assume it's a String
|
||||
this.target[this.action](this.value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// CircleBoxMorph //////////////////////////////////////////////////////
|
||||
|
||||
// I can be used for sliders
|
||||
|
@ -7672,7 +8018,8 @@ MenuMorph.prototype.drawNew = function () {
|
|||
isLine = false;
|
||||
if (tuple instanceof StringFieldMorph ||
|
||||
tuple instanceof ColorPickerMorph ||
|
||||
tuple instanceof SliderMorph) {
|
||||
tuple instanceof SliderMorph ||
|
||||
tuple instanceof DialMorph) {
|
||||
item = tuple;
|
||||
} else if (tuple[0] === 0) {
|
||||
isLine = true;
|
||||
|
@ -7729,7 +8076,8 @@ MenuMorph.prototype.maxWidth = function () {
|
|||
);
|
||||
} else if ((item instanceof StringFieldMorph) ||
|
||||
(item instanceof ColorPickerMorph) ||
|
||||
(item instanceof SliderMorph)) {
|
||||
(item instanceof SliderMorph) ||
|
||||
(item instanceof DialMorph)) {
|
||||
w = Math.max(w, item.width());
|
||||
}
|
||||
});
|
||||
|
@ -7744,7 +8092,9 @@ MenuMorph.prototype.adjustWidths = function () {
|
|||
isSelected,
|
||||
myself = this;
|
||||
this.children.forEach(function (item) {
|
||||
item.silentSetWidth(w);
|
||||
if (!(item instanceof DialMorph)) {
|
||||
item.silentSetWidth(w);
|
||||
}
|
||||
if (item instanceof MenuItemMorph) {
|
||||
item.fixLayout();
|
||||
isSelected = (item.image === item.pressImage);
|
||||
|
@ -7769,16 +8119,38 @@ MenuMorph.prototype.unselectAllItems = function () {
|
|||
this.children.forEach(function (item) {
|
||||
if (item instanceof MenuItemMorph) {
|
||||
item.image = item.normalImage;
|
||||
} else if (item instanceof ScrollFrameMorph) {
|
||||
item.contents.children.forEach(function (morph) {
|
||||
if (morph instanceof MenuItemMorph) {
|
||||
morph.image = morph.normalImage;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
this.changed();
|
||||
};
|
||||
|
||||
// MenuMorph popping up
|
||||
|
||||
MenuMorph.prototype.popup = function (world, pos) {
|
||||
var scroller;
|
||||
|
||||
this.drawNew();
|
||||
this.setPosition(pos);
|
||||
this.addShadow(new Point(2, 2), 80);
|
||||
this.keepWithin(world);
|
||||
|
||||
if (this.bottom() > world.bottom()) {
|
||||
// scroll menu items if the menu is taller than the world
|
||||
this.removeShadow();
|
||||
scroller = this.scroll();
|
||||
this.bounds.corner.y = world.bottom() - 2;
|
||||
MenuMorph.uber.drawNew.call(this);
|
||||
this.addShadow(new Point(2, 2), 80);
|
||||
scroller.setHeight(world.bottom() - scroller.top() - 6);
|
||||
scroller.adjustScrollBars(); // ?
|
||||
}
|
||||
|
||||
if (world.activeMenu) {
|
||||
world.activeMenu.destroy();
|
||||
}
|
||||
|
@ -7791,6 +8163,21 @@ MenuMorph.prototype.popup = function (world, pos) {
|
|||
this.fullChanged();
|
||||
};
|
||||
|
||||
MenuMorph.prototype.scroll = function () {
|
||||
// private - move all items into a scroll frame
|
||||
var scroller = new ScrollFrameMorph(),
|
||||
start = this.label ? 1 : 0,
|
||||
first = this.children[start];
|
||||
|
||||
scroller.setPosition(first.position());
|
||||
this.children.slice(start).forEach(function (morph) {
|
||||
scroller.addContents(morph);
|
||||
});
|
||||
this.add(scroller);
|
||||
scroller.setWidth(first.width());
|
||||
return scroller;
|
||||
};
|
||||
|
||||
MenuMorph.prototype.popUpAtHand = function (world) {
|
||||
var wrrld = world || this.world;
|
||||
this.popup(wrrld, wrrld.hand.position());
|
||||
|
@ -7881,21 +8268,31 @@ MenuMorph.prototype.processKeyPress = function (event) {
|
|||
};
|
||||
|
||||
MenuMorph.prototype.selectFirst = function () {
|
||||
var i;
|
||||
for (i = 0; i < this.children.length; i += 1) {
|
||||
if (this.children[i] instanceof MenuItemMorph) {
|
||||
this.select(this.children[i]);
|
||||
var scroller, items, i;
|
||||
|
||||
scroller = detect(this.children, function (morph) {
|
||||
return morph instanceof ScrollFrameMorph;
|
||||
});
|
||||
items = scroller ? scroller.contents.children : this.children;
|
||||
for (i = 0; i < items.length; i += 1) {
|
||||
if (items[i] instanceof MenuItemMorph) {
|
||||
this.select(items[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MenuMorph.prototype.selectUp = function () {
|
||||
var triggers, idx;
|
||||
var scroller, triggers, idx;
|
||||
|
||||
triggers = this.children.filter(function (each) {
|
||||
return each instanceof MenuItemMorph;
|
||||
scroller = detect(this.children, function (morph) {
|
||||
return morph instanceof ScrollFrameMorph;
|
||||
});
|
||||
triggers = (scroller ? scroller.contents.children : this.children).filter(
|
||||
function (each) {
|
||||
return each instanceof MenuItemMorph;
|
||||
}
|
||||
);
|
||||
if (!this.selection) {
|
||||
if (triggers.length) {
|
||||
this.select(triggers[0]);
|
||||
|
@ -7910,11 +8307,16 @@ MenuMorph.prototype.selectUp = function () {
|
|||
};
|
||||
|
||||
MenuMorph.prototype.selectDown = function () {
|
||||
var triggers, idx;
|
||||
var scroller, triggers, idx;
|
||||
|
||||
triggers = this.children.filter(function (each) {
|
||||
return each instanceof MenuItemMorph;
|
||||
scroller = detect(this.children, function (morph) {
|
||||
return morph instanceof ScrollFrameMorph;
|
||||
});
|
||||
triggers = (scroller ? scroller.contents.children : this.children).filter(
|
||||
function (each) {
|
||||
return each instanceof MenuItemMorph;
|
||||
}
|
||||
);
|
||||
if (!this.selection) {
|
||||
if (triggers.length) {
|
||||
this.select(triggers[0]);
|
||||
|
@ -7951,6 +8353,7 @@ MenuMorph.prototype.select = function (aMenuItem) {
|
|||
this.unselectAllItems();
|
||||
aMenuItem.image = aMenuItem.highlightImage;
|
||||
aMenuItem.changed();
|
||||
aMenuItem.scrollIntoView();
|
||||
this.selection = aMenuItem;
|
||||
};
|
||||
|
||||
|
@ -9620,7 +10023,7 @@ MenuItemMorph.prototype.mouseLeave = function () {
|
|||
|
||||
MenuItemMorph.prototype.mouseDownLeft = function (pos) {
|
||||
if (this.isListItem()) {
|
||||
this.parent.unselectAllItems();
|
||||
this.parentThatIsA(MenuMorph).unselectAllItems();
|
||||
this.escalateEvent('mouseDownLeft', pos);
|
||||
}
|
||||
this.image = this.pressImage;
|
||||
|
@ -9638,7 +10041,7 @@ MenuItemMorph.prototype.mouseClickLeft = function () {
|
|||
this.popUpSubmenu();
|
||||
} else {
|
||||
if (!this.isListItem()) {
|
||||
this.parent.closeRootMenu();
|
||||
this.parentThatIsA(MenuMorph).closeRootMenu();
|
||||
this.world().activeMenu = null;
|
||||
}
|
||||
this.trigger();
|
||||
|
@ -9646,8 +10049,9 @@ MenuItemMorph.prototype.mouseClickLeft = function () {
|
|||
};
|
||||
|
||||
MenuItemMorph.prototype.isListItem = function () {
|
||||
if (this.parent) {
|
||||
return this.parent.isListContents;
|
||||
var menu = this.parentThatIsA(MenuMorph);
|
||||
if (menu) {
|
||||
return menu.isListContents;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
@ -10691,7 +11095,9 @@ HandMorph.prototype.grab = function (aMorph) {
|
|||
if (this.children.length === 0) {
|
||||
this.world.stopEditing();
|
||||
this.grabOrigin = aMorph.situation();
|
||||
aMorph.addShadow();
|
||||
if (!(aMorph instanceof MenuMorph)) {
|
||||
aMorph.addShadow();
|
||||
}
|
||||
if (aMorph.prepareToBeGrabbed) {
|
||||
aMorph.prepareToBeGrabbed(this);
|
||||
}
|
||||
|
@ -10716,7 +11122,9 @@ HandMorph.prototype.drop = function () {
|
|||
morphToDrop.cachedFullImage = null;
|
||||
morphToDrop.cachedFullBounds = null;
|
||||
morphToDrop.changed();
|
||||
morphToDrop.removeShadow();
|
||||
if (!(morphToDrop instanceof MenuMorph)) {
|
||||
morphToDrop.removeShadow();
|
||||
}
|
||||
this.children = [];
|
||||
this.setExtent(new Point());
|
||||
if (morphToDrop.justDropped) {
|
||||
|
@ -10923,6 +11331,7 @@ HandMorph.prototype.processMouseMove = function (event) {
|
|||
this.morphToGrab.selectForEdit() : this.morphToGrab;
|
||||
this.grab(morph);
|
||||
} else if (this.morphToGrab.isTemplate) {
|
||||
this.world.stopEditing();
|
||||
morph = this.morphToGrab.fullCopy();
|
||||
morph.isTemplate = false;
|
||||
morph.isDraggable = true;
|
||||
|
@ -11840,6 +12249,10 @@ WorldMorph.prototype.userCreateMorph = function () {
|
|||
menu.addItem('slider', function () {
|
||||
create(new SliderMorph());
|
||||
});
|
||||
menu.addItem('dial', function () {
|
||||
newMorph = new DialMorph();
|
||||
newMorph.pickUp(this);
|
||||
});
|
||||
menu.addItem('frame', function () {
|
||||
newMorph = new FrameMorph();
|
||||
newMorph.setExtent(new Point(350, 250));
|
||||
|
|
303
objects.js
303
objects.js
|
@ -9,7 +9,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -81,9 +81,9 @@ modules, IDE_Morph, VariableDialogMorph, HTMLCanvasElement, Context, List,
|
|||
SpeechBubbleMorph, RingMorph, isNil, FileReader, TableDialogMorph,
|
||||
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
|
||||
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph,
|
||||
AlignmentMorph*/
|
||||
AlignmentMorph, Process, XML_Element, VectorPaintEditorMorph*/
|
||||
|
||||
modules.objects = '2017-October-28';
|
||||
modules.objects = '2018-July-06';
|
||||
|
||||
var SpriteMorph;
|
||||
var StageMorph;
|
||||
|
@ -573,16 +573,6 @@ SpriteMorph.prototype.initBlocks = function () {
|
|||
category: 'control',
|
||||
spec: 'when %keyHat key pressed'
|
||||
},
|
||||
|
||||
/* migrated to a newer block version:
|
||||
|
||||
receiveClick: {
|
||||
type: 'hat',
|
||||
category: 'control',
|
||||
spec: 'when I am clicked'
|
||||
},
|
||||
*/
|
||||
|
||||
receiveInteraction: {
|
||||
type: 'hat',
|
||||
category: 'control',
|
||||
|
@ -696,25 +686,6 @@ SpriteMorph.prototype.initBlocks = function () {
|
|||
category: 'control',
|
||||
spec: 'call %repRing %inputs'
|
||||
},
|
||||
/*
|
||||
doRunWithInputList: {
|
||||
type: 'command',
|
||||
category: 'control',
|
||||
spec: 'run %cmd with input list %l'
|
||||
},
|
||||
|
||||
forkWithInputList: {
|
||||
type: 'command',
|
||||
category: 'control',
|
||||
spec: 'launch %cmd with input list %l'
|
||||
},
|
||||
|
||||
evaluateWithInputList: {
|
||||
type: 'reporter',
|
||||
category: 'control',
|
||||
spec: 'call %r with input list %l'
|
||||
},
|
||||
*/
|
||||
doReport: {
|
||||
type: 'command',
|
||||
category: 'control',
|
||||
|
@ -745,15 +716,13 @@ SpriteMorph.prototype.initBlocks = function () {
|
|||
|
||||
// Message passing - very experimental
|
||||
|
||||
doTellTo: { // under construction +++
|
||||
dev: true,
|
||||
doTellTo: {
|
||||
type: 'command',
|
||||
category: 'control',
|
||||
// spec: 'tell %spr to %cl' // I liked this version much better, -Jens
|
||||
spec: 'tell %spr to %cmdRing %inputs'
|
||||
},
|
||||
reportAskFor: {
|
||||
dev: true,
|
||||
type: 'reporter',
|
||||
category: 'control',
|
||||
spec: 'ask %spr for %repRing %inputs'
|
||||
|
@ -872,11 +841,20 @@ SpriteMorph.prototype.initBlocks = function () {
|
|||
category: 'sensing',
|
||||
spec: 'key %key pressed?'
|
||||
},
|
||||
reportDistanceTo: {
|
||||
/*
|
||||
reportDistanceTo: { // has been superseded by reportRelationTo
|
||||
type: 'reporter',
|
||||
category: 'sensing',
|
||||
spec: 'distance to %dst'
|
||||
},
|
||||
*/
|
||||
reportRelationTo: {
|
||||
only: SpriteMorph,
|
||||
type: 'reporter',
|
||||
category: 'sensing',
|
||||
spec: '%rel to %dst',
|
||||
defaults: [['distance']]
|
||||
},
|
||||
doResetTimer: {
|
||||
type: 'command',
|
||||
category: 'sensing',
|
||||
|
@ -1042,7 +1020,7 @@ SpriteMorph.prototype.initBlocks = function () {
|
|||
reportLetter: {
|
||||
type: 'reporter',
|
||||
category: 'operators',
|
||||
spec: 'letter %n of %s',
|
||||
spec: 'letter %idx of %s',
|
||||
defaults: [1, localize('world')]
|
||||
},
|
||||
reportStringSize: {
|
||||
|
@ -1099,6 +1077,12 @@ SpriteMorph.prototype.initBlocks = function () {
|
|||
spec: '%txtfun of %s',
|
||||
defaults: [null, "Abelson & Sussman"]
|
||||
},
|
||||
reportCompiled: { // experimental
|
||||
type: 'reporter',
|
||||
category: 'operators',
|
||||
spec: 'compile %repRing for %n args',
|
||||
defaults: [null, 0]
|
||||
},
|
||||
|
||||
/*
|
||||
reportScript: {
|
||||
|
@ -1310,6 +1294,11 @@ SpriteMorph.prototype.initBlockMigrations = function () {
|
|||
selector: 'doMapValueCode',
|
||||
inputs: [['String'], '<#1>'],
|
||||
offset: 1
|
||||
},
|
||||
reportDistanceTo: {
|
||||
selector: 'reportRelationTo',
|
||||
inputs: [['distance']],
|
||||
offset: 1
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -1766,11 +1755,12 @@ SpriteMorph.prototype.blockForSelector = function (selector, setDefaults) {
|
|||
return block;
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.variableBlock = function (varName) {
|
||||
SpriteMorph.prototype.variableBlock = function (varName, isLocalTemplate) {
|
||||
var block = new ReporterBlockMorph(false);
|
||||
block.selector = 'reportGetVar';
|
||||
block.color = this.blockColor.variables;
|
||||
block.category = 'variables';
|
||||
block.isLocalVarTemplate = isLocalTemplate;
|
||||
block.setSpec(varName);
|
||||
block.isDraggable = true;
|
||||
return block;
|
||||
|
@ -1793,8 +1783,8 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
|||
return newBlock;
|
||||
}
|
||||
|
||||
function variableBlock(varName) {
|
||||
var newBlock = SpriteMorph.prototype.variableBlock(varName);
|
||||
function variableBlock(varName, isLocal) {
|
||||
var newBlock = SpriteMorph.prototype.variableBlock(varName, isLocal);
|
||||
newBlock.isDraggable = false;
|
||||
newBlock.isTemplate = true;
|
||||
if (contains(inheritedVars, varName)) {
|
||||
|
@ -2058,7 +2048,7 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push('-');
|
||||
blocks.push(block('reportKeyPressed'));
|
||||
blocks.push('-');
|
||||
blocks.push(block('reportDistanceTo'));
|
||||
blocks.push(block('reportRelationTo'));
|
||||
blocks.push('-');
|
||||
blocks.push(block('doResetTimer'));
|
||||
blocks.push(watcherToggle('getTimer'));
|
||||
|
@ -2142,6 +2132,9 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
|||
if (true) { // (Process.prototype.enableJS) {
|
||||
blocks.push('-');
|
||||
blocks.push(block('reportJSFunction'));
|
||||
if (Process.prototype.enableCompiling) {
|
||||
blocks.push(block('reportCompiled'));
|
||||
}
|
||||
}
|
||||
|
||||
// for debugging: ///////////////
|
||||
|
@ -2210,7 +2203,7 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
|||
|
||||
blocks.push('-');
|
||||
|
||||
varNames = this.variables.allNames();
|
||||
varNames = this.reachableGlobalVariableNames(true);
|
||||
if (varNames.length > 0) {
|
||||
varNames.forEach(function (name) {
|
||||
blocks.push(variableWatcherToggle(name));
|
||||
|
@ -2219,6 +2212,15 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push('-');
|
||||
}
|
||||
|
||||
varNames = this.allLocalVariableNames(true);
|
||||
if (varNames.length > 0) {
|
||||
varNames.forEach(function (name) {
|
||||
blocks.push(variableWatcherToggle(name));
|
||||
blocks.push(variableBlock(name, true));
|
||||
});
|
||||
blocks.push('-');
|
||||
}
|
||||
|
||||
blocks.push(block('doSetVar'));
|
||||
blocks.push(block('doChangeVar'));
|
||||
blocks.push(block('doShowVar'));
|
||||
|
@ -2689,7 +2691,7 @@ SpriteMorph.prototype.blocksMatching = function (
|
|||
[this.customBlocks, stage.globalBlocks].forEach(function (blocksList) {
|
||||
blocksList.forEach(function (definition) {
|
||||
if (contains(types, definition.type)) {
|
||||
var spec = localize(definition.blockSpec()).toLowerCase(),
|
||||
var spec = definition.localizedSpec().toLowerCase(),
|
||||
rel = relevance(labelOf(spec), search);
|
||||
if (rel !== -1) {
|
||||
blocks.push([definition.templateInstance(), rel + '2']);
|
||||
|
@ -3232,6 +3234,7 @@ SpriteMorph.prototype.userMenu = function () {
|
|||
}
|
||||
menu.addItem("delete", 'remove');
|
||||
menu.addItem("move", 'moveCenter');
|
||||
menu.addItem("rotate", 'setRotation');
|
||||
if (this.costume) {
|
||||
menu.addItem(
|
||||
"pivot",
|
||||
|
@ -3387,10 +3390,15 @@ SpriteMorph.prototype.initClone = function (hats) {
|
|||
};
|
||||
|
||||
SpriteMorph.prototype.removeClone = function () {
|
||||
var exemplar = this.exemplar;
|
||||
var exemplar = this.exemplar,
|
||||
myself = this;
|
||||
if (this.isTemporary) {
|
||||
// this.stopTalking();
|
||||
this.parent.threads.stopAllForReceiver(this);
|
||||
this.parts.slice().forEach(function (part) {
|
||||
myself.detachPart(part);
|
||||
part.removeClone();
|
||||
});
|
||||
this.corpsify();
|
||||
this.instances.forEach(function (child) {
|
||||
if (child.isTemporary) {
|
||||
|
@ -4421,9 +4429,20 @@ SpriteMorph.prototype.setPosition = function (aPoint, justMe) {
|
|||
|
||||
SpriteMorph.prototype.forward = function (steps) {
|
||||
var dest,
|
||||
dist = steps * this.parent.scale || 0;
|
||||
dist = steps * this.parent.scale || 0,
|
||||
dot = 0.1;
|
||||
|
||||
if (dist >= 0) {
|
||||
if (dist === 0 && this.isDown) { // draw a dot
|
||||
// dot = Math.min(this.size, 1);
|
||||
this.isDown = false;
|
||||
this.forward(dot * -0.5);
|
||||
this.isDown = true;
|
||||
this.forward(dot);
|
||||
this.isDown = false;
|
||||
this.forward(dot * -0.5);
|
||||
this.isDown = true;
|
||||
return;
|
||||
} else if (dist >= 0) {
|
||||
dest = this.position().distanceAngle(dist, this.heading);
|
||||
} else {
|
||||
dest = this.position().distanceAngle(
|
||||
|
@ -4479,6 +4498,10 @@ SpriteMorph.prototype.setHeading = function (degrees, noShadow) {
|
|||
};
|
||||
|
||||
SpriteMorph.prototype.faceToXY = function (x, y) {
|
||||
this.setHeading(this.angleToXY(x, y));
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.angleToXY = function (x, y) {
|
||||
var deltaX = (x - this.xPosition()) * this.parent.scale,
|
||||
deltaY = (y - this.yPosition()) * this.parent.scale,
|
||||
angle = Math.abs(deltaX) < 0.001 ? (deltaY < 0 ? 90 : 270)
|
||||
|
@ -4486,7 +4509,7 @@ SpriteMorph.prototype.faceToXY = function (x, y) {
|
|||
(deltaX >= 0 ? 0 : 180)
|
||||
- (Math.atan(deltaY / deltaX) * 57.2957795131)
|
||||
);
|
||||
this.setHeading(angle + 90);
|
||||
return angle + 90;
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.turn = function (degrees) {
|
||||
|
@ -4830,7 +4853,15 @@ SpriteMorph.prototype.mouseDownLeft = function () {
|
|||
return this.receiveUserInteraction('pressed');
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.receiveUserInteraction = function (interaction) {
|
||||
SpriteMorph.prototype.mouseScroll = function (y) {
|
||||
return this.receiveUserInteraction('scrolled-' + (y > 0 ? 'up' : 'down'));
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.receiveUserInteraction = function (
|
||||
interaction,
|
||||
rightAway,
|
||||
threadSafe
|
||||
) {
|
||||
var stage = this.parentThatIsA(StageMorph),
|
||||
procs = [],
|
||||
myself = this,
|
||||
|
@ -4841,7 +4872,12 @@ SpriteMorph.prototype.receiveUserInteraction = function (interaction) {
|
|||
procs.push(stage.threads.startProcess(
|
||||
block,
|
||||
myself,
|
||||
stage.isThreadSafe
|
||||
threadSafe || stage.isThreadSafe,
|
||||
null, // export result
|
||||
null, // callback
|
||||
null, // is clicked
|
||||
rightAway, // immediately
|
||||
interaction === 'stopped' // atomic
|
||||
));
|
||||
});
|
||||
return procs;
|
||||
|
@ -5748,6 +5784,41 @@ SpriteMorph.prototype.hasSpriteVariable = function (varName) {
|
|||
return contains(this.variables.names(), varName);
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.allLocalVariableNames = function (sorted) {
|
||||
var exceptGlobals = this.globalVariables(),
|
||||
globalNames = exceptGlobals.names(),
|
||||
data;
|
||||
|
||||
function alphabetically(x, y) {
|
||||
return x.toLowerCase() < y.toLowerCase() ? -1 : 1;
|
||||
}
|
||||
|
||||
data = this.variables.allNames(exceptGlobals).filter(function (each) {
|
||||
return !contains(globalNames, each);
|
||||
});
|
||||
if (sorted) {
|
||||
data.sort(alphabetically);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.reachableGlobalVariableNames = function (sorted) {
|
||||
var locals = this.allLocalVariableNames(),
|
||||
data;
|
||||
|
||||
function alphabetically(x, y) {
|
||||
return x.toLowerCase() < y.toLowerCase() ? -1 : 1;
|
||||
}
|
||||
|
||||
data = this.globalVariables().names().filter(function (each) {
|
||||
return !contains(locals, each);
|
||||
});
|
||||
if (sorted) {
|
||||
data.sort(alphabetically);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
// SpriteMorph inheritance - custom blocks
|
||||
|
||||
SpriteMorph.prototype.getMethod = function (spec) {
|
||||
|
@ -6517,6 +6588,26 @@ StageMorph.prototype.colorFiltered = function (aColor, excludedSprite) {
|
|||
return morph;
|
||||
};
|
||||
|
||||
// StageMorph pixel access:
|
||||
|
||||
StageMorph.prototype.getPixelColor = function (aPoint) {
|
||||
var point, context, data;
|
||||
if (this.trailsCanvas) {
|
||||
point = aPoint.subtract(this.bounds.origin);
|
||||
context = this.trailsCanvas.getContext('2d');
|
||||
data = context.getImageData(point.x, point.y, 1, 1);
|
||||
if (data.data[3] === 0) {
|
||||
return StageMorph.uber.getPixelColor.call(this, aPoint);
|
||||
}
|
||||
return new Color(
|
||||
data.data[0],
|
||||
data.data[1],
|
||||
data.data[2],
|
||||
data.data[3] / 255
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// StageMorph accessing
|
||||
|
||||
StageMorph.prototype.watchers = function (leftPos) {
|
||||
|
@ -6613,6 +6704,7 @@ StageMorph.prototype.step = function () {
|
|||
// handle keyboard events
|
||||
if (world.keyboardReceiver === null) {
|
||||
world.keyboardReceiver = this;
|
||||
world.worldCanvas.focus(); // addresses a Safari 11 bug
|
||||
}
|
||||
if (world.currentKey === null) {
|
||||
this.keyPressed = null;
|
||||
|
@ -6763,7 +6855,7 @@ StageMorph.prototype.fireKeyEvent = function (key) {
|
|||
myself = this;
|
||||
|
||||
this.keysPressed[evt] = true;
|
||||
if (evt === 'ctrl enter') {
|
||||
if (evt === 'ctrl enter' && !ide.isAppMode) {
|
||||
return this.fireGreenFlagEvent();
|
||||
}
|
||||
if (evt === 'shift enter') {
|
||||
|
@ -6797,7 +6889,7 @@ StageMorph.prototype.fireKeyEvent = function (key) {
|
|||
if (!ide.isAppMode) {return ide.saveProjectsBrowser(); }
|
||||
return;
|
||||
}
|
||||
if (evt === 'esc') {
|
||||
if (evt === 'esc' && !ide.isAppMode) {
|
||||
return this.fireStopAllEvent();
|
||||
}
|
||||
this.children.concat(this).forEach(function (morph) {
|
||||
|
@ -6806,7 +6898,7 @@ StageMorph.prototype.fireKeyEvent = function (key) {
|
|||
procs.push(myself.threads.startProcess(
|
||||
block,
|
||||
morph,
|
||||
myself.isThreadSafe
|
||||
true // ignore running scripts, was: myself.isThreadSafe
|
||||
));
|
||||
});
|
||||
}
|
||||
|
@ -6849,9 +6941,15 @@ StageMorph.prototype.fireGreenFlagEvent = function () {
|
|||
|
||||
StageMorph.prototype.fireStopAllEvent = function () {
|
||||
var ide = this.parentThatIsA(IDE_Morph);
|
||||
|
||||
this.threads.resumeAll(this.stage);
|
||||
|
||||
// experimental: run one step of a user-defined script
|
||||
this.runStopScripts();
|
||||
|
||||
this.keysPressed = {};
|
||||
this.threads.stopAll();
|
||||
|
||||
this.stopAllActiveSounds();
|
||||
this.children.forEach(function (morph) {
|
||||
if (morph.stopTalking) {
|
||||
|
@ -6867,6 +6965,17 @@ StageMorph.prototype.fireStopAllEvent = function () {
|
|||
}
|
||||
};
|
||||
|
||||
StageMorph.prototype.runStopScripts = function () {
|
||||
// experimental: Allow each sprite to run one last step before termination
|
||||
// usage example: Stop a robot or device associated with the sprite
|
||||
this.receiveUserInteraction('stopped', true, true);
|
||||
this.children.forEach(function (morph) {
|
||||
if (morph instanceof SpriteMorph) {
|
||||
morph.receiveUserInteraction('stopped', true, true);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
StageMorph.prototype.removeAllClones = function () {
|
||||
var myself = this,
|
||||
clones = this.children.filter(
|
||||
|
@ -6919,13 +7028,14 @@ StageMorph.prototype.blockTemplates = function (category) {
|
|||
return newBlock;
|
||||
}
|
||||
|
||||
function variableBlock(varName) {
|
||||
var newBlock = SpriteMorph.prototype.variableBlock(varName);
|
||||
function variableBlock(varName, isLocal) {
|
||||
var newBlock = SpriteMorph.prototype.variableBlock(varName, isLocal);
|
||||
newBlock.isDraggable = false;
|
||||
newBlock.isTemplate = true;
|
||||
return newBlock;
|
||||
}
|
||||
|
||||
|
||||
function watcherToggle(selector) {
|
||||
if (myself.hiddenPrimitives[selector]) {
|
||||
return null;
|
||||
|
@ -7082,7 +7192,10 @@ StageMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push(block('doStopAll'));
|
||||
*/
|
||||
blocks.push(block('doStopThis'));
|
||||
/*
|
||||
// migrated to doStopThis, now redundant
|
||||
blocks.push(block('doStopOthers'));
|
||||
*/
|
||||
blocks.push('-');
|
||||
blocks.push(block('doRun'));
|
||||
blocks.push(block('fork'));
|
||||
|
@ -7197,6 +7310,9 @@ StageMorph.prototype.blockTemplates = function (category) {
|
|||
if (true) { // (Process.prototype.enableJS) {
|
||||
blocks.push('-');
|
||||
blocks.push(block('reportJSFunction'));
|
||||
if (Process.prototype.enableCompiling) {
|
||||
blocks.push(block('reportCompiled'));
|
||||
}
|
||||
}
|
||||
|
||||
// for debugging: ///////////////
|
||||
|
@ -7259,7 +7375,7 @@ StageMorph.prototype.blockTemplates = function (category) {
|
|||
|
||||
blocks.push('-');
|
||||
|
||||
varNames = this.variables.allNames();
|
||||
varNames = this.reachableGlobalVariableNames(true);
|
||||
if (varNames.length > 0) {
|
||||
varNames.forEach(function (name) {
|
||||
blocks.push(variableWatcherToggle(name));
|
||||
|
@ -7268,6 +7384,15 @@ StageMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push('-');
|
||||
}
|
||||
|
||||
varNames = this.allLocalVariableNames(true);
|
||||
if (varNames.length > 0) {
|
||||
varNames.forEach(function (name) {
|
||||
blocks.push(variableWatcherToggle(name));
|
||||
blocks.push(variableBlock(name, true));
|
||||
});
|
||||
blocks.push('-');
|
||||
}
|
||||
|
||||
blocks.push(block('doSetVar'));
|
||||
blocks.push(block('doChangeVar'));
|
||||
blocks.push(block('doShowVar'));
|
||||
|
@ -7622,6 +7747,9 @@ StageMorph.prototype.mouseLeave = function () {
|
|||
StageMorph.prototype.mouseDownLeft
|
||||
= SpriteMorph.prototype.mouseDownLeft;
|
||||
|
||||
StageMorph.prototype.mouseScroll
|
||||
= SpriteMorph.prototype.mouseScroll;
|
||||
|
||||
StageMorph.prototype.receiveUserInteraction
|
||||
= SpriteMorph.prototype.receiveUserInteraction;
|
||||
|
||||
|
@ -7690,6 +7818,12 @@ StageMorph.prototype.inheritedVariableNames = function () {
|
|||
return [];
|
||||
};
|
||||
|
||||
StageMorph.prototype.allLocalVariableNames
|
||||
= SpriteMorph.prototype.allLocalVariableNames;
|
||||
|
||||
StageMorph.prototype.reachableGlobalVariableNames
|
||||
= SpriteMorph.prototype.reachableGlobalVariableNames;
|
||||
|
||||
// StageMorph inheritance - custom blocks
|
||||
|
||||
StageMorph.prototype.getMethod
|
||||
|
@ -8186,7 +8320,8 @@ Costume.prototype.edit = function (aWorld, anIDE, isnew, oncancel, onsubmit) {
|
|||
anIDE.hasChangedMedia = true;
|
||||
}
|
||||
(onsubmit || nop)();
|
||||
}
|
||||
},
|
||||
anIDE
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -8290,6 +8425,7 @@ SVG_Costume.uber = Costume.prototype;
|
|||
|
||||
function SVG_Costume(svgImage, name, rotationCenter) {
|
||||
this.contents = svgImage;
|
||||
this.shapes = [];
|
||||
this.shrinkToFit(this.maxExtent());
|
||||
this.name = name || null;
|
||||
this.rotationCenter = rotationCenter || this.center();
|
||||
|
@ -8309,6 +8445,7 @@ SVG_Costume.prototype.copy = function () {
|
|||
img.src = this.contents.src;
|
||||
cpy = new SVG_Costume(img, this.name ? copy(this.name) : null);
|
||||
cpy.rotationCenter = this.rotationCenter.copy();
|
||||
cpy.shapes = this.shapes.map(function (shape) { return shape.copy(); });
|
||||
return cpy;
|
||||
};
|
||||
|
||||
|
@ -8329,6 +8466,60 @@ SVG_Costume.prototype.shrinkToFit = function (extentPoint) {
|
|||
return;
|
||||
};
|
||||
|
||||
SVG_Costume.prototype.parseShapes = function () {
|
||||
// I try to parse my SVG as an editable collection of shapes
|
||||
var element = new XML_Element(),
|
||||
// remove 'data:image/svg+xml, ' from src
|
||||
contents = this.contents.src.replace(/^data:image\/.*?, */, '');
|
||||
|
||||
if (this.contents.src.indexOf('base64') > -1) {
|
||||
contents = atob(contents);
|
||||
}
|
||||
|
||||
element.parseString(contents);
|
||||
|
||||
if (this.shapes.length === 0 && element.attributes.snap) {
|
||||
this.shapes = element.children.map(function (child) {
|
||||
return window[child.attributes.prototype].fromSVG(child);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
SVG_Costume.prototype.edit = function (
|
||||
aWorld,
|
||||
anIDE,
|
||||
isnew,
|
||||
oncancel,
|
||||
onsubmit
|
||||
) {
|
||||
var myself = this,
|
||||
editor;
|
||||
|
||||
editor = new VectorPaintEditorMorph();
|
||||
|
||||
editor.oncancel = oncancel || nop;
|
||||
editor.openIn(
|
||||
aWorld,
|
||||
isnew ? newCanvas(StageMorph.prototype.dimensions) : this.contents,
|
||||
isnew ? new Point(240, 180) : myself.rotationCenter,
|
||||
function (img, rc, shapes) {
|
||||
myself.contents = img;
|
||||
myself.rotationCenter = rc;
|
||||
myself.shapes = shapes;
|
||||
myself.version = Date.now();
|
||||
aWorld.changed();
|
||||
if (anIDE) {
|
||||
if (isnew) {anIDE.currentSprite.addCostume(myself); }
|
||||
anIDE.currentSprite.wearCostume(myself);
|
||||
anIDE.hasChangedMedia = true;
|
||||
}
|
||||
(onsubmit || nop)();
|
||||
},
|
||||
anIDE,
|
||||
this.shapes || []
|
||||
);
|
||||
};
|
||||
|
||||
// CostumeEditorMorph ////////////////////////////////////////////////////////
|
||||
|
||||
// CostumeEditorMorph inherits from Morph:
|
||||
|
|
66
paint.js
66
paint.js
|
@ -5,7 +5,7 @@
|
|||
inspired by the Scratch paint editor.
|
||||
|
||||
written by Kartik Chandra
|
||||
Copyright (C) 2016 by Kartik Chandra
|
||||
Copyright (C) 2018 by Kartik Chandra
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -64,18 +64,21 @@
|
|||
Mar 22 - fixed automatic rotation center point mechanism (Jens)
|
||||
May 10 - retina display support adjustments (Jens)
|
||||
2017
|
||||
April 10 - getGlobalPixelColor adjustment for Chrome & retina (Jens)
|
||||
Apr 10 - getGlobalPixelColor adjustment for Chrome & retina (Jens)
|
||||
2018
|
||||
Jan 22 - floodfill alpha tweak (Bernat)
|
||||
Mar 19 - vector paint editor (Bernat)
|
||||
*/
|
||||
|
||||
/*global Point, Rectangle, DialogBoxMorph, AlignmentMorph, PushButtonMorph,
|
||||
Color, SymbolMorph, newCanvas, Morph, TextMorph, Costume, SpriteMorph, nop,
|
||||
localize, InputFieldMorph, SliderMorph, ToggleMorph, ToggleButtonMorph,
|
||||
BoxMorph, modules, radians, MorphicPreferences, getDocumentPositionOf,
|
||||
StageMorph, isNil*/
|
||||
StageMorph, isNil, SVG_Costume*/
|
||||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.paint = '2017-April-10';
|
||||
modules.paint = '2018-March-19';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -217,7 +220,8 @@ PaintEditorMorph.prototype.buildToolbox = function () {
|
|||
};
|
||||
|
||||
PaintEditorMorph.prototype.buildEdits = function () {
|
||||
var paper = this.paper;
|
||||
var myself = this,
|
||||
paper = this.paper;
|
||||
|
||||
this.edits.add(this.pushButton(
|
||||
"undo",
|
||||
|
@ -228,6 +232,25 @@ PaintEditorMorph.prototype.buildEdits = function () {
|
|||
"clear",
|
||||
function () {paper.clearCanvas(); }
|
||||
));
|
||||
this.edits.add(this.pushButton(
|
||||
'Vector',
|
||||
function () {
|
||||
if (myself.paper.undoBuffer.length > 0) {
|
||||
myself.ide.confirm(
|
||||
'This will erase your current drawing.\n' +
|
||||
'Are you sure you want to continue?',
|
||||
'Switch to vector editor?',
|
||||
function () {
|
||||
myself.switchToVector();
|
||||
},
|
||||
nop
|
||||
);
|
||||
} else {
|
||||
myself.switchToVector();
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
this.edits.fixLayout();
|
||||
};
|
||||
|
||||
|
@ -252,10 +275,17 @@ PaintEditorMorph.prototype.buildScaleBox = function () {
|
|||
this.scaleBox.fixLayout();
|
||||
};
|
||||
|
||||
PaintEditorMorph.prototype.openIn = function (world, oldim, oldrc, callback) {
|
||||
PaintEditorMorph.prototype.openIn = function (
|
||||
world,
|
||||
oldim,
|
||||
oldrc,
|
||||
callback,
|
||||
anIDE
|
||||
) {
|
||||
// Open the editor in a world with an optional image to edit
|
||||
this.oldim = oldim;
|
||||
this.callback = callback || nop;
|
||||
this.ide = anIDE;
|
||||
|
||||
this.processKeyUp = function () {
|
||||
this.shift = false;
|
||||
|
@ -324,6 +354,20 @@ PaintEditorMorph.prototype.cancel = function () {
|
|||
this.destroy();
|
||||
};
|
||||
|
||||
PaintEditorMorph.prototype.switchToVector = function () {
|
||||
var myself = this;
|
||||
this.object = new SVG_Costume(new Image(), '', new Point(0,0));
|
||||
this.object.edit(
|
||||
this.world(),
|
||||
this.ide,
|
||||
true,
|
||||
this.oncancel,
|
||||
function() {
|
||||
myself.ide.currentSprite.changed();
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
PaintEditorMorph.prototype.populatePropertiesMenu = function () {
|
||||
var c = this.controls,
|
||||
myself = this,
|
||||
|
@ -609,7 +653,10 @@ PaintCanvasMorph.prototype.calculateCanvasCenter = function(canvas) {
|
|||
return null;
|
||||
}
|
||||
// Can't use canvasBounds.center(), it rounds down.
|
||||
return new Point((canvasBounds.origin.x + canvasBounds.corner.x) / 2, (canvasBounds.origin.y + canvasBounds.corner.y) / 2);
|
||||
return new Point(
|
||||
(canvasBounds.origin.x + canvasBounds.corner.x) / 2,
|
||||
(canvasBounds.origin.y + canvasBounds.corner.y) / 2
|
||||
);
|
||||
};
|
||||
|
||||
// If we are in automaticCrosshairs mode, recalculate the rotationCenter.
|
||||
|
@ -772,7 +819,7 @@ PaintCanvasMorph.prototype.floodfill = function (sourcepoint) {
|
|||
if (sourcecolor[0] === this.settings.primarycolor.r &&
|
||||
sourcecolor[1] === this.settings.primarycolor.g &&
|
||||
sourcecolor[2] === this.settings.primarycolor.b &&
|
||||
sourcecolor[3] === this.settings.primarycolor.a) {
|
||||
sourcecolor[3] === this.settings.primarycolor.a * 255) {
|
||||
return;
|
||||
}
|
||||
if (sourcecolor[3] === 0 && this.settings.primarycolor.a === 0) {
|
||||
|
@ -945,7 +992,8 @@ PaintCanvasMorph.prototype.mouseMove = function (pos) {
|
|||
}
|
||||
break;
|
||||
case "crosshairs":
|
||||
// Disable automatic crosshairs: user has now chosen where they should be.
|
||||
// Disable automatic crosshairs:
|
||||
// user has now chosen where they should be.
|
||||
this.automaticCrosshairs = false;
|
||||
this.rotationCenter = relpos.copy();
|
||||
this.drawcrosshair(mctx);
|
||||
|
|
Plik diff jest za duży
Load Diff
41
snap.html
41
snap.html
|
@ -2,35 +2,36 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Snap! Build Your Own Blocks</title>
|
||||
<title>Snap! Build Your Own Blocks 4.2.1</title>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<script type="text/javascript" src="morphic.js"></script>
|
||||
<script type="text/javascript" src="widgets.js"></script>
|
||||
<script type="text/javascript" src="blocks.js"></script>
|
||||
<script type="text/javascript" src="threads.js"></script>
|
||||
<script type="text/javascript" src="objects.js"></script>
|
||||
<script type="text/javascript" src="gui.js"></script>
|
||||
<script type="text/javascript" src="paint.js"></script>
|
||||
<script type="text/javascript" src="lists.js"></script>
|
||||
<script type="text/javascript" src="byob.js"></script>
|
||||
<script type="text/javascript" src="tables.js"></script>
|
||||
<script type="text/javascript" src="symbols.js"></script>
|
||||
<script type="text/javascript" src="xml.js"></script>
|
||||
<script type="text/javascript" src="store.js"></script>
|
||||
<script type="text/javascript" src="locale.js"></script>
|
||||
<script type="text/javascript" src="cloud.js"></script>
|
||||
<script type="text/javascript" src="sha512.js"></script>
|
||||
<script type="text/javascript" src="FileSaver.min.js"></script>
|
||||
<script type="text/javascript" src="morphic.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="widgets.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="blocks.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="threads.js?version=2018-07-09"></script>
|
||||
<script type="text/javascript" src="objects.js?version=2018-07-06"></script>
|
||||
<script type="text/javascript" src="gui.js?version=2018-07-09"></script>
|
||||
<script type="text/javascript" src="paint.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="lists.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="byob.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="tables.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="symbols.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="sketch.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="xml.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="store.js?version=2018-07-09"></script>
|
||||
<script type="text/javascript" src="locale.js?version=2018-07-09"></script>
|
||||
<script type="text/javascript" src="cloud.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="sha512.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript" src="FileSaver.min.js?version=2018-06-21"></script>
|
||||
<script type="text/javascript">
|
||||
var world;
|
||||
window.onload = function () {
|
||||
world = new WorldMorph(document.getElementById('world'));
|
||||
world.worldCanvas.focus();
|
||||
new IDE_Morph().openIn(world);
|
||||
loop();
|
||||
loop();
|
||||
};
|
||||
function loop() {
|
||||
requestAnimationFrame(loop);
|
||||
requestAnimationFrame(loop);
|
||||
world.doOneCycle();
|
||||
}
|
||||
</script>
|
||||
|
|
110
store.js
110
store.js
|
@ -7,7 +7,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -61,7 +61,7 @@ normalizeCanvas, contains*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.store = '2017-October-28';
|
||||
modules.store = '2018-July-09';
|
||||
|
||||
|
||||
// XML_Serializer ///////////////////////////////////////////////////////
|
||||
|
@ -255,7 +255,7 @@ SnapSerializer.uber = XML_Serializer.prototype;
|
|||
|
||||
// SnapSerializer constants:
|
||||
|
||||
SnapSerializer.prototype.app = 'Snap! 4.1, http://snap.berkeley.edu';
|
||||
SnapSerializer.prototype.app = 'Snap! 4.2, http://snap.berkeley.edu';
|
||||
|
||||
SnapSerializer.prototype.thumbnailSize = new Point(160, 120);
|
||||
|
||||
|
@ -407,7 +407,7 @@ SnapSerializer.prototype.rawLoadProjectModel = function (xmlNode) {
|
|||
StageMorph.prototype.dimensions = new Point(480, 360);
|
||||
if (model.stage.attributes.width) {
|
||||
StageMorph.prototype.dimensions.x =
|
||||
Math.max(+model.stage.attributes.width, 480);
|
||||
Math.max(+model.stage.attributes.width, 240);
|
||||
}
|
||||
if (model.stage.attributes.height) {
|
||||
StageMorph.prototype.dimensions.y =
|
||||
|
@ -876,7 +876,7 @@ SnapSerializer.prototype.loadCustomBlocks = function (
|
|||
// private
|
||||
var myself = this;
|
||||
element.children.forEach(function (child) {
|
||||
var definition, names, inputs, vars, header, code, comment, i;
|
||||
var definition, names, inputs, vars, header, code, trans, comment, i;
|
||||
if (child.tag !== 'block-definition') {
|
||||
return;
|
||||
}
|
||||
|
@ -915,14 +915,17 @@ SnapSerializer.prototype.loadCustomBlocks = function (
|
|||
return;
|
||||
}
|
||||
i += 1;
|
||||
definition.declarations[names[i]] = [
|
||||
child.attributes.type,
|
||||
contains(['%b', '%boolUE'], child.attributes.type) ?
|
||||
(child.contents ? child.contents === 'true' : null)
|
||||
: child.contents,
|
||||
options ? options.contents : undefined,
|
||||
child.attributes.readonly === 'true'
|
||||
];
|
||||
definition.declarations.set(
|
||||
names[i],
|
||||
[
|
||||
child.attributes.type,
|
||||
contains(['%b', '%boolUE'], child.attributes.type) ?
|
||||
(child.contents ? child.contents === 'true' : null)
|
||||
: child.contents,
|
||||
options ? options.contents : undefined,
|
||||
child.attributes.readonly === 'true'
|
||||
]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -943,6 +946,11 @@ SnapSerializer.prototype.loadCustomBlocks = function (
|
|||
definition.codeMapping = code.contents;
|
||||
}
|
||||
|
||||
trans = child.childNamed('translations');
|
||||
if (trans) {
|
||||
definition.updateTranslations(trans.contents);
|
||||
}
|
||||
|
||||
comment = child.childNamed('comment');
|
||||
if (comment) {
|
||||
definition.comment = myself.loadComment(comment);
|
||||
|
@ -1097,10 +1105,10 @@ SnapSerializer.prototype.loadBlock = function (model, isReporter, object) {
|
|||
model.attributes,
|
||||
'var'
|
||||
)) {
|
||||
return SpriteMorph.prototype.variableBlock(
|
||||
block = SpriteMorph.prototype.variableBlock(
|
||||
model.attributes['var']
|
||||
);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
// disable JavaScript functions, commented out for now
|
||||
if (model.attributes.s === 'reportJSFunction' &&
|
||||
|
@ -1112,10 +1120,11 @@ SnapSerializer.prototype.loadBlock = function (model, isReporter, object) {
|
|||
}
|
||||
}
|
||||
*/
|
||||
block = SpriteMorph.prototype.blockForSelector(model.attributes.s);
|
||||
migration = SpriteMorph.prototype.blockMigrations[model.attributes.s];
|
||||
if (migration) {
|
||||
migrationOffset = migration.offset;
|
||||
block = SpriteMorph.prototype.blockForSelector(model.attributes.s);
|
||||
migration = SpriteMorph.prototype.blockMigrations[model.attributes.s];
|
||||
if (migration) {
|
||||
migrationOffset = migration.offset;
|
||||
}
|
||||
}
|
||||
} else if (model.tag === 'custom-block') {
|
||||
isGlobal = model.attributes.scope ? false : true;
|
||||
|
@ -1144,7 +1153,10 @@ SnapSerializer.prototype.loadBlock = function (model, isReporter, object) {
|
|||
: null
|
||||
);
|
||||
}
|
||||
if (!info) {
|
||||
if (!info || !contains(
|
||||
// catch other forks' blocks
|
||||
SpriteMorph.prototype.categories, info.category
|
||||
)) {
|
||||
return this.obsoleteBlock(isReporter);
|
||||
}
|
||||
block = info.type === 'command' ? new CustomCommandBlockMorph(
|
||||
|
@ -1238,6 +1250,7 @@ SnapSerializer.prototype.loadInput = function (model, input, block, object) {
|
|||
SnapSerializer.prototype.loadValue = function (model, object) {
|
||||
// private
|
||||
var v, i, lst, items, el, center, image, name, audio, option, bool, origin,
|
||||
wish, def,
|
||||
myself = this;
|
||||
|
||||
function record() {
|
||||
|
@ -1276,6 +1289,10 @@ SnapSerializer.prototype.loadValue = function (model, object) {
|
|||
if (bool) {
|
||||
return this.loadValue(bool);
|
||||
}
|
||||
wish = model.childNamed('wish');
|
||||
if (wish) {
|
||||
return this.loadValue(wish);
|
||||
}
|
||||
return model.contents;
|
||||
case 'bool':
|
||||
return model.contents === 'true';
|
||||
|
@ -1493,6 +1510,13 @@ SnapSerializer.prototype.loadValue = function (model, object) {
|
|||
}
|
||||
record();
|
||||
return v;
|
||||
case 'wish':
|
||||
def = new CustomBlockDefinition(model.attributes.s);
|
||||
def.type = model.attributes.type;
|
||||
def.category = model.attributes.category;
|
||||
def.storedSemanticSpec = model.attributes.s;
|
||||
def.updateTranslations(model.contents);
|
||||
return def.blockInstance(true); // include translations
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
@ -1895,10 +1919,20 @@ BlockMorph.prototype.toBlockXML = function (serializer) {
|
|||
};
|
||||
|
||||
ReporterBlockMorph.prototype.toXML = function (serializer) {
|
||||
return this.selector === 'reportGetVar' ? serializer.format(
|
||||
'<block var="@"/>',
|
||||
this.blockSpec
|
||||
) : this.toBlockXML(serializer);
|
||||
if (this.selector === 'reportGetVar') {
|
||||
if (!this.comment) {
|
||||
return serializer.format(
|
||||
'<block var="@"/>',
|
||||
this.blockSpec);
|
||||
} else {
|
||||
return serializer.format(
|
||||
'<block var="@">%</block>',
|
||||
this.blockSpec,
|
||||
this.comment.toXML(serializer));
|
||||
}
|
||||
} else {
|
||||
return this.toBlockXML(serializer);
|
||||
}
|
||||
};
|
||||
|
||||
ReporterBlockMorph.prototype.toScriptXML = function (
|
||||
|
@ -1930,7 +1964,7 @@ CustomCommandBlockMorph.prototype.toBlockXML = function (serializer) {
|
|||
var scope = this.isGlobal ? undefined : 'local';
|
||||
return serializer.format(
|
||||
'<custom-block s="@"%>%%%</custom-block>',
|
||||
this.blockSpec,
|
||||
this.semanticSpec,
|
||||
this.isGlobal ?
|
||||
'' : serializer.format(' scope="@"', scope),
|
||||
serializer.store(this.inputs()),
|
||||
|
@ -1951,7 +1985,6 @@ CustomReporterBlockMorph.prototype.toBlockXML
|
|||
CustomBlockDefinition.prototype.toXML = function (serializer) {
|
||||
var myself = this;
|
||||
|
||||
|
||||
function encodeScripts(array) {
|
||||
return array.reduce(function (xml, element) {
|
||||
if (element instanceof BlockMorph) {
|
||||
|
@ -1970,6 +2003,7 @@ CustomBlockDefinition.prototype.toXML = function (serializer) {
|
|||
(this.variableNames.length ? '<variables>%</variables>' : '@') +
|
||||
'<header>@</header>' +
|
||||
'<code>@</code>' +
|
||||
'<translations>@</translations>' +
|
||||
'<inputs>%</inputs>%%' +
|
||||
'</block-definition>',
|
||||
this.spec,
|
||||
|
@ -1980,15 +2014,17 @@ CustomBlockDefinition.prototype.toXML = function (serializer) {
|
|||
serializer.store(new List(this.variableNames)) : ''),
|
||||
this.codeHeader || '',
|
||||
this.codeMapping || '',
|
||||
Object.keys(this.declarations).reduce(function (xml, decl) {
|
||||
this.translationsAsText(),
|
||||
Array.from(this.declarations.keys()).reduce(function (xml, decl) {
|
||||
// to be refactored now that we've moved to ES6 Map:
|
||||
return xml + serializer.format(
|
||||
'<input type="@"$>$%</input>',
|
||||
myself.declarations[decl][0],
|
||||
myself.declarations[decl][3] ?
|
||||
myself.declarations.get(decl)[0],
|
||||
myself.declarations.get(decl)[3] ?
|
||||
' readonly="true"' : '',
|
||||
myself.declarations[decl][1],
|
||||
myself.declarations[decl][2] ?
|
||||
'<options>' + myself.declarations[decl][2] +
|
||||
myself.declarations.get(decl)[1],
|
||||
myself.declarations.get(decl)[2] ?
|
||||
'<options>' + myself.declarations.get(decl)[2] +
|
||||
'</options>'
|
||||
: ''
|
||||
);
|
||||
|
@ -2014,6 +2050,16 @@ BooleanSlotMorph.prototype.toXML = function () {
|
|||
};
|
||||
|
||||
InputSlotMorph.prototype.toXML = function (serializer) {
|
||||
if (this.selectedBlock) {
|
||||
return serializer.format(
|
||||
'<l><wish s="@" type="@" category="@">@</wish></l>',
|
||||
this.selectedBlock.semanticSpec,
|
||||
this.selectedBlock instanceof CommandBlockMorph ? 'command'
|
||||
: (this.selectedBlock.isPredicate ? 'predicate' : 'reporter'),
|
||||
this.selectedBlock.category,
|
||||
this.selectedBlock.storedTranslations
|
||||
);
|
||||
}
|
||||
if (this.constant) {
|
||||
return serializer.format(
|
||||
'<l><option>$</option></l>',
|
||||
|
|
67
symbols.js
67
symbols.js
|
@ -7,7 +7,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.symbols = '2017-September-26';
|
||||
modules.symbols = '2018-June-05';
|
||||
|
||||
var SymbolMorph;
|
||||
|
||||
|
@ -110,6 +110,7 @@ SymbolMorph.prototype.names = [
|
|||
'rectangleSolid',
|
||||
'circle',
|
||||
'circleSolid',
|
||||
'ellipse',
|
||||
'line',
|
||||
'cross',
|
||||
'crosshairs',
|
||||
|
@ -131,6 +132,9 @@ SymbolMorph.prototype.names = [
|
|||
'robot',
|
||||
'magnifyingGlass',
|
||||
'magnifierOutline',
|
||||
'selection',
|
||||
'polygon',
|
||||
'closedBrush',
|
||||
'notes',
|
||||
'camera',
|
||||
'location',
|
||||
|
@ -270,6 +274,8 @@ SymbolMorph.prototype.symbolCanvasColored = function (aColor) {
|
|||
return this.drawSymbolCircle(canvas, aColor);
|
||||
case 'circleSolid':
|
||||
return this.drawSymbolCircleSolid(canvas, aColor);
|
||||
case 'ellipse':
|
||||
return this.drawSymbolCircle(canvas, aColor);
|
||||
case 'line':
|
||||
return this.drawSymbolLine(canvas, aColor);
|
||||
case 'cross':
|
||||
|
@ -312,6 +318,12 @@ SymbolMorph.prototype.symbolCanvasColored = function (aColor) {
|
|||
return this.drawSymbolMagnifyingGlass(canvas, aColor);
|
||||
case 'magnifierOutline':
|
||||
return this.drawSymbolMagnifierOutline(canvas, aColor);
|
||||
case 'selection':
|
||||
return this.drawSymbolSelection(canvas, aColor);
|
||||
case 'polygon':
|
||||
return this.drawSymbolOctagonOutline(canvas, aColor);
|
||||
case 'closedBrush':
|
||||
return this.drawSymbolClosedBrushPath(canvas, aColor);
|
||||
case 'notes':
|
||||
return this.drawSymbolNotes(canvas, aColor);
|
||||
case 'camera':
|
||||
|
@ -1550,6 +1562,57 @@ SymbolMorph.prototype.drawSymbolMagnifierOutline = function (canvas, color) {
|
|||
return canvas;
|
||||
};
|
||||
|
||||
|
||||
SymbolMorph.prototype.drawSymbolSelection = function (canvas, color) {
|
||||
// answer a canvas showing a filled arrow and a dashed rectangle
|
||||
var ctx = canvas.getContext('2d'),
|
||||
w = canvas.width,
|
||||
h = canvas.height;
|
||||
|
||||
ctx.save();
|
||||
ctx.setLineDash([3]);
|
||||
this.drawSymbolRectangle(canvas, color);
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.fillStyle = color.toString();
|
||||
ctx.translate(0.7 * w, 0.4 * h);
|
||||
ctx.scale(0.5, 0.5);
|
||||
ctx.rotate(radians(135));
|
||||
this.drawSymbolArrowDownOutline(canvas, color);
|
||||
ctx.fill();
|
||||
ctx.restore();
|
||||
|
||||
return canvas;
|
||||
};
|
||||
|
||||
SymbolMorph.prototype.drawSymbolOctagonOutline = function (canvas, color) {
|
||||
// answer a canvas showing an octagon
|
||||
var ctx = canvas.getContext('2d'),
|
||||
side = canvas.width,
|
||||
vert = (side - (side * 0.383)) / 2,
|
||||
l = Math.max(side / 20, 0.5);
|
||||
|
||||
ctx.strokeStyle = color.toString();
|
||||
ctx.lineWidth = l * 2;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(vert, l);
|
||||
ctx.lineTo(side - vert, l);
|
||||
ctx.lineTo(side - l, vert);
|
||||
ctx.lineTo(side - l, side - vert);
|
||||
ctx.lineTo(side - vert, side - l);
|
||||
ctx.lineTo(vert, side - l);
|
||||
ctx.lineTo(l, side - vert);
|
||||
ctx.lineTo(l, vert);
|
||||
ctx.closePath();
|
||||
ctx.stroke();
|
||||
|
||||
return canvas;
|
||||
};
|
||||
|
||||
SymbolMorph.prototype.drawSymbolClosedBrushPath =
|
||||
SymbolMorph.prototype.drawSymbolCloudOutline;
|
||||
|
||||
SymbolMorph.prototype.drawSymbolNotes = function (canvas, color) {
|
||||
// answer a canvas showing two musical notes
|
||||
var ctx = canvas.getContext('2d'),
|
||||
|
|
675
threads.js
675
threads.js
|
@ -9,7 +9,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
|||
Context
|
||||
Variable
|
||||
VariableFrame
|
||||
JSCompiler
|
||||
|
||||
|
||||
credits
|
||||
|
@ -61,12 +62,14 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
|
|||
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
|
||||
TableFrameMorph, ColorSlotMorph, isSnapObject*/
|
||||
|
||||
modules.threads = '2017-October-20';
|
||||
modules.threads = '2018-July-09';
|
||||
|
||||
var ThreadManager;
|
||||
var Process;
|
||||
var Context;
|
||||
var Variable;
|
||||
var VariableFrame;
|
||||
var JSCompiler;
|
||||
|
||||
function snapEquals(a, b) {
|
||||
if (a instanceof List || (b instanceof List)) {
|
||||
|
@ -112,7 +115,8 @@ function invoke(
|
|||
receiver, // sprite or environment, optional for contexts
|
||||
timeout, // msecs
|
||||
timeoutErrorMsg, // string
|
||||
suppressErrors // bool
|
||||
suppressErrors, // bool
|
||||
callerProcess // optional for JS-functions
|
||||
) {
|
||||
// execute the given block or context synchronously without yielding.
|
||||
// Apply context (not a block) to a list of optional arguments.
|
||||
|
@ -151,6 +155,11 @@ function invoke(
|
|||
);
|
||||
} else if (action.evaluate) {
|
||||
return action.evaluate();
|
||||
} else if (action instanceof Function) {
|
||||
return action.apply(
|
||||
receiver,
|
||||
contextArgs.asArray().concat(callerProcess)
|
||||
);
|
||||
} else {
|
||||
throw new Error('expecting a block or ring but getting ' + action);
|
||||
}
|
||||
|
@ -196,7 +205,8 @@ ThreadManager.prototype.startProcess = function (
|
|||
exportResult, // bool
|
||||
callback,
|
||||
isClicked,
|
||||
rightAway
|
||||
rightAway,
|
||||
atomic // special option used (only) for "onStop" scripts
|
||||
) {
|
||||
var top = block.topBlock(),
|
||||
active = this.findProcess(top, receiver),
|
||||
|
@ -212,6 +222,7 @@ ThreadManager.prototype.startProcess = function (
|
|||
newProc = new Process(top, receiver, callback, isClicked);
|
||||
newProc.exportResult = exportResult;
|
||||
newProc.isClicked = isClicked || false;
|
||||
newProc.isAtomic = atomic || false;
|
||||
|
||||
// show a highlight around the running stack
|
||||
// if there are more than one active processes
|
||||
|
@ -525,6 +536,7 @@ Process.prototype.timeout = 500; // msecs after which to force yield
|
|||
Process.prototype.isCatchingErrors = true;
|
||||
Process.prototype.enableLiveCoding = false; // experimental
|
||||
Process.prototype.enableSingleStepping = false; // experimental
|
||||
Process.prototype.enableCompiling = false; // experimental
|
||||
Process.prototype.flashTime = 0; // experimental
|
||||
// Process.prototype.enableJS = false;
|
||||
|
||||
|
@ -694,7 +706,9 @@ Process.prototype.evaluateContext = function () {
|
|||
};
|
||||
|
||||
Process.prototype.evaluateBlock = function (block, argCount) {
|
||||
var selector = block.selector;
|
||||
var rcvr, inputs,
|
||||
selector = block.selector;
|
||||
|
||||
// check for special forms
|
||||
if (selector === 'reportOr' ||
|
||||
selector === 'reportAnd' ||
|
||||
|
@ -703,8 +717,8 @@ Process.prototype.evaluateBlock = function (block, argCount) {
|
|||
}
|
||||
|
||||
// first evaluate all inputs, then apply the primitive
|
||||
var rcvr = this.context.receiver || this.receiver,
|
||||
inputs = this.context.inputs;
|
||||
rcvr = this.context.receiver || this.receiver;
|
||||
inputs = this.context.inputs;
|
||||
|
||||
if (argCount > inputs.length) {
|
||||
this.evaluateNextInput(block);
|
||||
|
@ -775,7 +789,7 @@ Process.prototype.doReport = function (block) {
|
|||
if (this.isClicked && (block.topBlock() === this.topBlock)) {
|
||||
this.isShowingResult = true;
|
||||
}
|
||||
if (this.context.expression.partOfCustomCommand) {
|
||||
if (block.partOfCustomCommand) {
|
||||
this.doStopCustomBlock();
|
||||
this.popContext();
|
||||
} else {
|
||||
|
@ -798,8 +812,9 @@ Process.prototype.doReport = function (block) {
|
|||
}
|
||||
// in any case evaluate (and ignore)
|
||||
// the input, because it could be
|
||||
// and HTTP Request for a hardware extension
|
||||
// an HTTP Request for a hardware extension
|
||||
this.pushContext(block.inputs()[0], outer);
|
||||
this.context.isCustomCommand = block.partOfCustomCommand;
|
||||
};
|
||||
|
||||
// Process: Non-Block evaluation
|
||||
|
@ -1090,6 +1105,7 @@ Process.prototype.evaluate = function (
|
|||
outer,
|
||||
context.receiver
|
||||
);
|
||||
runnable.isCustomCommand = isCommand; // for short-circuiting HTTP requests
|
||||
this.context.parentContext = runnable;
|
||||
|
||||
if (context.expression instanceof ReporterBlockMorph) {
|
||||
|
@ -1162,16 +1178,17 @@ Process.prototype.evaluate = function (
|
|||
};
|
||||
|
||||
Process.prototype.fork = function (context, args) {
|
||||
if (this.readyToTerminate) {return; }
|
||||
var proc = new Process(),
|
||||
stage = this.homeContext.receiver.parentThatIsA(StageMorph);
|
||||
proc.instrument = this.instrument;
|
||||
proc.receiver = this.receiver;
|
||||
proc.initializeFor(context, args);
|
||||
proc.initializeFor(context, args, this.enableSingleStepping);
|
||||
// proc.pushContext('doYield');
|
||||
stage.threads.processes.push(proc);
|
||||
};
|
||||
|
||||
Process.prototype.initializeFor = function (context, args) {
|
||||
Process.prototype.initializeFor = function (context, args, ignoreExit) {
|
||||
// used by Process.fork() and global invoke()
|
||||
if (context.isContinuation) {
|
||||
throw new Error(
|
||||
|
@ -1243,14 +1260,16 @@ Process.prototype.initializeFor = function (context, args) {
|
|||
// insert a tagged exit context
|
||||
// which "report" can catch later
|
||||
// needed for invoke() situations
|
||||
exit = new Context(
|
||||
runnable.parentContext,
|
||||
'expectReport',
|
||||
outer,
|
||||
outer.receiver
|
||||
);
|
||||
exit.tag = 'exit';
|
||||
runnable.parentContext = exit;
|
||||
if (!ignoreExit) { // when single stepping LAUNCH
|
||||
exit = new Context(
|
||||
runnable.parentContext,
|
||||
'expectReport',
|
||||
outer,
|
||||
outer.receiver
|
||||
);
|
||||
exit.tag = 'exit';
|
||||
runnable.parentContext = exit;
|
||||
}
|
||||
}
|
||||
|
||||
this.homeContext = new Context(); // context.outerContext;
|
||||
|
@ -1330,7 +1349,7 @@ Process.prototype.evaluateCustomBlock = function () {
|
|||
var caller = this.context.parentContext,
|
||||
block = this.context.expression,
|
||||
method = block.isGlobal ? block.definition
|
||||
: this.blockReceiver().getMethod(block.blockSpec),
|
||||
: this.blockReceiver().getMethod(block.semanticSpec),
|
||||
context = method.body,
|
||||
declarations = method.declarations,
|
||||
args = new List(this.context.inputs),
|
||||
|
@ -1383,7 +1402,7 @@ Process.prototype.evaluateCustomBlock = function () {
|
|||
|
||||
// if the parameter is an upvar,
|
||||
// create a reference to the variable it points to
|
||||
if (declarations[context.inputs[i]][0] === '%upvar') {
|
||||
if (declarations.get(context.inputs[i])[0] === '%upvar') {
|
||||
this.context.outerContext.variables.vars[value] =
|
||||
outer.variables.vars[context.inputs[i]];
|
||||
}
|
||||
|
@ -1440,21 +1459,23 @@ Process.prototype.doDeclareVariables = function (varNames) {
|
|||
|
||||
Process.prototype.doSetVar = function (varName, value) {
|
||||
var varFrame = this.context.variables,
|
||||
name = varName,
|
||||
rcvr;
|
||||
name = varName;
|
||||
if (name instanceof Context) {
|
||||
rcvr = this.blockReceiver();
|
||||
if (name.expression.selector === 'reportGetVar') {
|
||||
name.variables.setVar(
|
||||
name.expression.blockSpec,
|
||||
value,
|
||||
rcvr
|
||||
this.blockReceiver()
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.doSet(name, value);
|
||||
return;
|
||||
}
|
||||
if (name instanceof Array) {
|
||||
this.doSet(name, value);
|
||||
return;
|
||||
}
|
||||
varFrame.setVar(name, value, this.blockReceiver());
|
||||
};
|
||||
|
||||
|
@ -1838,6 +1859,7 @@ Process.prototype.doStopAll = function () {
|
|||
if (stage) {
|
||||
stage.threads.resumeAll(stage);
|
||||
stage.keysPressed = {};
|
||||
stage.runStopScripts();
|
||||
stage.threads.stopAll();
|
||||
stage.stopAllActiveSounds();
|
||||
stage.children.forEach(function (morph) {
|
||||
|
@ -2280,7 +2302,14 @@ Process.prototype.reportURL = function (url) {
|
|||
}
|
||||
this.httpRequest = new XMLHttpRequest();
|
||||
this.httpRequest.open("GET", url, true);
|
||||
this.httpRequest.setRequestHeader('Cache-Control', 'max-age=0');
|
||||
this.httpRequest.send(null);
|
||||
if (this.context.isCustomCommand) {
|
||||
// special case when ignoring the result, e.g. when
|
||||
// communicating with a robot to control its motors
|
||||
this.httpRequest = null;
|
||||
return null;
|
||||
}
|
||||
} else if (this.httpRequest.readyState === 4) {
|
||||
response = this.httpRequest.responseText;
|
||||
this.httpRequest = null;
|
||||
|
@ -2308,6 +2337,9 @@ Process.prototype.doBroadcast = function (message) {
|
|||
myself = this,
|
||||
procs = [];
|
||||
|
||||
if (this.readyToTerminate) {
|
||||
return [];
|
||||
}
|
||||
if (message instanceof List && (message.length() === 2)) {
|
||||
thisObj = this.blockReceiver();
|
||||
msg = message.at(1);
|
||||
|
@ -2352,6 +2384,10 @@ Process.prototype.doBroadcast = function (message) {
|
|||
Process.prototype.doBroadcastAndWait = function (message) {
|
||||
if (!this.context.activeSends) {
|
||||
this.context.activeSends = this.doBroadcast(message);
|
||||
this.context.activeSends.forEach(function (proc) {
|
||||
// optimize for atomic sub-routines
|
||||
proc.runStep();
|
||||
});
|
||||
}
|
||||
this.context.activeSends = this.context.activeSends.filter(
|
||||
function (proc) {
|
||||
|
@ -2409,15 +2445,15 @@ Process.prototype.reportTypeOf = function (thing) {
|
|||
if (thing === true || (thing === false)) {
|
||||
return 'Boolean';
|
||||
}
|
||||
if (thing instanceof List) {
|
||||
return 'list';
|
||||
}
|
||||
if (!isNaN(+thing)) {
|
||||
return 'number';
|
||||
}
|
||||
if (isString(thing)) {
|
||||
return 'text';
|
||||
}
|
||||
if (thing instanceof List) {
|
||||
return 'list';
|
||||
}
|
||||
if (thing instanceof SpriteMorph) {
|
||||
return 'sprite';
|
||||
}
|
||||
|
@ -2671,11 +2707,18 @@ Process.prototype.reportJoinWords = function (aList) {
|
|||
// Process string ops
|
||||
|
||||
Process.prototype.reportLetter = function (idx, string) {
|
||||
var str, i;
|
||||
if (string instanceof List) { // catch a common user error
|
||||
return '';
|
||||
}
|
||||
var i = +(idx || 0),
|
||||
str = isNil(string) ? '' : string.toString();
|
||||
if (this.inputOption(idx) === 'any') {
|
||||
idx = this.reportRandom(1, string.length);
|
||||
}
|
||||
if (this.inputOption(idx) === 'last') {
|
||||
idx = string.length;
|
||||
}
|
||||
i = +(idx || 0);
|
||||
str = isNil(string) ? '' : string.toString();
|
||||
return str[i - 1] || '';
|
||||
};
|
||||
|
||||
|
@ -2688,12 +2731,20 @@ Process.prototype.reportStringSize = function (data) {
|
|||
};
|
||||
|
||||
Process.prototype.reportUnicode = function (string) {
|
||||
var str = (string || '').toString()[0];
|
||||
return str ? str.charCodeAt(0) : 0;
|
||||
var str = isNil(string) ? '\u0000' : string.toString();
|
||||
|
||||
if (str.codePointAt) { // support for Unicode in newer browsers.
|
||||
return str.codePointAt(0);
|
||||
}
|
||||
return str.charCodeAt(0);
|
||||
};
|
||||
|
||||
Process.prototype.reportUnicodeAsLetter = function (num) {
|
||||
var code = +(num || 0);
|
||||
|
||||
if (String.fromCodePoint) { // support for Unicode in newer browsers.
|
||||
return String.fromCodePoint(code);
|
||||
}
|
||||
return String.fromCharCode(code);
|
||||
};
|
||||
|
||||
|
@ -2878,13 +2929,28 @@ Process.prototype.getObjectsNamed = function (name, thisObj, stageObj) {
|
|||
return those;
|
||||
};
|
||||
|
||||
Process.prototype.setHeading = function (direction) {
|
||||
var thisObj = this.blockReceiver();
|
||||
|
||||
if (thisObj) {
|
||||
if (this.inputOption(direction) === 'random') {
|
||||
direction = this.reportRandom(1, 36000) / 100;
|
||||
}
|
||||
thisObj.setHeading(direction);
|
||||
}
|
||||
};
|
||||
|
||||
Process.prototype.doFaceTowards = function (name) {
|
||||
var thisObj = this.blockReceiver(),
|
||||
thatObj;
|
||||
|
||||
if (thisObj) {
|
||||
if (this.inputOption(name) === 'mouse-pointer') {
|
||||
if (this.inputOption(name) === 'center') {
|
||||
thisObj.faceToXY(0, 0);
|
||||
} else if (this.inputOption(name) === 'mouse-pointer') {
|
||||
thisObj.faceToXY(this.reportMouseX(), this.reportMouseY());
|
||||
} else if (this.inputOption(name) === 'random position') {
|
||||
thisObj.setHeading(this.reportRandom(1, 36000) / 100);
|
||||
} else {
|
||||
if (name instanceof List) {
|
||||
thisObj.faceToXY(
|
||||
|
@ -2906,11 +2972,22 @@ Process.prototype.doFaceTowards = function (name) {
|
|||
|
||||
Process.prototype.doGotoObject = function (name) {
|
||||
var thisObj = this.blockReceiver(),
|
||||
thatObj;
|
||||
thatObj,
|
||||
stage;
|
||||
|
||||
if (thisObj) {
|
||||
if (this.inputOption(name) === 'mouse-pointer') {
|
||||
if (this.inputOption(name) === 'center') {
|
||||
thisObj.gotoXY(0, 0);
|
||||
} else if (this.inputOption(name) === 'mouse-pointer') {
|
||||
thisObj.gotoXY(this.reportMouseX(), this.reportMouseY());
|
||||
} else if (this.inputOption(name) === 'random position') {
|
||||
stage = thisObj.parentThatIsA(StageMorph);
|
||||
if (stage) {
|
||||
thisObj.setCenter(new Point(
|
||||
this.reportRandom(stage.left(), stage.right()),
|
||||
this.reportRandom(stage.top(), stage.bottom())
|
||||
));
|
||||
}
|
||||
} else {
|
||||
if (name instanceof List) {
|
||||
thisObj.gotoXY(
|
||||
|
@ -2936,7 +3013,7 @@ Process.prototype.createClone = function (name) {
|
|||
var thisObj = this.blockReceiver(),
|
||||
thatObj;
|
||||
|
||||
if (!name) {return; }
|
||||
if (!name || this.readyToTerminate) {return; }
|
||||
if (thisObj) {
|
||||
if (this.inputOption(name) === 'myself') {
|
||||
thisObj.createClone(!this.isFirstStep);
|
||||
|
@ -3009,7 +3086,7 @@ Process.prototype.objectTouchingObject = function (thisObj, name) {
|
|||
return true;
|
||||
}
|
||||
if (isSnapObject(name)) {
|
||||
return thisObj.isTouching(name);
|
||||
return name.isVisible && thisObj.isTouching(name);
|
||||
}
|
||||
if (name instanceof List) { // assume all elements to be sprites
|
||||
those = name.itemsArray();
|
||||
|
@ -3017,7 +3094,7 @@ Process.prototype.objectTouchingObject = function (thisObj, name) {
|
|||
those = this.getObjectsNamed(name, thisObj, stage); // clones
|
||||
}
|
||||
if (those.some(function (any) {
|
||||
return thisObj.isTouching(any);
|
||||
return any.isVisible && thisObj.isTouching(any);
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
|
@ -3076,6 +3153,17 @@ Process.prototype.reportColorIsTouchingColor = function (color1, color2) {
|
|||
return false;
|
||||
};
|
||||
|
||||
Process.prototype.reportRelationTo = function (relation, name) {
|
||||
var rel = this.inputOption(relation);
|
||||
if (rel === 'distance') {
|
||||
return this.reportDistanceTo(name);
|
||||
}
|
||||
if (rel === 'direction') {
|
||||
return this.reportDirectionTo(name);
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
Process.prototype.reportDistanceTo = function (name) {
|
||||
var thisObj = this.blockReceiver(),
|
||||
thatObj,
|
||||
|
@ -3088,6 +3176,9 @@ Process.prototype.reportDistanceTo = function (name) {
|
|||
point = rc;
|
||||
if (this.inputOption(name) === 'mouse-pointer') {
|
||||
point = thisObj.world().hand.position();
|
||||
} else if (this.inputOption(name) === 'center') {
|
||||
return new Point(thisObj.xPosition(), thisObj.yPosition())
|
||||
.distanceTo(new Point(0, 0));
|
||||
} else if (name instanceof List) {
|
||||
return new Point(thisObj.xPosition(), thisObj.yPosition())
|
||||
.distanceTo(new Point(name.at(1), name.at(2)));
|
||||
|
@ -3102,6 +3193,35 @@ Process.prototype.reportDistanceTo = function (name) {
|
|||
return 0;
|
||||
};
|
||||
|
||||
Process.prototype.reportDirectionTo = function (name) {
|
||||
var thisObj = this.blockReceiver(),
|
||||
thatObj;
|
||||
|
||||
if (thisObj) {
|
||||
if (this.inputOption(name) === 'mouse-pointer') {
|
||||
return thisObj.angleToXY(this.reportMouseX(), this.reportMouseY());
|
||||
}
|
||||
if (this.inputOption(name) === 'center') {
|
||||
return thisObj.angleToXY(0, 0);
|
||||
}
|
||||
if (name instanceof List) {
|
||||
return thisObj.angleToXY(
|
||||
name.at(1),
|
||||
name.at(2)
|
||||
);
|
||||
}
|
||||
thatObj = this.getOtherObject(name, this.homeContext.receiver);
|
||||
if (thatObj) {
|
||||
return thisObj.angleToXY(
|
||||
thatObj.xPosition(),
|
||||
thatObj.yPosition()
|
||||
);
|
||||
}
|
||||
return thisObj.direction();
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
Process.prototype.reportAttributeOf = function (attribute, name) {
|
||||
var thisObj = this.blockReceiver(),
|
||||
thatObj,
|
||||
|
@ -3117,6 +3237,16 @@ Process.prototype.reportAttributeOf = function (attribute, name) {
|
|||
}
|
||||
if (thatObj) {
|
||||
this.assertAlive(thatObj);
|
||||
if (attribute instanceof BlockMorph) { // a "wish"
|
||||
return this.reportContextFor(
|
||||
this.reify(
|
||||
thatObj.getMethod(attribute.semanticSpec)
|
||||
.blockInstance(),
|
||||
new List()
|
||||
),
|
||||
thatObj
|
||||
);
|
||||
}
|
||||
if (attribute instanceof Context) {
|
||||
return this.reportContextFor(attribute, thatObj);
|
||||
}
|
||||
|
@ -3226,16 +3356,16 @@ Process.prototype.reportGet = function (query) {
|
|||
Process.prototype.doSet = function (attribute, value) {
|
||||
// experimental, manipulate sprites' attributes
|
||||
var name, rcvr;
|
||||
if (!(attribute instanceof Context)) {
|
||||
return;
|
||||
}
|
||||
rcvr = this.blockReceiver();
|
||||
this.assertAlive(rcvr);
|
||||
if (!(attribute instanceof Context) ||
|
||||
attribute.expression.selector !== 'reportGet') {
|
||||
if (!(attribute instanceof Context || attribute instanceof Array) ||
|
||||
(attribute instanceof Context &&
|
||||
attribute.expression.selector !== 'reportGet')) {
|
||||
throw new Error(localize('unsupported attribute'));
|
||||
}
|
||||
name = attribute.expression.inputs()[0].evaluate();
|
||||
name = attribute instanceof Context ?
|
||||
attribute.expression.inputs()[0].evaluate()
|
||||
: attribute;
|
||||
if (name instanceof Array) {
|
||||
name = name[0];
|
||||
}
|
||||
|
@ -3675,6 +3805,209 @@ Process.prototype.unflash = function () {
|
|||
}
|
||||
};
|
||||
|
||||
// Process: Compile (as of yet simple) block scripts to JS
|
||||
|
||||
/*
|
||||
with either only explicit formal parameters or a specified number of
|
||||
implicit formal parameters mapped to empty input slots
|
||||
*** highly experimental and heavily under construction ***
|
||||
*/
|
||||
|
||||
Process.prototype.reportCompiled = function (context, implicitParamCount) {
|
||||
// implicitParamCount is optional and indicates the number of
|
||||
// expected parameters, if any. This is only used to handle
|
||||
// implicit (empty slot) parameters and can otherwise be
|
||||
// ignored
|
||||
return new JSCompiler(this).compileFunction(context, implicitParamCount);
|
||||
};
|
||||
|
||||
Process.prototype.getVarNamed = function (name) {
|
||||
// private - special form for compiled expressions
|
||||
// DO NOT use except in compiled methods!
|
||||
// first check script vars, then global ones
|
||||
var frame = this.homeContext.variables.silentFind(name) ||
|
||||
this.context.variables.silentFind(name),
|
||||
value;
|
||||
if (frame) {
|
||||
value = frame.vars[name].value;
|
||||
return (value === 0 ? 0
|
||||
: value === false ? false
|
||||
: value === '' ? ''
|
||||
: value || 0); // don't return null
|
||||
}
|
||||
throw new Error(
|
||||
localize('a variable of name \'')
|
||||
+ name
|
||||
+ localize('\'\ndoes not exist in this context')
|
||||
);
|
||||
};
|
||||
|
||||
Process.prototype.setVarNamed = function (name, value) {
|
||||
// private - special form for compiled expressions
|
||||
// incomplete, currently only sets named vars
|
||||
// DO NOT use except in compiled methods!
|
||||
// first check script vars, then global ones
|
||||
var frame = this.homeContext.variables.silentFind(name) ||
|
||||
this.context.variables.silentFind(name);
|
||||
if (isNil(frame)) {
|
||||
throw new Error(
|
||||
localize('a variable of name \'')
|
||||
+ name
|
||||
+ localize('\'\ndoes not exist in this context')
|
||||
);
|
||||
}
|
||||
frame.vars[name].value = value;
|
||||
};
|
||||
|
||||
Process.prototype.incrementVarNamed = function (name, delta) {
|
||||
// private - special form for compiled expressions
|
||||
this.setVarNamed(name, this.getVarNamed(name) + (+delta));
|
||||
};
|
||||
|
||||
// Process: Atomic HOFs using experimental JIT-compilation
|
||||
|
||||
Process.prototype.reportAtomicMap = function (reporter, list) {
|
||||
this.assertType(list, 'list');
|
||||
var result = [],
|
||||
src = list.asArray(),
|
||||
len = src.length,
|
||||
func,
|
||||
i;
|
||||
|
||||
// try compiling the reporter into generic JavaScript
|
||||
// fall back to the morphic reporter if unsuccessful
|
||||
try {
|
||||
func = this.reportCompiled(reporter, 1); // a single expected input
|
||||
} catch (err) {
|
||||
console.log(err.message);
|
||||
func = reporter;
|
||||
}
|
||||
|
||||
// iterate over the data in a single frame:
|
||||
// to do: Insert some kind of user escape mechanism
|
||||
for (i = 0; i < len; i += 1) {
|
||||
result.push(
|
||||
invoke(
|
||||
func,
|
||||
new List([src[i]]),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
this // process
|
||||
)
|
||||
);
|
||||
}
|
||||
return new List(result);
|
||||
};
|
||||
|
||||
Process.prototype.reportAtomicKeep = function (reporter, list) {
|
||||
this.assertType(list, 'list');
|
||||
var result = [],
|
||||
src = list.asArray(),
|
||||
len = src.length,
|
||||
func,
|
||||
i;
|
||||
|
||||
// try compiling the reporter into generic JavaScript
|
||||
// fall back to the morphic reporter if unsuccessful
|
||||
try {
|
||||
func = this.reportCompiled(reporter, 1); // a single expected input
|
||||
} catch (err) {
|
||||
console.log(err.message);
|
||||
func = reporter;
|
||||
}
|
||||
|
||||
// iterate over the data in a single frame:
|
||||
// to do: Insert some kind of user escape mechanism
|
||||
for (i = 0; i < len; i += 1) {
|
||||
if (
|
||||
invoke(
|
||||
func,
|
||||
new List([src[i]]),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
this // process
|
||||
)
|
||||
) {
|
||||
result.push(src[i]);
|
||||
}
|
||||
}
|
||||
return new List(result);
|
||||
};
|
||||
|
||||
Process.prototype.reportAtomicCombine = function (reporter, list) {
|
||||
this.assertType(list, 'list');
|
||||
var result = '',
|
||||
src = list.asArray(),
|
||||
len = src.length,
|
||||
func,
|
||||
i;
|
||||
|
||||
if (len === 0) {
|
||||
return result;
|
||||
}
|
||||
result = src[0];
|
||||
|
||||
// try compiling the reporter into generic JavaScript
|
||||
// fall back to the morphic reporter if unsuccessful
|
||||
try {
|
||||
func = this.reportCompiled(reporter, 2); // a single expected input
|
||||
} catch (err) {
|
||||
console.log(err.message);
|
||||
func = reporter;
|
||||
}
|
||||
|
||||
// iterate over the data in a single frame:
|
||||
// to do: Insert some kind of user escape mechanism
|
||||
for (i = 1; i < len; i += 1) {
|
||||
result = invoke(
|
||||
func,
|
||||
new List([result, src[i]]),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
this // process
|
||||
);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
Process.prototype.reportAtomicSort = function (list, reporter) {
|
||||
this.assertType(list, 'list');
|
||||
var myself = this,
|
||||
func;
|
||||
|
||||
// try compiling the reporter into generic JavaScript
|
||||
// fall back to the morphic reporter if unsuccessful
|
||||
try {
|
||||
func = this.reportCompiled(reporter, 2); // two inputs expected
|
||||
} catch (err) {
|
||||
console.log(err.message);
|
||||
func = reporter;
|
||||
}
|
||||
|
||||
// iterate over the data in a single frame:
|
||||
return new List(
|
||||
list.asArray().slice().sort(
|
||||
function (a, b) {
|
||||
return invoke(
|
||||
func,
|
||||
new List([a, b]),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
myself // process
|
||||
) ? -1 : 1;
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
// Context /////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
|
@ -3703,7 +4036,9 @@ Process.prototype.unflash = function () {
|
|||
startValue initial value for interpolated operations
|
||||
activeAudio audio buffer for interpolated operations, don't persist
|
||||
activeNote audio oscillator for interpolated ops, don't persist
|
||||
activeSends forked processes waiting to be completed
|
||||
isCustomBlock marker for return ops
|
||||
isCustomCommand marker for interpolated blocking reporters (reportURL)
|
||||
emptySlots caches the number of empty slots for reification
|
||||
tag string or number to optionally identify the Context,
|
||||
as a "return" target (for the "stop block" primitive)
|
||||
|
@ -3730,9 +4065,11 @@ function Context(
|
|||
this.pc = 0;
|
||||
this.isContinuation = false;
|
||||
this.startTime = null;
|
||||
this.activeSends = null;
|
||||
this.activeAudio = null;
|
||||
this.activeNote = null;
|
||||
this.isCustomBlock = false; // marks the end of a custom block's stack
|
||||
this.isCustomCommand = null; // used for ignoring URL reporters' results
|
||||
this.emptySlots = 0; // used for block reification
|
||||
this.tag = null; // lexical catch-tag for custom blocks
|
||||
this.isFlashing = false; // for single-stepping
|
||||
|
@ -4063,7 +4400,8 @@ VariableFrame.prototype.names = function () {
|
|||
return names;
|
||||
};
|
||||
|
||||
VariableFrame.prototype.allNamesDict = function () {
|
||||
VariableFrame.prototype.allNamesDict = function (upTo) {
|
||||
// "upTo" is an optional parent frame at which to stop, e.g. globals
|
||||
var dict = {}, current = this;
|
||||
|
||||
function addKeysToDict(srcDict, trgtDict) {
|
||||
|
@ -4075,19 +4413,20 @@ VariableFrame.prototype.allNamesDict = function () {
|
|||
}
|
||||
}
|
||||
|
||||
while (current) {
|
||||
while (current && (current !== upTo)) {
|
||||
addKeysToDict(current.vars, dict);
|
||||
current = current.parentFrame;
|
||||
}
|
||||
return dict;
|
||||
};
|
||||
|
||||
VariableFrame.prototype.allNames = function () {
|
||||
VariableFrame.prototype.allNames = function (upTo) {
|
||||
/*
|
||||
only show the names of the lexical scope, hybrid scoping is
|
||||
reserved to the daring ;-)
|
||||
"upTo" is an optional parent frame at which to stop, e.g. globals
|
||||
*/
|
||||
var answer = [], each, dict = this.allNamesDict();
|
||||
var answer = [], each, dict = this.allNamesDict(upTo);
|
||||
|
||||
for (each in dict) {
|
||||
if (Object.prototype.hasOwnProperty.call(dict, each)) {
|
||||
|
@ -4096,3 +4435,243 @@ VariableFrame.prototype.allNames = function () {
|
|||
}
|
||||
return answer;
|
||||
};
|
||||
|
||||
// JSCompiler /////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
Compile simple, side-effect free Reporters
|
||||
with either only explicit formal parameters or a specified number of
|
||||
implicit formal parameters mapped to empty input slots
|
||||
*** highly experimental and heavily under construction ***
|
||||
*/
|
||||
|
||||
function JSCompiler(aProcess) {
|
||||
this.process = aProcess;
|
||||
this.source = null; // a context
|
||||
this.gensyms = null; // temp dictionary for parameter substitutions
|
||||
this.implicitParams = null;
|
||||
this.paramCount = null;
|
||||
}
|
||||
|
||||
JSCompiler.prototype.toString = function () {
|
||||
return 'a JSCompiler';
|
||||
};
|
||||
|
||||
JSCompiler.prototype.compileFunction = function (aContext, implicitParamCount) {
|
||||
var block = aContext.expression,
|
||||
parameters = aContext.inputs,
|
||||
parms = [],
|
||||
hasEmptySlots = false,
|
||||
myself = this,
|
||||
i;
|
||||
|
||||
this.source = aContext;
|
||||
this.implicitParams = implicitParamCount || 1;
|
||||
|
||||
// scan for empty input slots
|
||||
hasEmptySlots = !isNil(detect(
|
||||
block.allChildren(),
|
||||
function (morph) {return morph.isEmptySlot && morph.isEmptySlot(); }
|
||||
));
|
||||
|
||||
// translate formal parameters into gensyms
|
||||
this.gensyms = {};
|
||||
this.paramCount = 0;
|
||||
if (parameters.length) {
|
||||
// test for conflicts
|
||||
if (hasEmptySlots) {
|
||||
throw new Error(
|
||||
'compiling does not yet support\n' +
|
||||
'mixing explicit formal parameters\n' +
|
||||
'with empty input slots'
|
||||
);
|
||||
}
|
||||
// map explicit formal parameters
|
||||
parameters.forEach(function (pName, idx) {
|
||||
var pn = 'p' + idx;
|
||||
parms.push(pn);
|
||||
myself.gensyms[pName] = pn;
|
||||
});
|
||||
} else if (hasEmptySlots) {
|
||||
if (this.implicitParams > 1) {
|
||||
for (i = 0; i < this.implicitParams; i += 1) {
|
||||
parms.push('p' + i);
|
||||
}
|
||||
} else {
|
||||
// allow for a single implicit formal parameter
|
||||
parms = ['p0'];
|
||||
}
|
||||
}
|
||||
|
||||
// compile using gensyms
|
||||
|
||||
if (block instanceof CommandBlockMorph) {
|
||||
return Function.apply(
|
||||
null,
|
||||
parms.concat([this.compileSequence(block)])
|
||||
);
|
||||
}
|
||||
return Function.apply(
|
||||
null,
|
||||
parms.concat(['return ' + this.compileExpression(block)])
|
||||
);
|
||||
};
|
||||
|
||||
JSCompiler.prototype.compileExpression = function (block) {
|
||||
var selector = block.selector,
|
||||
inputs = block.inputs(),
|
||||
target,
|
||||
rcvr,
|
||||
args;
|
||||
|
||||
// first check for special forms and infix operators
|
||||
switch (selector) {
|
||||
case 'reportOr':
|
||||
return this.compileInfix('||', inputs);
|
||||
case 'reportAnd':
|
||||
return this.compileInfix('&&', inputs);
|
||||
case 'evaluateCustomBlock':
|
||||
throw new Error(
|
||||
'compiling does not yet support\n' +
|
||||
'custom blocks'
|
||||
);
|
||||
|
||||
// special command forms
|
||||
case 'doSetVar': // redirect var to process
|
||||
return 'arguments[arguments.length - 1].setVarNamed(' +
|
||||
this.compileInput(inputs[0]) +
|
||||
',' +
|
||||
this.compileInput(inputs[1]) +
|
||||
')';
|
||||
case 'doChangeVar': // redirect var to process
|
||||
return 'arguments[arguments.length - 1].incrementVarNamed(' +
|
||||
this.compileInput(inputs[0]) +
|
||||
',' +
|
||||
this.compileInput(inputs[1]) +
|
||||
')';
|
||||
case 'doReport':
|
||||
return 'return ' + this.compileInput(inputs[0]);
|
||||
case 'doIf':
|
||||
return 'if (' +
|
||||
this.compileInput(inputs[0]) +
|
||||
') {\n' +
|
||||
this.compileSequence(inputs[1].evaluate()) +
|
||||
'}';
|
||||
case 'doIfElse':
|
||||
return 'if (' +
|
||||
this.compileInput(inputs[0]) +
|
||||
') {\n' +
|
||||
this.compileSequence(inputs[1].evaluate()) +
|
||||
'} else {\n' +
|
||||
this.compileSequence(inputs[2].evaluate()) +
|
||||
'}';
|
||||
|
||||
default:
|
||||
target = this.process[selector] ? this.process
|
||||
: (this.source.receiver || this.process.receiver);
|
||||
rcvr = target.constructor.name + '.prototype';
|
||||
args = this.compileInputs(inputs);
|
||||
if (isSnapObject(target)) {
|
||||
return rcvr + '.' + selector + '.apply('+ rcvr + ', [' + args +'])';
|
||||
} else {
|
||||
return 'arguments[arguments.length - 1].' +
|
||||
selector +
|
||||
'.apply(arguments[arguments.length - 1], [' + args +'])';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
JSCompiler.prototype.compileSequence = function (commandBlock) {
|
||||
var body = '',
|
||||
myself = this;
|
||||
commandBlock.blockSequence().forEach(function (block) {
|
||||
body += myself.compileExpression(block);
|
||||
body += ';\n';
|
||||
});
|
||||
return body;
|
||||
};
|
||||
|
||||
JSCompiler.prototype.compileInfix = function (operator, inputs) {
|
||||
return '(' + this.compileInput(inputs[0]) + ' ' + operator + ' ' +
|
||||
this.compileInput(inputs[1]) +')';
|
||||
};
|
||||
|
||||
JSCompiler.prototype.compileInputs = function (array) {
|
||||
var args = '',
|
||||
myself = this;
|
||||
|
||||
array.forEach(function (inp) {
|
||||
if (args.length) {
|
||||
args += ', ';
|
||||
}
|
||||
args += myself.compileInput(inp);
|
||||
});
|
||||
return args;
|
||||
};
|
||||
|
||||
JSCompiler.prototype.compileInput = function (inp) {
|
||||
var value, type;
|
||||
|
||||
if (inp.isEmptySlot && inp.isEmptySlot()) {
|
||||
// implicit formal parameter
|
||||
if (this.implicitParams > 1) {
|
||||
if (this.paramCount < this.implicitParams) {
|
||||
this.paramCount += 1;
|
||||
return 'p' + (this.paramCount - 1);
|
||||
}
|
||||
throw new Error(
|
||||
localize('expecting') + ' ' + this.implicitParams + ' '
|
||||
+ localize('input(s), but getting') + ' '
|
||||
+ this.paramCount
|
||||
);
|
||||
}
|
||||
return 'p0';
|
||||
} else if (inp instanceof MultiArgMorph) {
|
||||
return 'new List([' + this.compileInputs(inp.inputs()) + '])';
|
||||
} else if (inp instanceof ArgLabelMorph) {
|
||||
return this.compileInput(inp.argMorph());
|
||||
} else if (inp instanceof ArgMorph) {
|
||||
// literal - evaluate inline
|
||||
value = inp.evaluate();
|
||||
type = this.process.reportTypeOf(value);
|
||||
switch (type) {
|
||||
case 'number':
|
||||
case 'Boolean':
|
||||
return '' + value;
|
||||
case 'text':
|
||||
// enclose in double quotes
|
||||
return '"' + value + '"';
|
||||
case 'list':
|
||||
return 'new List([' + this.compileInputs(value) + '])';
|
||||
default:
|
||||
if (value instanceof Array) {
|
||||
return '"' + value[0] + '"';
|
||||
}
|
||||
throw new Error(
|
||||
'compiling does not yet support\n' +
|
||||
'inputs of type\n' +
|
||||
type
|
||||
);
|
||||
}
|
||||
} else if (inp instanceof BlockMorph) {
|
||||
if (inp.selector === 'reportGetVar') {
|
||||
if (contains(this.source.inputs, inp.blockSpec)) {
|
||||
// un-quoted gensym:
|
||||
return this.gensyms[inp.blockSpec];
|
||||
}
|
||||
// redirect var query to process
|
||||
return 'arguments[arguments.length - 1].getVarNamed("' +
|
||||
inp.blockSpec +
|
||||
'")';
|
||||
}
|
||||
return this.compileExpression(inp);
|
||||
} else {
|
||||
throw new Error(
|
||||
'compiling does not yet support\n' +
|
||||
'input slots of type\n' +
|
||||
inp.constructor.name
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
21
widgets.js
21
widgets.js
|
@ -7,7 +7,7 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2017 by Jens Mönig
|
||||
Copyright (C) 2018 by Jens Mönig
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -85,7 +85,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph,
|
|||
ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences,
|
||||
ScrollFrameMorph, MenuItemMorph, Note*/
|
||||
|
||||
modules.widgets = '2017-September-25';
|
||||
modules.widgets = '2018-February-08';
|
||||
|
||||
var PushButtonMorph;
|
||||
var ToggleButtonMorph;
|
||||
|
@ -2075,6 +2075,10 @@ DialogBoxMorph.prototype.promptCredentials = function (
|
|||
emlLabel = labelText('foo');
|
||||
inp.add(emlLabel);
|
||||
inp.add(eml);
|
||||
inp.add(labelText('Password:'));
|
||||
inp.add(pw1);
|
||||
inp.add(labelText('Repeat Password:'));
|
||||
inp.add(pw2);
|
||||
}
|
||||
|
||||
if (purpose === 'login') {
|
||||
|
@ -2091,7 +2095,7 @@ DialogBoxMorph.prototype.promptCredentials = function (
|
|||
inp.add(pw2);
|
||||
}
|
||||
|
||||
if (purpose === 'resetPassword') {
|
||||
if (purpose === 'resetPassword' || purpose === 'resendVerification') {
|
||||
inp.add(labelText('User name:'));
|
||||
inp.add(usr);
|
||||
}
|
||||
|
@ -2182,10 +2186,10 @@ DialogBoxMorph.prototype.promptCredentials = function (
|
|||
if (purpose === 'login') {
|
||||
checklist = [usr, pw1];
|
||||
} else if (purpose === 'signup') {
|
||||
checklist = [usr, bmn, byr, eml];
|
||||
checklist = [usr, bmn, byr, eml, pw1, pw2];
|
||||
} else if (purpose === 'changePassword') {
|
||||
checklist = [opw, pw1, pw2];
|
||||
} else if (purpose === 'resetPassword') {
|
||||
} else if (purpose === 'resetPassword' || purpose === 'resendVerification') {
|
||||
checklist = [usr];
|
||||
}
|
||||
|
||||
|
@ -2205,12 +2209,12 @@ DialogBoxMorph.prototype.promptCredentials = function (
|
|||
return false;
|
||||
}
|
||||
if (em.indexOf(' ') > -1 || em.indexOf('@') === -1
|
||||
|| em.indexOf('.') === -1) {
|
||||
|| em.indexOf('.') === -1 || em.length < 5) {
|
||||
indicate(eml, 'please provide a valid\nemail address');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (purpose === 'changePassword') {
|
||||
if (purpose === 'changePassword' || purpose === 'signup') {
|
||||
if (pw1.getValue().length < 6) {
|
||||
indicate(pw1, 'password must be six\ncharacters or longer');
|
||||
return false;
|
||||
|
@ -2238,7 +2242,7 @@ DialogBoxMorph.prototype.promptCredentials = function (
|
|||
this.edit = function () {
|
||||
if (purpose === 'changePassword') {
|
||||
opw.edit();
|
||||
} else { // 'signup', 'login', 'resetPassword'
|
||||
} else { // 'signup', 'login', 'resetPassword', 'resendVerification'
|
||||
usr.edit();
|
||||
}
|
||||
};
|
||||
|
@ -2249,6 +2253,7 @@ DialogBoxMorph.prototype.promptCredentials = function (
|
|||
email: eml.getValue(),
|
||||
oldpassword: opw.getValue(),
|
||||
password: pw1.getValue(),
|
||||
passwordRepeat: pw2.getValue(),
|
||||
choice: agree
|
||||
};
|
||||
};
|
||||
|
|
6
xml.js
6
xml.js
|
@ -67,7 +67,7 @@
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.xml = '2015-June-25';
|
||||
modules.xml = '2017-November-15';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -238,7 +238,7 @@ XML_Element.prototype.toString = function (isFormatted, indentationLevel) {
|
|||
for (key in this.attributes) {
|
||||
if (Object.prototype.hasOwnProperty.call(this.attributes, key)
|
||||
&& this.attributes[key]) {
|
||||
result += ' ' + key + '="' + this.attributes[key] + '"';
|
||||
result += ' ' + key + '="' + this.escape(this.attributes[key]) + '"';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -247,7 +247,7 @@ XML_Element.prototype.toString = function (isFormatted, indentationLevel) {
|
|||
result += '/>';
|
||||
} else {
|
||||
result += '>';
|
||||
result += this.contents;
|
||||
result += this.escape(this.contents);
|
||||
this.children.forEach(function (element) {
|
||||
if (isFormatted) {
|
||||
result += '\n';
|
||||
|
|
Ładowanie…
Reference in New Issue