kopia lustrzana https://github.com/backface/turtlestitch
Merge remote-tracking branch 'jmoenig/master'
commit
8ec307f192
File diff suppressed because one or more lines are too long
34
byob.js
34
byob.js
|
@ -108,7 +108,7 @@ WatcherMorph, Variable*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.byob = '2016-February-24';
|
||||
modules.byob = '2016-July-14';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -936,7 +936,7 @@ CustomCommandBlockMorph.prototype.mouseEnter = function () {
|
|||
comment.contents.lines.forEach(function (line) {
|
||||
help = help + '\n' + line;
|
||||
});
|
||||
this.bubbleHelp(
|
||||
this.popUpbubbleHelp(
|
||||
help.substr(1),
|
||||
this.definition.comment.color
|
||||
);
|
||||
|
@ -949,20 +949,6 @@ CustomCommandBlockMorph.prototype.mouseLeave = function () {
|
|||
}
|
||||
};
|
||||
|
||||
// CustomCommandBlockMorph bubble help:
|
||||
|
||||
CustomCommandBlockMorph.prototype.bubbleHelp = function (contents, color) {
|
||||
var myself = this;
|
||||
this.fps = 2;
|
||||
this.step = function () {
|
||||
if (this.bounds.containsPoint(this.world().hand.position())) {
|
||||
myself.popUpbubbleHelp(contents, color);
|
||||
}
|
||||
myself.fps = 0;
|
||||
delete myself.step;
|
||||
};
|
||||
};
|
||||
|
||||
CustomCommandBlockMorph.prototype.popUpbubbleHelp = function (
|
||||
contents,
|
||||
color
|
||||
|
@ -1744,6 +1730,15 @@ BlockDialogMorph.prototype.fixLayout = function () {
|
|||
}
|
||||
};
|
||||
|
||||
BlockDialogMorph.prototype.accept = function () {
|
||||
if ((this.body instanceof InputFieldMorph) &&
|
||||
(this.normalizeSpaces(this.body.getValue()) === '')) {
|
||||
this.edit();
|
||||
} else {
|
||||
BlockDialogMorph.uber.accept.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
// BlockEditorMorph ////////////////////////////////////////////////////
|
||||
|
||||
// BlockEditorMorph inherits from DialogBoxMorph:
|
||||
|
@ -1780,6 +1775,7 @@ BlockEditorMorph.prototype.init = function (definition, target) {
|
|||
|
||||
// create scripting area
|
||||
scripts = new ScriptsMorph(target);
|
||||
scripts.rejectsHats = true;
|
||||
scripts.isDraggable = false;
|
||||
scripts.color = IDE_Morph.prototype.groupColor;
|
||||
scripts.cachedTexture = IDE_Morph.prototype.scriptsPaneTexture;
|
||||
|
@ -2686,6 +2682,7 @@ InputSlotDialogMorph.prototype.init = function (
|
|||
this.isExpanded = false;
|
||||
this.category = category || 'other';
|
||||
this.cachedRadioButton = null; // "template" for radio button backgrounds
|
||||
this.noDelete = false;
|
||||
|
||||
// initialize inherited properties:
|
||||
BlockDialogMorph.uber.init.call(
|
||||
|
@ -2804,8 +2801,9 @@ InputSlotDialogMorph.prototype.getInput = function () {
|
|||
this.fragment.labelString = lbl;
|
||||
this.fragment.defaultValue = this.slots.defaultInputField.getValue();
|
||||
return lbl;
|
||||
} else if (!this.noDelete) {
|
||||
this.fragment.isDeleted = true;
|
||||
}
|
||||
this.fragment.isDeleted = true;
|
||||
return null;
|
||||
};
|
||||
|
||||
|
@ -2890,6 +2888,8 @@ InputSlotDialogMorph.prototype.open = function (
|
|||
this.addButton('ok', 'OK');
|
||||
if (!noDeleteButton) {
|
||||
this.addButton('deleteFragment', 'Delete');
|
||||
} else {
|
||||
this.noDelete = true;
|
||||
}
|
||||
this.addButton('cancel', 'Cancel');
|
||||
this.fixLayout();
|
||||
|
|
431
gui.js
431
gui.js
|
@ -44,6 +44,7 @@
|
|||
CostumeIconMorph
|
||||
WardrobeMorph
|
||||
StageHandleMorph;
|
||||
PaletteHandleMorph;
|
||||
|
||||
|
||||
credits
|
||||
|
@ -62,14 +63,16 @@ InputFieldMorph, FrameMorph, Process, nop, SnapSerializer, ListMorph, detect,
|
|||
AlignmentMorph, TabMorph, Costume, MorphicPreferences, Sound, BlockMorph,
|
||||
ToggleMorph, InputSlotDialogMorph, ScriptsMorph, isNil, SymbolMorph,
|
||||
BlockExportDialogMorph, BlockImportDialogMorph, SnapTranslator, localize,
|
||||
List, InputSlotMorph, SnapCloud, Uint8Array, HandleMorph, SVG_Costume,
|
||||
List, ArgMorph, SnapCloud, Uint8Array, HandleMorph, SVG_Costume,
|
||||
fontHeight, hex_sha512, sb, CommentMorph, CommandBlockMorph,
|
||||
BlockLabelPlaceHolderMorph, Audio, SpeechBubbleMorph, ScriptFocusMorph,
|
||||
XML_Element, WatcherMorph, BlockRemovalDialogMorph, saveAs, TableMorph*/
|
||||
XML_Element, WatcherMorph, BlockRemovalDialogMorph, saveAs, TableMorph,
|
||||
isSnapObject, isRetinaEnabled, disableRetinaSupport, enableRetinaSupport,
|
||||
isRetinaSupported*/
|
||||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.gui = '2016-March-16';
|
||||
modules.gui = '2016-August-12';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -82,6 +85,7 @@ var WardrobeMorph;
|
|||
var SoundIconMorph;
|
||||
var JukeboxMorph;
|
||||
var StageHandleMorph;
|
||||
var PaletteHandleMorph;
|
||||
|
||||
// IDE_Morph ///////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -224,6 +228,7 @@ IDE_Morph.prototype.init = function (isAutoFill) {
|
|||
this.controlBar = null;
|
||||
this.categories = null;
|
||||
this.palette = null;
|
||||
this.paletteHandle = null;
|
||||
this.spriteBar = null;
|
||||
this.spriteEditor = null;
|
||||
this.stage = null;
|
||||
|
@ -238,6 +243,7 @@ IDE_Morph.prototype.init = function (isAutoFill) {
|
|||
this.hasChangedMedia = false;
|
||||
|
||||
this.isAnimating = true;
|
||||
this.paletteWidth = 200; // initially same as logo width
|
||||
this.stageRatio = 1; // for IDE animations, e.g. when zooming
|
||||
|
||||
this.loadNewProject = false; // flag when starting up translated
|
||||
|
@ -458,6 +464,7 @@ IDE_Morph.prototype.openIn = function (world) {
|
|||
}
|
||||
|
||||
if (this.userLanguage) {
|
||||
this.loadNewProject = true;
|
||||
this.setLanguage(this.userLanguage, interpretUrlAnchors);
|
||||
} else {
|
||||
interpretUrlAnchors.call(this);
|
||||
|
@ -849,7 +856,6 @@ IDE_Morph.prototype.createControlBar = function () {
|
|||
};
|
||||
|
||||
IDE_Morph.prototype.createCategories = function () {
|
||||
// assumes the logo has already been created
|
||||
var myself = this;
|
||||
|
||||
if (this.categories) {
|
||||
|
@ -857,7 +863,7 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
}
|
||||
this.categories = new Morph();
|
||||
this.categories.color = this.groupColor;
|
||||
this.categories.silentSetWidth(this.logo.width()); // width is fixed
|
||||
this.categories.silentSetWidth(this.paletteWidth);
|
||||
|
||||
function addCategoryButton(category) {
|
||||
var labelWidth = 75,
|
||||
|
@ -905,7 +911,7 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
buttonHeight = myself.categories.children[0].height(),
|
||||
border = 3,
|
||||
rows = Math.ceil((myself.categories.children.length) / 2),
|
||||
xPadding = (myself.categories.width()
|
||||
xPadding = (200 // myself.logo.width()
|
||||
- border
|
||||
- buttonWidth * 2) / 3,
|
||||
yPadding = 2,
|
||||
|
@ -984,6 +990,13 @@ IDE_Morph.prototype.createPalette = function (forSearching) {
|
|||
return this.palette;
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.createPaletteHandle = function () {
|
||||
// assumes that the palette has already been created
|
||||
if (this.paletteHandle) {this.paletteHandle.destroy(); }
|
||||
this.paletteHandle = new PaletteHandleMorph(this.categories);
|
||||
this.add(this.paletteHandle);
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.createStage = function () {
|
||||
// assumes that the logo pane has already been created
|
||||
if (this.stage) {this.stage.destroy(); }
|
||||
|
@ -1372,6 +1385,8 @@ IDE_Morph.prototype.createCorral = function () {
|
|||
var frame, template, padding = 5, myself = this;
|
||||
|
||||
this.createStageHandle();
|
||||
this.createPaletteHandle();
|
||||
|
||||
if (this.corral) {
|
||||
this.corral.destroy();
|
||||
}
|
||||
|
@ -1399,8 +1414,10 @@ IDE_Morph.prototype.createCorral = function () {
|
|||
frame.alpha = 0;
|
||||
|
||||
this.sprites.asArray().forEach(function (morph) {
|
||||
template = new SpriteIconMorph(morph, template);
|
||||
frame.contents.add(template);
|
||||
if (!morph.isClone) {
|
||||
template = new SpriteIconMorph(morph, template);
|
||||
frame.contents.add(template);
|
||||
}
|
||||
});
|
||||
|
||||
this.corral.frame = frame;
|
||||
|
@ -1473,7 +1490,8 @@ IDE_Morph.prototype.createCorral = function () {
|
|||
IDE_Morph.prototype.fixLayout = function (situation) {
|
||||
// situation is a string, i.e.
|
||||
// 'selectSprite' or 'refreshPalette' or 'tabEditor'
|
||||
var padding = this.padding;
|
||||
var padding = this.padding,
|
||||
maxPaletteWidth;
|
||||
|
||||
Morph.prototype.trackChanges = false;
|
||||
|
||||
|
@ -1486,12 +1504,14 @@ IDE_Morph.prototype.fixLayout = function (situation) {
|
|||
// categories
|
||||
this.categories.setLeft(this.logo.left());
|
||||
this.categories.setTop(this.logo.bottom());
|
||||
this.categories.setWidth(this.paletteWidth);
|
||||
}
|
||||
|
||||
// palette
|
||||
this.palette.setLeft(this.logo.left());
|
||||
this.palette.setTop(this.categories.bottom());
|
||||
this.palette.setHeight(this.bottom() - this.palette.top());
|
||||
this.palette.setWidth(this.paletteWidth);
|
||||
|
||||
if (situation !== 'refreshPalette') {
|
||||
// stage
|
||||
|
@ -1506,11 +1526,21 @@ IDE_Morph.prototype.fixLayout = function (situation) {
|
|||
this.stage.setScale(this.isSmallStage ? this.stageRatio : 1);
|
||||
this.stage.setTop(this.logo.bottom() + padding);
|
||||
this.stage.setRight(this.right());
|
||||
maxPaletteWidth = this.width() -
|
||||
this.stage.width() -
|
||||
this.spriteBar.tabBar.width() -
|
||||
(this.padding * 2);
|
||||
if (this.paletteWidth > maxPaletteWidth) {
|
||||
this.paletteWidth = maxPaletteWidth;
|
||||
this.fixLayout();
|
||||
}
|
||||
this.stageHandle.fixLayout();
|
||||
this.paletteHandle.fixLayout();
|
||||
}
|
||||
|
||||
// spriteBar
|
||||
this.spriteBar.setPosition(this.logo.bottomRight().add(padding));
|
||||
this.spriteBar.setLeft(this.paletteWidth + padding);
|
||||
this.spriteBar.setTop(this.logo.bottom() + padding);
|
||||
this.spriteBar.setExtent(new Point(
|
||||
Math.max(0, this.stage.left() - padding - this.spriteBar.left()),
|
||||
this.categories.bottom() - this.spriteBar.top() - padding
|
||||
|
@ -1579,8 +1609,8 @@ IDE_Morph.prototype.setExtent = function (point) {
|
|||
ext = point.max(minExt);
|
||||
|
||||
// adjust stage ratio if necessary
|
||||
maxWidth = ext.x - (this.spriteBar.tabBar.fullBounds().right() -
|
||||
this.left());
|
||||
maxWidth = ext.x -
|
||||
(200 + this.spriteBar.tabBar.width() + (this.padding * 2));
|
||||
minWidth = SpriteIconMorph.prototype.thumbSize.x * 3;
|
||||
maxHeight = (ext.y - SpriteIconMorph.prototype.thumbSize.y * 3.5);
|
||||
minRatio = minWidth / this.stage.dimensions.x;
|
||||
|
@ -1795,6 +1825,21 @@ IDE_Morph.prototype.selectSprite = function (sprite) {
|
|||
this.currentSprite.scripts.fixMultiArgs();
|
||||
};
|
||||
|
||||
// IDE_Morph retina display support
|
||||
|
||||
IDE_Morph.prototype.toggleRetina = function () {
|
||||
if (isRetinaEnabled()) {
|
||||
disableRetinaSupport();
|
||||
} else {
|
||||
enableRetinaSupport();
|
||||
}
|
||||
this.world().fillPage();
|
||||
IDE_Morph.prototype.scriptsPaneTexture = this.scriptsTexture();
|
||||
this.stage.clearPenTrails();
|
||||
this.drawNew();
|
||||
this.refreshIDE();
|
||||
};
|
||||
|
||||
// IDE_Morph skins
|
||||
|
||||
IDE_Morph.prototype.defaultDesign = function () {
|
||||
|
@ -1884,17 +1929,17 @@ IDE_Morph.prototype.applySavedSettings = function () {
|
|||
}
|
||||
|
||||
// keyboard editing
|
||||
if (keyboard) {
|
||||
ScriptsMorph.prototype.enableKeyboard = true;
|
||||
} else {
|
||||
if (keyboard === 'false') {
|
||||
ScriptsMorph.prototype.enableKeyboard = false;
|
||||
} else {
|
||||
ScriptsMorph.prototype.enableKeyboard = true;
|
||||
}
|
||||
|
||||
// tables
|
||||
if (tables) {
|
||||
List.prototype.enableTables = true;
|
||||
} else {
|
||||
if (tables === 'false') {
|
||||
List.prototype.enableTables = false;
|
||||
} else {
|
||||
List.prototype.enableTables = true;
|
||||
}
|
||||
|
||||
// tableLines
|
||||
|
@ -1988,6 +2033,7 @@ IDE_Morph.prototype.removeSprite = function (sprite) {
|
|||
sprite.parts.forEach(function (part) {myself.removeSprite(part); });
|
||||
idx = this.sprites.asArray().indexOf(sprite) + 1;
|
||||
this.stage.threads.stopAllForReceiver(sprite);
|
||||
sprite.corpsify();
|
||||
sprite.destroy();
|
||||
this.stage.watchers().forEach(function (watcher) {
|
||||
if (watcher.object() === sprite) {
|
||||
|
@ -2261,6 +2307,15 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
);
|
||||
}
|
||||
menu.addLine();
|
||||
if (isRetinaSupported()) {
|
||||
addPreference(
|
||||
'Retina display support',
|
||||
'toggleRetina',
|
||||
isRetinaEnabled(),
|
||||
'uncheck for lower resolution,\nsaves computing resources',
|
||||
'check for higher resolution,\nuses more computing resources'
|
||||
);
|
||||
}
|
||||
addPreference(
|
||||
'Blurred shadows',
|
||||
'toggleBlurredShadows',
|
||||
|
@ -2326,7 +2381,7 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
addPreference(
|
||||
'Execute on slider change',
|
||||
'toggleSliderExecute',
|
||||
InputSlotMorph.prototype.executeOnSliderEdit,
|
||||
ArgMorph.prototype.executeOnSliderEdit,
|
||||
'uncheck to supress\nrunning scripts\nwhen moving the slider',
|
||||
'check to run\nthe edited script\nwhen moving the slider'
|
||||
);
|
||||
|
@ -2421,15 +2476,29 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
'check to enable\nsprite composition',
|
||||
true
|
||||
);
|
||||
addPreference(
|
||||
'First-Class Sprites',
|
||||
function () {
|
||||
SpriteMorph.prototype.enableFirstClass =
|
||||
!SpriteMorph.prototype.enableFirstClass;
|
||||
myself.currentSprite.blocksCache.sensing = null;
|
||||
myself.currentSprite.paletteCache.sensing = null;
|
||||
myself.refreshPalette();
|
||||
},
|
||||
SpriteMorph.prototype.enableFirstClass,
|
||||
'uncheck to disable support\nfor first-class sprites',
|
||||
'check to enable support\n for first-class sprite',
|
||||
true
|
||||
);
|
||||
addPreference(
|
||||
'Keyboard Editing',
|
||||
function () {
|
||||
ScriptsMorph.prototype.enableKeyboard =
|
||||
!ScriptsMorph.prototype.enableKeyboard;
|
||||
if (ScriptsMorph.prototype.enableKeyboard) {
|
||||
myself.saveSetting('keyboard', true);
|
||||
} else {
|
||||
myself.removeSetting('keyboard');
|
||||
} else {
|
||||
myself.saveSetting('keyboard', false);
|
||||
}
|
||||
},
|
||||
ScriptsMorph.prototype.enableKeyboard,
|
||||
|
@ -2443,9 +2512,9 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
List.prototype.enableTables =
|
||||
!List.prototype.enableTables;
|
||||
if (List.prototype.enableTables) {
|
||||
myself.saveSetting('tables', true);
|
||||
} else {
|
||||
myself.removeSetting('tables');
|
||||
} else {
|
||||
myself.saveSetting('tables', false);
|
||||
}
|
||||
},
|
||||
List.prototype.enableTables,
|
||||
|
@ -2471,6 +2540,17 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
false
|
||||
);
|
||||
}
|
||||
addPreference(
|
||||
'Live coding support',
|
||||
function () {
|
||||
Process.prototype.enableLiveCoding =
|
||||
!Process.prototype.enableLiveCoding;
|
||||
},
|
||||
Process.prototype.enableLiveCoding,
|
||||
'EXPERIMENTAL! uncheck to disable live\ncustom control structures',
|
||||
'EXPERIMENTAL! check to enable\n live custom control structures',
|
||||
true
|
||||
);
|
||||
menu.addLine(); // everything below this line is stored in the project
|
||||
addPreference(
|
||||
'Thread safe scripts',
|
||||
|
@ -2612,7 +2692,9 @@ IDE_Morph.prototype.projectMenu = function () {
|
|||
|
||||
if (shiftClicked) {
|
||||
menu.addItem(
|
||||
localize('Export project...') + ' ' + localize('(in a new window)'),
|
||||
localize(
|
||||
'Export project...') + ' ' + localize('(in a new window)'
|
||||
),
|
||||
function () {
|
||||
if (myself.projectName) {
|
||||
myself.exportProject(myself.projectName, shiftClicked);
|
||||
|
@ -2708,19 +2790,9 @@ IDE_Morph.prototype.projectMenu = function () {
|
|||
|
||||
menu.addItem(
|
||||
localize(graphicsName) + '...',
|
||||
createMediaMenu(
|
||||
graphicsName,
|
||||
function loadCostume(file, name) {
|
||||
var url = myself.resourceURL(graphicsName, file),
|
||||
img = new Image();
|
||||
img.onload = function () {
|
||||
var canvas = newCanvas(new Point(img.width, img.height));
|
||||
canvas.getContext('2d').drawImage(img, 0, 0);
|
||||
myself.droppedImage(canvas, name);
|
||||
};
|
||||
img.src = url;
|
||||
}
|
||||
),
|
||||
function () {
|
||||
myself.importMedia(graphicsName);
|
||||
},
|
||||
'Select a costume from the media library'
|
||||
);
|
||||
menu.addItem(
|
||||
|
@ -2799,6 +2871,109 @@ IDE_Morph.prototype.parseResourceFile = function (text) {
|
|||
return items;
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.importMedia = function (mediaType) {
|
||||
// open a dialog box letting the user browse available "built-in"
|
||||
// costumes or backgrounds
|
||||
|
||||
var dialog = new DialogBoxMorph().withKey('import' + mediaType),
|
||||
frame = new ScrollFrameMorph(),
|
||||
selectedIcon = null,
|
||||
turtle = new SymbolMorph('turtle', 60),
|
||||
items = this.getMediaList(mediaType),
|
||||
myself = this,
|
||||
world = this.world(),
|
||||
handle;
|
||||
|
||||
frame.acceptsDrops = false;
|
||||
frame.contents.acceptsDrops = false;
|
||||
frame.color = myself.groupColor;
|
||||
frame.fixLayout = nop;
|
||||
dialog.labelString = mediaType;
|
||||
dialog.createLabel();
|
||||
dialog.addBody(frame);
|
||||
dialog.addButton('ok', 'Import');
|
||||
dialog.addButton('cancel', 'Cancel');
|
||||
|
||||
dialog.ok = function () {
|
||||
if (selectedIcon) {
|
||||
myself.droppedImage(
|
||||
selectedIcon.object.contents,
|
||||
selectedIcon.labelString
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
dialog.fixLayout = function () {
|
||||
var th = fontHeight(this.titleFontSize) + this.titlePadding * 2,
|
||||
x = 0,
|
||||
y = 0,
|
||||
fp, fw;
|
||||
this.buttons.fixLayout();
|
||||
this.body.setPosition(this.position().add(new Point(
|
||||
this.padding,
|
||||
th + this.padding
|
||||
)));
|
||||
this.body.setExtent(new Point(
|
||||
this.width() - this.padding * 2,
|
||||
this.height() - this.padding * 3 - th - this.buttons.height()
|
||||
));
|
||||
fp = this.body.position();
|
||||
fw = this.body.width();
|
||||
frame.contents.children.forEach(function (icon) {
|
||||
icon.setPosition(fp.add(new Point(x, y)));
|
||||
x += icon.width();
|
||||
if (x + icon.width() > fw) {
|
||||
x = 0;
|
||||
y += icon.height();
|
||||
}
|
||||
});
|
||||
frame.contents.adjustBounds();
|
||||
this.label.setCenter(this.center());
|
||||
this.label.setTop(this.top() + (th - this.label.height()) / 2);
|
||||
this.buttons.setCenter(this.center());
|
||||
this.buttons.setBottom(this.bottom() - this.padding);
|
||||
};
|
||||
|
||||
items.forEach(function (item) {
|
||||
var url = myself.resourceURL(mediaType, item.file),
|
||||
img = new Image(),
|
||||
icon = new CostumeIconMorph(
|
||||
new Costume(turtle.image, item.name)
|
||||
);
|
||||
icon.isDraggable = false;
|
||||
icon.userMenu = nop;
|
||||
icon.action = function () {
|
||||
if (selectedIcon === icon) return;
|
||||
var prevSelected = selectedIcon;
|
||||
selectedIcon = icon;
|
||||
if (prevSelected) prevSelected.refresh();
|
||||
};
|
||||
icon.doubleClickAction = dialog.ok;
|
||||
icon.query = function () {
|
||||
return icon === selectedIcon;
|
||||
};
|
||||
frame.addContents(icon);
|
||||
img.onload = function () {
|
||||
var canvas = newCanvas(new Point(img.width, img.height), true);
|
||||
canvas.getContext('2d').drawImage(img, 0, 0);
|
||||
icon.object = new Costume(canvas, item.name);
|
||||
icon.refresh();
|
||||
};
|
||||
img.src = url;
|
||||
});
|
||||
dialog.popUp(world);
|
||||
dialog.setExtent(new Point(400, 300));
|
||||
dialog.setCenter(world.center());
|
||||
dialog.drawNew();
|
||||
|
||||
handle = new HandleMorph(
|
||||
dialog,
|
||||
300,
|
||||
280,
|
||||
dialog.corner,
|
||||
dialog.corner
|
||||
);
|
||||
};
|
||||
|
||||
// IDE_Morph menu actions
|
||||
|
||||
|
@ -2807,15 +2982,16 @@ IDE_Morph.prototype.aboutSnap = function () {
|
|||
module, btn1, btn2, btn3, btn4, licenseBtn, translatorsBtn,
|
||||
world = this.world();
|
||||
|
||||
aboutTxt = 'Snap! 4.0.6\nBuild Your Own Blocks\n\n'
|
||||
aboutTxt = 'Snap! 4.0.8.7\nBuild Your Own Blocks\n\n'
|
||||
+ 'Copyright \u24B8 2016 Jens M\u00F6nig and '
|
||||
+ 'Brian Harvey\n'
|
||||
+ 'jens@moenig.org, bh@cs.berkeley.edu\n\n'
|
||||
|
||||
+ 'Snap! is developed by the University of California, Berkeley\n'
|
||||
+ ' with support from the National Science Foundation, '
|
||||
+ 'MioSoft, \n'
|
||||
+ 'and the Communications Design Group at SAP Labs. \n'
|
||||
+ ' with support from the National Science Foundation (NSF), '
|
||||
+ 'MioSoft, \n'
|
||||
+ 'the Communications Design Group (CDG) at SAP Labs, and the\n'
|
||||
+ 'Human Advancement Research Community (HARC) at YC Research.\n'
|
||||
|
||||
+ 'The design of Snap! is influenced and inspired by Scratch,\n'
|
||||
+ 'from the Lifelong Kindergarten group at the MIT Media Lab\n\n'
|
||||
|
@ -2844,7 +3020,8 @@ IDE_Morph.prototype.aboutSnap = function () {
|
|||
+ '\ncountless bugfixes and optimizations'
|
||||
+ '\nKartik Chandra: Paint Editor'
|
||||
+ '\nMichael Ball: Time/Date UI, many bugfixes'
|
||||
+ '\n"Ava" Yuan Yuan: Graphic Effects'
|
||||
+ '\nBartosz Leper: Retina Display Support'
|
||||
+ '\n"Ava" Yuan Yuan, Dylan Servilla: Graphic Effects'
|
||||
+ '\nKyle Hotchkiss: Block search design'
|
||||
+ '\nIan Reynolds: UI Design, Event Bindings, '
|
||||
+ 'Sound primitives'
|
||||
|
@ -3027,6 +3204,7 @@ IDE_Morph.prototype.newProject = function () {
|
|||
StageMorph.prototype.enableInheritance = false;
|
||||
StageMorph.prototype.enableSublistIDs = false;
|
||||
SpriteMorph.prototype.useFlatLineEnds = false;
|
||||
Process.prototype.enableLiveCoding = false;
|
||||
this.setProjectName('');
|
||||
this.projectNotes = '';
|
||||
this.createStage();
|
||||
|
@ -3534,6 +3712,7 @@ IDE_Morph.prototype.rawOpenProjectString = function (str) {
|
|||
StageMorph.prototype.enableCodeMapping = false;
|
||||
StageMorph.prototype.enableInheritance = false;
|
||||
StageMorph.prototype.enableSublistIDs = false;
|
||||
Process.prototype.enableLiveCoding = false;
|
||||
if (Process.prototype.isCatchingErrors) {
|
||||
try {
|
||||
this.serializer.openProject(
|
||||
|
@ -3578,6 +3757,7 @@ IDE_Morph.prototype.rawOpenCloudDataString = function (str) {
|
|||
StageMorph.prototype.enableCodeMapping = false;
|
||||
StageMorph.prototype.enableInheritance = false;
|
||||
StageMorph.prototype.enableSublistIDs = false;
|
||||
Process.prototype.enableLiveCoding = false;
|
||||
if (Process.prototype.isCatchingErrors) {
|
||||
try {
|
||||
model = this.serializer.parse(str);
|
||||
|
@ -3811,15 +3991,19 @@ IDE_Morph.prototype.saveFileAs = function (
|
|||
|
||||
IDE_Morph.prototype.saveCanvasAs = function (canvas, fileName, newWindow) {
|
||||
// Export a Canvas object as a PNG image
|
||||
// cavas.toBlob() is currently only supported in Firefox and IE
|
||||
var myself = this;
|
||||
if (canvas.toBlob) {
|
||||
canvas.toBlob(function (blob) {
|
||||
myself.saveFileAs(blob, 'image/png', fileName, newWindow);
|
||||
});
|
||||
} else {
|
||||
this.saveFileAs(canvas.toDataURL(), 'image/png', fileName, newWindow);
|
||||
}
|
||||
// Note: This commented out due to poor browser support.
|
||||
// cavas.toBlob() is currently supported in Firefox, IE, Chrome but
|
||||
// browsers prevent easily saving the generated files.
|
||||
// Do not re-enable without revisiting issue #1191
|
||||
// if (canvas.toBlob) {
|
||||
// var myself = this;
|
||||
// canvas.toBlob(function (blob) {
|
||||
// myself.saveFileAs(blob, 'image/png', fileName, newWindow);
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
this.saveFileAs(canvas.toDataURL(), 'image/png', fileName, newWindow);
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.saveXMLAs = function(xml, fileName, newWindow) {
|
||||
|
@ -3849,7 +4033,11 @@ IDE_Morph.prototype.switchToUserMode = function () {
|
|||
// onto the World in user-mode
|
||||
world.reactToDropOf = function (morph) {
|
||||
if (!(morph instanceof DialogBoxMorph)) {
|
||||
world.hand.grab(morph);
|
||||
if (world.hand.grabOrigin) {
|
||||
morph.slideBackTo(world.hand.grabOrigin);
|
||||
} else {
|
||||
world.hand.grab(morph);
|
||||
}
|
||||
}
|
||||
};
|
||||
this.showMessage('entering user mode', 1);
|
||||
|
@ -3929,7 +4117,7 @@ IDE_Morph.prototype.toggleZebraColoring = function () {
|
|||
|
||||
// select all scripts:
|
||||
this.stage.children.concat(this.stage).forEach(function (morph) {
|
||||
if (morph instanceof SpriteMorph || morph instanceof StageMorph) {
|
||||
if (isSnapObject(morph)) {
|
||||
scripts = scripts.concat(
|
||||
morph.scripts.children.filter(function (morph) {
|
||||
return morph instanceof BlockMorph;
|
||||
|
@ -4004,8 +4192,8 @@ IDE_Morph.prototype.toggleInputSliders = function () {
|
|||
};
|
||||
|
||||
IDE_Morph.prototype.toggleSliderExecute = function () {
|
||||
InputSlotMorph.prototype.executeOnSliderEdit =
|
||||
!InputSlotMorph.prototype.executeOnSliderEdit;
|
||||
ArgMorph.prototype.executeOnSliderEdit =
|
||||
!ArgMorph.prototype.executeOnSliderEdit;
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.toggleAppMode = function (appMode) {
|
||||
|
@ -4016,6 +4204,7 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
|
|||
this.controlBar.projectButton,
|
||||
this.controlBar.settingsButton,
|
||||
this.controlBar.stageSizeButton,
|
||||
this.paletteHandle,
|
||||
this.stageHandle,
|
||||
this.corral,
|
||||
this.corralBar,
|
||||
|
@ -4075,9 +4264,9 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
|
|||
this.setExtent(this.world().extent()); // resume trackChanges
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.toggleStageSize = function (isSmall) {
|
||||
IDE_Morph.prototype.toggleStageSize = function (isSmall, forcedRatio) {
|
||||
var myself = this,
|
||||
smallRatio = 0.5,
|
||||
smallRatio = forcedRatio || 0.5,
|
||||
world = this.world(),
|
||||
shiftClicked = (world.currentKey === 16),
|
||||
altClicked = (world.currentKey === 18);
|
||||
|
@ -4135,6 +4324,29 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall) {
|
|||
}
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.setPaletteWidth = function (newWidth) {
|
||||
var count = 1,
|
||||
steps = this.isAnimating ? 5 : 1,
|
||||
world = this.world(),
|
||||
myself = this;
|
||||
|
||||
newWidth = Math.max(newWidth, 200);
|
||||
this.fps = 30;
|
||||
this.step = function () {
|
||||
var diff;
|
||||
if (count >= steps) {
|
||||
myself.paletteWidth = newWidth;
|
||||
delete myself.step;
|
||||
myself.fps = 0;
|
||||
} else {
|
||||
count += 1;
|
||||
diff = (myself.paletteWidth - newWidth) / 2;
|
||||
myself.paletteWidth -= diff;
|
||||
}
|
||||
myself.setExtent(world.extent());
|
||||
};
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.createNewProject = function () {
|
||||
var myself = this;
|
||||
this.confirm(
|
||||
|
@ -4166,7 +4378,10 @@ IDE_Morph.prototype.languageMenu = function () {
|
|||
menu.addItem(
|
||||
(SnapTranslator.language === lang ? '\u2713 ' : ' ') +
|
||||
SnapTranslator.languageName(lang),
|
||||
function () {myself.setLanguage(lang); }
|
||||
function () {
|
||||
myself.loadNewProject = false;
|
||||
myself.setLanguage(lang);
|
||||
}
|
||||
);
|
||||
});
|
||||
menu.popup(world, pos);
|
||||
|
@ -4193,7 +4408,8 @@ IDE_Morph.prototype.setLanguage = function (lang, callback) {
|
|||
};
|
||||
|
||||
IDE_Morph.prototype.reflectLanguage = function (lang, callback) {
|
||||
var projectData;
|
||||
var projectData,
|
||||
urlBar = location.hash;
|
||||
SnapTranslator.language = lang;
|
||||
if (!this.loadNewProject) {
|
||||
if (Process.prototype.isCatchingErrors) {
|
||||
|
@ -4213,6 +4429,7 @@ IDE_Morph.prototype.reflectLanguage = function (lang, callback) {
|
|||
this.fixLayout();
|
||||
if (this.loadNewProject) {
|
||||
this.newProject();
|
||||
location.hash = urlBar;
|
||||
} else {
|
||||
this.openProjectString(projectData);
|
||||
}
|
||||
|
@ -4807,7 +5024,7 @@ IDE_Morph.prototype.getURL = function (url) {
|
|||
}
|
||||
throw new Error('unable to retrieve ' + url);
|
||||
} catch (err) {
|
||||
myself.showMessage(err);
|
||||
myself.showMessage(err.toString());
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
@ -6298,7 +6515,8 @@ CostumeIconMorph.prototype.editCostume = function () {
|
|||
} else {
|
||||
this.object.edit(
|
||||
this.world(),
|
||||
this.parentThatIsA(IDE_Morph)
|
||||
this.parentThatIsA(IDE_Morph),
|
||||
false // not a new costume, retain existing rotation center
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -6707,7 +6925,7 @@ WardrobeMorph.prototype.removeCostumeAt = function (idx) {
|
|||
|
||||
WardrobeMorph.prototype.paintNew = function () {
|
||||
var cos = new Costume(
|
||||
newCanvas(),
|
||||
newCanvas(null, true),
|
||||
this.sprite.newCostumeName(localize('Untitled'))
|
||||
),
|
||||
ide = this.parentThatIsA(IDE_Morph),
|
||||
|
@ -7218,3 +7436,92 @@ StageHandleMorph.prototype.mouseLeave = function () {
|
|||
this.changed();
|
||||
};
|
||||
|
||||
StageHandleMorph.prototype.mouseDoubleClick = function () {
|
||||
this.target.parentThatIsA(IDE_Morph).toggleStageSize(true, 1);
|
||||
};
|
||||
|
||||
// PaletteHandleMorph ////////////////////////////////////////////////////////
|
||||
|
||||
// I am a horizontal resizing handle for a blocks palette
|
||||
// I pseudo-inherit many things from StageHandleMorph
|
||||
|
||||
// PaletteHandleMorph inherits from Morph:
|
||||
|
||||
PaletteHandleMorph.prototype = new Morph();
|
||||
PaletteHandleMorph.prototype.constructor = PaletteHandleMorph;
|
||||
PaletteHandleMorph.uber = Morph.prototype;
|
||||
|
||||
// PaletteHandleMorph instance creation:
|
||||
|
||||
function PaletteHandleMorph(target) {
|
||||
this.init(target);
|
||||
}
|
||||
|
||||
PaletteHandleMorph.prototype.init = function (target) {
|
||||
this.target = target || null;
|
||||
HandleMorph.uber.init.call(this);
|
||||
this.color = MorphicPreferences.isFlat ?
|
||||
new Color(255, 255, 255) : new Color(190, 190, 190);
|
||||
this.isDraggable = false;
|
||||
this.noticesTransparentClick = true;
|
||||
this.setExtent(new Point(12, 50));
|
||||
};
|
||||
|
||||
// PaletteHandleMorph drawing:
|
||||
|
||||
PaletteHandleMorph.prototype.drawNew =
|
||||
StageHandleMorph.prototype.drawNew;
|
||||
|
||||
PaletteHandleMorph.prototype.drawOnCanvas =
|
||||
StageHandleMorph.prototype.drawOnCanvas;
|
||||
|
||||
// PaletteHandleMorph layout:
|
||||
|
||||
PaletteHandleMorph.prototype.fixLayout = function () {
|
||||
if (!this.target) {return; }
|
||||
var ide = this.target.parentThatIsA(IDE_Morph);
|
||||
this.setTop(this.target.top() + 10);
|
||||
this.setRight(this.target.right());
|
||||
if (ide) {ide.add(this); } // come to front
|
||||
};
|
||||
|
||||
// PaletteHandleMorph stepping:
|
||||
|
||||
PaletteHandleMorph.prototype.step = null;
|
||||
|
||||
PaletteHandleMorph.prototype.mouseDownLeft = function (pos) {
|
||||
var world = this.world(),
|
||||
offset = this.right() - pos.x,
|
||||
ide = this.target.parentThatIsA(IDE_Morph);
|
||||
|
||||
if (!this.target) {
|
||||
return null;
|
||||
}
|
||||
this.step = function () {
|
||||
var newPos;
|
||||
if (world.hand.mouseButton) {
|
||||
newPos = world.hand.bounds.origin.x + offset;
|
||||
ide.paletteWidth = Math.min(
|
||||
Math.max(200, newPos),
|
||||
ide.stageHandle.left() - ide.spriteBar.tabBar.width()
|
||||
);
|
||||
ide.setExtent(world.extent());
|
||||
|
||||
} else {
|
||||
this.step = null;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// PaletteHandleMorph events:
|
||||
|
||||
PaletteHandleMorph.prototype.mouseEnter
|
||||
= StageHandleMorph.prototype.mouseEnter;
|
||||
|
||||
PaletteHandleMorph.prototype.mouseLeave
|
||||
= StageHandleMorph.prototype.mouseLeave;
|
||||
|
||||
PaletteHandleMorph.prototype.mouseDoubleClick = function () {
|
||||
this.target.parentThatIsA(IDE_Morph).setPaletteWidth(200);
|
||||
};
|
||||
|
||||
|
|
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 388 KiB Po Szerokość: | Wysokość: | Rozmiar: 99 KiB |
122
history.txt
122
history.txt
|
@ -2882,3 +2882,125 @@ end - bulk of 151215
|
|||
* added web api / https reporter library
|
||||
* Blocks, Store: New “transient variable” feature
|
||||
* German translation update
|
||||
|
||||
== v4.0.6 ==== - saving linked lists
|
||||
|
||||
160502
|
||||
------
|
||||
* first class sprites, new MY reporter block and extended functionality of TOUCHING
|
||||
* fixed switching from list watcher to table view inside sprite speech bubbles
|
||||
* fixed paint editor automatic rotation center issue
|
||||
* enhanced functionality to SET a sprite’s attributes
|
||||
* execute clone initialization scripts’ first step in the same frame as the clone command
|
||||
* auto-repair (sorta) certain broken project files
|
||||
* Threads: More aggressive emergency yielding
|
||||
* “corpsify” deleted sprites, which might still be referred to by variables and lists
|
||||
* Blocks: simplify block copying
|
||||
* experimental hidden “live-coding support” preference
|
||||
* updated penTrails library to shrinkWrap generated costumes
|
||||
|
||||
|
||||
demos from the documentation:
|
||||
http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=population
|
||||
http://snap.berkeley.edu/run#present:Username=jens&ProjectName=Woodworm
|
||||
http://snap.berkeley.edu/run#present:Username=jens&ProjectName=Ferris%20Wheel%202016
|
||||
http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=PathFollower
|
||||
http://snap.berkeley.edu/run#present:Username=jens&ProjectName=cartwheel
|
||||
http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
|
||||
|
||||
* new Indonesian translation. Yay!! Thank you, Alexander Liu!!
|
||||
* Translation updates: Slovenian, Portuguese, Chinese
|
||||
* minor bug fixes
|
||||
|
||||
== v4.0.7 ==== - first class sprites
|
||||
|
||||
160504
|
||||
------
|
||||
* Morphic, Objects, Blocks, Threads, GUI: Partially shallow-copy clones for speed
|
||||
* new Estonian translation! Yay!! Thanks, Hasso Tepper!
|
||||
|
||||
== v4.0.7.1 ==== - cloning speed-up
|
||||
|
||||
160509
|
||||
------
|
||||
* Threads: fixed #1212 - Null continuation doesn't escape from calling context.
|
||||
* Updated Simplified Chinese translation, thanks to @ubertao!
|
||||
* Media import dialog with thumbnail, thanks to @ubertao!
|
||||
|
||||
== v4.0.7.2 ====
|
||||
|
||||
160714
|
||||
------
|
||||
* New Features
|
||||
- Retina Display Support, thanks, Bartosz Leper!!
|
||||
- Additional Graphic Effects, thanks, Dylan Servilla!!
|
||||
- Interactive Toggle Switches for Boolean Slots and Literals
|
||||
- Resizable Palette (double-click on resizers to slide back to normal)
|
||||
|
||||
* New Default Settings (now enabled by default)
|
||||
- Keyboard Editing
|
||||
- Tables Support
|
||||
|
||||
* Bugfixes (most notable only):
|
||||
- reject dropping hat-blocks into block editor scripting areas
|
||||
- accept multi-line inputs (e.g. in JS-functions or code-mapping blocks) with shift-enter
|
||||
- prevent “make a block” dialog from being closed by pressing “OK” if no label text has been specified
|
||||
- show error message balloons happening in other sprites next to their icon in the sprite-corral
|
||||
- (again) enable recursive cloning
|
||||
- prevent expandable blocks from expanding / collapsing inside the palette
|
||||
|
||||
* Translation updates
|
||||
- Italian
|
||||
- Swedish
|
||||
- Chinese
|
||||
- Russian
|
||||
- Catalan
|
||||
- German
|
||||
|
||||
== v4.0.8 ==== - retina screen support -
|
||||
|
||||
160715
|
||||
------
|
||||
* Blocks: activate generic hat blocks inserted via keyboard editing
|
||||
|
||||
== v4.0.8.1 ====
|
||||
|
||||
160717
|
||||
------
|
||||
* Morphic: fixed collision detection for non-integer devicePixelRatios
|
||||
|
||||
== v4.0.8.2 ====
|
||||
|
||||
160719
|
||||
------
|
||||
* Morphic: avoid blitting artifacts for non-integer devicePixelRatios in Firefox
|
||||
* Widgets: fixed 3D corners for buttons in Firefox for Windows
|
||||
* Objects: fixed color collision detection for retina mode
|
||||
* Threads: enable broadcasts to be sent to specific sprites (experimental)
|
||||
|
||||
== v4.0.8.3 ====
|
||||
|
||||
160720
|
||||
------
|
||||
* GUI: fixed #1333 - paint a new costume not working in retina mode in FF and Edge
|
||||
|
||||
== v4.0.8.4 ====
|
||||
|
||||
160731
|
||||
------
|
||||
* GUI: fixed #1348 - opening projects from url not working in non-English
|
||||
|
||||
== v4.0.8.5 ====
|
||||
|
||||
160803
|
||||
------
|
||||
* Store: restore implicit formal parameters for serialized lambdas
|
||||
|
||||
== v4.0.8.6 ====
|
||||
|
||||
160812
|
||||
------
|
||||
* Threads: for hidden sprites display ASK questions in the input box
|
||||
* Morphic: replace deprecated KeyboardEvent.keyIdentifier with .key
|
||||
|
||||
== v4.0.8.7 ====
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<title>Redirecting to Snap!</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>If you are no automatically redirected to Snap<i>!</i>,
|
||||
<p>If you are not automatically redirected to Snap<i>!</i>,
|
||||
<a href="snap.html">please click here.</a> </p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
173
lang-ca.js
173
lang-ca.js
|
@ -181,11 +181,11 @@ SnapTranslator.dict.ca = {
|
|||
'language_name':
|
||||
'Català', // the name as it should appear in the language menu
|
||||
'language_translator':
|
||||
'Bernat Romagosa Carrasquer', // your name for the Translators tab
|
||||
'Bernat Romagosa Carrasquer, Joan Guillén i Pelegay', // your name for the Translators tab
|
||||
'translator_e-mail':
|
||||
'bromagosa@citilab.eu', // optional
|
||||
'bernat@arduino.org, jguille2@xtec.cat', // optional
|
||||
'last_changed':
|
||||
'2015-09-17', // this, too, will appear in the Translators tab
|
||||
'2016-07-07', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -236,15 +236,15 @@ SnapTranslator.dict.ca = {
|
|||
|
||||
// rotation styles:
|
||||
'don\'t rotate':
|
||||
'no girar',
|
||||
'no gira',
|
||||
'can rotate':
|
||||
'pot girar',
|
||||
'only face left/right':
|
||||
'només mirar esquerra/dreta',
|
||||
'només mira a esquerra/dreta',
|
||||
|
||||
// new sprite button:
|
||||
'add a new sprite':
|
||||
'afegir un nou objecte',
|
||||
'afegeix un nou objecte',
|
||||
|
||||
// tab help
|
||||
'costumes tab help':
|
||||
|
@ -291,7 +291,7 @@ SnapTranslator.dict.ca = {
|
|||
+ 'disponibles',
|
||||
|
||||
'move %n steps':
|
||||
'moure %n passos',
|
||||
'mou-te %n passos',
|
||||
'turn %clockwise %n degrees':
|
||||
'gira %clockwise %n graus',
|
||||
'turn %counterclockwise %n degrees':
|
||||
|
@ -527,6 +527,8 @@ SnapTranslator.dict.ca = {
|
|||
'cronòmetre',
|
||||
'%att of %spr':
|
||||
'%att de %spr',
|
||||
'my %get':
|
||||
'atribut %get',
|
||||
'http:// %s':
|
||||
'http:// %s',
|
||||
'turbo mode?':
|
||||
|
@ -573,26 +575,26 @@ SnapTranslator.dict.ca = {
|
|||
'length of %s':
|
||||
'longitud de %s',
|
||||
'unicode of %s':
|
||||
'Valor Unicode de %s',
|
||||
'valor Unicode de %s',
|
||||
'unicode %n as letter':
|
||||
'Lletra amb valor Unicode %n',
|
||||
'lletra amb valor Unicode %n',
|
||||
'is %s a %typ ?':
|
||||
'És %s un %typ ?',
|
||||
'és %s un %typ ?',
|
||||
'is %s identical to %s ?':
|
||||
'És %s idèntic a %s ?',
|
||||
'és %s idèntic a %s ?',
|
||||
|
||||
'type of %s':
|
||||
'tipus de %s',
|
||||
|
||||
// variables:
|
||||
'Make a variable':
|
||||
'Crear una variable',
|
||||
'Crea una variable',
|
||||
'Variable name':
|
||||
'Nom de variable',
|
||||
'Script variable name':
|
||||
'Nom de la variable de programa',
|
||||
'Delete a variable':
|
||||
'Esborrar una variable',
|
||||
'Esborra una variable',
|
||||
|
||||
'set %var to %s':
|
||||
'assigna a %var el valor %s',
|
||||
|
@ -609,7 +611,7 @@ SnapTranslator.dict.ca = {
|
|||
'list %exp':
|
||||
'llista %exp',
|
||||
'%s in front of %l':
|
||||
'%s afegir davant de %l',
|
||||
'afegeix %s davant de %l',
|
||||
'item %idx of %l':
|
||||
'element %idx de %l',
|
||||
'all but first of %l':
|
||||
|
@ -642,15 +644,15 @@ SnapTranslator.dict.ca = {
|
|||
'Snap! website':
|
||||
'Web de Snap!',
|
||||
'Download source':
|
||||
'Descarregar codi font',
|
||||
'Descarrega el codi font',
|
||||
'Switch back to user mode':
|
||||
'Tornar a mode d\'usuari',
|
||||
'Torna a mode d\'usuari',
|
||||
'disable deep-Morphic\ncontext menus\nand show user-friendly ones':
|
||||
'canviar menús contextuals\nprimitius de Morphic\nper menús més amigables',
|
||||
'canvia els menús contextuals\nprimitius de Morphic\nper menús més amigables',
|
||||
'Switch to dev mode':
|
||||
'Canviar a mode desenvolupador',
|
||||
'Canvia a mode desenvolupador',
|
||||
'enable Morphic\ncontext menus\nand inspectors,\nnot user-friendly!':
|
||||
'habilitar menús\ncontextuals de\nMorphic i inspectors,\nmode expert!',
|
||||
'habilita els menús\ncontextuals de\nMorphic i inspectors,\nmode expert!',
|
||||
|
||||
// project menu
|
||||
'Project notes...':
|
||||
|
@ -658,30 +660,32 @@ SnapTranslator.dict.ca = {
|
|||
'New':
|
||||
'Nou',
|
||||
'Open...':
|
||||
'Obrir...',
|
||||
'Obre...',
|
||||
'Save':
|
||||
'Desar',
|
||||
'Desa',
|
||||
'Save to disk':
|
||||
'Desar a disc',
|
||||
'Desa al disc',
|
||||
'store this project\nin the downloads folder\n(in supporting browsers)':
|
||||
'desa aquest projecte\na la carpeta de descàrregues\n'
|
||||
+ '(en navegadors que ho suportin)',
|
||||
'Save As...':
|
||||
'Desar com...',
|
||||
'Anomena i desa...',
|
||||
'Import...':
|
||||
'Importar...',
|
||||
'Importa...',
|
||||
'file menu import hint':
|
||||
'carrega una llibreria de projecte\no de blocs exportada, un vestit\no un so',
|
||||
|
||||
|
||||
'Export project as plain text...':
|
||||
'Exportar projecte en text pla...',
|
||||
'Exporta el projecte en text pla...',
|
||||
'Export project...':
|
||||
'Exportar projecte...',
|
||||
'Exporta el projecte...',
|
||||
'show project data as XML\nin a new browser window':
|
||||
'mostrar tot el projecte en format XML\nen una altra finestra del navegador',
|
||||
'mostra tot el projecte en format XML\nen una altra finestra del navegador',
|
||||
'Export blocks...':
|
||||
'Exportar blocs...',
|
||||
'Exporta els blocs...',
|
||||
'show global custom block definitions as XML\nin a new browser window':
|
||||
'mostrar definicions de blocs personalitzats\nen format XML en una altra finestra del\nnavegador',
|
||||
'mostra les definicions de blocs personalitzats\nen format XML en una altra finestra del\nnavegador',
|
||||
'Unused blocks...':
|
||||
'Blocs no utilitzats...',
|
||||
'find unused global custom blocks\nand remove their definitions':
|
||||
|
@ -693,9 +697,10 @@ SnapTranslator.dict.ca = {
|
|||
'unused block(s) removed':
|
||||
'bloc(s) personalitzats no utilitzats esborrats',
|
||||
'Export summary...':
|
||||
'Exportar resum...',
|
||||
'Exporta el resum...',
|
||||
'open a new browser browser window\n with a summary of this project':
|
||||
'obre una finestra nova del navegador\namb un resum d\'aquest projecte',
|
||||
|
||||
'Contents':
|
||||
'Continguts',
|
||||
'Kind of':
|
||||
|
@ -709,23 +714,23 @@ SnapTranslator.dict.ca = {
|
|||
'For all Sprites':
|
||||
'Per a tots els objectes',
|
||||
'Import tools':
|
||||
'Importar eines',
|
||||
'Importa eines',
|
||||
'load the official library of\npowerful blocks':
|
||||
'carregar la llibreria\noficial de blocs avançats',
|
||||
'carrega la llibreria\noficial de blocs avançats',
|
||||
'Libraries...':
|
||||
'Llibreries...',
|
||||
'Import library':
|
||||
'Importar llibreria',
|
||||
'Importa una llibreria',
|
||||
|
||||
// cloud menu
|
||||
'Login...':
|
||||
'Iniciar sessió...',
|
||||
'Inicia la sessió...',
|
||||
'Signup...':
|
||||
'Registrar-se...',
|
||||
'Registra\'t...',
|
||||
|
||||
// settings menu
|
||||
'Language...':
|
||||
'Idioma...',
|
||||
'Llengua...',
|
||||
'Zoom blocks...':
|
||||
'Mida dels blocs...',
|
||||
'Stage size...':
|
||||
|
@ -760,10 +765,12 @@ SnapTranslator.dict.ca = {
|
|||
'Dóna preferència a les ranures buides',
|
||||
'settings menu prefer empty slots hint':
|
||||
'marca\'m per a fer que les ranures\nbuides tinguin preferència sobre les plenes\na l\'hora de deixar-hi caure peces',
|
||||
|
||||
'uncheck to allow dropped\nreporters to kick out others':
|
||||
'marca\'m per a fer que les ranures\nbuides tinguin la mateixa preferència que les\nplenes a l\'hora de deixar-hi caure peces',
|
||||
|
||||
'Long form input dialog':
|
||||
'Forçar diàleg de selecció de tipus',
|
||||
'Força el diàleg de selecció de tipus',
|
||||
'Plain prototype labels':
|
||||
'Etiquetes de prototip simples',
|
||||
'uncheck to always show (+) symbols\nin block prototype labels':
|
||||
|
@ -778,8 +785,10 @@ SnapTranslator.dict.ca = {
|
|||
'Teclat virtual',
|
||||
'uncheck to disable\nvirtual keyboard support\nfor mobile devices':
|
||||
'desmarca\'m per inhabilitar\nel suport per al teclat virtual\nen dispositius mòbils',
|
||||
|
||||
'check to enable\nvirtual keyboard support\nfor mobile devices':
|
||||
'marca\'m per habilitar\nel suport per al teclat virtual\nen dispositius mòbils',
|
||||
|
||||
'Input sliders':
|
||||
'Lliscadors d\'entrada',
|
||||
'uncheck to disable\ninput sliders for\nentry fields':
|
||||
|
@ -808,6 +817,10 @@ SnapTranslator.dict.ca = {
|
|||
'Disseny pla',
|
||||
'Keyboard Editing':
|
||||
'Edició per teclat',
|
||||
'Table support':
|
||||
'Edició de taules',
|
||||
'Table lines':
|
||||
'Línies de taules',
|
||||
'Thread safe scripts':
|
||||
'Fil d\'execució segur',
|
||||
'uncheck to allow\nscript reentrance':
|
||||
|
@ -845,9 +858,9 @@ SnapTranslator.dict.ca = {
|
|||
|
||||
// palette:
|
||||
'hide primitives':
|
||||
'amaga blocs primitius',
|
||||
'amaga els blocs primitius',
|
||||
'show primitives':
|
||||
'mostra blocs primitius',
|
||||
'mostra els blocs primitius',
|
||||
|
||||
// blocks:
|
||||
'help...':
|
||||
|
@ -870,6 +883,12 @@ SnapTranslator.dict.ca = {
|
|||
'encapsula\'m',
|
||||
'unringify':
|
||||
'des-encapsula\'m',
|
||||
'transient':
|
||||
'no persistent',
|
||||
'uncheck to save contents\nin the project':
|
||||
'desactiveu l\'opció per desar els continguts\nen el projecte',
|
||||
'check to prevent contents\nfrom being saved':
|
||||
'activeu l\'opció per evitar que els continguts\nes desin',
|
||||
|
||||
// custom blocks:
|
||||
'delete block definition...':
|
||||
|
@ -879,21 +898,21 @@ SnapTranslator.dict.ca = {
|
|||
|
||||
// sprites:
|
||||
'edit':
|
||||
'editar',
|
||||
'edita',
|
||||
'move':
|
||||
'moure',
|
||||
'mou',
|
||||
'detach from':
|
||||
'desenganxa de',
|
||||
'detach all parts':
|
||||
'desenganxa totes les parts',
|
||||
'export...':
|
||||
'exportar...',
|
||||
'exporta...',
|
||||
|
||||
// stage:
|
||||
'show all':
|
||||
'mostrar-los tots',
|
||||
'mostra\'ls tots',
|
||||
'pic...':
|
||||
'exportar com a imatge...',
|
||||
'exporta com a imatge...',
|
||||
'open a new window\nwith a picture of the stage':
|
||||
'obre una nova finestra\namb una foto de l\'escenari',
|
||||
|
||||
|
@ -909,7 +928,7 @@ SnapTranslator.dict.ca = {
|
|||
'undo the last\nblock drop\nin this pane':
|
||||
'recupera l\'últim bloc\nque s\'hagi llençat',
|
||||
'scripts pic...':
|
||||
'exportar com a imatge...',
|
||||
'exporta com a imatge...',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
'obre una nova finestra\namb una foto d\'aquests programes',
|
||||
'make a block...':
|
||||
|
@ -935,6 +954,18 @@ SnapTranslator.dict.ca = {
|
|||
'rename sound':
|
||||
'canvia el nom del so',
|
||||
|
||||
// lists and tables
|
||||
'list view...':
|
||||
'vista en format de llista...',
|
||||
'table view...':
|
||||
'vista en format de taula...',
|
||||
'open in dialog...':
|
||||
'obre en una finestra...',
|
||||
'reset columns':
|
||||
'reinicialitza les columnes',
|
||||
'items':
|
||||
'elements',
|
||||
|
||||
// dialogs
|
||||
// buttons
|
||||
'OK':
|
||||
|
@ -979,14 +1010,14 @@ SnapTranslator.dict.ca = {
|
|||
// Project Manager
|
||||
'Untitled':
|
||||
'Sense títol',
|
||||
'Open Project':
|
||||
'Open un Project':
|
||||
'Obre projecte',
|
||||
'(empty)':
|
||||
'(buit)',
|
||||
'Saved!':
|
||||
'Desat!',
|
||||
'Delete Project':
|
||||
'Esborra projecte',
|
||||
'Esborra un projecte',
|
||||
'Are you sure you want to delete':
|
||||
'Segur que vols esborrar',
|
||||
'rename...':
|
||||
|
@ -1010,7 +1041,7 @@ SnapTranslator.dict.ca = {
|
|||
|
||||
// save project
|
||||
'Save Project As...':
|
||||
'Anomena i desa projecte...',
|
||||
'Anomena i desa el projecte...',
|
||||
|
||||
// export blocks
|
||||
'Export blocks':
|
||||
|
@ -1020,7 +1051,7 @@ SnapTranslator.dict.ca = {
|
|||
'this project doesn\'t have any\ncustom global blocks yet':
|
||||
'aquest projecte encara no\nté cap bloc personalitzat',
|
||||
'select':
|
||||
'seleccionar',
|
||||
'selecciona',
|
||||
'none':
|
||||
'cap bloc',
|
||||
|
||||
|
@ -1048,17 +1079,18 @@ SnapTranslator.dict.ca = {
|
|||
|
||||
// block deletion dialog
|
||||
'Delete Custom Block':
|
||||
'Esborrar un bloc personalitzat',
|
||||
'Esborra el bloc personalitzat',
|
||||
'block deletion dialog text':
|
||||
'Segur que vols esborrar la definició\nd\'aquest bloc?',
|
||||
|
||||
|
||||
// input dialog
|
||||
'Create input name':
|
||||
'Crear ranura',
|
||||
'Crea una ranura',
|
||||
'Edit input name':
|
||||
'Editar ranura',
|
||||
'Edita la ranura',
|
||||
'Edit label fragment':
|
||||
'Editar fragment d\'etiqueta',
|
||||
'Edita el fragment d\'etiqueta',
|
||||
'Title text':
|
||||
'Text del títol',
|
||||
'Input name':
|
||||
|
@ -1140,7 +1172,7 @@ SnapTranslator.dict.ca = {
|
|||
|
||||
// coments
|
||||
'add comment here...':
|
||||
'afegir un comentari aquí...',
|
||||
'afegeix un comentari aquí...',
|
||||
|
||||
// drow downs
|
||||
// directions
|
||||
|
@ -1327,5 +1359,36 @@ SnapTranslator.dict.ca = {
|
|||
'last':
|
||||
'últim',
|
||||
'any':
|
||||
'qualsevol'
|
||||
'qualsevol',
|
||||
|
||||
// attributes
|
||||
'neighbors':
|
||||
'veins',
|
||||
'self':
|
||||
'un mateix',
|
||||
'other sprites':
|
||||
'els altres objectes',
|
||||
'parts':
|
||||
'parts',
|
||||
'anchor':
|
||||
'àncora',
|
||||
'parent':
|
||||
'pare',
|
||||
'children':
|
||||
'fill',
|
||||
'clones':
|
||||
'clons',
|
||||
'other clones':
|
||||
'altres clons',
|
||||
'dangling?':
|
||||
'Baumeln?',
|
||||
'rotation x':
|
||||
'rotació x',
|
||||
'rotation y':
|
||||
'rotació y',
|
||||
'center x':
|
||||
'centre x',
|
||||
'center y':
|
||||
'centre y'
|
||||
|
||||
};
|
||||
|
|
54
lang-de.js
54
lang-de.js
|
@ -185,7 +185,7 @@ SnapTranslator.dict.de = {
|
|||
'translator_e-mail':
|
||||
'jens@moenig.org', // optional
|
||||
'last_changed':
|
||||
'2016-03-16', // this, too, will appear in the Translators tab
|
||||
'2016-07-12', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -527,6 +527,8 @@ SnapTranslator.dict.de = {
|
|||
'Stoppuhr',
|
||||
'%att of %spr':
|
||||
'%att von %spr',
|
||||
'my %get':
|
||||
'Attribut %get',
|
||||
'http:// %s':
|
||||
'http:// %s',
|
||||
'turbo mode?':
|
||||
|
@ -1198,6 +1200,18 @@ SnapTranslator.dict.de = {
|
|||
'Leer',
|
||||
|
||||
// graphical effects
|
||||
'color':
|
||||
'Farbe',
|
||||
'fisheye':
|
||||
'Fischauge',
|
||||
'whirl':
|
||||
'Wirbel',
|
||||
'pixelate':
|
||||
'Pixel',
|
||||
'mosaic':
|
||||
'Mosaik',
|
||||
'saturation':
|
||||
'Sättigung',
|
||||
'brightness':
|
||||
'Helligeit',
|
||||
'ghost':
|
||||
|
@ -1352,10 +1366,46 @@ SnapTranslator.dict.de = {
|
|||
'Funktionsblock',
|
||||
'predicate':
|
||||
'Pr\u00e4dikat',
|
||||
'sprite':
|
||||
'Objekt',
|
||||
|
||||
// list indices
|
||||
'last':
|
||||
'letztes',
|
||||
'any':
|
||||
'beliebig'
|
||||
'beliebig',
|
||||
|
||||
// attributes
|
||||
'neighbors':
|
||||
'Nachbarn',
|
||||
'self':
|
||||
'selbst',
|
||||
'other sprites':
|
||||
'andere Objekte',
|
||||
'parts':
|
||||
'Teile',
|
||||
'anchor':
|
||||
'Verankerung',
|
||||
'parent':
|
||||
'Vorfahr',
|
||||
'children':
|
||||
'Abkömmlinge',
|
||||
'clones':
|
||||
'Klone',
|
||||
'other clones':
|
||||
'andere Klone',
|
||||
'dangling?':
|
||||
'Baumeln?',
|
||||
'rotation x':
|
||||
'Drehpunkt x',
|
||||
'rotation y':
|
||||
'Drehpunkt y',
|
||||
'center x':
|
||||
'Mittelpunkt x',
|
||||
'center y':
|
||||
'Mittelpunkt y',
|
||||
'name':
|
||||
'Name',
|
||||
'stage':
|
||||
'B\u00fchne',
|
||||
};
|
||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
183
lang-it.js
183
lang-it.js
|
@ -181,11 +181,11 @@ SnapTranslator.dict.it = {
|
|||
'language_name':
|
||||
'Italiano', // the name as it should appear in the language menu
|
||||
'language_translator':
|
||||
'Stefano Federici, Alberto Firpo', // your name for the Translators tab
|
||||
'Stefano Federici, Alberto Firpo, Massimo Ghisalberti', // your name for the Translators tab
|
||||
'translator_e-mail':
|
||||
's_federici@yahoo.com, albertofirpo12@gmail.com', // optional
|
||||
's_federici@yahoo.com, albertofirpo12@gmail.com, zairik@gmail.com', // optional
|
||||
'last_changed':
|
||||
'2015-01-12', // this, too, will appear in the Translators tab
|
||||
'2016-05-10', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -410,12 +410,28 @@ SnapTranslator.dict.it = {
|
|||
'porta dimensione penna a %n',
|
||||
'stamp':
|
||||
'timbra',
|
||||
'fill':
|
||||
'riempi',
|
||||
|
||||
// control:
|
||||
'when %b':
|
||||
'quando %b',
|
||||
'when %greenflag clicked':
|
||||
'quando si clicca su %greenflag',
|
||||
'when %keyHat key pressed':
|
||||
'quando si preme il tasto %keyHat',
|
||||
'when I am %interaction':
|
||||
'quando sono %interaction',
|
||||
'clicked':
|
||||
'cliccato',
|
||||
'pressed':
|
||||
'premuto',
|
||||
'dropped':
|
||||
'lasciato',
|
||||
'mouse-entered':
|
||||
'il mouse entra',
|
||||
'mouse-departed':
|
||||
'il mouse esce',
|
||||
'when I am clicked':
|
||||
'quando vengo cliccato',
|
||||
'when I receive %msgHat':
|
||||
|
@ -448,7 +464,12 @@ SnapTranslator.dict.it = {
|
|||
'risultato %s',
|
||||
'stop block':
|
||||
'ferma il blocco',
|
||||
'all':
|
||||
'stop %stopOthersChoices':
|
||||
'ferma %stopOthersChoices',
|
||||
'stop %stopChoices':
|
||||
'ferma %stopChoices',
|
||||
|
||||
'all':
|
||||
'tutti',
|
||||
'this script':
|
||||
'questo script',
|
||||
|
@ -514,6 +535,8 @@ SnapTranslator.dict.it = {
|
|||
'cronometro',
|
||||
'%att of %spr':
|
||||
'%att di %spr',
|
||||
'my %get':
|
||||
'attributo %get',
|
||||
'http:// %s':
|
||||
'leggi pagina web http:// %s',
|
||||
'turbo mode?':
|
||||
|
@ -521,6 +544,26 @@ SnapTranslator.dict.it = {
|
|||
'set turbo mode to %b':
|
||||
'porta modalit\u00E0 turbo a %b',
|
||||
|
||||
'current %dates':
|
||||
'%dates attuale',
|
||||
|
||||
'year':
|
||||
'anno',
|
||||
'month':
|
||||
'mese',
|
||||
'date':
|
||||
'giorno',
|
||||
'hour':
|
||||
'ora',
|
||||
'minute':
|
||||
'minuto',
|
||||
'second':
|
||||
'secondo',
|
||||
'time in milliseconds':
|
||||
'ora in millisecondi',
|
||||
'day of week':
|
||||
'giorno della settimana',
|
||||
|
||||
'filtered for %clr':
|
||||
'selezionati per colore %clr',
|
||||
'stack size':
|
||||
|
@ -567,9 +610,10 @@ SnapTranslator.dict.it = {
|
|||
'%s \u00E8 di tipo %typ',
|
||||
'is %s identical to %s ?':
|
||||
'%s \u00E8 identico a %s ?',
|
||||
|
||||
'type of %s':
|
||||
'tipo di %s',
|
||||
'JavaScript function ( %mult%s ) { %code }':
|
||||
'funzione JavaScript ( %mult%s ) { %code }',
|
||||
|
||||
// variables:
|
||||
'Make a variable':
|
||||
|
@ -766,7 +810,11 @@ SnapTranslator.dict.it = {
|
|||
'check to enable\nIDE animations':
|
||||
'abilitare per nconsentire\nanimazioni dell\u0027IDE',
|
||||
'Thread safe scripts':
|
||||
'Script thread safe',
|
||||
'Script sicuri per i thread',
|
||||
'check to disallow\nscript reentrance':
|
||||
'attivare per disabilitare\nla \'rientranza\' degli script',
|
||||
'uncheck to allow\nscript reentrance':
|
||||
'disattivare per abilitare\nla \'rientranza\' degli script',
|
||||
'uncheck to allow\nscript reentrancy':
|
||||
'disabilitare per permettere agli script di rientrare',
|
||||
'check to disallow\nscript reentrancy':
|
||||
|
@ -777,13 +825,48 @@ SnapTranslator.dict.it = {
|
|||
'disabilitare per massima velocità\na framerate variabile',
|
||||
'check for smooth, predictable\nanimations across computers':
|
||||
'abilitare per avere animazioni\nfluide su tutti i computer',
|
||||
'Flat line ends':
|
||||
'Flat line ends':
|
||||
'fine linea piana',
|
||||
'check for flat ends of lines':
|
||||
'abilitare per fine linea netti',
|
||||
'uncheck for round ends of lines':
|
||||
'disabilitare per fine linea arrotondati',
|
||||
|
||||
'Inheritance support':
|
||||
'Supporto ereditarietà degli sprite',
|
||||
'check for sprite\ninheritance features':
|
||||
'attivare per\n la ereditarietà degli sprite',
|
||||
'uncheck to disable\nsprite inheritance features':
|
||||
'disattivare per rimuovere\n la ereditarietà degli sprite',
|
||||
'Codification support':
|
||||
'Supporto per il codice nei blocchi',
|
||||
'check for block\nto text mapping features':
|
||||
'attivare per il supporto\n al codice nei blocchi',
|
||||
'uncheck to disable\nblock to text mapping features':
|
||||
'disattivare per disabilitare\n il supporto al codice nei blocchi',
|
||||
'Flat design':
|
||||
'Aspetto piatto interfaccia',
|
||||
'check for alternative\nGUI design':
|
||||
'attivare per una interfaccia alternativa',
|
||||
'uncheck for default\nGUI design':
|
||||
'disattivare per la interfaccia normale',
|
||||
'Keyboard Editing':
|
||||
'Modifica della tastiera',
|
||||
'check to enable\nkeyboard editing support':
|
||||
'attivare per la modifica della tastiera',
|
||||
'uncheck to disable\nkeyboard editing support':
|
||||
'disattivare per la modifica della tastiera',
|
||||
'Table support':
|
||||
'Supporto per le tabelle',
|
||||
'Table lines':
|
||||
'Tabelle con linee',
|
||||
'check for multi-column\nlist view support':
|
||||
'attiva la vista multicolonna',
|
||||
'uncheck to disable\nmulti-column list views':
|
||||
'disattiva la vista multicolonna',
|
||||
'check for higher contrast\ntable views':
|
||||
'attivare per un maggior contrasto',
|
||||
'uncheck for less contrast\nmulti-column list views':
|
||||
'disattivare per un minor contrasto',
|
||||
|
||||
// inputs
|
||||
'with inputs':
|
||||
|
@ -1287,5 +1370,87 @@ SnapTranslator.dict.it = {
|
|||
'last':
|
||||
'ultimo',
|
||||
'any':
|
||||
'qualunque'
|
||||
'qualunque',
|
||||
|
||||
// attributes
|
||||
'neighbors':
|
||||
'vicinato',
|
||||
'self':
|
||||
'me stesso',
|
||||
'other sprites':
|
||||
'altri sprite',
|
||||
'parts':
|
||||
'parti',
|
||||
'anchor':
|
||||
'ancora',
|
||||
'parent':
|
||||
'genitore',
|
||||
'children':
|
||||
'figli',
|
||||
'clones':
|
||||
'cloni',
|
||||
'other clones':
|
||||
'altri cloni',
|
||||
'dangling?':
|
||||
'pendente?',
|
||||
'rotation x':
|
||||
'rotazione x',
|
||||
'rotation y':
|
||||
'rotazione y',
|
||||
'center x':
|
||||
'centro x',
|
||||
'center y':
|
||||
'centro y',
|
||||
'name':
|
||||
'nome',
|
||||
'stage':
|
||||
'stage',
|
||||
|
||||
// Paint.js
|
||||
'Paint editor':
|
||||
'Editor grafico',
|
||||
'undo':
|
||||
'annulla',
|
||||
'Paintbrush tool\n(free draw)':
|
||||
'Pennello (disegno libero)',
|
||||
'Stroked Rectangle\n(shift: square)':
|
||||
'Rettangolo\n(shift: quadrato)',
|
||||
'Stroked Ellipse\n(shift: circle)':
|
||||
'Ellisse\n(shift: cerchio)',
|
||||
'Eraser tool':
|
||||
'Gomma per cancellare',
|
||||
'Set the rotation center':
|
||||
'imposta centro di rotazione',
|
||||
'Line tool\n(shift: vertical/horizontal)':
|
||||
'Linea\n(shift: verticale/orizzontale)',
|
||||
'Filled Rectangle\n(shift: square)':
|
||||
'Rettangolo pieno\n(shift: quadrato)',
|
||||
'Filled Ellipse\n(shift: circle)':
|
||||
'Ellisse piena\n(shift: cerchio)',
|
||||
'Fill a region':
|
||||
'Riempi un\'area',
|
||||
'Pipette tool\n(pick a color anywhere)':
|
||||
'contagocce\n(preleva un colore dovunque)',
|
||||
'grow':
|
||||
'ingrandisci',
|
||||
'shrink':
|
||||
'rimpicciolisci',
|
||||
'flip \u2194':
|
||||
'capovolgi ↔ ',
|
||||
'flip \u2195':
|
||||
'capovolgi ↕',
|
||||
'Brush size':
|
||||
'dimensione del pennello',
|
||||
'Constrain proportions of shapes?\n(you can also hold shift)':
|
||||
'Costringi le proporzioni della figura?\n(puoi tenere premuto il tasto: shift)',
|
||||
|
||||
// thread.js
|
||||
'a variable of name \'':
|
||||
'una variabile di nome \'',
|
||||
'\'\ndoes not exist in this context':
|
||||
'\'\nnon esiste in questo contesto',
|
||||
'expecting':
|
||||
'aspettando',
|
||||
'input(s), but getting':
|
||||
'entra(s), ma arriva'
|
||||
};
|
||||
|
|
170
lang-ru.js
170
lang-ru.js
|
@ -178,11 +178,11 @@ SnapTranslator.dict.ru = {
|
|||
'language_name':
|
||||
'Русский', // the name as it should appear in the language menu
|
||||
'language_translator':
|
||||
'Svetlana Ptashnaya', // your name for the Translators tab
|
||||
'Svetlana Ptashnaya, Проскурнёв Артём', // your name for the Translators tab
|
||||
'translator_e-mail':
|
||||
'svetlanap@berkeley.edu', // optional
|
||||
'svetlanap@berkeley.edu, tema@school830.ru', // optional
|
||||
'last_changed':
|
||||
'2014-09-29', // this, too, will appear in the Translators tab
|
||||
'2016-06-21', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -237,7 +237,7 @@ SnapTranslator.dict.ru = {
|
|||
'can rotate':
|
||||
'вращаемый',
|
||||
'only face left/right':
|
||||
'вращаемый только на лево и направо',
|
||||
'зеркальное отображение лево-право при вращении',
|
||||
|
||||
// new sprite button:
|
||||
'add a new sprite':
|
||||
|
@ -406,14 +406,28 @@ SnapTranslator.dict.ru = {
|
|||
'установить размер пера %n',
|
||||
'stamp':
|
||||
'оттиск',
|
||||
'fill':
|
||||
'заливка',
|
||||
|
||||
// control:
|
||||
'when %greenflag clicked':
|
||||
'когда щелкнуть на %greenflag',
|
||||
'when %keyHat key pressed':
|
||||
'когда нажать %keyHat клавишу',
|
||||
'when I am clicked':
|
||||
'когда щелкнуть на меня',
|
||||
'when I am %interaction':
|
||||
'когда меня %interaction',
|
||||
'clicked':
|
||||
'кликнут',
|
||||
'pressed':
|
||||
'нажмут',
|
||||
'dropped':
|
||||
'бросят',
|
||||
'mouse-entered':
|
||||
'заденет курсор',
|
||||
'mouse-departed':
|
||||
'покинет курсор',
|
||||
'when %b':
|
||||
'когда %b',
|
||||
'when I receive %msgHat':
|
||||
'когда я получу %msgHat',
|
||||
'broadcast %msg':
|
||||
|
@ -422,6 +436,10 @@ SnapTranslator.dict.ru = {
|
|||
'переслать %msg всем и ждать',
|
||||
'Message name':
|
||||
'Название сообщения',
|
||||
'message':
|
||||
'сообщение',
|
||||
'any message':
|
||||
'любое сообщение',
|
||||
'wait %n secs':
|
||||
'ждать %n сек.',
|
||||
'wait until %b':
|
||||
|
@ -438,12 +456,20 @@ SnapTranslator.dict.ru = {
|
|||
'если %b %c иначе %c',
|
||||
'report %s':
|
||||
'результат %s',
|
||||
'stop block':
|
||||
'стоп блок',
|
||||
'stop script':
|
||||
'стоп скрипт',
|
||||
'stop all %stop':
|
||||
'стоп все %stop',
|
||||
'stop %stopChoices':
|
||||
'стоп %stopChoices',
|
||||
'all':
|
||||
'все',
|
||||
'this script':
|
||||
'этот скрипт',
|
||||
'this block':
|
||||
'этот блок',
|
||||
'stop %stopOthersChoices':
|
||||
'стоп %stopOthersChoices',
|
||||
'all but this script':
|
||||
'всех, кроме меня',
|
||||
'other scripts in sprite':
|
||||
'все другие мои скрипты',
|
||||
'run %cmdRing %inputs':
|
||||
'выполнять %cmdRing %inputs',
|
||||
'launch %cmdRing %inputs':
|
||||
|
@ -455,19 +481,29 @@ SnapTranslator.dict.ru = {
|
|||
'call %cmdRing w/continuation':
|
||||
'вызвать %cmdRing с продолжением',
|
||||
'warp %c':
|
||||
'warp %c',
|
||||
'сразу %c',
|
||||
'when I start as a clone':
|
||||
'когда я создан как клон',
|
||||
'create a clone of %cln':
|
||||
'клонировать %cln',
|
||||
'myself':
|
||||
'меня',
|
||||
'delete this clone':
|
||||
'удалить клона',
|
||||
'pause all %pause':
|
||||
'пауза для всех %pause',
|
||||
|
||||
// sensing:
|
||||
'touching %col ?':
|
||||
'касаеться %col ?',
|
||||
'касается %col ?',
|
||||
'touching %clr ?':
|
||||
'касаеться %clr ?',
|
||||
'касается %clr ?',
|
||||
'color %clr is touching %clr ?':
|
||||
'цвет %clr касаеться %clr ?',
|
||||
'ask %s and wait':
|
||||
'спросить %s и ждать',
|
||||
'what\'s your name?':
|
||||
'как вас зовут?',
|
||||
'Как Вас зовут?',
|
||||
'answer':
|
||||
'ответ',
|
||||
'mouse x':
|
||||
|
@ -484,8 +520,16 @@ SnapTranslator.dict.ru = {
|
|||
'переустановить таймер',
|
||||
'timer':
|
||||
'таймер',
|
||||
'%att of %spr':
|
||||
'%att у %spr',
|
||||
'my %get':
|
||||
'атрибут %get',
|
||||
'http:// %s':
|
||||
'http:// %s',
|
||||
'turbo mode?':
|
||||
'режим турбо?',
|
||||
'set turbo mode to %b':
|
||||
'установить турбо-режим %b',
|
||||
|
||||
'filtered for %clr':
|
||||
'отфильтровано для %clr',
|
||||
|
@ -516,7 +560,7 @@ SnapTranslator.dict.ru = {
|
|||
'join %words':
|
||||
'объединить %words',
|
||||
'hello':
|
||||
'привет',
|
||||
'Привет',
|
||||
'world':
|
||||
'мир',
|
||||
'letter %n of %s':
|
||||
|
@ -531,6 +575,8 @@ SnapTranslator.dict.ru = {
|
|||
'%s это %typ ?',
|
||||
'is %s identical to %s ?':
|
||||
'%s тождественно %s ?',
|
||||
'split %s by %delim':
|
||||
'разделить %s по %delim',
|
||||
|
||||
'type of %s':
|
||||
'тип %s',
|
||||
|
@ -618,6 +664,8 @@ SnapTranslator.dict.ru = {
|
|||
'Экспорт проект как текстовый файл...',
|
||||
'Export project...':
|
||||
'Экспорт проект...',
|
||||
'Export summary...':
|
||||
'Экспортируемая информация...',
|
||||
'show project data as XML\nin a new browser window':
|
||||
'представить проектные данные как XML\nв новом окне браузера',
|
||||
'Export blocks...':
|
||||
|
@ -625,13 +673,27 @@ SnapTranslator.dict.ru = {
|
|||
'show global custom block definitions as XML\nin a new browser window':
|
||||
'представить определения глобальных пользовательских блоков как XML\nв новом окне браузера',
|
||||
'Import tools':
|
||||
'Импорт сервисные ср-ва',
|
||||
'Импортировать сервисные ср-ва',
|
||||
'Backgrounds...':
|
||||
'Фоны...',
|
||||
'Libraries...':
|
||||
'Библиотеки...',
|
||||
'load the official library of\npowerful blocks':
|
||||
'загрузить служебную библиотеку блоков',
|
||||
|
||||
// settings menu
|
||||
'Language...':
|
||||
'Язык...',
|
||||
'Zoom blocks...':
|
||||
'Увеличение блоков кода...',
|
||||
'Stage size...':
|
||||
'Размер сцены...',
|
||||
'Stage size':
|
||||
'Размер сцены',
|
||||
'Stage width':
|
||||
'Ширина сцены',
|
||||
'Stage height':
|
||||
'Высота сцены',
|
||||
'Blurred shadows':
|
||||
'Контрастность тени',
|
||||
'uncheck to use solid drop\nshadows and highlights':
|
||||
|
@ -1097,6 +1159,18 @@ SnapTranslator.dict.ru = {
|
|||
'e^':
|
||||
'e^',
|
||||
|
||||
// delimiters
|
||||
'letter':
|
||||
'буквам',
|
||||
'whitespace':
|
||||
'пробелам',
|
||||
'line':
|
||||
'строкам',
|
||||
'tab':
|
||||
'табуляторам',
|
||||
'cr':
|
||||
'концам строк',
|
||||
|
||||
// data types
|
||||
'number':
|
||||
'число',
|
||||
|
@ -1112,6 +1186,8 @@ SnapTranslator.dict.ru = {
|
|||
'генератор значений',
|
||||
'predicate':
|
||||
'предикат',
|
||||
'sprite':
|
||||
'спрайт',
|
||||
|
||||
// list indices
|
||||
'last':
|
||||
|
@ -1121,5 +1197,61 @@ SnapTranslator.dict.ru = {
|
|||
'now connected':
|
||||
'вы вошли в систему',
|
||||
'undo':
|
||||
'отменить'
|
||||
'отменить',
|
||||
|
||||
// attributes
|
||||
'neighbors':
|
||||
'соседи',
|
||||
'self':
|
||||
'я',
|
||||
'other sprites':
|
||||
'другие спрайты',
|
||||
'parts':
|
||||
'части',
|
||||
'anchor':
|
||||
'якорь',
|
||||
'parent':
|
||||
'родитель',
|
||||
'children':
|
||||
'потомок',
|
||||
'clones':
|
||||
'клоны',
|
||||
'other clones':
|
||||
'другие клоны',
|
||||
'dangling?':
|
||||
'висячий?',
|
||||
'rotation x':
|
||||
'смещение по x',
|
||||
'rotation y':
|
||||
'смещение по y',
|
||||
'center x':
|
||||
'x центра спрайта',
|
||||
'center y':
|
||||
'y центра спрайта',
|
||||
'name':
|
||||
'имя',
|
||||
'stage':
|
||||
'сцена',
|
||||
//Переводы найденых в программе, но не в файле перевода
|
||||
'current %dates':
|
||||
'сейчас %dates',
|
||||
'year':
|
||||
'год',
|
||||
'month':
|
||||
'месяц',
|
||||
'date':
|
||||
'день',
|
||||
'day of week':
|
||||
'день недели',
|
||||
'hour':
|
||||
'часов',
|
||||
'minute':
|
||||
'минут',
|
||||
'second':
|
||||
'секунд',
|
||||
'time in milliseconds':
|
||||
'время в миллисекундах',
|
||||
'costume name':
|
||||
'имя костюма'
|
||||
|
||||
};
|
||||
|
|
308
lang-si.js
308
lang-si.js
|
@ -183,11 +183,11 @@ SnapTranslator.dict.si = {
|
|||
'language_name':
|
||||
'Sloven\u0161\u010Dina', // the name as it should appear in the language menu
|
||||
'language_translator':
|
||||
'Sasa Divjak', // your name for the Translators tab
|
||||
'Sasa Divjak, Gorazd Breskvar', // your name for the Translators tab
|
||||
'translator_e-mail':
|
||||
'sasa.divjak@fri.uni-lj.si', // optional
|
||||
'last_changed':
|
||||
'2013-01-07', // this, too, will appear in the Translators tab
|
||||
'2016-04-22', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -378,6 +378,16 @@ SnapTranslator.dict.si = {
|
|||
'predvajaj zvok %snd do konca',
|
||||
'stop all sounds':
|
||||
'ustavi vse zvoke',
|
||||
'rest for %n beats':
|
||||
'po\u010Divaj %n udarcev',
|
||||
'play note %n for %n beats':
|
||||
'predvajaj noto %n za %n udarcev',
|
||||
'change tempo by %n':
|
||||
'spremeni tempo za %n',
|
||||
'set tempo to %n bpm':
|
||||
'nastavi tempo na %n udarcev na minuto.',
|
||||
'tempo':
|
||||
'tempo',
|
||||
|
||||
// pen:
|
||||
'clear':
|
||||
|
@ -408,8 +418,20 @@ SnapTranslator.dict.si = {
|
|||
'ko kliknemo na %greenflag',
|
||||
'when %keyHat key pressed':
|
||||
'ko pritisnemo na tipko %keyHat ',
|
||||
'when I am clicked':
|
||||
'ko je klik name',
|
||||
'when I am %interaction':
|
||||
'Ko je %interaction',
|
||||
'clicked':
|
||||
'mi\u0161ka kliknjena',
|
||||
'pressed':
|
||||
'gumb mi\u0161ke pritisnjen',
|
||||
'dropped':
|
||||
'konec vle\u010Denja',
|
||||
'mouse-entered':
|
||||
'mi\u0161ka se dotika',
|
||||
'mouse-departed':
|
||||
'mi\u0161ka se ne dotika ve\u010D',
|
||||
'when %b':
|
||||
'Ko je %b',
|
||||
'when I receive %msgHat':
|
||||
'ko sprejmem %msgHat',
|
||||
'broadcast %msg':
|
||||
|
@ -418,6 +440,10 @@ SnapTranslator.dict.si = {
|
|||
'po\u0161lji vsem %msg in po\u010Dakaj',
|
||||
'Message name':
|
||||
'Obvestilo',
|
||||
'message':
|
||||
'sporo\u010Dilo',
|
||||
'any message':
|
||||
'poljudno sporo\u010Dilo',
|
||||
'wait %n secs':
|
||||
'\u010Dakaj %n sekund.',
|
||||
'wait until %b':
|
||||
|
@ -434,12 +460,20 @@ SnapTranslator.dict.si = {
|
|||
'\u010De %b %c sicer %c',
|
||||
'report %s':
|
||||
'sporo\u010Di %s',
|
||||
'stop block':
|
||||
'ustavi ta blok',
|
||||
'stop script':
|
||||
'ustavi ta program',
|
||||
'stop all %stop':
|
||||
'ustavi vse %stop',
|
||||
'stop %stopChoices':
|
||||
'ustavi %stopChoices',
|
||||
'this script':
|
||||
'to skripto',
|
||||
'this block':
|
||||
'ta blok',
|
||||
'stop %stopOthersChoices':
|
||||
'ustavi %stopOthersChoices',
|
||||
'all but this script':
|
||||
'vse razen te skripte',
|
||||
'other scripts in sprite':
|
||||
'ostale skripte tega objekta',
|
||||
'pause all %pause':
|
||||
'pavziraj vse %pause',
|
||||
'run %cmdRing %inputs':
|
||||
'izvajaj %cmdRing %inputs',
|
||||
'launch %cmdRing %inputs':
|
||||
|
@ -452,6 +486,14 @@ SnapTranslator.dict.si = {
|
|||
'pokli\u010Di %cmdRing z nadaljevanjem',
|
||||
'warp %c':
|
||||
'Warp %c',
|
||||
'when I start as a clone':
|
||||
'ko za\u010Dnem kot klon',
|
||||
'create a clone of %cln':
|
||||
'kloniraj %cln',
|
||||
'myself':
|
||||
'sebe',
|
||||
'delete this clone':
|
||||
'izbri\u0161i ta klon',
|
||||
|
||||
// sensing:
|
||||
'touching %col ?':
|
||||
|
@ -482,6 +524,30 @@ SnapTranslator.dict.si = {
|
|||
'\u0161toparica',
|
||||
'http:// %s':
|
||||
'http:// %s',
|
||||
'turbo mode?':
|
||||
'hitri na\u010Din?',
|
||||
'set turbo mode to %b':
|
||||
'nastavi hitri na\u010Din na %b',
|
||||
|
||||
'current %dates':
|
||||
'trenutni %dates',
|
||||
'year':
|
||||
'leto',
|
||||
'month':
|
||||
'mesec',
|
||||
'date':
|
||||
'dan',
|
||||
'day of week':
|
||||
'dan v tednu',
|
||||
'hour':
|
||||
'ura',
|
||||
'minute':
|
||||
'minuta',
|
||||
'second':
|
||||
'sekunda',
|
||||
'time in milliseconds':
|
||||
'\u010Das v tiso\u010Dinkah sekunde',
|
||||
|
||||
|
||||
'filtered for %clr':
|
||||
'filtriran za %clr',
|
||||
|
@ -511,6 +577,8 @@ SnapTranslator.dict.si = {
|
|||
'ni res',
|
||||
'join %words':
|
||||
'pove\u017Ei %words',
|
||||
'split %s by %delim':
|
||||
'razdeli %s z %delim',
|
||||
'hello':
|
||||
'Halo',
|
||||
'world':
|
||||
|
@ -525,6 +593,8 @@ SnapTranslator.dict.si = {
|
|||
'Unicode %n kot \u010Drka',
|
||||
'is %s a %typ ?':
|
||||
'je %s tipa %typ ?',
|
||||
'is %s identical to %s ?':
|
||||
'je %s identi\u010Den %s ?',
|
||||
|
||||
'type of %s':
|
||||
'Tip od %s',
|
||||
|
@ -580,6 +650,8 @@ SnapTranslator.dict.si = {
|
|||
// snap menu
|
||||
'About...':
|
||||
'Nekaj o Snap!...',
|
||||
'Reference manual':
|
||||
'Uporabni\u0161ka navodila',
|
||||
'Snap! website':
|
||||
'Spletna stran Snap!',
|
||||
'Download source':
|
||||
|
@ -602,6 +674,11 @@ SnapTranslator.dict.si = {
|
|||
'Odpri...',
|
||||
'Save':
|
||||
'Shrani',
|
||||
'Save to disk':
|
||||
'Shrani na disk',
|
||||
'store this project\nin the downloads folder\n(in supporting browsers)':
|
||||
'shrani v mapo Prenosi\n'
|
||||
+ '(ni na voljo v vseh brkljalnika)',
|
||||
'Save As...':
|
||||
'Shrani kot...',
|
||||
'Import...':
|
||||
|
@ -620,10 +697,50 @@ SnapTranslator.dict.si = {
|
|||
'Izvozi bloke',
|
||||
'show global custom block definitions as XML\nin a new browser window':
|
||||
'Prikaz definicij globalnih lastnih blokov kot XML\nv novem oknu brkljalnika',
|
||||
'Unused blocks...':
|
||||
'Neuporabljeni bloki...',
|
||||
'find unused global custom blocks\nand remove their definitions':
|
||||
'najdi in odstrani uporabni\u0161ke neuporabljene globalne bloke',
|
||||
'Remove unused blocks':
|
||||
'Odstrani neuporabljene bloke',
|
||||
'there are currently no unused\nglobal custom blocks in this project':
|
||||
'trenutno ni neuporabljenih globalnih blokov v tem projektu',
|
||||
'unused block(s) removed':
|
||||
'neuporabljeni bloki so bili odstranjeni',
|
||||
'Export summary...':
|
||||
'Povzetek izvoza...',
|
||||
'Import tools':
|
||||
'Uvozi orodja',
|
||||
'load the official library of\npowerful blocks':
|
||||
'uvozi uradni modul z naprednimi bloki',
|
||||
'Libraries...':
|
||||
'Knji\u017Enice...',
|
||||
'Import library':
|
||||
'Nalo\u017Ei knji\u017Enico',
|
||||
|
||||
// cloud menu
|
||||
'Login...':
|
||||
'Prijava...',
|
||||
'Signup...':
|
||||
'Registracija...',
|
||||
'Reset Password...':
|
||||
'Pozabljeno geslo...',
|
||||
|
||||
// settings menu
|
||||
'Language...':
|
||||
'Jezik...',
|
||||
'Zoom blocks...':
|
||||
'Pove\u010Daj bloke...',
|
||||
'Stage size...':
|
||||
'Velikost scene...',
|
||||
'Stage size':
|
||||
'Velikost scene',
|
||||
'Stage width':
|
||||
'\u0160irina scene',
|
||||
'Stage height':
|
||||
'Vi\u0161ina scene',
|
||||
'Default':
|
||||
'Normalno',
|
||||
'Blurred shadows':
|
||||
'Mehke sence',
|
||||
'uncheck to use solid drop\nshadows and highlights':
|
||||
|
@ -637,9 +754,9 @@ SnapTranslator.dict.si = {
|
|||
'uncheck to disable alternating\ncolors for nested block':
|
||||
'izklopi izmenjujo\u010De barve gnezdenih blokov',
|
||||
'Prefer empty slot drops':
|
||||
'Imejmo raje prazne reže',
|
||||
'Imejmo raje prazne re\u017Ee',
|
||||
'settings menu prefer empty slots hint':
|
||||
'vklop raje namiga za prazne reže'
|
||||
'vklop raje namiga za prazne re\u017Ee'
|
||||
+ 'zu bevorzugen',
|
||||
'uncheck to allow dropped\nreporters to kick out others':
|
||||
'razkljukaj za to, da reporterji odrinejo druge',
|
||||
|
@ -667,12 +784,46 @@ SnapTranslator.dict.si = {
|
|||
'razkljukaj za deaktiviranje akusti\u010Dnega klikanja',
|
||||
'check to turn\nblock clicking\nsound on':
|
||||
'odkljukaj za vklop akusti\u010Dnega klikanja',
|
||||
'Animations':
|
||||
'Animacije',
|
||||
'uncheck to disable\nIDE animations':
|
||||
'razkljukaj za izklop IDE animacij',
|
||||
'Turbo mode':
|
||||
'Hitri na\u010Din',
|
||||
'check to prioritize\nscript execution':
|
||||
'odkljukaj za ve\u010Djo prioriteto izvajanja skript',
|
||||
'uncheck to run scripts\nat normal speed':
|
||||
'razkljukaj za normalno hitrost izvajanja skript',
|
||||
'check to enable\nIDE animations':
|
||||
'odkljukaj za IDE animacije',
|
||||
'Flat design':
|
||||
'Svetli izgled',
|
||||
'Keyboard Editing':
|
||||
'Urejanje s tipkovnico',
|
||||
'Table support':
|
||||
'Podpora za tabele',
|
||||
'Table lines':
|
||||
'\u010Crte med celicami v tabeli',
|
||||
'Thread safe scripts':
|
||||
'Varnost niti',
|
||||
'uncheck to allow\nscript reentrancy':
|
||||
'uncheck to allow\nscript reentrance':
|
||||
'razkljukaj za dopu\u0161\u010Danje ve\u010Dkraten vstop skript (reentrancy)',
|
||||
'check to disallow\nscript reentrancy':
|
||||
'check to disallow\nscript reentrance':
|
||||
'odkljukaj za onemogo\u010Danje ve\u010Dkratnega vstopa skript',
|
||||
'Prefer smooth animations':
|
||||
'Gladka animacija',
|
||||
'uncheck for greater speed\nat variable frame rates':
|
||||
'razkljukaj za hitrej\u0161e animacije s spremenljivo hitrostjo osve\u017Eevanja',
|
||||
'check for smooth, predictable\nanimations across computers':
|
||||
'odkljukaj za bolj predvidljivo hitrost animacij med razli\u010Dnimi ra\u010Dunalniki',
|
||||
'Flat line ends':
|
||||
'Ravni zaklju\u010Dki \u010Drt',
|
||||
'check for flat ends of lines':
|
||||
'odkljukaj za ravne zaklju\u010Dke \u010Drt',
|
||||
'uncheck for round ends of lines':
|
||||
'razkljukaj za zaobljene zaklju\u010Dke \u010Drt',
|
||||
'Inheritance support':
|
||||
'Podpora za dedovanje',
|
||||
|
||||
// inputs
|
||||
'with inputs':
|
||||
|
@ -681,18 +832,30 @@ SnapTranslator.dict.si = {
|
|||
'imena vhodov:',
|
||||
'Input Names:':
|
||||
'imena vhodov:',
|
||||
'input list:':
|
||||
'vhodni seznam:',
|
||||
|
||||
// context menus:
|
||||
'help':
|
||||
'Pomo\u010D',
|
||||
'Pomo\u010D...',
|
||||
|
||||
// palette:
|
||||
'hide primitives':
|
||||
'skrij osnovne bloke',
|
||||
'show primitives':
|
||||
'poka\u017Ei osnovne bloke',
|
||||
|
||||
// blocks:
|
||||
'help...':
|
||||
'Pomo\u010D...',
|
||||
'pomo\u010D...',
|
||||
'relabel...':
|
||||
'spremeni tip...',
|
||||
'duplicate':
|
||||
'podvoji',
|
||||
'make a copy\nand pick it up':
|
||||
'kopiraj',
|
||||
'only duplicate this block':
|
||||
'podvoji ta blok',
|
||||
'delete':
|
||||
'bri\u0161i',
|
||||
'script pic...':
|
||||
|
@ -703,6 +866,8 @@ SnapTranslator.dict.si = {
|
|||
'Obkro\u017Ei',
|
||||
'unringify':
|
||||
'odstrani obro\u010D',
|
||||
'transient':
|
||||
'se ne shranjuje',
|
||||
|
||||
// custom blocks:
|
||||
'delete block definition...':
|
||||
|
@ -713,9 +878,23 @@ SnapTranslator.dict.si = {
|
|||
// sprites:
|
||||
'edit':
|
||||
'uredi',
|
||||
'move':
|
||||
'premakni',
|
||||
'detach from':
|
||||
'odklopi',
|
||||
'detach all parts':
|
||||
'odklopi vse dele',
|
||||
'export...':
|
||||
'izvozi...',
|
||||
|
||||
// stage:
|
||||
'show all':
|
||||
'prila\u017Ei vse ',
|
||||
'pic...':
|
||||
'izvozi sliko...',
|
||||
'open a new window\nwith a picture of the stage':
|
||||
'odpri novo okno s sliko te scene',
|
||||
|
||||
// scripting area
|
||||
'clean up':
|
||||
'po\u010Disti',
|
||||
|
@ -723,6 +902,14 @@ SnapTranslator.dict.si = {
|
|||
'uredi skripte vertikalno',
|
||||
'add comment':
|
||||
'dodaj komentar',
|
||||
'undrop':
|
||||
'ponovno povle\u010Di',
|
||||
'undo the last\nblock drop\nin this pane':
|
||||
'prekli\u010Di dodajanje zadnjega bloka v tem okviru',
|
||||
'scripts pic...':
|
||||
'slika skript...',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
'odpri novo okno s sliko vseh skript',
|
||||
'make a block...':
|
||||
'Gradnja novega bloka...',
|
||||
|
||||
|
@ -731,6 +918,8 @@ SnapTranslator.dict.si = {
|
|||
'preimenuj',
|
||||
'export':
|
||||
'izvozi',
|
||||
'rename costume':
|
||||
'preimenuj izgled',
|
||||
|
||||
// sounds
|
||||
'Play sound':
|
||||
|
@ -741,11 +930,25 @@ SnapTranslator.dict.si = {
|
|||
'Ustavi',
|
||||
'Play':
|
||||
'Predvajaj',
|
||||
'rename sound':
|
||||
'Preimenuj zvok',
|
||||
|
||||
// lists and tables
|
||||
'list view...':
|
||||
'prika\u017Ei kot seznam...',
|
||||
'table view...':
|
||||
'prika\u017Ei kot tabelo',
|
||||
'open in dialog...':
|
||||
'odpri v novem oknu',
|
||||
'items':
|
||||
'elementi',
|
||||
|
||||
// dialogs
|
||||
// buttons
|
||||
'OK':
|
||||
'V redu',
|
||||
'Ok':
|
||||
'V redu',
|
||||
'Cancel':
|
||||
'Prekli\u010Di',
|
||||
'Yes':
|
||||
|
@ -757,6 +960,46 @@ SnapTranslator.dict.si = {
|
|||
'Help':
|
||||
'Pomo\u010D',
|
||||
|
||||
// zoom blocks
|
||||
'Zoom blocks':
|
||||
'Pove\u010Daj blok',
|
||||
'build':
|
||||
'zgradi',
|
||||
'your own':
|
||||
'svoj',
|
||||
'blocks':
|
||||
'blok',
|
||||
'normal (1x)':
|
||||
'normalno (1x)',
|
||||
'demo (1.2x)':
|
||||
'demo (1.2x)',
|
||||
'presentation (1.4x)':
|
||||
'predstavitev(1.4x)',
|
||||
'big (2x)':
|
||||
'veliko (2x)',
|
||||
'huge (4x)':
|
||||
've\u010Dje(4x)',
|
||||
'giant (8x)':
|
||||
'ogromno (8x)',
|
||||
'monstrous (10x)':
|
||||
'najve\u010Dje(10x)',
|
||||
|
||||
// Project Manager
|
||||
'Untitled':
|
||||
'Neimenovano',
|
||||
'Open Project':
|
||||
'Odpri projekt',
|
||||
'(empty)':
|
||||
'(prazno)',
|
||||
'Saved!':
|
||||
'Shranjeno!',
|
||||
'Delete Project':
|
||||
'Zbri\u0161i projekt',
|
||||
'Are you sure you want to delete':
|
||||
'Ste prepri\u010Dani da \u017Eelite izbrisati?',
|
||||
'rename...':
|
||||
'preimenuj...',
|
||||
|
||||
// costume editor
|
||||
'Costume Editor':
|
||||
'Urejevalnik oblek',
|
||||
|
@ -773,10 +1016,6 @@ SnapTranslator.dict.si = {
|
|||
'Replace the current project with a new one?':
|
||||
'Zamenjam trenutni projekt z novim?',
|
||||
|
||||
// open project
|
||||
'Open Project':
|
||||
'Odpri projekt',
|
||||
|
||||
// save project
|
||||
'Save Project As...':
|
||||
'Shrani projekt kot...',
|
||||
|
@ -784,6 +1023,8 @@ SnapTranslator.dict.si = {
|
|||
// export blocks
|
||||
'Export blocks':
|
||||
'Izvoz blokov',
|
||||
'Import blocks':
|
||||
'Uvoz blokov',
|
||||
'this project doesn\'t have any\ncustom global blocks yet':
|
||||
'ta projekt \u0161e nima lastnih globalnih blokov',
|
||||
'select':
|
||||
|
@ -827,6 +1068,8 @@ SnapTranslator.dict.si = {
|
|||
'Tvori ime vhoda',
|
||||
'Edit input name':
|
||||
'Uredi ime vhoda',
|
||||
'Edit label fragment':
|
||||
'Uredi ime dela',
|
||||
'Title text':
|
||||
'Naslovno besedilo',
|
||||
'Input name':
|
||||
|
@ -895,6 +1138,8 @@ SnapTranslator.dict.si = {
|
|||
'min vrednost...',
|
||||
'slider max...':
|
||||
'maks vrednost...',
|
||||
'import...':
|
||||
'uvozi...',
|
||||
'Slider minimum value':
|
||||
'Minimalna vrednost drsnika',
|
||||
'Slider maximum value':
|
||||
|
@ -930,11 +1175,16 @@ SnapTranslator.dict.si = {
|
|||
// costumes
|
||||
'Turtle':
|
||||
'Kazalec smeri',
|
||||
'Empty':
|
||||
'Prazno',
|
||||
|
||||
// graphical effects
|
||||
'brightness':
|
||||
'svetlost',
|
||||
'ghost':
|
||||
'prosojnost',
|
||||
|
||||
'negative':
|
||||
'obratno',
|
||||
// keys
|
||||
'space':
|
||||
'presledek',
|
||||
|
@ -946,6 +1196,8 @@ SnapTranslator.dict.si = {
|
|||
'pu\u0161\u010Dica desno',
|
||||
'left arrow':
|
||||
'pu\u0161\u010Dica levo',
|
||||
'any key':
|
||||
'poljuden',
|
||||
'a':
|
||||
'a',
|
||||
'b':
|
||||
|
@ -1026,6 +1278,10 @@ SnapTranslator.dict.si = {
|
|||
// math functions
|
||||
'abs':
|
||||
'abs',
|
||||
'ceiling':
|
||||
'zaokro\u017Eevanje navzgor',
|
||||
'floor':
|
||||
'zaokro\u017Eevanje navzdol',
|
||||
'sqrt':
|
||||
'koren',
|
||||
'sin':
|
||||
|
@ -1045,6 +1301,16 @@ SnapTranslator.dict.si = {
|
|||
'e^':
|
||||
'e^',
|
||||
|
||||
// delimiters
|
||||
'letter':
|
||||
'\u010Drke',
|
||||
'whitespace':
|
||||
'presledki',
|
||||
'line':
|
||||
'vrstica',
|
||||
'tab':
|
||||
'tab',
|
||||
|
||||
// data types
|
||||
'number':
|
||||
'\u0161tevilo',
|
||||
|
|
510
lang-sv.js
510
lang-sv.js
|
@ -187,7 +187,7 @@ SnapTranslator.dict.sv = {
|
|||
'translator_e-mail':
|
||||
'eolsson@gmail.com', // optional
|
||||
'last_changed':
|
||||
'2014-11-01', // this, too, will appear in the Translators tab
|
||||
'2016-06-09', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -250,7 +250,7 @@ SnapTranslator.dict.sv = {
|
|||
|
||||
// tab help
|
||||
'costumes tab help':
|
||||
'importera en bild fr\u00E5n en annan webbsida eller fr\u00E5n\nen fil på din dator genom att dra den hit',
|
||||
'importera en bild fr\u00E5n en annan webbsida eller fr\u00E5n\nen fil p\u00E5 din dator genom att dra den hit',
|
||||
|
||||
'import a sound from your computer\nby dragging it into here':
|
||||
'importera en ljudfil fr\u00E5n din dator\ngenom att dra den hit',
|
||||
|
@ -331,6 +331,8 @@ SnapTranslator.dict.sv = {
|
|||
'n\u00E4sta kostym',
|
||||
'costume #':
|
||||
'kostym nr.',
|
||||
'costume name':
|
||||
'kostymnamn',
|
||||
'say %s for %n secs':
|
||||
's\u00E4g %s i %n sek',
|
||||
'say %s':
|
||||
|
@ -412,6 +414,8 @@ SnapTranslator.dict.sv = {
|
|||
's\u00E4tt penntjocklek til %n',
|
||||
'stamp':
|
||||
'st\u00E4mpla',
|
||||
'fill':
|
||||
'fyll',
|
||||
|
||||
// control:
|
||||
'when %greenflag clicked':
|
||||
|
@ -443,7 +447,7 @@ SnapTranslator.dict.sv = {
|
|||
'if %b %c else %c':
|
||||
'om %b %c d\u00E5 %c',
|
||||
'report %s':
|
||||
'returnera %s',
|
||||
'rapportera %s',
|
||||
'stop block':
|
||||
'stoppa block',
|
||||
'stop script':
|
||||
|
@ -471,6 +475,25 @@ SnapTranslator.dict.sv = {
|
|||
'mig sj\u00E4lv',
|
||||
'delete this clone':
|
||||
'radera klon',
|
||||
'when I am %interaction':
|
||||
'n\u00E4r jag %interaction',
|
||||
'when %b':
|
||||
'n\u00E4r %b',
|
||||
'clicked':
|
||||
'klickas p\u00E5',
|
||||
'pressed':
|
||||
'trycks ned',
|
||||
'dropped':
|
||||
'sl\u00E4pps ned',
|
||||
'mouse-entered':
|
||||
'f\u00E5r muspekaren \u00F6ver mig',
|
||||
'mouse-departed':
|
||||
'inte l\u00E4ngre har muspekaren \u00F6ver mig',
|
||||
'when I am clicked':
|
||||
'n\u00E4r jag klickas p\u00E5',
|
||||
'when I receive %msgHat':
|
||||
'n\u00E4r jag tar emot %msgHat',
|
||||
|
||||
|
||||
|
||||
'warp %c':
|
||||
|
@ -480,7 +503,7 @@ SnapTranslator.dict.sv = {
|
|||
'touching %col ?':
|
||||
'r\u00F6r %col ?',
|
||||
'touching %clr ?':
|
||||
'r\u00F6r %clr ?',
|
||||
'r\u00F6r f\u00E4rgen %clr ?',
|
||||
'color %clr is touching %clr ?':
|
||||
'f\u00E4rgen %clr r\u00F6r %clr ?',
|
||||
'ask %s and wait':
|
||||
|
@ -519,13 +542,41 @@ SnapTranslator.dict.sv = {
|
|||
'frames':
|
||||
'ramar',
|
||||
|
||||
|
||||
'%att of %spr':
|
||||
'%att av %spr',
|
||||
'my %get':
|
||||
'attribut %get',
|
||||
|
||||
|
||||
'current %dates':
|
||||
'%dates just nu',
|
||||
|
||||
'year':
|
||||
'\u00E5ret',
|
||||
'month':
|
||||
'm\u00E5naden',
|
||||
'date':
|
||||
'datum',
|
||||
'hour':
|
||||
'timmen',
|
||||
'minute':
|
||||
'minuten',
|
||||
'second':
|
||||
'sekunden',
|
||||
'time in milliseconds':
|
||||
'tiden i millisekunder',
|
||||
'day of week':
|
||||
'veckodagen',
|
||||
|
||||
|
||||
// operators:
|
||||
'%n mod %n':
|
||||
'%n mod %n',
|
||||
'round %n':
|
||||
'avrunda %n',
|
||||
'%fun av %n':
|
||||
'%fun von %n',
|
||||
'%fun of %n':
|
||||
'%fun av %n',
|
||||
'pick random %n to %n':
|
||||
'slumptal fr\u00E5n %n till %n',
|
||||
'%b and %b':
|
||||
|
@ -558,7 +609,7 @@ SnapTranslator.dict.sv = {
|
|||
'%s identisk med %s ?',
|
||||
|
||||
'type of %s':
|
||||
'type %s',
|
||||
'typ %s',
|
||||
|
||||
// variables:
|
||||
'Make a variable':
|
||||
|
@ -638,7 +689,7 @@ SnapTranslator.dict.sv = {
|
|||
'Import...':
|
||||
'Importera...',
|
||||
'file menu import hint':
|
||||
'l\u00E4ser in ett exporterat projekt,\nett bibliotek med block,\nen kostym, eller ett ljud',
|
||||
'l\u00E4ser in ett exporterat projekt,\nett bibliotek med block,\nen kostym, eller ett ljud',
|
||||
'Export project as plain text ...':
|
||||
'Exportera projektet som vanlig text...',
|
||||
'Export project...':
|
||||
|
@ -784,6 +835,10 @@ SnapTranslator.dict.sv = {
|
|||
'redigera',
|
||||
'export...':
|
||||
'exportera...',
|
||||
'parent...':
|
||||
'f\u00F6r\u00E4lder...',
|
||||
'current parent':
|
||||
'nuvarande f\u00F6r\u00E4lder',
|
||||
|
||||
// stage:
|
||||
'show all':
|
||||
|
@ -910,10 +965,10 @@ SnapTranslator.dict.sv = {
|
|||
|
||||
// block deletion dialog
|
||||
'Delete Custom Block':
|
||||
'Radera custom blokk',
|
||||
'Radera block',
|
||||
'block deletion dialog text':
|
||||
'Skal denne blokken med alle dens instanser\n' +
|
||||
'bli slettet?',
|
||||
'Ska detta block med alla dess instanser\n' +
|
||||
'tas bort?',
|
||||
|
||||
// input dialog
|
||||
'Create input name':
|
||||
|
@ -1141,6 +1196,10 @@ SnapTranslator.dict.sv = {
|
|||
'ln',
|
||||
'e^':
|
||||
'e^',
|
||||
'floor':
|
||||
'golv',
|
||||
'ceiling':
|
||||
'tak',
|
||||
|
||||
// data types
|
||||
'number':
|
||||
|
@ -1164,196 +1223,247 @@ SnapTranslator.dict.sv = {
|
|||
'any':
|
||||
'vilken som helst',
|
||||
|
||||
|
||||
// attributes
|
||||
'neighbors':
|
||||
'grannar',
|
||||
'self':
|
||||
'mig sj\u00E4lv',
|
||||
'other sprites':
|
||||
'andra sprites',
|
||||
'parts':
|
||||
'delar',
|
||||
'anchor':
|
||||
'ankare',
|
||||
'parent':
|
||||
'f\u00F6r\u00E4ldrar',
|
||||
'children':
|
||||
'barn',
|
||||
'clones':
|
||||
'kloner',
|
||||
'other clones':
|
||||
'andra kloner',
|
||||
'dangling?':
|
||||
'h\u00E4ngande?',
|
||||
'rotation x':
|
||||
'rotation x',
|
||||
'rotation y':
|
||||
'rotation y',
|
||||
'center x':
|
||||
'mittpunkt x',
|
||||
'center y':
|
||||
'mittpunkt y',
|
||||
'name':
|
||||
'namn',
|
||||
'stage':
|
||||
'scen',
|
||||
|
||||
// missing labels from initial translation added below
|
||||
'add a new sprite':
|
||||
'ny sprite',
|
||||
'when %keyHat key pressed':
|
||||
'n\u00E4r tangent %keyHat trycks ned',
|
||||
'when I receive %msgHat':
|
||||
'n\u00E4r jag tar emot %msgHat',
|
||||
'message':
|
||||
'meddelande',
|
||||
'any message':
|
||||
'n\u00E5got meddelande',
|
||||
'stop %stopChoices':
|
||||
'stoppa %stopChoices',
|
||||
'this script':
|
||||
'detta skript',
|
||||
'this block':
|
||||
'detta block',
|
||||
'stop %stopOthersChoices':
|
||||
'stoppa %stopOthersChoices',
|
||||
'all but this script':
|
||||
'alla f\u00F6rutom detta skript',
|
||||
'other scripts in sprite':
|
||||
'andra skript i denna sprite',
|
||||
'%att of %spr':
|
||||
'%att av %spr',
|
||||
'%fun of %n':
|
||||
'%fun av %n',
|
||||
'split %s by %delim':
|
||||
'dela %s med tecken %delim',
|
||||
'Script variable name':
|
||||
'Skriptvariabelnamn',
|
||||
'Reference manual':
|
||||
'Referensbok',
|
||||
'Export project as plain text...':
|
||||
'Exportera projektet som vanlig text...',
|
||||
'Import tools':
|
||||
'Importverktyg',
|
||||
'Signup...':
|
||||
'Registrera...',
|
||||
'Stage size...':
|
||||
'Scenstorlek...',
|
||||
'Stage size':
|
||||
'Scenstorlek',
|
||||
'Stage width':
|
||||
'Scenbredd',
|
||||
'Stage height':
|
||||
'Scenh\u00F6jd',
|
||||
'Default':
|
||||
'Standard',
|
||||
'Plain prototype labels':
|
||||
'Vanliga prototypetiketter',
|
||||
'uncheck to always show (+) symbols\nin block prototype labels':
|
||||
'avmarkera f\u00F6r att visa (+) symboler \n i blockprototypetiketter',
|
||||
'check to hide (+) symbols\nin block prototype labels':
|
||||
'kryssa f\u00F6r att visa (+) symboler \n i blockprototypetiketter',
|
||||
'check to prioritize\nscript execution':
|
||||
'kryssa f\u00F6r att prioritera \nskriptexekvering',
|
||||
'uncheck to run scripts\nat normal speed':
|
||||
'avmarkera f\u00F6r att k\u00F6ra \nskript vid normal hastighet',
|
||||
'uncheck to allow\nscript reentrance':
|
||||
'avmarkera f\u00F6r att till\u00E5ta \nskript att \u00E5tertilltr\u00E4da',
|
||||
'check to disallow\nscript reentrance':
|
||||
'kryssa f\u00F6r att f\u00F6rbjuda \nskript att \u00E5tertilltr\u00E4da',
|
||||
'Flat line ends':
|
||||
'Platta streckslut',
|
||||
'check for flat ends of lines':
|
||||
'kryssa f\u00F6r platta streckslut',
|
||||
'uncheck for round ends of lines':
|
||||
'avmarkera f\u00F6r avrundade streckslut',
|
||||
'hide primitives':
|
||||
'g\u00F6m primitiva',
|
||||
'show primitives':
|
||||
'visa primitiva',
|
||||
'help...':
|
||||
'hj\u00E4lp...',
|
||||
'move':
|
||||
'flytta',
|
||||
'detach from':
|
||||
'koppla bort',
|
||||
'detach all parts':
|
||||
'koppla bort alla delar',
|
||||
'pic...':
|
||||
'bild...',
|
||||
'open a new window\nwith a picture of the stage':
|
||||
'\u00F6ppna ett nytt f\u00F6nster\nmed en bild av scenen',
|
||||
'undrop':
|
||||
'\u00E5ngra sl\u00E4pp',
|
||||
'undo the last\nblock drop\nin this pane':
|
||||
'\u00E5ngra sista \nblocksl\u00E4ppet i\ndetta omr\u00E5de',
|
||||
'scripts pic...':
|
||||
'skriptbild...',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
'\u00F6ppna ett nytt f\u00F6nster\nmed en bild p\u00E5 alla skript',
|
||||
'Zoom blocks':
|
||||
'F\u00F6rstora blocken',
|
||||
'build':
|
||||
'bygg',
|
||||
'your own':
|
||||
'dina egna',
|
||||
'blocks':
|
||||
'block',
|
||||
'normal (1x)':
|
||||
'normal (1x)',
|
||||
'demo (1.2x)':
|
||||
'demo (1.2x)',
|
||||
'presentation (1.4x)':
|
||||
'presentation (1.4x)',
|
||||
'big (2x)':
|
||||
'stor (2x)',
|
||||
'huge (4x)':
|
||||
'j\u00E4ttestor (4x)',
|
||||
'giant (8x)':
|
||||
'enorm (8x)',
|
||||
'monstrous (10x)':
|
||||
'gigantisk (10x)',
|
||||
'Empty':
|
||||
'Tom',
|
||||
'brightness':
|
||||
'ljusstyrke',
|
||||
'negative':
|
||||
'negativ',
|
||||
'comic':
|
||||
'komisk',
|
||||
'confetti':
|
||||
'konfetti',
|
||||
'floor':
|
||||
'golv',
|
||||
'letter':
|
||||
'bokstav',
|
||||
'whitespace':
|
||||
'mellanslag',
|
||||
'line':
|
||||
'rad',
|
||||
'tab':
|
||||
'tab',
|
||||
'cr':
|
||||
'retur',
|
||||
'warp %c':
|
||||
'snabbspola %c',
|
||||
'Reset Password...':
|
||||
'Nollst\u00E4ll l\u00F6senord...',
|
||||
'Codification support':
|
||||
'St\u00F6d f\u00F6r textprogrammering',
|
||||
'Flat design':
|
||||
'Platt utseende',
|
||||
'check for block\nto text mapping features':
|
||||
'kryssa f\u00F6r att aktivera\nblock-till-text funktioner',
|
||||
'uncheck to disable\nblock to text mapping features':
|
||||
'avmarkera f\u00F6r att inaktivera\nblock-till-text funktioner',
|
||||
'check for alternative\nGUI design':
|
||||
'kryssa f\u00F6r att aktivera ett\nalternativt utseende',
|
||||
'uncheck for default\nGUI design':
|
||||
'avmarkera f\u00F6r att byta\ntill standardutseendet',
|
||||
'Select categories of additional blocks to add to this project.':
|
||||
'v\u00E4lj grupper av extrablock att l\u00E4gga till i projektet',
|
||||
'Select a costume from the media library':
|
||||
'v\u00E4lj en kostym fr\u00E5n mediabiblioteket',
|
||||
'Select a sound from the media library':
|
||||
'v\u00E4lj ett ljud fr\u00E5n mediabiblioteket',
|
||||
'Iteration, composition':
|
||||
'Upprepning, komposition',
|
||||
'List utilities':
|
||||
'Listverktyg',
|
||||
'Streams (lazy lists)':
|
||||
'Str\u00F6mmar (lata listor)',
|
||||
'Variadic reporters':
|
||||
'Variabla rapporterare',
|
||||
'Words, sentences':
|
||||
'Ord, meningar',
|
||||
'Paint a new costume':
|
||||
'Rita en ny kostym',
|
||||
'add a new Turtle sprite':
|
||||
'l\u00E4gg till en ny Sk\u00F6ldpadda-sprite',
|
||||
'paint a new sprite':
|
||||
'rita en ny sprite',
|
||||
'Paint Editor':
|
||||
'Rita',
|
||||
'undo':
|
||||
'\u00E5ngra',
|
||||
'grow':
|
||||
'st\u00F6rre',
|
||||
'shrink':
|
||||
'mindre',
|
||||
'flip ↔':
|
||||
'v\u00E4nd ↔',
|
||||
'flip ↕':
|
||||
'v\u00E4nd ↕',
|
||||
'Brush size':
|
||||
'Pennstorlek',
|
||||
'Constrain proportions of shapes?\n(you can also hold shift)':
|
||||
'Beh\u00E5ll figurernas proportioner?\n(du kan ocks\u00E5 h\u00E5lla skift nedtryckt)'
|
||||
'ny sprite',
|
||||
'when %keyHat key pressed':
|
||||
'n\u00E4r tangent %keyHat trycks ned',
|
||||
'when I receive %msgHat':
|
||||
'n\u00E4r jag tar emot %msgHat',
|
||||
'message':
|
||||
'meddelande',
|
||||
'any message':
|
||||
'n\u00E5got meddelande',
|
||||
'stop %stopChoices':
|
||||
'stoppa %stopChoices',
|
||||
'this script':
|
||||
'detta skript',
|
||||
'this block':
|
||||
'detta block',
|
||||
'stop %stopOthersChoices':
|
||||
'stoppa %stopOthersChoices',
|
||||
'all but this script':
|
||||
'alla f\u00F6rutom detta skript',
|
||||
'other scripts in sprite':
|
||||
'andra skript i denna sprite',
|
||||
'%att of %spr':
|
||||
'%att av %spr',
|
||||
'%fun of %n':
|
||||
'%fun av %n',
|
||||
'split %s by %delim':
|
||||
'dela %s med tecken %delim',
|
||||
'Script variable name':
|
||||
'Skriptvariabelnamn',
|
||||
'Reference manual':
|
||||
'Referensbok',
|
||||
'Export project as plain text...':
|
||||
'Exportera projektet som vanlig text...',
|
||||
'Import tools':
|
||||
'Importverktyg',
|
||||
'Signup...':
|
||||
'Registrera...',
|
||||
'Stage size...':
|
||||
'Scenstorlek...',
|
||||
'Stage size':
|
||||
'Scenstorlek',
|
||||
'Stage width':
|
||||
'Scenbredd',
|
||||
'Stage height':
|
||||
'Scenh\u00F6jd',
|
||||
'Default':
|
||||
'Standard',
|
||||
'Plain prototype labels':
|
||||
'Vanliga prototypetiketter',
|
||||
'uncheck to always show (+) symbols\nin block prototype labels':
|
||||
'avmarkera f\u00F6r att visa (+) symboler \n i blockprototypetiketter',
|
||||
'check to hide (+) symbols\nin block prototype labels':
|
||||
'kryssa f\u00F6r att visa (+) symboler \n i blockprototypetiketter',
|
||||
'check to prioritize\nscript execution':
|
||||
'kryssa f\u00F6r att prioritera \nskriptexekvering',
|
||||
'uncheck to run scripts\nat normal speed':
|
||||
'avmarkera f\u00F6r att k\u00F6ra \nskript vid normal hastighet',
|
||||
'uncheck to allow\nscript reentrance':
|
||||
'avmarkera f\u00F6r att till\u00E5ta \nskript att \u00E5tertilltr\u00E4da',
|
||||
'check to disallow\nscript reentrance':
|
||||
'kryssa f\u00F6r att f\u00F6rbjuda \nskript att \u00E5tertilltr\u00E4da',
|
||||
'Flat line ends':
|
||||
'Platta streckslut',
|
||||
'check for flat ends of lines':
|
||||
'kryssa f\u00F6r platta streckslut',
|
||||
'uncheck for round ends of lines':
|
||||
'avmarkera f\u00F6r avrundade streckslut',
|
||||
'hide primitives':
|
||||
'g\u00F6m primitiva',
|
||||
'show primitives':
|
||||
'visa primitiva',
|
||||
'help...':
|
||||
'hj\u00E4lp...',
|
||||
'move':
|
||||
'flytta',
|
||||
'detach from':
|
||||
'koppla bort',
|
||||
'detach all parts':
|
||||
'koppla bort alla delar',
|
||||
'pic...':
|
||||
'bild...',
|
||||
'open a new window\nwith a picture of the stage':
|
||||
'\u00F6ppna ett nytt f\u00F6nster\nmed en bild av scenen',
|
||||
'undrop':
|
||||
'\u00E5ngra sl\u00E4pp',
|
||||
'undo the last\nblock drop\nin this pane':
|
||||
'\u00E5ngra sista \nblocksl\u00E4ppet i\ndetta omr\u00E5de',
|
||||
'scripts pic...':
|
||||
'skriptbild...',
|
||||
'open a new window\nwith a picture of all scripts':
|
||||
'\u00F6ppna ett nytt f\u00F6nster\nmed en bild p\u00E5 alla skript',
|
||||
'Zoom blocks':
|
||||
'F\u00F6rstora blocken',
|
||||
'build':
|
||||
'bygg',
|
||||
'your own':
|
||||
'dina egna',
|
||||
'blocks':
|
||||
'block',
|
||||
'normal (1x)':
|
||||
'normal (1x)',
|
||||
'demo (1.2x)':
|
||||
'demo (1.2x)',
|
||||
'presentation (1.4x)':
|
||||
'presentation (1.4x)',
|
||||
'big (2x)':
|
||||
'stor (2x)',
|
||||
'huge (4x)':
|
||||
'j\u00E4ttestor (4x)',
|
||||
'giant (8x)':
|
||||
'enorm (8x)',
|
||||
'monstrous (10x)':
|
||||
'gigantisk (10x)',
|
||||
'Empty':
|
||||
'Tom',
|
||||
'brightness':
|
||||
'ljusstyrka',
|
||||
'negative':
|
||||
'negativ',
|
||||
'comic':
|
||||
'komisk',
|
||||
'confetti':
|
||||
'konfetti',
|
||||
'letter':
|
||||
'bokstav',
|
||||
'whitespace':
|
||||
'mellanslag',
|
||||
'line':
|
||||
'rad',
|
||||
'tab':
|
||||
'tab',
|
||||
'cr':
|
||||
'retur',
|
||||
'warp %c':
|
||||
'snabbspola %c',
|
||||
'Reset Password...':
|
||||
'Nollst\u00E4ll l\u00F6senord...',
|
||||
'Codification support':
|
||||
'St\u00F6d f\u00F6r textprogrammering',
|
||||
'Flat design':
|
||||
'Platt utseende',
|
||||
'Keyboard Editing':
|
||||
'Tangentbordsredigering',
|
||||
'Table support':
|
||||
'Tabellstöd',
|
||||
'Inheritance support':
|
||||
'Arv',
|
||||
'uncheck to disable\nsprite inheritance features':
|
||||
'avmarkera f\u00F6r att inaktivera\nst\u00F6d f\u00F6r arv mellan sprites',
|
||||
'check for sprite\ninheritance features':
|
||||
'kryssa f\u00F6r att aktivera\nst\u00F6d f\u00F6r arv mellan sprites',
|
||||
'uncheck to disable\nmulti-column list views':
|
||||
'avmarkera f\u00F6r att inaktivera\nst\u00F6d f\u00F6r redigering av listor i flera kolumner',
|
||||
'check for multi-column\nlist view support':
|
||||
'kryssa f\u00F6r att aktivera\nst\u00F6d f\u00F6r redigering av listor i flera kolumner',
|
||||
'check to enable\nkeyboard editing support':
|
||||
'kryssa f\u00F6r att aktivera\ntangentbordsredigering',
|
||||
'uncheck to disable\nkeyboard editing support':
|
||||
'avmarkera f\u00F6r att inaktivera\ntangentbordsredigering',
|
||||
'check for block\nto text mapping features':
|
||||
'kryssa f\u00F6r att aktivera\nblock-till-text funktioner',
|
||||
'uncheck to disable\nblock to text mapping features':
|
||||
'avmarkera f\u00F6r att inaktivera\nblock-till-text funktioner',
|
||||
'check for alternative\nGUI design':
|
||||
'kryssa f\u00F6r att aktivera ett\nalternativt utseende',
|
||||
'uncheck for default\nGUI design':
|
||||
'avmarkera f\u00F6r att byta\ntill standardutseendet',
|
||||
'Select categories of additional blocks to add to this project.':
|
||||
'v\u00E4lj grupper av extrablock att l\u00E4gga till i projektet',
|
||||
'Select a costume from the media library':
|
||||
'v\u00E4lj en kostym fr\u00E5n mediabiblioteket',
|
||||
'Select a sound from the media library':
|
||||
'v\u00E4lj ett ljud fr\u00E5n mediabiblioteket',
|
||||
'Iteration, composition':
|
||||
'Upprepning, komposition',
|
||||
'List utilities':
|
||||
'Listverktyg',
|
||||
'Streams (lazy lists)':
|
||||
'Str\u00F6mmar (lata listor)',
|
||||
'Variadic reporters':
|
||||
'Variabla rapporterare',
|
||||
'Words, sentences':
|
||||
'Ord, meningar',
|
||||
'Paint a new costume':
|
||||
'Rita en ny kostym',
|
||||
'add a new Turtle sprite':
|
||||
'l\u00E4gg till en ny Sk\u00F6ldpadda-sprite',
|
||||
'paint a new sprite':
|
||||
'rita en ny sprite',
|
||||
'Paint Editor':
|
||||
'Rita',
|
||||
'undo':
|
||||
'\u00E5ngra',
|
||||
'grow':
|
||||
'st\u00F6rre',
|
||||
'shrink':
|
||||
'mindre',
|
||||
'flip ↔':
|
||||
'v\u00E4nd ↔',
|
||||
'flip ↕':
|
||||
'v\u00E4nd ↕',
|
||||
'Brush size':
|
||||
'Pennstorlek',
|
||||
'Constrain proportions of shapes?\n(you can also hold shift)':
|
||||
'Beh\u00E5ll figurernas proportioner?\n(du kan ocks\u00E5 h\u00E5lla skift nedtryckt)'
|
||||
|
||||
};
|
||||
|
|
1476
lang-zh.js
1476
lang-zh.js
Plik diff jest za duży
Load Diff
|
@ -7,4 +7,6 @@ word-sentence.xml Words, sentences
|
|||
cases.xml Multi-branched conditional (switch)
|
||||
leap-library.xml LEAP Motion controller
|
||||
setrgb.xml Set RGB or HSV pen color
|
||||
penTrails.xml Save and restore pictures drawn by pen
|
||||
penTrails.xml Save and restore pictures drawn by pen
|
||||
try-catch.xml Catch errors in a script
|
||||
multiline.xml Allow multi-line text input to a block
|
||||
|
|
|
@ -1 +1 @@
|
|||
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="cases: if %'test' then %'result' %'more'" type="command" category="control"><header></header><code></code><inputs><input type="%b"></input><input type="%cs"></input><input type="%mult%boolUE"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doRun"><block var="result"/><list></list></block></script><script><custom-block s="catch %upvar %cs"><l>tag</l><script><custom-block s="for each %upvar of %l %cs"><l>item</l><block var="more"/><script><block s="doIf"><block s="evaluate"><block var="item"/><list></list></block><script><custom-block s="throw %s"><block var="tag"/></custom-block></script></block></script></custom-block></script></custom-block></script></block></script></block-definition><block-definition s="catch %'tag' %'action'" type="command" category="control"><header></header><code></code><inputs><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doRun"><block var="action"/><list></list></block></script><list><l>cont</l></list></block></block></script></block-definition><block-definition s="throw %'cont'" type="command" category="control"><header></header><code></code><inputs><input type="%s">catchtag</input></inputs><script><block s="doRun"><block var="cont"/><list></list></block></script></block-definition><block-definition s="for each %'item' of %'data' %'action'" type="command" category="lists"><header></header><code></code><inputs><input type="%upvar"></input><input type="%l"></input><input type="%cs"></input></inputs><script><block s="doUntil"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doSetVar"><l>item</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><block s="doRun"><block var="action"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block s="doSetVar"><l>data</l><block s="reportCDR"><block var="data"/></block></block></script></block></script></block-definition><block-definition s="else if %'test' then %'action'" type="predicate" category="control"><header></header><code></code><inputs><input type="%b"></input><input type="%cs"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doRun"><block var="action"/><list></list></block><block s="doReport"><block s="reportTrue"></block></block></script><script><block s="doReport"><block s="reportFalse"></block></block></script></block></script></block-definition><block-definition s="else %'action'" type="predicate" category="control"><header></header><code></code><inputs><input type="%cs"></input></inputs><script><block s="doRun"><block var="action"/><list></list></block><block s="doReport"><block s="reportTrue"></block></block></script></block-definition></blocks>
|
||||
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="cases: if %'test' then %'result' %'more'" type="command" category="control"><header></header><code></code><inputs><input type="%b"></input><input type="%cs"></input><input type="%mult%boolUE"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doRun"><block var="result"/><list></list></block></script><script><custom-block s="catch %upvar %cs"><l>tag</l><script><custom-block s="for each %upvar of %l %cs"><l>item</l><block var="more"/><script><block s="doIf"><block s="evaluate"><block var="item"/><list></list></block><script><custom-block s="throw %s"><block var="tag"/></custom-block></script></block></script></custom-block></script></custom-block><block s="doHideVar"><l>test</l></block></script></block></script></block-definition><block-definition s="catch %'tag' %'action'" type="command" category="control"><header></header><code></code><inputs><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doRun"><block var="action"/><list></list></block></script><list><l>cont</l></list></block></block></script></block-definition><block-definition s="throw %'cont'" type="command" category="control"><header></header><code></code><inputs><input type="%s">catchtag</input></inputs><script><block s="doRun"><block var="cont"/><list></list></block></script></block-definition><block-definition s="for each %'item' of %'data' %'action'" type="command" category="lists"><header></header><code></code><inputs><input type="%upvar"></input><input type="%l"></input><input type="%cs"></input></inputs><script><block s="doUntil"><block s="reportEquals"><block var="data"/><block s="reportNewList"><list></list></block></block><script><block s="doSetVar"><l>item</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><block s="doRun"><block var="action"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block s="doSetVar"><l>data</l><block s="reportCDR"><block var="data"/></block></block></script></block></script></block-definition><block-definition s="else if %'test' then %'action'" type="predicate" category="control"><header></header><code></code><inputs><input type="%b"></input><input type="%cs"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doRun"><block var="action"/><list></list></block><block s="doReport"><block s="reportTrue"></block></block></script><script><block s="doReport"><block s="reportFalse"></block></block></script></block></script></block-definition><block-definition s="else %'action'" type="predicate" category="control"><header></header><code></code><inputs><input type="%cs"></input></inputs><script><block s="doRun"><block var="action"/><list></list></block><block s="doReport"><block s="reportTrue"></block></block></script></block-definition></blocks>
|
|
@ -1,4 +1,4 @@
|
|||
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="%'method' url: %'url' send: %'payload' headers: %'headers'" type="reporter" category="sensing"><header></header><code></code><inputs><input type="%s" readonly="true">GET<options>GET
|
||||
POST
|
||||
PUT
|
||||
DELETE</options></input><input type="%s">http://snap.berkeley.edu</input><input type="%s"></input><input type="%mult%l" readonly="true"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>method</l><l>url</l><l>data</l><l>headers</l><l>proc</l></list><l>var response, i, header;
if (!proc.httpRequest) {
 proc.httpRequest = new XMLHttpRequest();
 proc.httpRequest.open(method, url, true);
 proc.assertType(headers, 'list');
 for (i = 1; i <= headers.length(); i += 1) {
 header = headers.at(i);
 proc.assertType(header, 'list');
 proc.httpRequest.setRequestHeader(
 header.at(1),
 header.at(2)
 );
 }
 proc.httpRequest.send(data || null);
} else if (proc.httpRequest.readyState === 4) {
 response = proc.httpRequest.responseText;
 proc.httpRequest = null;
 return response;
}
proc.pushContext('doYield');
proc.pushContext();</l></block><list><block var="method"/><block var="url"/><block var="payload"/><block var="headers"/></list></block></block></script></block-definition><block-definition s="key: %'key' value: %'value'" type="reporter" category="operators"><header></header><code></code><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportNewList"><list><block var="key"/><block var="value"/></list></block></block></script></block-definition></blocks>
|
||||
DELETE</options></input><input type="%s">http://snap.berkeley.edu</input><input type="%s"></input><input type="%mult%l" readonly="true"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>method</l><l>url</l><l>data</l><l>headers</l><l>proc</l></list><l>var response, i, header;
if (!proc.httpRequest) {
 proc.httpRequest = new XMLHttpRequest();
 proc.httpRequest.open(method, url, true);
 proc.assertType(headers, 'list');
 for (i = 1; i <= headers.length(); i += 1) {
 header = headers.at(i);
 proc.assertType(header, 'list');
 proc.httpRequest.setRequestHeader(
 header.at(1),
 header.at(2)
 );
 }
 proc.httpRequest.send(data || null);
} else if (proc.httpRequest.readyState === 4) {
 response = proc.httpRequest.responseText;
 proc.httpRequest = null;
 return response;
}
proc.pushContext('doYield');
proc.pushContext();</l></block><list><block var="method"/><block var="url"/><block var="payload"/><block var="headers"/></list></block></block></script></block-definition><block-definition s="key: %'key' value: %'value'" type="reporter" category="operators"><header></header><code></code><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportNewList"><list><block var="key"/><block var="value"/></list></block></block></script></block-definition><block-definition s="curent location" type="reporter" category="sensing"><comment x="0" y="0" w="200" collapsed="false">Reports a three-item list containing the latitude and longitude of the user, and the precision of the measurements. Works only if the user allows snap.berkeley.edu access to location data. Some browsers also require an HTTPS connection to Snap!.</comment><header></header><code></code><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>proc</l></list><l>if (!proc.geostarted) {
 var geo = navigator.geolocation;
 var cords = [];
 var options = {
 enableHighAccuracy: false,
 };

 function success(pos) {
 console.log(pos);
 proc.geocords = [pos.coords.latitude,
 pos.coords.longitude,
 pos.coords.accuracy];
 }

 function error(err) {
 alert("ERROR " + err.code + ": " + err.message);
 }
 proc.geostarted = true;
 proc.geocords = null;
 console.log("starting geolocation")
 geo.getCurrentPosition(success, error, options);
} else if (proc.geocords) {
 var cords = proc.geocords;
 proc.geostarted = null;
 proc.geocords = null;
 console.log("returning");
 return new List(cords);
} else {
 console.log("yielding");
 proc.pushContext('doYield');
 proc.pushContext();
}</l></block><list></list></block></block></script></block-definition></blocks>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="multiline %'text'" type="reporter" category="operators"><header></header><code></code><inputs><input type="%code"></input></inputs><script><block s="doReport"><block var="text"/></block></script></block-definition></blocks>
|
|
@ -1 +1 @@
|
|||
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="pen trails" type="reporter" category="pen"><header></header><code></code><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list></list><l>return new Costume(
 this.parentThatIsA(StageMorph).trailsCanvas
);</l></block><list></list></block></block></script></block-definition><block-definition s="set pen trails to: %'costume'" type="command" category="pen"><header></header><code></code><inputs><input type="%s" readonly="true"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>cst</l></list><l>var stage = this.parentThatIsA(StageMorph);
stage.trailsCanvas = cst.contents;
stage.changed();</l></block><list><block var="costume"/></list></block></script></block-definition></blocks>
|
||||
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="pen trails" type="reporter" category="pen"><header></header><code></code><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list></list><l>var cst = new Costume(
 this.parentThatIsA(StageMorph).trailsCanvas
);
cst.shrinkWrap();
return cst;</l></block><list></list></block></block></script></block-definition><block-definition s="set pen trails to: %'costume'" type="command" category="pen"><header></header><code></code><inputs><input type="%s" readonly="true"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>cst</l></list><l>var stage = this.parentThatIsA(StageMorph);
stage.trailsCanvas = cst.contents;
stage.changed();</l></block><list><block var="costume"/></list></block></script></block-definition></blocks>
|
57
lists.js
57
lists.js
|
@ -60,9 +60,9 @@
|
|||
Color, Point, WatcherMorph, StringMorph, SpriteMorph, ScrollFrameMorph,
|
||||
CellMorph, ArrowMorph, MenuMorph, snapEquals, Morph, isNil, localize,
|
||||
MorphicPreferences, TableDialogMorph, SpriteBubbleMorph, SpeechBubbleMorph,
|
||||
TableFrameMorph, TableMorph, Variable*/
|
||||
TableFrameMorph, TableMorph, Variable, isSnapObject*/
|
||||
|
||||
modules.lists = '2016-February-24';
|
||||
modules.lists = '2016-July-14';
|
||||
|
||||
var List;
|
||||
var ListWatcherMorph;
|
||||
|
@ -322,6 +322,27 @@ List.prototype.asArray = function () {
|
|||
return this.contents;
|
||||
};
|
||||
|
||||
List.prototype.itemsArray = function () {
|
||||
// answer an array containing my elements
|
||||
// don't convert linked lists to arrays
|
||||
if (this.isLinked) {
|
||||
var next = this,
|
||||
result = [],
|
||||
i;
|
||||
while (next && next.isLinked) {
|
||||
result.push(next.first);
|
||||
next = next.rest;
|
||||
}
|
||||
if (next) {
|
||||
for (i = 1; i <= next.contents.length; i += 1) {
|
||||
result.push(next.at(i));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return this.contents;
|
||||
};
|
||||
|
||||
List.prototype.asText = function () {
|
||||
var result = '',
|
||||
length,
|
||||
|
@ -353,17 +374,7 @@ List.prototype.asText = function () {
|
|||
|
||||
List.prototype.becomeArray = function () {
|
||||
if (this.isLinked) {
|
||||
var next = this, i;
|
||||
this.contents = [];
|
||||
while (next && next.isLinked) {
|
||||
this.contents.push(next.first);
|
||||
next = next.rest;
|
||||
}
|
||||
if (next) {
|
||||
for (i = 1; i <= next.contents.length; i += 1) {
|
||||
this.contents.push(next.at(i));
|
||||
}
|
||||
}
|
||||
this.contents = this.itemsArray();
|
||||
this.isLinked = false;
|
||||
this.first = null;
|
||||
this.rest = null;
|
||||
|
@ -376,9 +387,11 @@ List.prototype.becomeLinked = function () {
|
|||
stop = this.length();
|
||||
for (i = 0; i < stop; i += 1) {
|
||||
tail.first = this.contents[i];
|
||||
tail.rest = new List();
|
||||
tail.isLinked = true;
|
||||
tail = tail.rest;
|
||||
if (i < (stop - 1)) {
|
||||
tail.rest = new List();
|
||||
tail.isLinked = true;
|
||||
tail = tail.rest;
|
||||
}
|
||||
}
|
||||
this.contents = [];
|
||||
this.isLinked = true;
|
||||
|
@ -543,10 +556,12 @@ ListWatcherMorph.prototype.update = function (anyway) {
|
|||
starttime, maxtime = 1000;
|
||||
|
||||
this.frame.contents.children.forEach(function (m) {
|
||||
|
||||
if (m instanceof CellMorph
|
||||
&& m.contentsMorph instanceof ListWatcherMorph) {
|
||||
m.contentsMorph.update();
|
||||
if (m instanceof CellMorph) {
|
||||
if (m.contentsMorph instanceof ListWatcherMorph) {
|
||||
m.contentsMorph.update();
|
||||
} else if (isSnapObject(m.contents)) {
|
||||
m.update();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -802,7 +817,7 @@ ListWatcherMorph.prototype.showTableView = function () {
|
|||
if (!view) {return; }
|
||||
if (view instanceof SpriteBubbleMorph) {
|
||||
view.changed();
|
||||
view.drawNew();
|
||||
view.drawNew(true);
|
||||
} else if (view instanceof SpeechBubbleMorph) {
|
||||
view.contents = new TableFrameMorph(new TableMorph(this.list, 10));
|
||||
view.contents.expand(this.extent());
|
||||
|
|
87
locale.js
87
locale.js
|
@ -42,7 +42,7 @@
|
|||
|
||||
/*global modules, contains*/
|
||||
|
||||
modules.locale = '2016-March-16';
|
||||
modules.locale = '2016-July-14';
|
||||
|
||||
// Global stuff
|
||||
|
||||
|
@ -153,7 +153,6 @@ SnapTranslator.dict.en = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.de = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Deutsch',
|
||||
'language_translator':
|
||||
|
@ -161,23 +160,21 @@ SnapTranslator.dict.de = {
|
|||
'translator_e-mail':
|
||||
'jens@moenig.org',
|
||||
'last_changed':
|
||||
'2016-03-16'
|
||||
'2016-07-12'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.it = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Italiano',
|
||||
'language_translator':
|
||||
'Stefano Federici, Alberto Firpo',
|
||||
'Stefano Federici, Alberto Firpo, Massimo Ghisalberti',
|
||||
'translator_e-mail':
|
||||
's_federici@yahoo.com, albertofirpo12@gmail.com',
|
||||
's_federici@yahoo.com, albertofirpo12@gmail.com, zairik@gmail.com',
|
||||
'last_changed':
|
||||
'2015-01-12'
|
||||
'2016-05-10'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.ja = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'日本語',
|
||||
'language_translator':
|
||||
|
@ -189,7 +186,6 @@ SnapTranslator.dict.ja = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.ja_HIRA = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'にほんご',
|
||||
'language_translator':
|
||||
|
@ -201,7 +197,6 @@ SnapTranslator.dict.ja_HIRA = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.ko = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'한국어',
|
||||
'language_translator':
|
||||
|
@ -213,7 +208,6 @@ SnapTranslator.dict.ko = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.pt = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Português',
|
||||
'language_translator':
|
||||
|
@ -225,7 +219,6 @@ SnapTranslator.dict.pt = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.cs = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Česky',
|
||||
'language_translator':
|
||||
|
@ -237,19 +230,17 @@ SnapTranslator.dict.cs = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.zh = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'简体中文',
|
||||
'language_translator':
|
||||
'邓江华',
|
||||
'五百刀/邓江华',
|
||||
'translator_e-mail':
|
||||
'djh@rhjxx.cn',
|
||||
'ubertao@qq.com/djh@rhjxx.cn',
|
||||
'last_changed':
|
||||
'2013-03-25'
|
||||
'2016-05-09'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.eo = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Esperanto',
|
||||
'language_translator':
|
||||
|
@ -261,7 +252,6 @@ SnapTranslator.dict.eo = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.fr = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Fran\u00E7ais',
|
||||
'language_translator':
|
||||
|
@ -273,31 +263,28 @@ SnapTranslator.dict.fr = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.si = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Sloven\u0161\u010Dina',
|
||||
'language_translator':
|
||||
'Sasa Divjak',
|
||||
'Sasa Divjak, Gorazd Breskvar',
|
||||
'translator_e-mail':
|
||||
'sasa.divjak@fri.uni-lj.si',
|
||||
'last_changed':
|
||||
'2013-01-07'
|
||||
'2016-04-22'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.ru = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Русский',
|
||||
'language_translator':
|
||||
'Svetlana Ptashnaya',
|
||||
'Svetlana Ptashnaya, Проскурнёв Артём',
|
||||
'translator_e-mail':
|
||||
'svetlanap@berkeley.edu',
|
||||
'svetlanap@berkeley.edu, tema@school830.ru',
|
||||
'last_changed':
|
||||
'2014-09-29'
|
||||
'2016-05-25'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.es = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Espa\u00F1ol',
|
||||
'language_translator':
|
||||
|
@ -309,7 +296,6 @@ SnapTranslator.dict.es = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.nl = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Nederlands',
|
||||
'language_translator':
|
||||
|
@ -321,7 +307,6 @@ SnapTranslator.dict.nl = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.pl = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Polski',
|
||||
'language_translator':
|
||||
|
@ -333,7 +318,6 @@ SnapTranslator.dict.pl = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.tw = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'繁體中文',
|
||||
'language_translator':
|
||||
|
@ -345,7 +329,6 @@ SnapTranslator.dict.tw = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.no = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Norsk',
|
||||
'language_translator':
|
||||
|
@ -357,7 +340,6 @@ SnapTranslator.dict.no = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.dk = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Dansk',
|
||||
'language_translator':
|
||||
|
@ -369,7 +351,6 @@ SnapTranslator.dict.dk = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.el = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Ελληνικά',
|
||||
'language_translator':
|
||||
|
@ -381,19 +362,17 @@ SnapTranslator.dict.el = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.ca = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Català',
|
||||
'language_translator':
|
||||
'Bernat Romagosa Carrasquer',
|
||||
'Bernat Romagosa Carrasquer, Joan Guillén i Pelegay',
|
||||
'translator_e-mail':
|
||||
'bromagosa@citilab.eu',
|
||||
'bernat@arduino.org, jguille2@xtec.cat',
|
||||
'last_changed':
|
||||
'2016-02-24'
|
||||
'2016-07-07'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.fi = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'suomi',
|
||||
'language_translator':
|
||||
|
@ -405,7 +384,6 @@ SnapTranslator.dict.fi = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.sv = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'svenska',
|
||||
'language_translator':
|
||||
|
@ -413,11 +391,10 @@ SnapTranslator.dict.sv = {
|
|||
'translator_e-mail':
|
||||
'eolsson@gmail.com',
|
||||
'last_changed':
|
||||
'2014-12-14'
|
||||
'2016-06-09'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.pt_BR = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'Português do Brasil',
|
||||
'language_translator':
|
||||
|
@ -429,7 +406,6 @@ SnapTranslator.dict.pt_BR = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.bn = {
|
||||
// meta information
|
||||
'language_name':
|
||||
'বাংলা',
|
||||
'language_translator':
|
||||
|
@ -441,7 +417,6 @@ SnapTranslator.dict.bn = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.kn = {
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'\u0C95\u0CA8\u0CCD\u0CA8\u0CA1',
|
||||
'language_translator':
|
||||
|
@ -453,7 +428,6 @@ SnapTranslator.dict.kn = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.ml = {
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'Malayalam',
|
||||
'language_translator':
|
||||
|
@ -465,7 +439,6 @@ SnapTranslator.dict.ml = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.ta = {
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'Tamil',
|
||||
'language_translator':
|
||||
|
@ -477,7 +450,6 @@ SnapTranslator.dict.ta = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.te = {
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'Telagu', // the name as it should appear in the language menu
|
||||
'language_translator':
|
||||
|
@ -489,7 +461,6 @@ SnapTranslator.dict.te = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.tr = {
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'Türkçe',
|
||||
'language_translator':
|
||||
|
@ -501,7 +472,6 @@ SnapTranslator.dict.tr = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.hu = {
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'Magyar',
|
||||
'language_translator':
|
||||
|
@ -513,7 +483,6 @@ SnapTranslator.dict.hu = {
|
|||
};
|
||||
|
||||
SnapTranslator.dict.ia = {
|
||||
// translations meta information
|
||||
'language_name':
|
||||
'Interlingua',
|
||||
'language_translator':
|
||||
|
@ -567,3 +536,25 @@ SnapTranslator.dict.ar = {
|
|||
'last_changed':
|
||||
'2016-02-24'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.id = {
|
||||
'language_name':
|
||||
'Bahasa Indonesia',
|
||||
'language_translator':
|
||||
'Alexander Raphael Liu',
|
||||
'translator_e-mail':
|
||||
'raphaxander@gmail.com',
|
||||
'last_changed':
|
||||
'2016-5-2'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.et = {
|
||||
'language_name':
|
||||
'Eesti',
|
||||
'language_translator':
|
||||
'Hasso Tepper',
|
||||
'translator_e-mail':
|
||||
'hasso.tepper@gmail.com',
|
||||
'last_changed':
|
||||
'2016-05-03'
|
||||
};
|
||||
|
|
515
morphic.js
515
morphic.js
|
@ -54,7 +54,8 @@
|
|||
(6) development and user modes
|
||||
(7) turtle graphics
|
||||
(8) damage list housekeeping
|
||||
(9) minifying morphic.js
|
||||
(9) supporting high-resolution "retina" screens
|
||||
(10) minifying morphic.js
|
||||
VIII. acknowledgements
|
||||
IX. contributors
|
||||
|
||||
|
@ -104,7 +105,6 @@
|
|||
the following list shows the order in which all constructors are
|
||||
defined. Use this list to locate code in this document:
|
||||
|
||||
|
||||
Global settings
|
||||
Global functions
|
||||
|
||||
|
@ -154,7 +154,6 @@
|
|||
IV. open issues
|
||||
----------------
|
||||
- clipboard support (copy & paste) for non-textual data
|
||||
- native (unscaled) high-resolution display support
|
||||
|
||||
|
||||
V. browser compatibility
|
||||
|
@ -337,7 +336,7 @@
|
|||
(c) an application
|
||||
-------------------
|
||||
Of course, most of the time you don't want to just plain use the
|
||||
standard Morhic World "as is" out of the box, but write your own
|
||||
standard Morphic World "as is" out of the box, but write your own
|
||||
application (something like Scratch!) in it. For such an
|
||||
application you'll create your own morph prototypes, perhaps
|
||||
assemble your own "window frame" and bring it all to life in a
|
||||
|
@ -990,8 +989,54 @@
|
|||
methods of SyntaxElementMorph in the Snap application.
|
||||
|
||||
|
||||
(9) minifying morphic.js
|
||||
------------------------
|
||||
(9) supporting high-resolution "retina" screens
|
||||
-----------------------------------------------
|
||||
By default retina support gets installed when Morphic.js loads. There
|
||||
are two global functions that let you test for retina availability:
|
||||
|
||||
isRetinaSupported() - Bool, answers if retina support is available
|
||||
isRetinaEnabled() - Bool, answers if currently in retina mode
|
||||
|
||||
and two more functions that let you control retina support if it is
|
||||
available:
|
||||
|
||||
enableRetinaSupport()
|
||||
disableRetinaSupport()
|
||||
|
||||
Both of these internally test whether retina is available, so they are
|
||||
safe to call directly. For an example how to make retina support
|
||||
user-specifiable refer to
|
||||
|
||||
Snap! >> guis.js >> toggleRetina()
|
||||
|
||||
Even when in retina mode it often makes sense to use normal-resolution
|
||||
canvasses for simple shapes in order to save system resources and
|
||||
optimize performance. Examples are costumes and backgrounds in Snap.
|
||||
In Morphic you can create new canvas elements using
|
||||
|
||||
newCanvas(extentPoint [, nonRetinaFlag])
|
||||
|
||||
If retina support is enabled such new canvasses will automatically be
|
||||
high-resolution canvasses, unless the newCanvas() function is given an
|
||||
otherwise optional second Boolean <true> argument that explicitly makes
|
||||
it a non-retina canvas.
|
||||
|
||||
Not the whole canvas API is supported by Morphic's retina utilities.
|
||||
Especially if your code uses putImageData() you will want to "downgrade"
|
||||
a target high-resolution canvas to a normal-resolution ("non-retina")
|
||||
one before using
|
||||
|
||||
normalizeCanvas(aCanvas [, copyFlag])
|
||||
|
||||
This will change the target canvas' resolution in place (!). If you
|
||||
pass in the optional second Boolean <true> flag the function returns
|
||||
a non-retina copy and leaves the target canvas unchanged. An example
|
||||
of this normalize mechanism is converting the penTrails layer of Snap's
|
||||
stage (high-resolution) into a sprite-costume (normal resolution).
|
||||
|
||||
|
||||
(10) minifying morphic.js
|
||||
-------------------------
|
||||
Coming from Smalltalk and being a Squeaker at heart I am a huge fan
|
||||
of browsing the code itself to make sense of it. Therefore I have
|
||||
included this documentation and (too little) inline comments so all
|
||||
|
@ -1036,7 +1081,8 @@
|
|||
I have originally written morphic.js in Florian Balmer's Notepad2
|
||||
editor for Windows, later switched to Apple's Dashcode and later
|
||||
still to Apple's Xcode. I've also come to depend on both Douglas
|
||||
Crockford's JSLint, Mozilla's Firebug and Google's Chrome to get
|
||||
Crockford's JSLint and later the JSHint project, as well as on
|
||||
Mozilla's Firebug and Google's Chrome to get
|
||||
it right.
|
||||
|
||||
|
||||
|
@ -1048,16 +1094,16 @@
|
|||
Ian Reynolds contributed backspace key handling for Chrome.
|
||||
Davide Della Casa contributed performance optimizations for Firefox.
|
||||
Jason N (@cyderize) contributed native copy & paste for text editing.
|
||||
Bartosz Leper contributed retina display support.
|
||||
|
||||
- Jens Mönig
|
||||
*/
|
||||
|
||||
// Global settings /////////////////////////////////////////////////////
|
||||
|
||||
/*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio,
|
||||
FileList, getBlurredShadowSupport*/
|
||||
/*global window, HTMLCanvasElement, FileReader, Audio, FileList*/
|
||||
|
||||
var morphicVersion = '2016-February-24';
|
||||
var morphicVersion = '2016-August-12';
|
||||
var modules = {}; // keep track of additional loaded modules
|
||||
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug
|
||||
|
||||
|
@ -1103,6 +1149,34 @@ var touchScreenSettings = {
|
|||
|
||||
var MorphicPreferences = standardSettings;
|
||||
|
||||
// first, try enabling support for retina displays - can be turned off later
|
||||
|
||||
/*
|
||||
Support for retina displays has been pioneered and contributed by
|
||||
Bartosz Leper.
|
||||
|
||||
NOTE: this will make changes to the HTMLCanvasElement that - mostly -
|
||||
make Morphic usable on retina displays in very high resolution mode
|
||||
with crisp fonts and clear fine lines without you (the programmer)
|
||||
needing to know any specifics, provided both the display and the browser
|
||||
support these (Safari currently doesn't), otherwise these utilities will
|
||||
not be installed.
|
||||
If you don't want your Morphic application to support retina resolutions
|
||||
you don't have to edit this morphic.js file to comment out the next line
|
||||
of code, instead you can simply call
|
||||
|
||||
disableRetinaSupport();
|
||||
|
||||
before you create your World(s) in the html page. Disabling retina
|
||||
support also will simply do nothing if retina support is not possible
|
||||
or already disabled, so it's equally safe to call.
|
||||
|
||||
For an example how to make retina support user-specifiable refer to
|
||||
Snap! >> guis.js >> toggleRetina()
|
||||
*/
|
||||
|
||||
enableRetinaSupport();
|
||||
|
||||
// Global Functions ////////////////////////////////////////////////////
|
||||
|
||||
function nop() {
|
||||
|
@ -1171,13 +1245,18 @@ function fontHeight(height) {
|
|||
return minHeight * 1.2; // assuming 1/5 font size for ascenders
|
||||
}
|
||||
|
||||
function newCanvas(extentPoint) {
|
||||
function newCanvas(extentPoint, nonRetina) {
|
||||
// answer a new empty instance of Canvas, don't display anywhere
|
||||
// nonRetina - optional Boolean "false"
|
||||
// by default retina support is automatic
|
||||
var canvas, ext;
|
||||
ext = extentPoint || {x: 0, y: 0};
|
||||
canvas = document.createElement('canvas');
|
||||
canvas.width = ext.x;
|
||||
canvas.height = ext.y;
|
||||
if (nonRetina && canvas.isRetinaEnabled) {
|
||||
canvas.isRetinaEnabled = false;
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
|
||||
|
@ -1282,6 +1361,364 @@ function copy(target) {
|
|||
return c;
|
||||
}
|
||||
|
||||
// Retina Display Support //////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
By default retina support gets installed when Morphic.js loads. There
|
||||
are two global functions that let you test for retina availability:
|
||||
|
||||
isRetinaSupported() - Boolean, whether retina support is available
|
||||
isRetinaEnabled() - Boolean, whether currently in retina mode
|
||||
|
||||
and two more functions that let you control retina support if it is
|
||||
available:
|
||||
|
||||
enableRetinaSupport()
|
||||
disableRetinaSupport()
|
||||
|
||||
Both of these internally test whether retina is available, so they are
|
||||
safe to call directly.
|
||||
|
||||
Even when in retina mode it often makes sense to use non-high-resolution
|
||||
canvasses for simple shapes in order to save system resources and
|
||||
optimize performance. Examples are costumes and backgrounds in Snap.
|
||||
In Morphic you can create new canvas elements using
|
||||
|
||||
newCanvas(extentPoint [, nonRetinaFlag])
|
||||
|
||||
If retina support is enabled such new canvasses will automatically be
|
||||
high-resolution canvasses, unless the newCanvas() function is given an
|
||||
otherwise optional second Boolean <true> argument that explicitly makes
|
||||
it a non-retina canvas.
|
||||
|
||||
Not the whole canvas API is supported by Morphic's retina utilities.
|
||||
Especially if your code uses putImageData() you will want to "downgrade"
|
||||
a target high-resolution canvas to a normal-resolution ("non-retina")
|
||||
one before using
|
||||
|
||||
normalizeCanvas(aCanvas [, copyFlag])
|
||||
|
||||
This will change the target canvas' resolution in place (!). If you
|
||||
pass in the optional second Boolean <true> flag the function returns
|
||||
a non-retina copy and leaves the target canvas unchanged. An example
|
||||
of this normalize mechanism is converting the penTrails layer of Snap's
|
||||
stage (high-resolution) into a sprite-costume (normal resolution).
|
||||
*/
|
||||
|
||||
function enableRetinaSupport() {
|
||||
/*
|
||||
=== contributed by Bartosz Leper ===
|
||||
|
||||
This installs a series of utilities that allow using Canvas the same way
|
||||
on retina and non-retina displays. If the display is a retina one, the
|
||||
underlying dimensions of the Canvas elements are doubled, but this will
|
||||
be transparent to the code that uses Canvas. All dimensions read or
|
||||
written to the Canvas element will be scaled appropriately.
|
||||
|
||||
NOTE: This implementation is not exhaustive; it only implements what is
|
||||
needed by the Snap! UI.
|
||||
|
||||
[Jens]: like all other retina screen support implementations I've seen
|
||||
Bartosz's patch also does not address putImageData() compatibility when
|
||||
mixing retina-enabled and non-retina canvasses. If you need to manipulate
|
||||
pixels in such mixed canvasses, make sure to "downgrade" them all using
|
||||
normalizeCanvas() below.
|
||||
*/
|
||||
|
||||
// Get the window's pixel ratio for canvas elements.
|
||||
// See: http://www.html5rocks.com/en/tutorials/canvas/hidpi/
|
||||
var ctx = document.createElement("canvas").getContext("2d"),
|
||||
backingStorePixelRatio = ctx.webkitBackingStorePixelRatio ||
|
||||
ctx.mozBackingStorePixelRatio ||
|
||||
ctx.msBackingStorePixelRatio ||
|
||||
ctx.oBackingStorePixelRatio ||
|
||||
ctx.backingStorePixelRatio || 1,
|
||||
|
||||
// Unfortunately, it's really hard to make this work well when changing
|
||||
// zoom level, so let's leave it like this right now, and stick to
|
||||
// whatever the ratio was in the beginning.
|
||||
|
||||
// originalDevicePixelRatio = window.devicePixelRatio,
|
||||
|
||||
// [Jens]: As of summer 2016 non-integer devicePixelRatios lead to
|
||||
// artifacts when blitting images onto canvas elements in all browsers
|
||||
// except Chrome, especially Firefox, Edge, IE (Safari doesn't even
|
||||
// support retina mode as implemented here).
|
||||
// therefore - to ensure crisp fonts - use the ceiling of whatever
|
||||
// the devicePixelRatio is. This needs more memory, but looks nicer.
|
||||
|
||||
originalDevicePixelRatio = Math.ceil(window.devicePixelRatio),
|
||||
|
||||
canvasProto = HTMLCanvasElement.prototype,
|
||||
contextProto = CanvasRenderingContext2D.prototype,
|
||||
|
||||
// [Jens]: keep track of original properties in a dictionary
|
||||
// so they can be iterated over and restored
|
||||
uber = {
|
||||
drawImage: contextProto.drawImage,
|
||||
getImageData: contextProto.getImageData,
|
||||
|
||||
width: Object.getOwnPropertyDescriptor(
|
||||
canvasProto,
|
||||
'width'
|
||||
),
|
||||
height: Object.getOwnPropertyDescriptor(
|
||||
canvasProto,
|
||||
'height'
|
||||
),
|
||||
shadowOffsetX: Object.getOwnPropertyDescriptor(
|
||||
contextProto,
|
||||
'shadowOffsetX'
|
||||
),
|
||||
shadowOffsetY: Object.getOwnPropertyDescriptor(
|
||||
contextProto,
|
||||
'shadowOffsetY'
|
||||
),
|
||||
shadowBlur: Object.getOwnPropertyDescriptor(
|
||||
contextProto,
|
||||
'shadowBlur'
|
||||
)
|
||||
};
|
||||
|
||||
// [Jens]: only install retina utilities if the display supports them
|
||||
if (backingStorePixelRatio === originalDevicePixelRatio) {return; }
|
||||
// [Jens]: check whether properties can be overridden, needed for Safari
|
||||
if (Object.keys(uber).some(function (any) {
|
||||
var prop = uber[any];
|
||||
return prop.hasOwnProperty('configurable') && (!prop.configurable);
|
||||
})) {return; }
|
||||
|
||||
function getPixelRatio(imageSource) {
|
||||
return imageSource.isRetinaEnabled ?
|
||||
(originalDevicePixelRatio || 1) / backingStorePixelRatio : 1;
|
||||
}
|
||||
|
||||
canvasProto._isRetinaEnabled = true;
|
||||
// [Jens]: remember the original non-retina properties,
|
||||
// so they can be restored again
|
||||
canvasProto._bak = uber;
|
||||
|
||||
Object.defineProperty(canvasProto, 'isRetinaEnabled', {
|
||||
get: function() {
|
||||
return this._isRetinaEnabled;
|
||||
},
|
||||
set: function(enabled) {
|
||||
var prevPixelRatio = getPixelRatio(this);
|
||||
var prevWidth = this.width;
|
||||
var prevHeight = this.height;
|
||||
|
||||
this._isRetinaEnabled = enabled;
|
||||
if (getPixelRatio(this) != prevPixelRatio) {
|
||||
this.width = prevWidth;
|
||||
this.height = prevHeight;
|
||||
}
|
||||
},
|
||||
configurable: true // [Jens]: allow to be deleted an reconfigured
|
||||
});
|
||||
|
||||
Object.defineProperty(canvasProto, 'width', {
|
||||
get: function() {
|
||||
return uber.width.get.call(this) / getPixelRatio(this);
|
||||
},
|
||||
set: function(width) {
|
||||
var pixelRatio = getPixelRatio(this);
|
||||
uber.width.set.call(this, width * pixelRatio);
|
||||
var context = this.getContext('2d');
|
||||
context.restore();
|
||||
context.save();
|
||||
context.scale(pixelRatio, pixelRatio);
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(canvasProto, 'height', {
|
||||
get: function() {
|
||||
return uber.height.get.call(this) / getPixelRatio(this);
|
||||
},
|
||||
set: function(height) {
|
||||
var pixelRatio = getPixelRatio(this);
|
||||
uber.height.set.call(this, height * pixelRatio);
|
||||
var context = this.getContext('2d');
|
||||
context.restore();
|
||||
context.save();
|
||||
context.scale(pixelRatio, pixelRatio);
|
||||
}
|
||||
});
|
||||
|
||||
contextProto.drawImage = function(image) {
|
||||
var pixelRatio = getPixelRatio(image),
|
||||
sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight;
|
||||
|
||||
// Different signatures of drawImage() method have different
|
||||
// parameter assignments.
|
||||
switch (arguments.length) {
|
||||
case 9:
|
||||
sx = arguments[1];
|
||||
sy = arguments[2];
|
||||
sWidth = arguments[3];
|
||||
sHeight = arguments[4];
|
||||
dx = arguments[5];
|
||||
dy = arguments[6];
|
||||
dWidth = arguments[7];
|
||||
dHeight = arguments[8];
|
||||
break;
|
||||
|
||||
case 5:
|
||||
sx = 0;
|
||||
sy = 0;
|
||||
sWidth = image.width;
|
||||
sHeight = image.height;
|
||||
dx = arguments[1];
|
||||
dy = arguments[2];
|
||||
dWidth = arguments[3];
|
||||
dHeight = arguments[4];
|
||||
break;
|
||||
|
||||
case 3:
|
||||
sx = 0;
|
||||
sy = 0;
|
||||
sWidth = image.width;
|
||||
sHeight = image.height;
|
||||
dx = arguments[1];
|
||||
dy = arguments[2];
|
||||
dWidth = image.width;
|
||||
dHeight = image.height;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw Error('Called drawImage() with ' + arguments.length +
|
||||
' arguments');
|
||||
}
|
||||
uber.drawImage.call(
|
||||
this, image,
|
||||
sx * pixelRatio, sy * pixelRatio,
|
||||
sWidth * pixelRatio, sHeight * pixelRatio,
|
||||
dx, dy,
|
||||
dWidth, dHeight);
|
||||
};
|
||||
|
||||
contextProto.getImageData = function(sx, sy, sw, sh) {
|
||||
var pixelRatio = getPixelRatio(this.canvas);
|
||||
return uber.getImageData.call(
|
||||
this,
|
||||
sx * pixelRatio, sy * pixelRatio,
|
||||
sw * pixelRatio, sh * pixelRatio);
|
||||
};
|
||||
|
||||
Object.defineProperty(contextProto, 'shadowOffsetX', {
|
||||
get: function() {
|
||||
return uber.shadowOffsetX.get.call(this) /
|
||||
getPixelRatio(this.canvas);
|
||||
},
|
||||
set: function(offset) {
|
||||
var pixelRatio = getPixelRatio(this.canvas);
|
||||
uber.shadowOffsetX.set.call(this, offset * pixelRatio);
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(contextProto, 'shadowOffsetY', {
|
||||
get: function() {
|
||||
return uber.shadowOffsetY.get.call(this) /
|
||||
getPixelRatio(this.canvas);
|
||||
},
|
||||
set: function(offset) {
|
||||
var pixelRatio = getPixelRatio(this.canvas);
|
||||
uber.shadowOffsetY.set.call(this, offset * pixelRatio);
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(contextProto, 'shadowBlur', {
|
||||
get: function() {
|
||||
return uber.shadowBlur.get.call(this) /
|
||||
getPixelRatio(this.canvas);
|
||||
},
|
||||
set: function(blur) {
|
||||
var pixelRatio = getPixelRatio(this.canvas);
|
||||
uber.shadowBlur.set.call(this, blur * pixelRatio);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function isRetinaSupported () {
|
||||
var ctx = document.createElement("canvas").getContext("2d"),
|
||||
backingStorePixelRatio = ctx.webkitBackingStorePixelRatio ||
|
||||
ctx.mozBackingStorePixelRatio ||
|
||||
ctx.msBackingStorePixelRatio ||
|
||||
ctx.oBackingStorePixelRatio ||
|
||||
ctx.backingStorePixelRatio || 1,
|
||||
canvasProto = HTMLCanvasElement.prototype,
|
||||
contextProto = CanvasRenderingContext2D.prototype,
|
||||
uber = {
|
||||
drawImage: contextProto.drawImage,
|
||||
getImageData: contextProto.getImageData,
|
||||
|
||||
width: Object.getOwnPropertyDescriptor(
|
||||
canvasProto,
|
||||
'width'
|
||||
),
|
||||
height: Object.getOwnPropertyDescriptor(
|
||||
canvasProto,
|
||||
'height'
|
||||
),
|
||||
shadowOffsetX: Object.getOwnPropertyDescriptor(
|
||||
contextProto,
|
||||
'shadowOffsetX'
|
||||
),
|
||||
shadowOffsetY: Object.getOwnPropertyDescriptor(
|
||||
contextProto,
|
||||
'shadowOffsetY'
|
||||
),
|
||||
shadowBlur: Object.getOwnPropertyDescriptor(
|
||||
contextProto,
|
||||
'shadowBlur'
|
||||
)
|
||||
};
|
||||
return backingStorePixelRatio !== window.devicePixelRatio &&
|
||||
!(Object.keys(uber).some(function (any) {
|
||||
var prop = uber[any];
|
||||
return prop.hasOwnProperty('configurable') && (!prop.configurable);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
function isRetinaEnabled () {
|
||||
return HTMLCanvasElement.prototype.hasOwnProperty('_isRetinaEnabled');
|
||||
}
|
||||
|
||||
function disableRetinaSupport() {
|
||||
// uninstalls Retina utilities. Make sure to re-create every Canvas
|
||||
// element afterwards
|
||||
var canvasProto, contextProto, uber;
|
||||
if (!isRetinaEnabled()) {return; }
|
||||
canvasProto = HTMLCanvasElement.prototype;
|
||||
contextProto = CanvasRenderingContext2D.prototype;
|
||||
uber = canvasProto._bak;
|
||||
Object.defineProperty(canvasProto, 'width', uber.width);
|
||||
Object.defineProperty(canvasProto, 'height', uber.height);
|
||||
contextProto.drawImage = uber.drawImage;
|
||||
contextProto.getImageData = uber.getImageData;
|
||||
Object.defineProperty(contextProto, 'shadowOffsetX', uber.shadowOffsetX);
|
||||
Object.defineProperty(contextProto, 'shadowOffsetY', uber.shadowOffsetY);
|
||||
Object.defineProperty(contextProto, 'shadowBlur', uber.shadowBlur);
|
||||
delete canvasProto._isRetinaEnabled;
|
||||
delete canvasProto.isRetinaEnabled;
|
||||
delete canvasProto._bak;
|
||||
}
|
||||
|
||||
function normalizeCanvas(aCanvas, getCopy) {
|
||||
// make sure aCanvas is non-retina, otherwise convert it in place (!)
|
||||
// or answer a normalized copy if the "getCopy" flag is <true>
|
||||
var cpy;
|
||||
if (!aCanvas.isRetinaEnabled) {return aCanvas; }
|
||||
cpy = newCanvas(new Point(aCanvas.width, aCanvas.height), true);
|
||||
cpy.getContext('2d').drawImage(aCanvas, 0, 0);
|
||||
if (getCopy) {return cpy; }
|
||||
aCanvas.isRetinaEnabled = false;
|
||||
aCanvas.width = cpy.width;
|
||||
aCanvas.height = cpy.height;
|
||||
aCanvas.getContext('2d').drawImage(cpy, 0, 0);
|
||||
return aCanvas;
|
||||
}
|
||||
|
||||
// Colors //////////////////////////////////////////////////////////////
|
||||
|
||||
// Color instance creation:
|
||||
|
@ -1938,7 +2375,7 @@ Rectangle.prototype.round = function () {
|
|||
Rectangle.prototype.spread = function () {
|
||||
// round me by applying floor() to my origin and ceil() to my corner
|
||||
// expand by 1 to be on the safe side, this eliminates rounding
|
||||
// artefacts caused by Safari's auto-scaling on retina displays
|
||||
// artifacts caused by Safari's auto-scaling on retina displays
|
||||
return this.origin.floor().corner(this.corner.ceil()).expandBy(1);
|
||||
};
|
||||
|
||||
|
@ -2090,6 +2527,20 @@ Node.prototype.forAllChildren = function (aFunction) {
|
|||
aFunction.call(null, this);
|
||||
};
|
||||
|
||||
Node.prototype.anyChild = function (aPredicate) {
|
||||
// includes myself
|
||||
var i;
|
||||
if (aPredicate.call(null, this)) {
|
||||
return true;
|
||||
}
|
||||
for (i = 0; i < this.children.length; i += 1) {
|
||||
if (this.children[i].anyChild(aPredicate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
Node.prototype.allLeafs = function () {
|
||||
var result = [];
|
||||
this.allChildren().forEach(function (element) {
|
||||
|
@ -3673,9 +4124,13 @@ Morph.prototype.evaluateString = function (code) {
|
|||
|
||||
Morph.prototype.isTouching = function (otherMorph) {
|
||||
var oImg = this.overlappingImage(otherMorph),
|
||||
data = oImg.getContext('2d')
|
||||
.getImageData(1, 1, oImg.width, oImg.height)
|
||||
.data;
|
||||
data;
|
||||
if (!oImg.width || !oImg.height) {
|
||||
return false;
|
||||
}
|
||||
data = oImg.getContext('2d')
|
||||
.getImageData(1, 1, oImg.width, oImg.height)
|
||||
.data;
|
||||
return detect(
|
||||
data,
|
||||
function (each) {
|
||||
|
@ -4535,8 +4990,8 @@ CursorMorph.prototype.initializeClipboardHandler = function () {
|
|||
this.select();
|
||||
|
||||
// Make sure tab prevents default
|
||||
if (event.keyIdentifier === 'U+0009' ||
|
||||
event.keyIdentifier === 'Tab') {
|
||||
if (event.key === 'U+0009' ||
|
||||
event.key === 'Tab') {
|
||||
myself.processKeyPress(event);
|
||||
event.preventDefault();
|
||||
}
|
||||
|
@ -4650,7 +5105,7 @@ CursorMorph.prototype.processKeyDown = function (event) {
|
|||
this.keyDownEventUsed = true;
|
||||
break;
|
||||
case 13:
|
||||
if (this.target instanceof StringMorph) {
|
||||
if ((this.target instanceof StringMorph) || shift) {
|
||||
this.accept();
|
||||
} else {
|
||||
this.insert('\n');
|
||||
|
@ -9934,7 +10389,7 @@ HandMorph.prototype.processDrop = function (event) {
|
|||
target = target.parent;
|
||||
}
|
||||
pic.onload = function () {
|
||||
canvas = newCanvas(new Point(pic.width, pic.height));
|
||||
canvas = newCanvas(new Point(pic.width, pic.height), true);
|
||||
canvas.getContext('2d').drawImage(pic, 0, 0);
|
||||
target.droppedImage(canvas, aFile.name);
|
||||
};
|
||||
|
@ -10025,7 +10480,7 @@ HandMorph.prototype.processDrop = function (event) {
|
|||
}
|
||||
img = new Image();
|
||||
img.onload = function () {
|
||||
canvas = newCanvas(new Point(img.width, img.height));
|
||||
canvas = newCanvas(new Point(img.width, img.height), true);
|
||||
canvas.getContext('2d').drawImage(img, 0, 0);
|
||||
target.droppedImage(canvas);
|
||||
};
|
||||
|
@ -10037,7 +10492,7 @@ HandMorph.prototype.processDrop = function (event) {
|
|||
}
|
||||
img = new Image();
|
||||
img.onload = function () {
|
||||
canvas = newCanvas(new Point(img.width, img.height));
|
||||
canvas = newCanvas(new Point(img.width, img.height), true);
|
||||
canvas.getContext('2d').drawImage(img, 0, 0);
|
||||
target.droppedImage(canvas);
|
||||
};
|
||||
|
@ -10177,22 +10632,16 @@ WorldMorph.prototype.doOneCycle = function () {
|
|||
};
|
||||
|
||||
WorldMorph.prototype.fillPage = function () {
|
||||
var pos = getDocumentPositionOf(this.worldCanvas),
|
||||
clientHeight = window.innerHeight,
|
||||
var clientHeight = window.innerHeight,
|
||||
clientWidth = window.innerWidth,
|
||||
myself = this;
|
||||
|
||||
this.worldCanvas.style.position = "absolute";
|
||||
this.worldCanvas.style.left = "0px";
|
||||
this.worldCanvas.style.right = "0px";
|
||||
this.worldCanvas.style.width = "100%";
|
||||
this.worldCanvas.style.height = "100%";
|
||||
|
||||
if (pos.x > 0) {
|
||||
this.worldCanvas.style.position = "absolute";
|
||||
this.worldCanvas.style.left = "0px";
|
||||
pos.x = 0;
|
||||
}
|
||||
if (pos.y > 0) {
|
||||
this.worldCanvas.style.position = "absolute";
|
||||
this.worldCanvas.style.top = "0px";
|
||||
pos.y = 0;
|
||||
}
|
||||
if (document.documentElement.scrollTop) {
|
||||
// scrolled down b/c of viewport scaling
|
||||
clientHeight = document.documentElement.clientHeight;
|
||||
|
|
67
morphic.txt
67
morphic.txt
|
@ -7,9 +7,9 @@
|
|||
written by Jens Mönig
|
||||
jens@moenig.org
|
||||
|
||||
Copyright (C) 2015 by Jens Mönig
|
||||
Copyright (C) 2016 by Jens Mönig
|
||||
|
||||
this documentation last changed: Dec 21, 2015
|
||||
this documentation last changed: July 14, 2016
|
||||
|
||||
This file is part of Snap!.
|
||||
|
||||
|
@ -55,7 +55,8 @@
|
|||
(6) development and user modes
|
||||
(7) turtle graphics
|
||||
(8) damage list housekeeping
|
||||
(9) minifying morphic.js
|
||||
(9) supporting high-resolution "retina" screens
|
||||
(10) minifying morphic.js
|
||||
VIII. acknowledgements
|
||||
IX. contributors
|
||||
|
||||
|
@ -105,7 +106,6 @@
|
|||
the following list shows the order in which all constructors are
|
||||
defined. Use this list to locate code in this document:
|
||||
|
||||
|
||||
Global settings
|
||||
Global functions
|
||||
|
||||
|
@ -155,7 +155,6 @@
|
|||
IV. open issues
|
||||
----------------
|
||||
- clipboard support (copy & paste) for non-textual data
|
||||
- native (unscaled) high-resolution display support
|
||||
|
||||
|
||||
V. browser compatibility
|
||||
|
@ -338,7 +337,7 @@
|
|||
(c) an application
|
||||
-------------------
|
||||
Of course, most of the time you don't want to just plain use the
|
||||
standard Morhic World "as is" out of the box, but write your own
|
||||
standard Morphic World "as is" out of the box, but write your own
|
||||
application (something like Scratch!) in it. For such an
|
||||
application you'll create your own morph prototypes, perhaps
|
||||
assemble your own "window frame" and bring it all to life in a
|
||||
|
@ -975,7 +974,7 @@
|
|||
single submorph's changes tremendous performance improvements can be
|
||||
achieved by setting the trackChanges flag to false before propagating
|
||||
the layout changes, setting it to true again and then storing the full
|
||||
bounds of the surrounding morph. An an example refer to the
|
||||
bounds of the surrounding morph. As an example refer to the
|
||||
|
||||
moveBy()
|
||||
|
||||
|
@ -991,8 +990,54 @@
|
|||
methods of SyntaxElementMorph in the Snap application.
|
||||
|
||||
|
||||
(9) minifying morphic.js
|
||||
------------------------
|
||||
(9) supporting high-resolution "retina" screens
|
||||
-----------------------------------------------
|
||||
By default retina support gets installed when Morphic.js loads. There
|
||||
are two global functions that let you test for retina availability:
|
||||
|
||||
isRetinaSupported() - Bool, answers if retina support is available
|
||||
isRetinaEnabled() - Bool, answers if currently in retina mode
|
||||
|
||||
and two more functions that let you control retina support if it is
|
||||
available:
|
||||
|
||||
enableRetinaSupport()
|
||||
disableRetinaSupport()
|
||||
|
||||
Both of these internally test whether retina is available, so they are
|
||||
safe to call directly. For an example how to make retina support
|
||||
user-specifiable refer to
|
||||
|
||||
Snap! >> guis.js >> toggleRetina()
|
||||
|
||||
Even when in retina mode it often makes sense to use normal-resolution
|
||||
canvasses for simple shapes in order to save system resources and
|
||||
optimize performance. Examples are costumes and backgrounds in Snap.
|
||||
In Morphic you can create new canvas elements using
|
||||
|
||||
newCanvas(extentPoint [, nonRetinaFlag])
|
||||
|
||||
If retina support is enabled such new canvasses will automatically be
|
||||
high-resolution canvasses, unless the newCanvas() function is given an
|
||||
otherwise optional second Boolean <true> argument that explicitly makes
|
||||
it a non-retina canvas.
|
||||
|
||||
Not the whole canvas API is supported by Morphic's retina utilities.
|
||||
Especially if your code uses putImageData() you will want to "downgrade"
|
||||
a target high-resolution canvas to a normal-resolution ("non-retina")
|
||||
one before using
|
||||
|
||||
normalizeCanvas(aCanvas [, copyFlag])
|
||||
|
||||
This will change the target canvas' resolution in place (!). If you
|
||||
pass in the optional second Boolean <true> flag the function returns
|
||||
a non-retina copy and leaves the target canvas unchanged. An example
|
||||
of this normalize mechanism is converting the penTrails layer of Snap's
|
||||
stage (high-resolution) into a sprite-costume (normal resolution).
|
||||
|
||||
|
||||
(10) minifying morphic.js
|
||||
-------------------------
|
||||
Coming from Smalltalk and being a Squeaker at heart I am a huge fan
|
||||
of browsing the code itself to make sense of it. Therefore I have
|
||||
included this documentation and (too little) inline comments so all
|
||||
|
@ -1037,7 +1082,8 @@
|
|||
I have originally written morphic.js in Florian Balmer's Notepad2
|
||||
editor for Windows, later switched to Apple's Dashcode and later
|
||||
still to Apple's Xcode. I've also come to depend on both Douglas
|
||||
Crockford's JSLint, Mozilla's Firebug and Google's Chrome to get
|
||||
Crockford's JSLint and later the JSHint project, as well as on
|
||||
Mozilla's Firebug and Google's Chrome to get
|
||||
it right.
|
||||
|
||||
|
||||
|
@ -1049,5 +1095,6 @@
|
|||
Ian Reynolds contributed backspace key handling for Chrome.
|
||||
Davide Della Casa contributed performance optimizations for Firefox.
|
||||
Jason N (@cyderize) contributed native copy & paste for text editing.
|
||||
Bartosz Leper contributed retina display support.
|
||||
|
||||
- Jens Mönig
|
||||
|
|
754
objects.js
754
objects.js
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,18 @@
|
|||
Ideas for optimizing Snap!
|
||||
--------------------------
|
||||
|
||||
|
||||
Graphics engine
|
||||
---------------
|
||||
|
||||
* reuse (and cache) icons, e.g. for input slot types, in the prototype. Make sure to update when changing display settings (flat design, zoom blocks etc.)
|
||||
|
||||
* generate state-images for buttons (push buttons, toggles etc.) just-in-time (and possibly cache them only then), instead of always creating them up-front.
|
||||
|
||||
|
||||
Evaluator
|
||||
----------
|
||||
|
||||
* Get rid of blockSequences, instead evaluate blocks directly.
|
||||
* Get rid of modifying blocks to evaluate them (solve implicit parameter bindings another way)
|
||||
* Cache variables (not values) in accessor-blocks (this should speed things up a lot)
|
50
paint.js
50
paint.js
|
@ -61,19 +61,19 @@
|
|||
Oct 02 - revert disable smoothing (Jens)
|
||||
Dec 15 - center rotation point on costume creating (Craxic)
|
||||
Jan 18 - avoid pixel collision detection in PaintCanvas (Jens)
|
||||
*/
|
||||
Mar 22 - fixed automatic rotation center point mechanism (Jens)
|
||||
May 10 - retina display support adjustments (Jens)
|
||||
*/
|
||||
|
||||
/*global Point, Rectangle, DialogBoxMorph, fontHeight, AlignmentMorph,
|
||||
FrameMorph, PushButtonMorph, Color, SymbolMorph, newCanvas, Morph, TextMorph,
|
||||
CostumeIconMorph, IDE_Morph, Costume, SpriteMorph, nop, Image, WardrobeMorph,
|
||||
TurtleIconMorph, localize, MenuMorph, InputFieldMorph, SliderMorph,
|
||||
ToggleMorph, ToggleButtonMorph, BoxMorph, modules, radians,
|
||||
MorphicPreferences, getDocumentPositionOf, StageMorph
|
||||
*/
|
||||
/*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*/
|
||||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.paint = '2016-January-18';
|
||||
modules.paint = '2016-July-14';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -253,7 +253,6 @@ PaintEditorMorph.prototype.buildScaleBox = function () {
|
|||
PaintEditorMorph.prototype.openIn = function (world, oldim, oldrc, callback) {
|
||||
// Open the editor in a world with an optional image to edit
|
||||
this.oldim = oldim;
|
||||
this.oldrc = oldrc.copy();
|
||||
this.callback = callback || nop;
|
||||
|
||||
this.processKeyUp = function () {
|
||||
|
@ -268,9 +267,10 @@ PaintEditorMorph.prototype.openIn = function (world, oldim, oldrc, callback) {
|
|||
|
||||
//merge oldim:
|
||||
if (this.oldim) {
|
||||
this.paper.automaticCrosshairs = isNil(oldrc);
|
||||
this.paper.centermerge(this.oldim, this.paper.paper);
|
||||
this.paper.rotationCenter =
|
||||
this.oldrc.add(
|
||||
(oldrc || new Point(0, 0)).add(
|
||||
new Point(
|
||||
(this.paper.paper.width - this.oldim.width) / 2,
|
||||
(this.paper.paper.height - this.oldim.height) / 2
|
||||
|
@ -573,9 +573,9 @@ PaintCanvasMorph.prototype.init = function (shift) {
|
|||
this.dragRect = new Rectangle();
|
||||
// rectangle with origin being the starting drag position and
|
||||
// corner being the current drag position
|
||||
this.mask = newCanvas(this.extent()); // Temporary canvas
|
||||
this.paper = newCanvas(this.extent()); // Actual canvas
|
||||
this.erasermask = newCanvas(this.extent()); // eraser memory
|
||||
this.mask = newCanvas(this.extent(), true); // Temporary canvas
|
||||
this.paper = newCanvas(this.extent(), true); // Actual canvas
|
||||
this.erasermask = newCanvas(this.extent(), true); // eraser memory
|
||||
this.background = newCanvas(this.extent()); // checkers
|
||||
this.settings = {
|
||||
"primarycolor": new Color(0, 0, 0, 255), // usually fill color
|
||||
|
@ -618,8 +618,8 @@ PaintCanvasMorph.prototype.updateAutomaticCenter = function () {
|
|||
|
||||
PaintCanvasMorph.prototype.scale = function (x, y) {
|
||||
this.updateAutomaticCenter();
|
||||
this.mask = newCanvas(this.extent());
|
||||
var c = newCanvas(this.extent());
|
||||
this.mask = newCanvas(this.extent(), true);
|
||||
var c = newCanvas(this.extent(), true);
|
||||
c.getContext("2d").save();
|
||||
c.getContext("2d").translate(
|
||||
this.rotationCenter.x,
|
||||
|
@ -638,14 +638,14 @@ PaintCanvasMorph.prototype.scale = function (x, y) {
|
|||
};
|
||||
|
||||
PaintCanvasMorph.prototype.cacheUndo = function () {
|
||||
var cachecan = newCanvas(this.extent());
|
||||
var cachecan = newCanvas(this.extent(), true);
|
||||
this.merge(this.paper, cachecan);
|
||||
this.undoBuffer.push(cachecan);
|
||||
};
|
||||
|
||||
PaintCanvasMorph.prototype.undo = function () {
|
||||
if (this.undoBuffer.length > 0) {
|
||||
this.paper = newCanvas(this.extent());
|
||||
this.paper = newCanvas(this.extent(), true);
|
||||
this.mask.width = this.mask.width + 1 - 1;
|
||||
this.merge(this.undoBuffer.pop(), this.paper);
|
||||
this.drawNew();
|
||||
|
@ -672,7 +672,7 @@ PaintCanvasMorph.prototype.clearCanvas = function () {
|
|||
};
|
||||
|
||||
PaintCanvasMorph.prototype.toolChanged = function (tool) {
|
||||
this.mask = newCanvas(this.extent());
|
||||
this.mask = newCanvas(this.extent(), true);
|
||||
if (tool === "crosshairs") {
|
||||
this.updateAutomaticCenter();
|
||||
this.drawcrosshair();
|
||||
|
@ -813,7 +813,7 @@ PaintCanvasMorph.prototype.mouseDownLeft = function (pos) {
|
|||
}
|
||||
if (this.settings.primarycolor === "transparent" &&
|
||||
this.currentTool !== "crosshairs") {
|
||||
this.erasermask = newCanvas(this.extent());
|
||||
this.erasermask = newCanvas(this.extent(), true);
|
||||
this.merge(this.paper, this.erasermask);
|
||||
}
|
||||
};
|
||||
|
@ -954,7 +954,7 @@ PaintCanvasMorph.prototype.mouseMove = function (pos) {
|
|||
}
|
||||
mctx.stroke();
|
||||
mctx.restore();
|
||||
this.paper = newCanvas(this.extent());
|
||||
this.paper = newCanvas(this.extent(), true);
|
||||
this.merge(this.mask, this.paper);
|
||||
break;
|
||||
default:
|
||||
|
@ -978,9 +978,9 @@ PaintCanvasMorph.prototype.mouseLeaveDragging
|
|||
|
||||
PaintCanvasMorph.prototype.buildContents = function () {
|
||||
this.background = newCanvas(this.extent());
|
||||
this.paper = newCanvas(this.extent());
|
||||
this.mask = newCanvas(this.extent());
|
||||
this.erasermask = newCanvas(this.extent());
|
||||
this.paper = newCanvas(this.extent(), true);
|
||||
this.mask = newCanvas(this.extent(), true);
|
||||
this.erasermask = newCanvas(this.extent(), true);
|
||||
var i, j, bkctx = this.background.getContext("2d");
|
||||
for (i = 0; i < this.background.width; i += 5) {
|
||||
for (j = 0; j < this.background.height; j += 5) {
|
||||
|
@ -995,7 +995,7 @@ PaintCanvasMorph.prototype.buildContents = function () {
|
|||
};
|
||||
|
||||
PaintCanvasMorph.prototype.drawNew = function () {
|
||||
var can = newCanvas(this.extent());
|
||||
var can = newCanvas(this.extent(), true);
|
||||
this.merge(this.background, can);
|
||||
this.merge(this.paper, can);
|
||||
this.merge(this.mask, can);
|
||||
|
|
103
store.js
103
store.js
|
@ -56,11 +56,12 @@ Color, List, newCanvas, Costume, Sound, Audio, IDE_Morph, ScriptsMorph,
|
|||
BlockMorph, ArgMorph, InputSlotMorph, TemplateSlotMorph, CommandSlotMorph,
|
||||
FunctionSlotMorph, MultiArgMorph, ColorSlotMorph, nop, CommentMorph, isNil,
|
||||
localize, sizeOf, ArgLabelMorph, SVG_Costume, MorphicPreferences,
|
||||
SyntaxElementMorph, Variable*/
|
||||
SyntaxElementMorph, Variable, isSnapObject, console, BooleanSlotMorph,
|
||||
normalizeCanvas*/
|
||||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.store = '2016-March-16';
|
||||
modules.store = '2016-August-03';
|
||||
|
||||
|
||||
// XML_Serializer ///////////////////////////////////////////////////////
|
||||
|
@ -389,6 +390,7 @@ SnapSerializer.prototype.rawLoadProjectModel = function (xmlNode) {
|
|||
if (model.pentrails) {
|
||||
project.pentrails = new Image();
|
||||
project.pentrails.onload = function () {
|
||||
normalizeCanvas(project.stage.trailsCanvas);
|
||||
var context = project.stage.trailsCanvas.getContext('2d');
|
||||
context.drawImage(project.pentrails, 0, 0);
|
||||
project.stage.changed();
|
||||
|
@ -974,7 +976,16 @@ SnapSerializer.prototype.loadScript = function (model) {
|
|||
return;
|
||||
}
|
||||
if (block) {
|
||||
block.nextBlock(nextBlock);
|
||||
if (block.nextBlock && (nextBlock instanceof CommandBlockMorph)) {
|
||||
block.nextBlock(nextBlock);
|
||||
} else { // +++
|
||||
console.log(
|
||||
'SNAP: expecting a command but getting a reporter:\n' +
|
||||
' ' + block.blockSpec + '\n' +
|
||||
' ' + nextBlock.blockSpec
|
||||
);
|
||||
return topBlock;
|
||||
}
|
||||
} else {
|
||||
topBlock = nextBlock;
|
||||
}
|
||||
|
@ -1125,7 +1136,7 @@ SnapSerializer.prototype.loadInput = function (model, input, block) {
|
|||
|
||||
SnapSerializer.prototype.loadValue = function (model) {
|
||||
// private
|
||||
var v, lst, items, el, center, image, name, audio, option,
|
||||
var v, i, lst, items, el, center, image, name, audio, option, bool,
|
||||
myself = this;
|
||||
|
||||
function record() {
|
||||
|
@ -1156,7 +1167,14 @@ SnapSerializer.prototype.loadValue = function (model) {
|
|||
throw new Error('expecting a reference id');
|
||||
case 'l':
|
||||
option = model.childNamed('option');
|
||||
return option ? [option.contents] : model.contents;
|
||||
if (option) {
|
||||
return [option.contents];
|
||||
}
|
||||
bool = model.childNamed('bool');
|
||||
if (bool) {
|
||||
return this.loadValue(bool);
|
||||
}
|
||||
return model.contents;
|
||||
case 'bool':
|
||||
return model.contents === 'true';
|
||||
case 'list':
|
||||
|
@ -1166,7 +1184,7 @@ SnapSerializer.prototype.loadValue = function (model) {
|
|||
record();
|
||||
lst = v;
|
||||
items = model.childrenNamed('item');
|
||||
items.forEach(function (item) {
|
||||
items.forEach(function (item, i) {
|
||||
var value = item.children[0];
|
||||
if (!value) {
|
||||
v.first = 0;
|
||||
|
@ -1178,9 +1196,11 @@ SnapSerializer.prototype.loadValue = function (model) {
|
|||
if (tail) {
|
||||
v.rest = myself.loadValue(tail);
|
||||
} else {
|
||||
v.rest = new List();
|
||||
v = v.rest;
|
||||
v.isLinked = true;
|
||||
if (i < (items.length - 1)) {
|
||||
v.rest = new List();
|
||||
v = v.rest;
|
||||
v.isLinked = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return lst;
|
||||
|
@ -1239,10 +1259,31 @@ SnapSerializer.prototype.loadValue = function (model) {
|
|||
} else {
|
||||
el = model.childNamed('l');
|
||||
if (el) {
|
||||
v.expression = new InputSlotMorph(el.contents);
|
||||
bool = el.childNamed('bool');
|
||||
if (bool) {
|
||||
v.expression = new BooleanSlotMorph(
|
||||
this.loadValue(bool)
|
||||
);
|
||||
} else {
|
||||
v.expression = new InputSlotMorph(el.contents);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (v.expression instanceof BlockMorph) {
|
||||
// bind empty slots to implicit formal parameters
|
||||
i = 0;
|
||||
v.expression.allEmptySlots().forEach(function (slot) {
|
||||
i += 1;
|
||||
if (slot instanceof MultiArgMorph) {
|
||||
slot.bindingID = ['arguments'];
|
||||
} else {
|
||||
slot.bindingID = i;
|
||||
}
|
||||
});
|
||||
// and remember the number of detected empty slots
|
||||
v.emptySlots = i;
|
||||
}
|
||||
el = model.childNamed('receiver');
|
||||
if (el) {
|
||||
el = el.childNamed('ref') || el.childNamed('sprite');
|
||||
|
@ -1312,7 +1353,8 @@ SnapSerializer.prototype.loadValue = function (model) {
|
|||
v = new Costume(null, name, center);
|
||||
image.onload = function () {
|
||||
var canvas = newCanvas(
|
||||
new Point(image.width, image.height)
|
||||
new Point(image.width, image.height),
|
||||
true // nonRetina
|
||||
),
|
||||
context = canvas.getContext('2d');
|
||||
context.drawImage(image, 0, 0);
|
||||
|
@ -1414,7 +1456,10 @@ Array.prototype.toXML = function (serializer) {
|
|||
// Sprites
|
||||
|
||||
StageMorph.prototype.toXML = function (serializer) {
|
||||
var thumbnail = this.thumbnail(SnapSerializer.prototype.thumbnailSize),
|
||||
var thumbnail = normalizeCanvas(
|
||||
this.thumbnail(SnapSerializer.prototype.thumbnailSize),
|
||||
true
|
||||
),
|
||||
thumbdata,
|
||||
ide = this.parentThatIsA(IDE_Morph);
|
||||
|
||||
|
@ -1482,7 +1527,7 @@ StageMorph.prototype.toXML = function (serializer) {
|
|||
this.enableInheritance,
|
||||
this.enableSublistIDs,
|
||||
StageMorph.prototype.frameRate !== 0,
|
||||
this.trailsCanvas.toDataURL('image/png'),
|
||||
normalizeCanvas(this.trailsCanvas, true).toDataURL('image/png'),
|
||||
serializer.store(this.costumes, this.name + '_cst'),
|
||||
serializer.store(this.sounds, this.name + '_snd'),
|
||||
serializer.store(this.variables),
|
||||
|
@ -1605,10 +1650,14 @@ VariableFrame.prototype.toXML = function (serializer) {
|
|||
dta = serializer.format(
|
||||
'<variable name="@">%</variable>',
|
||||
v,
|
||||
typeof val === 'object' ? serializer.store(val)
|
||||
: typeof val === 'boolean' ?
|
||||
serializer.format('<bool>$</bool>', val)
|
||||
: serializer.format('<l>$</l>', val)
|
||||
typeof val === 'object' ?
|
||||
(isSnapObject(val) ? ''
|
||||
: serializer.store(val))
|
||||
: typeof val === 'boolean' ?
|
||||
serializer.format(
|
||||
'<bool>$</bool>', val
|
||||
)
|
||||
: serializer.format('<l>$</l>', val)
|
||||
);
|
||||
}
|
||||
return vars + dta;
|
||||
|
@ -1625,6 +1674,10 @@ WatcherMorph.prototype.toXML = function (serializer) {
|
|||
this.topLeft().subtract(this.parent.topLeft())
|
||||
: this.topLeft();
|
||||
|
||||
if (this.isTemporary()) {
|
||||
// do not save watchers on temporary variables
|
||||
return '';
|
||||
}
|
||||
return serializer.format(
|
||||
'<watcher% % style="@"% x="@" y="@" color="@,@,@"%%/>',
|
||||
(isVar && this.target.owner) || (!isVar && this.target) ?
|
||||
|
@ -1828,6 +1881,13 @@ ArgMorph.prototype.toXML = function () {
|
|||
return '<l/>'; // empty by default
|
||||
};
|
||||
|
||||
BooleanSlotMorph.prototype.toXML = function () {
|
||||
return (typeof this.value === 'boolean') ?
|
||||
'<l><bool>' + this.value + '</bool></l>'
|
||||
: '<l/>';
|
||||
|
||||
};
|
||||
|
||||
InputSlotMorph.prototype.toXML = function (serializer) {
|
||||
if (this.constant) {
|
||||
return serializer.format(
|
||||
|
@ -1897,7 +1957,8 @@ List.prototype.toXML = function (serializer, mediaContext) {
|
|||
xml += serializer.format(
|
||||
'<item>%</item>',
|
||||
typeof value === 'object' ?
|
||||
serializer.store(value, mediaContext)
|
||||
(isSnapObject(value) ? ''
|
||||
: serializer.store(value, mediaContext))
|
||||
: typeof value === 'boolean' ?
|
||||
serializer.format('<bool>$</bool>', value)
|
||||
: serializer.format('<l>$</l>', value)
|
||||
|
@ -1916,7 +1977,8 @@ List.prototype.toXML = function (serializer, mediaContext) {
|
|||
xml += serializer.format(
|
||||
'<item>%</item>',
|
||||
typeof value === 'object' ?
|
||||
serializer.store(value, mediaContext)
|
||||
(isSnapObject(value) ? ''
|
||||
: serializer.store(value, mediaContext))
|
||||
: typeof value === 'boolean' ?
|
||||
serializer.format('<bool>$</bool>', value)
|
||||
: serializer.format('<l>$</l>', value)
|
||||
|
@ -1933,7 +1995,8 @@ List.prototype.toXML = function (serializer, mediaContext) {
|
|||
return xml + serializer.format(
|
||||
'<item>%</item>',
|
||||
typeof item === 'object' ?
|
||||
serializer.store(item, mediaContext)
|
||||
(isSnapObject(item) ? ''
|
||||
: serializer.store(item, mediaContext))
|
||||
: typeof item === 'boolean' ?
|
||||
serializer.format('<bool>$</bool>', item)
|
||||
: serializer.format('<l>$</l>', item)
|
||||
|
|
29
tables.js
29
tables.js
|
@ -68,9 +68,9 @@
|
|||
MorphicPreferences, FrameMorph, HandleMorph, DialogBoxMorph, isString,
|
||||
SpriteMorph, Context, Costume, ArgMorph, BlockEditorMorph,
|
||||
SyntaxElementMorph, MenuMorph, SpriteBubbleMorph, SpeechBubbleMorph,
|
||||
CellMorph, ListWatcherMorph, isNil, BoxMorph, Variable*/
|
||||
CellMorph, ListWatcherMorph, isNil, BoxMorph, Variable, isSnapObject*/
|
||||
|
||||
modules.tables = '2016-February-24';
|
||||
modules.tables = '2016-May-02';
|
||||
|
||||
var Table;
|
||||
var TableCellMorph;
|
||||
|
@ -307,6 +307,10 @@ TableCellMorph.prototype.setData = function (data, extent) {
|
|||
// note: don't call changed(), let the TableMorph handle it instead
|
||||
};
|
||||
|
||||
TableCellMorph.prototype.getData = function () {
|
||||
return this.data instanceof Array ? this.data[0] : this.data;
|
||||
};
|
||||
|
||||
TableCellMorph.prototype.drawNew = function () {
|
||||
this.image = newCanvas(this.extent());
|
||||
this.drawData();
|
||||
|
@ -373,7 +377,11 @@ TableCellMorph.prototype.drawData = function (lbl, bg) {
|
|||
|
||||
TableCellMorph.prototype.dataRepresentation = function (dta) {
|
||||
if (dta instanceof Morph) {
|
||||
return dta.fullImageClassic();
|
||||
if (isSnapObject(dta)) {
|
||||
return dta.thumbnail(new Point(40, 40));
|
||||
} else {
|
||||
return dta.fullImageClassic();
|
||||
}
|
||||
} else if (isString(dta)) {
|
||||
return dta.length > 100 ? dta.slice(0, 100) + '...' : dta;
|
||||
} else if (typeof dta === 'number') {
|
||||
|
@ -544,6 +552,9 @@ TableMorph.prototype.init = function (
|
|||
this.resizeCol = null;
|
||||
this.resizeRow = null;
|
||||
|
||||
// cached property for updating (don not persist):
|
||||
this.wantsUpdate = false;
|
||||
|
||||
// initialize inherited properties:
|
||||
// make sure not to draw anything just yet
|
||||
// therefore omit FrameMorph's properties (not needed here)
|
||||
|
@ -697,6 +708,9 @@ TableMorph.prototype.buildCells = function () {
|
|||
).add(pos)
|
||||
);
|
||||
this.add(cell);
|
||||
if (isSnapObject(cell.getData())) {
|
||||
this.wantsUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.add(this.hBar);
|
||||
|
@ -718,6 +732,9 @@ TableMorph.prototype.drawData = function (noScrollUpdate) {
|
|||
!r ? r : r + this.startRow - 1
|
||||
)
|
||||
);
|
||||
if (isSnapObject(cell.getData())) {
|
||||
this.wantsUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!noScrollUpdate) {this.updateScrollBars(); }
|
||||
|
@ -777,7 +794,10 @@ TableMorph.prototype.update = function () {
|
|||
version = this.table instanceof List ?
|
||||
this.table.version(this.startRow, this.rows)
|
||||
: this.table.lastChanged;
|
||||
if (this.tableVersion === version) { return; }
|
||||
if (this.tableVersion === version && !this.wantsUpdate) {
|
||||
return;
|
||||
}
|
||||
this.wantsUpdate = false;
|
||||
if (this.table instanceof List) {
|
||||
oldCols = this.columns.length;
|
||||
oldRows = this.rows;
|
||||
|
@ -1048,6 +1068,7 @@ TableMorph.prototype.showListView = function () {
|
|||
view.drawNew(true);
|
||||
} else if (view instanceof SpeechBubbleMorph) {
|
||||
view.contents = new ListWatcherMorph(this.table);
|
||||
view.contents.step = view.contents.update;
|
||||
view.contents.expand(this.extent());
|
||||
view.drawNew(true);
|
||||
} else { // watcher cell
|
||||
|
|
331
threads.js
331
threads.js
|
@ -59,9 +59,9 @@ degrees, detect, nop, radians, ReporterSlotMorph, CSlotMorph, RingMorph,
|
|||
IDE_Morph, ArgLabelMorph, localize, XML_Element, hex_sha512, TableDialogMorph,
|
||||
StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
|
||||
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
|
||||
TableFrameMorph*/
|
||||
TableFrameMorph, isSnapObject*/
|
||||
|
||||
modules.threads = '2016-March-16';
|
||||
modules.threads = '2016-August-12';
|
||||
|
||||
var ThreadManager;
|
||||
var Process;
|
||||
|
@ -149,6 +149,8 @@ function invoke(
|
|||
action.blockSequence(),
|
||||
proc.homeContext
|
||||
);
|
||||
} else if (action.evaluate) {
|
||||
return action.evaluate();
|
||||
} else {
|
||||
throw new Error('expecting a block or ring but getting ' + action);
|
||||
}
|
||||
|
@ -191,7 +193,8 @@ ThreadManager.prototype.startProcess = function (
|
|||
isThreadSafe,
|
||||
exportResult,
|
||||
callback,
|
||||
isClicked
|
||||
isClicked,
|
||||
rightAway
|
||||
) {
|
||||
var active = this.findProcess(block),
|
||||
top = block.topBlock(),
|
||||
|
@ -203,13 +206,16 @@ ThreadManager.prototype.startProcess = function (
|
|||
active.stop();
|
||||
this.removeTerminatedProcesses();
|
||||
}
|
||||
newProc = new Process(block.topBlock(), callback);
|
||||
newProc = new Process(block.topBlock(), callback, rightAway);
|
||||
newProc.exportResult = exportResult;
|
||||
newProc.isClicked = isClicked || false;
|
||||
if (!newProc.homeContext.receiver.isClone) {
|
||||
top.addHighlight();
|
||||
}
|
||||
this.processes.push(newProc);
|
||||
if (rightAway) {
|
||||
newProc.runStep();
|
||||
}
|
||||
return newProc;
|
||||
};
|
||||
|
||||
|
@ -342,16 +348,14 @@ ThreadManager.prototype.doWhen = function (block, stopIt) {
|
|||
}
|
||||
}
|
||||
if (stopIt) {return; }
|
||||
if ((!block) ||
|
||||
!(pred instanceof ReporterBlockMorph) ||
|
||||
this.findProcess(block)
|
||||
if ((!block) || this.findProcess(block)
|
||||
) {return; }
|
||||
try {
|
||||
if (invoke(
|
||||
pred,
|
||||
null,
|
||||
null,
|
||||
20,
|
||||
block.receiver(), // needed for shallow copied clones - was null
|
||||
50,
|
||||
'the predicate takes\ntoo long for a\ncustom hat block',
|
||||
true // suppress errors => handle them right here instead
|
||||
) === true) {
|
||||
|
@ -408,6 +412,7 @@ ThreadManager.prototype.doWhen = function (block, stopIt) {
|
|||
isDead boolean indicating a terminated clone process
|
||||
timeout msecs after which to force yield
|
||||
lastYield msecs when the process last yielded
|
||||
isFirstStep boolean indicating whether on first step - for clones
|
||||
errorFlag boolean indicating whether an error was encountered
|
||||
prompter active instance of StagePrompterMorph
|
||||
httpRequest active instance of an HttpRequest or null
|
||||
|
@ -430,8 +435,9 @@ Process.prototype = {};
|
|||
Process.prototype.constructor = Process;
|
||||
Process.prototype.timeout = 500; // msecs after which to force yield
|
||||
Process.prototype.isCatchingErrors = true;
|
||||
Process.prototype.enableLiveCoding = false; // experimental
|
||||
|
||||
function Process(topBlock, onComplete) {
|
||||
function Process(topBlock, onComplete, rightAway) {
|
||||
this.topBlock = topBlock || null;
|
||||
|
||||
this.readyToYield = false;
|
||||
|
@ -442,7 +448,8 @@ function Process(topBlock, onComplete) {
|
|||
this.errorFlag = false;
|
||||
this.context = null;
|
||||
this.homeContext = new Context();
|
||||
this.lastYield = Date.now();
|
||||
this.lastYield = Date.now();
|
||||
this.isFirstStep = true;
|
||||
this.isAtomic = false;
|
||||
this.prompter = null;
|
||||
this.httpRequest = null;
|
||||
|
@ -462,7 +469,9 @@ function Process(topBlock, onComplete) {
|
|||
topBlock.blockSequence(),
|
||||
this.homeContext
|
||||
);
|
||||
this.pushContext('doYield'); // highlight top block
|
||||
if (!rightAway) {
|
||||
this.pushContext('doYield'); // highlight top block
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -485,9 +494,8 @@ Process.prototype.runStep = function (deadline) {
|
|||
this.readyToYield = false;
|
||||
while (!this.readyToYield
|
||||
&& this.context
|
||||
&& (this.isAtomic ?
|
||||
(Date.now() - this.lastYield < this.timeout) : true)
|
||||
) {
|
||||
&& (Date.now() - this.lastYield < this.timeout)
|
||||
) {
|
||||
// also allow pausing inside atomic steps - for PAUSE block primitive:
|
||||
if (this.isPaused) {
|
||||
return this.pauseStep();
|
||||
|
@ -503,6 +511,7 @@ Process.prototype.runStep = function (deadline) {
|
|||
this.evaluateContext();
|
||||
}
|
||||
this.lastYield = Date.now();
|
||||
this.isFirstStep = false;
|
||||
|
||||
// make sure to redraw atomic things
|
||||
if (this.isAtomic &&
|
||||
|
@ -870,7 +879,8 @@ Process.prototype.reify = function (topBlock, parameterNames, isCustomBlock) {
|
|||
i = 0;
|
||||
|
||||
if (topBlock) {
|
||||
context.expression = topBlock.fullCopy();
|
||||
context.expression = this.enableLiveCoding ?
|
||||
topBlock : topBlock.fullCopy();
|
||||
context.expression.show(); // be sure to make visible if in app mode
|
||||
|
||||
if (!isCustomBlock) {
|
||||
|
@ -888,7 +898,8 @@ Process.prototype.reify = function (topBlock, parameterNames, isCustomBlock) {
|
|||
}
|
||||
|
||||
} else {
|
||||
context.expression = [this.context.expression.fullCopy()];
|
||||
context.expression = this.enableLiveCoding ? [this.context.expression]
|
||||
: [this.context.expression.fullCopy()];
|
||||
}
|
||||
|
||||
context.inputs = parameterNames.asArray();
|
||||
|
@ -1294,16 +1305,20 @@ Process.prototype.doDeclareVariables = function (varNames) {
|
|||
|
||||
Process.prototype.doSetVar = function (varName, value) {
|
||||
var varFrame = this.context.variables,
|
||||
name = varName;
|
||||
name = varName,
|
||||
rcvr;
|
||||
if (name instanceof Context) {
|
||||
rcvr = this.blockReceiver();
|
||||
if (name.expression.selector === 'reportGetVar') {
|
||||
name.variables.setVar(
|
||||
name.expression.blockSpec,
|
||||
value,
|
||||
this.blockReceiver()
|
||||
rcvr
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.doSet(name, value);
|
||||
return;
|
||||
}
|
||||
varFrame.setVar(name, value, this.blockReceiver());
|
||||
};
|
||||
|
@ -1758,6 +1773,7 @@ Process.prototype.doPauseAll = function () {
|
|||
// Process loop primitives
|
||||
|
||||
Process.prototype.doForever = function (body) {
|
||||
this.context.inputs = []; // force re-evaluation of C-slot
|
||||
this.pushContext('doYield');
|
||||
if (body) {
|
||||
this.pushContext(body.blockSequence());
|
||||
|
@ -1959,7 +1975,7 @@ Process.prototype.blockReceiver = function () {
|
|||
// Process sound primitives (interpolated)
|
||||
|
||||
Process.prototype.doPlaySoundUntilDone = function (name) {
|
||||
var sprite = this.homeContext.receiver;
|
||||
var sprite = this.blockReceiver();
|
||||
if (this.context.activeAudio === null) {
|
||||
this.context.activeAudio = sprite.playSound(name);
|
||||
}
|
||||
|
@ -1990,7 +2006,9 @@ Process.prototype.doStopAllSounds = function () {
|
|||
|
||||
Process.prototype.doAsk = function (data) {
|
||||
var stage = this.homeContext.receiver.parentThatIsA(StageMorph),
|
||||
isStage = this.blockReceiver() instanceof StageMorph,
|
||||
rcvr = this.blockReceiver(),
|
||||
isStage = rcvr instanceof StageMorph,
|
||||
isHiddenSprite = rcvr instanceof SpriteMorph && !rcvr.isVisible,
|
||||
activePrompter;
|
||||
|
||||
stage.keysPressed = {};
|
||||
|
@ -2000,10 +2018,12 @@ Process.prototype.doAsk = function (data) {
|
|||
function (morph) {return morph instanceof StagePrompterMorph; }
|
||||
);
|
||||
if (!activePrompter) {
|
||||
if (!isStage) {
|
||||
this.blockReceiver().bubble(data, false, true);
|
||||
if (!isStage && !isHiddenSprite) {
|
||||
rcvr.bubble(data, false, true);
|
||||
}
|
||||
this.prompter = new StagePrompterMorph(isStage ? data : null);
|
||||
this.prompter = new StagePrompterMorph(
|
||||
isStage || isHiddenSprite ? data : null
|
||||
);
|
||||
if (stage.scale < 1) {
|
||||
this.prompter.setWidth(stage.width() - 10);
|
||||
} else {
|
||||
|
@ -2021,7 +2041,7 @@ Process.prototype.doAsk = function (data) {
|
|||
stage.lastAnswer = this.prompter.inputField.getValue();
|
||||
this.prompter.destroy();
|
||||
this.prompter = null;
|
||||
if (!isStage) {this.blockReceiver().stopTalking(); }
|
||||
if (!isStage) {rcvr.stopTalking(); }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2052,6 +2072,65 @@ Process.prototype.reportURL = function (url) {
|
|||
|
||||
// Process event messages primitives
|
||||
|
||||
Process.prototype.doBroadcast = function (message) {
|
||||
// messages are user-defined events, and by default global, same as in
|
||||
// Scratch. An experimental feature, messages can be sent to a single
|
||||
// sprite or to a list of sprites by using a 2-item list in the message
|
||||
// slot, where the first slot is a message text, and the second slot
|
||||
// its recipient(s), identified either by a single name or sprite, or by
|
||||
// a list of names or sprites (can be a heterogeneous list).
|
||||
|
||||
var stage = this.homeContext.receiver.parentThatIsA(StageMorph),
|
||||
thisObj,
|
||||
msg = message,
|
||||
trg,
|
||||
rcvrs,
|
||||
myself = this,
|
||||
hats = [],
|
||||
procs = [];
|
||||
|
||||
if (message instanceof List && (message.length() === 2)) {
|
||||
thisObj = this.blockReceiver();
|
||||
msg = message.at(1);
|
||||
trg = message.at(2);
|
||||
if (isSnapObject(trg)) {
|
||||
rcvrs = [trg];
|
||||
} else if (isString(trg)) {
|
||||
// assume the string to be the name of a sprite or the stage
|
||||
if (trg === stage.name) {
|
||||
rcvrs = [stage];
|
||||
} else {
|
||||
rcvrs = [this.getOtherObject(trg, thisObj, stage)];
|
||||
}
|
||||
} else if (trg instanceof List) {
|
||||
// assume all elements to be sprites or sprite names
|
||||
rcvrs = trg.itemsArray().map(function (each) {
|
||||
return myself.getOtherObject(each, thisObj, stage);
|
||||
});
|
||||
} else {
|
||||
return; // abort
|
||||
}
|
||||
} else { // global
|
||||
rcvrs = stage.children.concat(stage);
|
||||
}
|
||||
if (msg !== '') {
|
||||
stage.lastMessage = message; // the actual data structure
|
||||
rcvrs.forEach(function (morph) {
|
||||
if (isSnapObject(morph)) {
|
||||
hats = hats.concat(morph.allHatBlocksFor(msg));
|
||||
}
|
||||
});
|
||||
hats.forEach(function (block) {
|
||||
procs.push(stage.threads.startProcess(block, stage.isThreadSafe));
|
||||
});
|
||||
}
|
||||
return procs;
|
||||
};
|
||||
|
||||
// old purely global broadcast code, commented out and retained in case
|
||||
// we need to revert
|
||||
|
||||
/*
|
||||
Process.prototype.doBroadcast = function (message) {
|
||||
var stage = this.homeContext.receiver.parentThatIsA(StageMorph),
|
||||
hats = [],
|
||||
|
@ -2060,7 +2139,7 @@ Process.prototype.doBroadcast = function (message) {
|
|||
if (message !== '') {
|
||||
stage.lastMessage = message;
|
||||
stage.children.concat(stage).forEach(function (morph) {
|
||||
if (morph instanceof SpriteMorph || morph instanceof StageMorph) {
|
||||
if (isSnapObject(morph)) {
|
||||
hats = hats.concat(morph.allHatBlocksFor(message));
|
||||
}
|
||||
});
|
||||
|
@ -2070,6 +2149,7 @@ Process.prototype.doBroadcast = function (message) {
|
|||
}
|
||||
return procs;
|
||||
};
|
||||
*/
|
||||
|
||||
Process.prototype.doBroadcastAndWait = function (message) {
|
||||
if (!this.context.activeSends) {
|
||||
|
@ -2116,6 +2196,12 @@ Process.prototype.assertType = function (thing, typeString) {
|
|||
throw new Error('expecting ' + typeString + ' but getting ' + thingType);
|
||||
};
|
||||
|
||||
Process.prototype.assertAlive = function (thing) {
|
||||
if (thing && thing.isCorpse) {
|
||||
throw new Error('cannot operate on a deleted sprite');
|
||||
}
|
||||
};
|
||||
|
||||
Process.prototype.reportTypeOf = function (thing) {
|
||||
// answer a string denoting the argument's type
|
||||
var exp;
|
||||
|
@ -2134,6 +2220,12 @@ Process.prototype.reportTypeOf = function (thing) {
|
|||
if (thing instanceof List) {
|
||||
return 'list';
|
||||
}
|
||||
if (thing instanceof SpriteMorph) {
|
||||
return 'sprite';
|
||||
}
|
||||
if (thing instanceof StageMorph) {
|
||||
return 'stage';
|
||||
}
|
||||
if (thing instanceof Context) {
|
||||
if (thing.expression instanceof RingMorph) {
|
||||
return thing.expression.dataType();
|
||||
|
@ -2266,12 +2358,8 @@ Process.prototype.isImmutable = function (obj) {
|
|||
type === 'undefined';
|
||||
};
|
||||
|
||||
Process.prototype.reportTrue = function () {
|
||||
return true;
|
||||
};
|
||||
|
||||
Process.prototype.reportFalse = function () {
|
||||
return false;
|
||||
Process.prototype.reportBoolean = function (bool) {
|
||||
return bool;
|
||||
};
|
||||
|
||||
Process.prototype.reportRound = function (n) {
|
||||
|
@ -2383,16 +2471,16 @@ Process.prototype.reportLetter = function (idx, string) {
|
|||
return '';
|
||||
}
|
||||
var i = +(idx || 0),
|
||||
str = (string || '').toString();
|
||||
str = isNil(string) ? '' : string.toString();
|
||||
return str[i - 1] || '';
|
||||
};
|
||||
|
||||
Process.prototype.reportStringSize = function (string) {
|
||||
if (string instanceof List) { // catch a common user error
|
||||
return string.length();
|
||||
Process.prototype.reportStringSize = function (data) {
|
||||
if (data instanceof List) { // catch a common user error
|
||||
return data.length();
|
||||
}
|
||||
var str = (string || '').toString();
|
||||
return str.length;
|
||||
|
||||
return isNil(data) ? 0 : data.toString().length;
|
||||
};
|
||||
|
||||
Process.prototype.reportUnicode = function (string) {
|
||||
|
@ -2417,10 +2505,10 @@ Process.prototype.reportTextSplit = function (string, delimiter) {
|
|||
if (!contains(types, delType)) {
|
||||
throw new Error('expecting a text delimiter instead of a ' + delType);
|
||||
}
|
||||
str = (string || '').toString();
|
||||
str = isNil(string) ? '' : string.toString();
|
||||
switch (this.inputOption(delimiter)) {
|
||||
case 'line':
|
||||
// Unicode Compliant Line Splitting (Platform independent)
|
||||
// Unicode compliant line splitting (platform independent)
|
||||
// http://www.unicode.org/reports/tr18/#Line_Boundaries
|
||||
del = /\r\n|[\n\v\f\r\x85\u2028\u2029]/;
|
||||
break;
|
||||
|
@ -2438,7 +2526,7 @@ Process.prototype.reportTextSplit = function (string, delimiter) {
|
|||
del = '';
|
||||
break;
|
||||
default:
|
||||
del = (delimiter || '').toString();
|
||||
del = isNil(delimiter) ? '' : delimiter.toString();
|
||||
}
|
||||
return new List(str.split(del));
|
||||
};
|
||||
|
@ -2473,6 +2561,11 @@ Process.prototype.getOtherObject = function (name, thisObj, stageObj) {
|
|||
// private, find the sprite indicated by the given name
|
||||
// either onstage or in the World's hand
|
||||
|
||||
// experimental: deal with first-class sprites
|
||||
if (isSnapObject(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
var stage = isNil(stageObj) ?
|
||||
thisObj.parentThatIsA(StageMorph) : stageObj,
|
||||
thatObj = null;
|
||||
|
@ -2564,17 +2657,17 @@ Process.prototype.doGotoObject = function (name) {
|
|||
// Process temporary cloning (Scratch-style)
|
||||
|
||||
Process.prototype.createClone = function (name) {
|
||||
var thisObj = this.homeContext.receiver,
|
||||
var thisObj = this.blockReceiver(),
|
||||
thatObj;
|
||||
|
||||
if (!name) {return; }
|
||||
if (thisObj) {
|
||||
if (this.inputOption(name) === 'myself') {
|
||||
thisObj.createClone();
|
||||
thisObj.createClone(!this.isFirstStep);
|
||||
} else {
|
||||
thatObj = this.getOtherObject(name, thisObj);
|
||||
if (thatObj) {
|
||||
thatObj.createClone();
|
||||
thatObj.createClone(!this.isFirstStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2623,7 +2716,14 @@ Process.prototype.objectTouchingObject = function (thisObj, name) {
|
|||
thisObj.isTouching(stage.penTrailsMorph())) {
|
||||
return true;
|
||||
}
|
||||
those = this.getObjectsNamed(name, thisObj, stage); // clones
|
||||
if (isSnapObject(name)) {
|
||||
return thisObj.isTouching(name);
|
||||
}
|
||||
if (name instanceof List) { // assume all elements to be sprites
|
||||
those = name.itemsArray();
|
||||
} else {
|
||||
those = this.getObjectsNamed(name, thisObj, stage); // clones
|
||||
}
|
||||
if (those.some(function (any) {
|
||||
return thisObj.isTouching(any);
|
||||
})) {
|
||||
|
@ -2640,7 +2740,7 @@ Process.prototype.objectTouchingObject = function (thisObj, name) {
|
|||
|
||||
Process.prototype.reportTouchingColor = function (aColor) {
|
||||
// also check for any parts (subsprites)
|
||||
var thisObj = this.homeContext.receiver,
|
||||
var thisObj = this.blockReceiver(),
|
||||
stage;
|
||||
|
||||
if (thisObj) {
|
||||
|
@ -2661,7 +2761,7 @@ Process.prototype.reportTouchingColor = function (aColor) {
|
|||
|
||||
Process.prototype.reportColorIsTouchingColor = function (color1, color2) {
|
||||
// also check for any parts (subsprites)
|
||||
var thisObj = this.homeContext.receiver,
|
||||
var thisObj = this.blockReceiver(),
|
||||
stage;
|
||||
|
||||
if (thisObj) {
|
||||
|
@ -2713,6 +2813,7 @@ Process.prototype.reportAttributeOf = function (attribute, name) {
|
|||
stage;
|
||||
|
||||
if (thisObj) {
|
||||
this.assertAlive(thisObj);
|
||||
stage = thisObj.parentThatIsA(StageMorph);
|
||||
if (stage.name === name) {
|
||||
thatObj = stage;
|
||||
|
@ -2720,6 +2821,7 @@ Process.prototype.reportAttributeOf = function (attribute, name) {
|
|||
thatObj = this.getOtherObject(name, thisObj, stage);
|
||||
}
|
||||
if (thatObj) {
|
||||
this.assertAlive(thatObj);
|
||||
if (attribute instanceof Context) {
|
||||
return this.reportContextFor(attribute, thatObj);
|
||||
}
|
||||
|
@ -2747,6 +2849,139 @@ Process.prototype.reportAttributeOf = function (attribute, name) {
|
|||
return '';
|
||||
};
|
||||
|
||||
Process.prototype.reportGet = function (query) {
|
||||
// experimental, answer a reference to a first-class member
|
||||
// or a list of first-class members
|
||||
var thisObj = this.blockReceiver(),
|
||||
neighborhood,
|
||||
stage,
|
||||
objName;
|
||||
|
||||
if (thisObj) {
|
||||
switch (this.inputOption(query)) {
|
||||
case 'self' :
|
||||
return thisObj;
|
||||
case 'other sprites':
|
||||
stage = thisObj.parentThatIsA(StageMorph);
|
||||
return new List(
|
||||
stage.children.filter(function (each) {
|
||||
return each instanceof SpriteMorph &&
|
||||
each !== thisObj;
|
||||
})
|
||||
);
|
||||
case 'parts':
|
||||
return new List(thisObj.parts || []);
|
||||
case 'anchor':
|
||||
return thisObj.anchor || '';
|
||||
case 'parent':
|
||||
return thisObj.exemplar || '';
|
||||
case 'children':
|
||||
return new List(thisObj.specimens ? thisObj.specimens() : []);
|
||||
case 'clones':
|
||||
stage = thisObj.parentThatIsA(StageMorph);
|
||||
objName = thisObj.name || thisObj.cloneOriginName;
|
||||
return new List(
|
||||
stage.children.filter(function (each) {
|
||||
return each.isClone &&
|
||||
(each !== thisObj) &&
|
||||
(each.cloneOriginName === objName);
|
||||
})
|
||||
);
|
||||
case 'other clones':
|
||||
return thisObj.isClone ? this.reportGet(['clones']) : new List();
|
||||
case 'neighbors':
|
||||
stage = thisObj.parentThatIsA(StageMorph);
|
||||
neighborhood = thisObj.bounds.expandBy(new Point(
|
||||
thisObj.width(),
|
||||
thisObj.height()
|
||||
));
|
||||
return new List(
|
||||
stage.children.filter(function (each) {
|
||||
return each instanceof SpriteMorph &&
|
||||
(each !== thisObj) &&
|
||||
each.bounds.intersects(neighborhood);
|
||||
})
|
||||
);
|
||||
case 'dangling?':
|
||||
return !thisObj.rotatesWithAnchor;
|
||||
case 'rotation x':
|
||||
return thisObj.xPosition();
|
||||
case 'rotation y':
|
||||
return thisObj.yPosition();
|
||||
case 'center x':
|
||||
return thisObj.xCenter();
|
||||
case 'center y':
|
||||
return thisObj.yCenter();
|
||||
case 'name':
|
||||
return thisObj.name;
|
||||
case 'stage':
|
||||
return thisObj.parentThatIsA(StageMorph);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
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') {
|
||||
throw new Error(localize('unsupported attribute'));
|
||||
}
|
||||
name = attribute.expression.inputs()[0].evaluate();
|
||||
if (name instanceof Array) {
|
||||
name = name[0];
|
||||
}
|
||||
switch (name) {
|
||||
case 'anchor':
|
||||
this.assertType(rcvr, 'sprite');
|
||||
if (value instanceof SpriteMorph) {
|
||||
// avoid circularity here, because the GUI already checks for
|
||||
// conflicts while the user drags parts over prospective targets
|
||||
if (!rcvr.enableNesting || contains(rcvr.allParts(), value)) {
|
||||
throw new Error(
|
||||
localize('unable to nest\n(disabled or circular?)')
|
||||
);
|
||||
}
|
||||
value.attachPart(rcvr);
|
||||
} else {
|
||||
rcvr.detachFromAnchor();
|
||||
}
|
||||
break;
|
||||
case 'parent':
|
||||
this.assertType(rcvr, 'sprite');
|
||||
value = value instanceof SpriteMorph ? value : null;
|
||||
// needed: circularity avoidance
|
||||
rcvr.setExemplar(value);
|
||||
break;
|
||||
case 'dangling?':
|
||||
this.assertType(rcvr, 'sprite');
|
||||
this.assertType(value, 'Boolean');
|
||||
rcvr.rotatesWithAnchor = !value;
|
||||
rcvr.version = Date.now();
|
||||
break;
|
||||
case 'rotation x':
|
||||
this.assertType(rcvr, 'sprite');
|
||||
this.assertType(value, 'number');
|
||||
rcvr.setRotationX(value);
|
||||
break;
|
||||
case 'rotation y':
|
||||
this.assertType(rcvr, 'sprite');
|
||||
this.assertType(value, 'number');
|
||||
rcvr.setRotationY(value);
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
'"' + localize(name) + '" ' + localize('is read-only')
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Process.prototype.reportContextFor = function (context, otherObj) {
|
||||
// Private - return a copy of the context
|
||||
// and bind it to another receiver
|
||||
|
@ -3159,7 +3394,7 @@ Context.prototype.continuation = function () {
|
|||
} else if (this.parentContext) {
|
||||
cont = this.parentContext;
|
||||
} else {
|
||||
return new Context(null, 'doYield');
|
||||
return new Context(null, 'doStop');
|
||||
}
|
||||
cont = cont.copyForContinuation();
|
||||
cont.tag = null;
|
||||
|
|
19
widgets.js
19
widgets.js
|
@ -74,7 +74,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph,
|
|||
ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences,
|
||||
ScrollFrameMorph*/
|
||||
|
||||
modules.widgets = '2015-July-27';
|
||||
modules.widgets = '2016-July-19';
|
||||
|
||||
var PushButtonMorph;
|
||||
var ToggleButtonMorph;
|
||||
|
@ -220,8 +220,8 @@ PushButtonMorph.prototype.drawOutline = function (context) {
|
|||
0,
|
||||
this.height()
|
||||
);
|
||||
outlineStyle.addColorStop(1, 'white');
|
||||
outlineStyle.addColorStop(0, this.outlineColor.darker().toString());
|
||||
outlineStyle.addColorStop(1, 'white');
|
||||
} else {
|
||||
outlineStyle = this.outlineColor.toString();
|
||||
}
|
||||
|
@ -290,8 +290,8 @@ PushButtonMorph.prototype.drawEdges = function (
|
|||
this.corner,
|
||||
Math.max(this.corner - this.outline, 0)
|
||||
);
|
||||
gradient.addColorStop(1, topColor.toString());
|
||||
gradient.addColorStop(0, color.toString());
|
||||
gradient.addColorStop(1, topColor.toString());
|
||||
|
||||
context.strokeStyle = gradient;
|
||||
context.lineCap = 'round';
|
||||
|
@ -352,8 +352,8 @@ PushButtonMorph.prototype.drawEdges = function (
|
|||
h - this.corner,
|
||||
Math.max(this.corner - this.outline, 0)
|
||||
);
|
||||
gradient.addColorStop(1, bottomColor.toString());
|
||||
gradient.addColorStop(0, color.toString());
|
||||
gradient.addColorStop(1, bottomColor.toString());
|
||||
|
||||
context.strokeStyle = gradient;
|
||||
context.lineCap = 'round';
|
||||
|
@ -2513,6 +2513,12 @@ DialogBoxMorph.prototype.fixLayout = function () {
|
|||
+ this.buttons.height()
|
||||
+ this.padding
|
||||
);
|
||||
this.silentSetWidth(Math.max(
|
||||
this.width(),
|
||||
this.buttons.width()
|
||||
+ (2 * this.padding)
|
||||
)
|
||||
);
|
||||
this.buttons.setCenter(this.center());
|
||||
this.buttons.setBottom(this.bottom() - this.padding);
|
||||
}
|
||||
|
@ -2760,11 +2766,11 @@ DialogBoxMorph.prototype.drawNew = function () {
|
|||
this.corner,
|
||||
0
|
||||
);
|
||||
gradient.addColorStop(1, this.color.toString());
|
||||
gradient.addColorStop(
|
||||
0,
|
||||
this.color.lighter(this.contrast).toString()
|
||||
);
|
||||
gradient.addColorStop(1, this.color.toString());
|
||||
|
||||
context.lineCap = 'butt';
|
||||
context.strokeStyle = gradient;
|
||||
|
@ -2781,11 +2787,11 @@ DialogBoxMorph.prototype.drawNew = function () {
|
|||
this.corner,
|
||||
0
|
||||
);
|
||||
gradient.addColorStop(1, this.color.toString());
|
||||
gradient.addColorStop(
|
||||
0,
|
||||
this.color.lighter(this.contrast).toString()
|
||||
);
|
||||
gradient.addColorStop(1, this.color.toString());
|
||||
|
||||
context.lineCap = 'round';
|
||||
context.strokeStyle = gradient;
|
||||
|
@ -2927,6 +2933,7 @@ AlignmentMorph.prototype.fixLayout = function () {
|
|||
))
|
||||
);
|
||||
}
|
||||
cfb = c.fullBounds();
|
||||
newBounds = newBounds.merge(cfb);
|
||||
} else {
|
||||
newBounds = cfb;
|
||||
|
|
Ładowanie…
Reference in New Issue