kopia lustrzana https://github.com/backface/turtlestitch
little reformattings, mostly to shut up LINT
rodzic
b958e2fe3a
commit
96bf69b83e
|
@ -3,11 +3,15 @@
|
||||||
## in development for v7:
|
## in development for v7:
|
||||||
* **New Features:**
|
* **New Features:**
|
||||||
* Scenes
|
* Scenes
|
||||||
|
* unified blocks palette option, thanks, Michael!
|
||||||
* **Notable Changes:**
|
* **Notable Changes:**
|
||||||
* saved projects remember the last edited srpite
|
* saved projects remember the last edited srpite
|
||||||
* **Notable Fixes:**
|
* **Notable Fixes:**
|
||||||
* made scrollbars in the wardrobe and jukebox more responsive
|
* made scrollbars in the wardrobe and jukebox more responsive
|
||||||
|
|
||||||
|
### 2021-07-02
|
||||||
|
* gui, object, store, etc.: unified blocks palette option, thanks, Michael!
|
||||||
|
|
||||||
### 2021-05-21
|
### 2021-05-21
|
||||||
* gui, scenes, store: proxied thumbnail, name and notes in project, restored in XML
|
* gui, scenes, store: proxied thumbnail, name and notes in project, restored in XML
|
||||||
* gui: distinguished project name from scene names, removed hidden "export as plain text" option
|
* gui: distinguished project name from scene names, removed hidden "export as plain text" option
|
||||||
|
|
10
snap.html
10
snap.html
|
@ -8,11 +8,11 @@
|
||||||
<script src="src/morphic.js?version=2021-04-12"></script>
|
<script src="src/morphic.js?version=2021-04-12"></script>
|
||||||
<script src="src/symbols.js?version=2021-03-03"></script>
|
<script src="src/symbols.js?version=2021-03-03"></script>
|
||||||
<script src="src/widgets.js?version=2021-01-05"></script>
|
<script src="src/widgets.js?version=2021-01-05"></script>
|
||||||
<script src="src/blocks.js?version=2021-06-18"></script>
|
<script src="src/blocks.js?version=2021-07-02"></script>
|
||||||
<script src="src/threads.js?version=2021-06-24"></script>
|
<script src="src/threads.js?version=2021-06-24"></script>
|
||||||
<script src="src/objects.js?version=2021-06-14"></script>
|
<script src="src/objects.js?version=2021-07-02"></script>
|
||||||
<script src="src/scenes.js?version=2021-05-21"></script>
|
<script src="src/scenes.js?version=2021-07-02"></script>
|
||||||
<script src="src/gui.js?version=2021-06-23"></script>
|
<script src="src/gui.js?version=2021-07-02"></script>
|
||||||
<script src="src/paint.js?version=2020-05-17"></script>
|
<script src="src/paint.js?version=2020-05-17"></script>
|
||||||
<script src="src/lists.js?version=2021-03-15"></script>
|
<script src="src/lists.js?version=2021-03-15"></script>
|
||||||
<script src="src/byob.js?version=2021-06-24"></script>
|
<script src="src/byob.js?version=2021-06-24"></script>
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<script src="src/maps.js?version=2021-06-15"></script>
|
<script src="src/maps.js?version=2021-06-15"></script>
|
||||||
<script src="src/extensions.js?version=2021-07-02"></script>
|
<script src="src/extensions.js?version=2021-07-02"></script>
|
||||||
<script src="src/xml.js?version=2020-04-27"></script>
|
<script src="src/xml.js?version=2020-04-27"></script>
|
||||||
<script src="src/store.js?version=2021-06-24"></script>
|
<script src="src/store.js?version=2021-07-02"></script>
|
||||||
<script src="src/locale.js?version=2021-06-11"></script>
|
<script src="src/locale.js?version=2021-06-11"></script>
|
||||||
<script src="src/cloud.js?version=2021-02-04"></script>
|
<script src="src/cloud.js?version=2021-02-04"></script>
|
||||||
<script src="src/api.js?version=2021-01-25"></script>
|
<script src="src/api.js?version=2021-01-25"></script>
|
||||||
|
|
|
@ -158,7 +158,7 @@ CustomCommandBlockMorph, ToggleButtonMorph, DialMorph, SnapExtensions*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.blocks = '2021-June-18';
|
modules.blocks = '2021-July-02';
|
||||||
|
|
||||||
var SyntaxElementMorph;
|
var SyntaxElementMorph;
|
||||||
var BlockMorph;
|
var BlockMorph;
|
||||||
|
@ -11030,7 +11030,8 @@ BooleanSlotMorph.prototype.drawKnob = function (ctx, progress) {
|
||||||
var w = this.width(),
|
var w = this.width(),
|
||||||
r = this.height() / 2,
|
r = this.height() / 2,
|
||||||
shift = this.edge / 2,
|
shift = this.edge / 2,
|
||||||
slideStep = (this.width() - this.height()) / 4 * Math.max(0, (progress || 0)),
|
slideStep = (this.width() - this.height()) / 4 *
|
||||||
|
Math.max(0, (progress || 0)),
|
||||||
gradient,
|
gradient,
|
||||||
x,
|
x,
|
||||||
y = r,
|
y = r,
|
||||||
|
|
12
src/gui.js
12
src/gui.js
|
@ -83,7 +83,7 @@ Animation, BoxMorph, BlockDialogMorph, Project, ZERO, BLACK*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.gui = '2021-June-23';
|
modules.gui = '2021-July-02';
|
||||||
|
|
||||||
// Declarations
|
// Declarations
|
||||||
|
|
||||||
|
@ -1270,7 +1270,7 @@ IDE_Morph.prototype.createCategories = function () {
|
||||||
each.refresh()
|
each.refresh()
|
||||||
);
|
);
|
||||||
myself.refreshPalette(true);
|
myself.refreshPalette(true);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollToCategory(category) {
|
function scrollToCategory(category) {
|
||||||
|
@ -2533,11 +2533,13 @@ IDE_Morph.prototype.refreshPalette = function (shouldIgnorePosition) {
|
||||||
|
|
||||||
IDE_Morph.prototype.scrollPaletteToCategory = function (category) {
|
IDE_Morph.prototype.scrollPaletteToCategory = function (category) {
|
||||||
let palette = this.palette,
|
let palette = this.palette,
|
||||||
firstInCategory = palette.contents.children.find(block => block.category == category);
|
firstInCategory = palette.contents.children.find(
|
||||||
|
block => block.category === category
|
||||||
|
);
|
||||||
|
|
||||||
palette.scrollY(palette.top() - firstInCategory.top() + palette.padding);
|
palette.scrollY(palette.top() - firstInCategory.top() + palette.padding);
|
||||||
palette.adjustScrollBars();
|
palette.adjustScrollBars();
|
||||||
}
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.pressStart = function () {
|
IDE_Morph.prototype.pressStart = function () {
|
||||||
if (this.world().currentKey === 16) { // shiftClicked
|
if (this.world().currentKey === 16) { // shiftClicked
|
||||||
|
@ -6024,7 +6026,7 @@ IDE_Morph.prototype.toggleUnifiedPalette = function () {
|
||||||
this.flushBlocksCache();
|
this.flushBlocksCache();
|
||||||
this.currentSprite.palette(this.currentCategory);
|
this.currentSprite.palette(this.currentCategory);
|
||||||
this.refreshPalette(true);
|
this.refreshPalette(true);
|
||||||
}
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.setPaletteWidth = function (newWidth) {
|
IDE_Morph.prototype.setPaletteWidth = function (newWidth) {
|
||||||
var msecs = this.isAnimating ? 100 : 0,
|
var msecs = this.isAnimating ? 100 : 0,
|
||||||
|
|
|
@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph,
|
||||||
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
|
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
|
||||||
AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows*/
|
AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows*/
|
||||||
|
|
||||||
modules.objects = '2021-June-14';
|
modules.objects = '2021-July-02';
|
||||||
|
|
||||||
var SpriteMorph;
|
var SpriteMorph;
|
||||||
var StageMorph;
|
var StageMorph;
|
||||||
|
@ -856,7 +856,7 @@ SpriteMorph.prototype.initBlocks = function () {
|
||||||
doTellTo: {
|
doTellTo: {
|
||||||
type: 'command',
|
type: 'command',
|
||||||
category: 'control',
|
category: 'control',
|
||||||
// spec: 'tell %spr to %cl' // I liked this version much better, -Jens
|
// spec: 'tell %spr to %cl' // I liked this version better, -Jens
|
||||||
spec: 'tell %spr to %cmdRing %inputs'
|
spec: 'tell %spr to %cmdRing %inputs'
|
||||||
},
|
},
|
||||||
reportAskFor: {
|
reportAskFor: {
|
||||||
|
@ -2285,9 +2285,9 @@ SpriteMorph.prototype.variableBlock = function (varName, isLocalTemplate) {
|
||||||
|
|
||||||
// SpriteMorph block templates
|
// SpriteMorph block templates
|
||||||
|
|
||||||
SpriteMorph.prototype.blockTemplates = function (category) {
|
SpriteMorph.prototype.blockTemplates = function (category = 'motion') {
|
||||||
var blocks = [], myself = this, varNames,
|
var blocks = [], myself = this, varNames,
|
||||||
category = category || 'motion';
|
inheritedVars = this.inheritedVariableNames();
|
||||||
|
|
||||||
function block(selector, isGhosted) {
|
function block(selector, isGhosted) {
|
||||||
if (StageMorph.prototype.hiddenPrimitives[selector]) {
|
if (StageMorph.prototype.hiddenPrimitives[selector]) {
|
||||||
|
@ -2456,7 +2456,7 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
||||||
// for debugging: ///////////////
|
// for debugging: ///////////////
|
||||||
if (this.world().isDevMode) {
|
if (this.world().isDevMode) {
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(devModeText());
|
blocks.push(this.devModeText());
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doPlayFrequency'));
|
blocks.push(block('doPlayFrequency'));
|
||||||
}
|
}
|
||||||
|
@ -2736,7 +2736,7 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
||||||
|
|
||||||
// Utitlies displayed in the palette
|
// Utitlies displayed in the palette
|
||||||
SpriteMorph.prototype.makeVariableButton = function () {
|
SpriteMorph.prototype.makeVariableButton = function () {
|
||||||
let button, myself = this;
|
var button, myself = this;
|
||||||
|
|
||||||
function addVar(pair) {
|
function addVar(pair) {
|
||||||
var ide;
|
var ide;
|
||||||
|
@ -2773,10 +2773,10 @@ SpriteMorph.prototype.makeVariableButton = function () {
|
||||||
button.selector = 'addVariable';
|
button.selector = 'addVariable';
|
||||||
button.showHelp = BlockMorph.prototype.showHelp;
|
button.showHelp = BlockMorph.prototype.showHelp;
|
||||||
return button;
|
return button;
|
||||||
}
|
};
|
||||||
|
|
||||||
SpriteMorph.prototype.deleteVariableButton = function () {
|
SpriteMorph.prototype.deleteVariableButton = function () {
|
||||||
let button, myself = this;
|
var button, myself = this;
|
||||||
button = new PushButtonMorph(
|
button = new PushButtonMorph(
|
||||||
null,
|
null,
|
||||||
function () {
|
function () {
|
||||||
|
@ -2806,21 +2806,24 @@ SpriteMorph.prototype.deleteVariableButton = function () {
|
||||||
button.selector = 'deleteVariable';
|
button.selector = 'deleteVariable';
|
||||||
button.showHelp = BlockMorph.prototype.showHelp;
|
button.showHelp = BlockMorph.prototype.showHelp;
|
||||||
return button;
|
return button;
|
||||||
}
|
};
|
||||||
|
|
||||||
SpriteMorph.prototype.devModeText = function () {
|
SpriteMorph.prototype.devModeText = function () {
|
||||||
let txt = new TextMorph(localize('development mode \ndebugging primitives:'));
|
var txt = new TextMorph(
|
||||||
|
localize('development mode \ndebugging primitives:')
|
||||||
|
);
|
||||||
txt.fontSize = 9;
|
txt.fontSize = 9;
|
||||||
txt.setColor(this.paletteTextColor);
|
txt.setColor(this.paletteTextColor);
|
||||||
return txt;
|
return txt;
|
||||||
}
|
};
|
||||||
|
|
||||||
SpriteMorph.prototype.helpMenu = function () {
|
SpriteMorph.prototype.helpMenu = function () {
|
||||||
// return a 1 item context menu for anything that implements a 'showHelp' method.
|
// return a 1 item context menu for anything that implements
|
||||||
|
// a 'showHelp' method.
|
||||||
var menu = new MenuMorph(this);
|
var menu = new MenuMorph(this);
|
||||||
menu.addItem('help...', 'showHelp');
|
menu.addItem('help...', 'showHelp');
|
||||||
return menu;
|
return menu;
|
||||||
}
|
};
|
||||||
|
|
||||||
// returns an array alock templates for a selected category.
|
// returns an array alock templates for a selected category.
|
||||||
SpriteMorph.prototype.customBlockTemplatesForCategory = function (category) {
|
SpriteMorph.prototype.customBlockTemplatesForCategory = function (category) {
|
||||||
|
@ -2829,7 +2832,8 @@ SpriteMorph.prototype.customBlockTemplatesForCategory = function (category) {
|
||||||
|
|
||||||
function addCustomBlock(definition) {
|
function addCustomBlock(definition) {
|
||||||
if (definition.category === category ||
|
if (definition.category === category ||
|
||||||
(Array.isArray(category) && category.includes(definition.category))) {
|
(Array.isArray(category) && category.includes(definition.category))
|
||||||
|
) {
|
||||||
block = definition.templateInstance();
|
block = definition.templateInstance();
|
||||||
if (isInherited) {block.ghost(); }
|
if (isInherited) {block.ghost(); }
|
||||||
blocks.push(block);
|
blocks.push(block);
|
||||||
|
@ -2848,7 +2852,9 @@ SpriteMorph.prototype.customBlockTemplatesForCategory = function (category) {
|
||||||
// inherited custom blocks:
|
// inherited custom blocks:
|
||||||
if (this.exemplar) {
|
if (this.exemplar) {
|
||||||
inheritedBlocks = this.inheritedBlocks(true);
|
inheritedBlocks = this.inheritedBlocks(true);
|
||||||
if (this.customBlocks.length && inheritedBlocks.length) {blocks.push('='); }
|
if (this.customBlocks.length && inheritedBlocks.length) {
|
||||||
|
blocks.push('=');
|
||||||
|
}
|
||||||
isInherited = true;
|
isInherited = true;
|
||||||
inheritedBlocks.forEach(addCustomBlock);
|
inheritedBlocks.forEach(addCustomBlock);
|
||||||
}
|
}
|
||||||
|
@ -2910,7 +2916,7 @@ SpriteMorph.prototype.makeBlock = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
SpriteMorph.prototype.getPrimitiveTemplates = function (category) {
|
SpriteMorph.prototype.getPrimitiveTemplates = function (category) {
|
||||||
blocks = this.primitivesCache[category];
|
var blocks = this.primitivesCache[category];
|
||||||
if (!blocks) {
|
if (!blocks) {
|
||||||
blocks = this.blockTemplates(category);
|
blocks = this.blockTemplates(category);
|
||||||
if (this.isCachingPrimitives) {
|
if (this.isCachingPrimitives) {
|
||||||
|
@ -2918,7 +2924,7 @@ SpriteMorph.prototype.getPrimitiveTemplates = function (category) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return blocks;
|
return blocks;
|
||||||
}
|
};
|
||||||
|
|
||||||
SpriteMorph.prototype.palette = function (category) {
|
SpriteMorph.prototype.palette = function (category) {
|
||||||
if (!this.paletteCache[category]) {
|
if (!this.paletteCache[category]) {
|
||||||
|
@ -2935,7 +2941,6 @@ SpriteMorph.prototype.freshPalette = function (category) {
|
||||||
ry = 0,
|
ry = 0,
|
||||||
blocks,
|
blocks,
|
||||||
hideNextSpace = false,
|
hideNextSpace = false,
|
||||||
stage = this.parentThatIsA(StageMorph),
|
|
||||||
shade = new Color(140, 140, 140),
|
shade = new Color(140, 140, 140),
|
||||||
searchButton,
|
searchButton,
|
||||||
makeButton;
|
makeButton;
|
||||||
|
@ -4325,7 +4330,7 @@ SpriteMorph.prototype.setColorComponentHSVA = function (idx, num) {
|
||||||
|
|
||||||
idx = +idx;
|
idx = +idx;
|
||||||
if (idx < 0 || idx > 3) {return; }
|
if (idx < 0 || idx > 3) {return; }
|
||||||
if (idx == 0) {
|
if (idx === 0) {
|
||||||
if (n < 0 || n > 100) { // wrap the hue
|
if (n < 0 || n > 100) { // wrap the hue
|
||||||
n = (n < 0 ? 100 : 0) + n % 100;
|
n = (n < 0 ? 100 : 0) + n % 100;
|
||||||
}
|
}
|
||||||
|
@ -8479,9 +8484,8 @@ StageMorph.prototype.pauseGenericHatBlocks = function () {
|
||||||
|
|
||||||
// StageMorph block templates
|
// StageMorph block templates
|
||||||
|
|
||||||
StageMorph.prototype.blockTemplates = function (category) {
|
StageMorph.prototype.blockTemplates = function (category = 'motion') {
|
||||||
var blocks = [], myself = this, varNames,
|
var blocks = [], myself = this, varNames, txt;
|
||||||
category = category || 'motion', txt;
|
|
||||||
|
|
||||||
function block(selector) {
|
function block(selector) {
|
||||||
if (myself.hiddenPrimitives[selector]) {
|
if (myself.hiddenPrimitives[selector]) {
|
||||||
|
@ -8989,7 +8993,9 @@ StageMorph.prototype.fancyThumbnail = function (
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
}
|
}
|
||||||
this.children.forEach(morph => {
|
this.children.forEach(morph => {
|
||||||
if ((isSnapObject(morph) || !noWatchers) && morph.isVisible && (morph !== excludedSprite)) {
|
if ((isSnapObject(morph) || !noWatchers) &&
|
||||||
|
morph.isVisible && (morph !== excludedSprite)
|
||||||
|
) {
|
||||||
fb = morph.fullBounds();
|
fb = morph.fullBounds();
|
||||||
fimg = morph.fullImage();
|
fimg = morph.fullImage();
|
||||||
if (fimg.width && fimg.height) {
|
if (fimg.width && fimg.height) {
|
||||||
|
@ -9100,7 +9106,7 @@ StageMorph.prototype.setColorComponentHSVA = function (idx, num) {
|
||||||
|
|
||||||
idx = +idx;
|
idx = +idx;
|
||||||
if (idx < 0 || idx > 3) {return; }
|
if (idx < 0 || idx > 3) {return; }
|
||||||
if (idx == 0) {
|
if (idx === 0) {
|
||||||
if (n < 0 || n > 100) { // wrap the hue
|
if (n < 0 || n > 100) { // wrap the hue
|
||||||
n = (n < 0 ? 100 : 0) + n % 100;
|
n = (n < 0 ? 100 : 0) + n % 100;
|
||||||
}
|
}
|
||||||
|
@ -9156,11 +9162,21 @@ StageMorph.prototype.deleteVariable = SpriteMorph.prototype.deleteVariable;
|
||||||
StageMorph.prototype.makeBlock = SpriteMorph.prototype.makeBlock;
|
StageMorph.prototype.makeBlock = SpriteMorph.prototype.makeBlock;
|
||||||
StageMorph.prototype.helpMenu = SpriteMorph.prototype.helpMenu;
|
StageMorph.prototype.helpMenu = SpriteMorph.prototype.helpMenu;
|
||||||
StageMorph.prototype.makeBlockButton = SpriteMorph.prototype.makeBlockButton;
|
StageMorph.prototype.makeBlockButton = SpriteMorph.prototype.makeBlockButton;
|
||||||
StageMorph.prototype.makeVariableButton = SpriteMorph.prototype.makeVariableButton;
|
|
||||||
|
StageMorph.prototype.makeVariableButton
|
||||||
|
= SpriteMorph.prototype.makeVariableButton;
|
||||||
|
|
||||||
StageMorph.prototype.devModeText = SpriteMorph.prototype.devModeText;
|
StageMorph.prototype.devModeText = SpriteMorph.prototype.devModeText;
|
||||||
StageMorph.prototype.deleteVariableButton = SpriteMorph.prototype.deleteVariableButton;
|
|
||||||
StageMorph.prototype.customBlockTemplatesForCategory = SpriteMorph.prototype.customBlockTemplatesForCategory;
|
StageMorph.prototype.deleteVariableButton
|
||||||
StageMorph.prototype.getPrimitiveTemplates = SpriteMorph.prototype.getPrimitiveTemplates;
|
= SpriteMorph.prototype.deleteVariableButton;
|
||||||
|
|
||||||
|
StageMorph.prototype.customBlockTemplatesForCategory
|
||||||
|
= SpriteMorph.prototype.customBlockTemplatesForCategory;
|
||||||
|
|
||||||
|
StageMorph.prototype.getPrimitiveTemplates
|
||||||
|
= SpriteMorph.prototype.getPrimitiveTemplates;
|
||||||
|
|
||||||
StageMorph.prototype.palette = SpriteMorph.prototype.palette;
|
StageMorph.prototype.palette = SpriteMorph.prototype.palette;
|
||||||
StageMorph.prototype.freshPalette = SpriteMorph.prototype.freshPalette;
|
StageMorph.prototype.freshPalette = SpriteMorph.prototype.freshPalette;
|
||||||
StageMorph.prototype.blocksMatching = SpriteMorph.prototype.blocksMatching;
|
StageMorph.prototype.blocksMatching = SpriteMorph.prototype.blocksMatching;
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
/*global modules, VariableFrame, StageMorph, SpriteMorph, Process, List,
|
/*global modules, VariableFrame, StageMorph, SpriteMorph, Process, List,
|
||||||
normalizeCanvas, SnapSerializer*/
|
normalizeCanvas, SnapSerializer*/
|
||||||
|
|
||||||
modules.scenes = '2021-May-21';
|
modules.scenes = '2021-July-02';
|
||||||
|
|
||||||
|
|
||||||
// Projecct /////////////////////////////////////////////////////////
|
// Projecct /////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -61,7 +61,7 @@ Project*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.store = '2021-June-24';
|
modules.store = '2021-July-02';
|
||||||
|
|
||||||
// XML_Serializer ///////////////////////////////////////////////////////
|
// XML_Serializer ///////////////////////////////////////////////////////
|
||||||
/*
|
/*
|
||||||
|
|
Ładowanie…
Reference in New Issue