backport app check (nagging dialog), reenable hide

pull/131/head v2.7.16
Michael 2023-05-10 20:04:42 +02:00
rodzic 3e3db7e9cd
commit 50231e1205
4 zmienionych plików z 62 dodań i 12 usunięć

Wyświetl plik

@ -45,11 +45,12 @@
<script type="text/javascript" src="stitchcode/morphic.js?version=2021-12-14"></script> <script type="text/javascript" src="stitchcode/morphic.js?version=2021-12-14"></script>
<script type="text/javascript" src="stitchcode/symbols.js?version=2021-12-14"></script> <script type="text/javascript" src="stitchcode/symbols.js?version=2021-12-14"></script>
<script type="text/javascript" src="stitchcode/blocks.js?version=2021-12-14"></script> <script type="text/javascript" src="stitchcode/blocks.js?version=2021-12-14"></script>
<script type="text/javascript" src="stitchcode/widgets.js?version=2023-05-10"></script>
<script type="text/javascript" src="stitchcode/threads.js?version=2022-12-05"></script> <script type="text/javascript" src="stitchcode/threads.js?version=2022-12-05"></script>
<script type="text/javascript" src="stitchcode/objects.js?version=2023-02-20"></script> <script type="text/javascript" src="stitchcode/objects.js?version=2023-05-10"></script>
<script type="text/javascript" src="stitchcode/turtlecloud.js?version=2022-10-05"></script> <script type="text/javascript" src="stitchcode/turtlecloud.js?version=2022-10-05"></script>
<script type="text/javascript" src="stitchcode/gui.js?version=2022-10-31"></script> <script type="text/javascript" src="stitchcode/gui.js?version=2023-05-10"></script>
<script type="text/javascript" src="stitchcode/store.js?version=2022-06-14"></script> <script type="text/javascript" src="stitchcode/store.js?version=2023-05-10"></script>
<script type="text/javascript"> <script type="text/javascript">
var world; var world;

Wyświetl plik

@ -1,4 +1,4 @@
VERSION="2.7.15" VERSION="2.7.16"
// get debug mode // get debug mode
url = new URL(window.location.href); url = new URL(window.location.href);
@ -328,6 +328,8 @@ IDE_Morph.prototype.openProject = function (project) {
true // pause generic WHEN hat blocks true // pause generic WHEN hat blocks
); );
this.createStageHandle(); this.createStageHandle();
this.flushBlocksCache();
this.refreshPalette(true);
}; };
@ -3349,8 +3351,10 @@ IDE_Morph.prototype.switchToScene = function (
if (!scene || !scene.stage) { if (!scene || !scene.stage) {
return; return;
} }
this.siblings().forEach(morph => this.siblings().filter(
morph.destroy() morph => !morph.nag
).forEach(
morph => morph.destroy()
); );
this.scene.captureGlobalSettings(); this.scene.captureGlobalSettings();
this.scene = scene; this.scene = scene;
@ -3399,3 +3403,14 @@ StageHandleMorph.prototype.init = function (target) {
this.noticesTransparentClick = true; this.noticesTransparentClick = true;
this.setExtent(new Point(12, 50)); this.setExtent(new Point(12, 50));
}; };
// backport from Snap 8
IDE_Morph.prototype.inform = function (title, message) {
return new DialogBoxMorph().inform(
title,
localize(message),
this.world()
);
};

Wyświetl plik

@ -2693,21 +2693,22 @@ StageMorph.prototype.initRenderer = function () {
var myself = this; var myself = this;
console.log("set up renderer"); console.log("set up renderer");
// console.log(this.penTrails().isRetinaEnabled)
if(!this.renderer) { if(!this.renderer) {
if (Detector.webgl) { if (Detector.webgl) {
this.renderer = new THREE.WebGLRenderer({ this.renderer = new THREE.WebGLRenderer({
antialias: true, antialias: true,
alpha: true, alpha: true,
canvas: this.penTrails() canvas: this.penTrails()
}); });
console.log("webgl enabled"); console.log("webgl enabled");
this.renderer_status_msg = "webgl enabled"; this.renderer_status_msg = "webgl enabled";
} else { } else {
console.log("webgl unavailable. fallback to canvas (SLOW!)"); console.log("webgl unavailable. fallback to canvas (SLOW!)");
this.renderer_status_msg = "webgl unavailable. fallback to canvas (SLOW!)"; this.renderer_status_msg = "webgl unavailable. fallback to canvas (SLOW!)";
this.renderer = new THREE.CanvasRenderer( this.renderer = new THREE.CanvasRenderer(
{canvas: this.penTrails()}); {canvas: this.penTrails()});
} }
@ -2721,7 +2722,7 @@ StageMorph.prototype.initRenderer = function () {
} }
this.renderer.setBackgroundColor(StageMorph.prototype.backgroundColor); this.renderer.setBackgroundColor(StageMorph.prototype.backgroundColor);
this.renderer.changed = false; this.renderer.changed = false;
this.renderer.showingAxes = true; this.renderer.showingAxes = true;
this.renderer.isParallelProjection = true; this.renderer.isParallelProjection = true;
@ -3411,10 +3412,13 @@ SpriteMorph.prototype.palette = function (category) {
], ],
() => myself.searchBlocks(), () => myself.searchBlocks(),
'^F' '^F'
); );
menu.addItem(
'hide blocks...',
() => new BlockVisibilityDialogMorph(myself).popUp(myself.world())
);
return menu; return menu;
}; };
} }
return this.paletteCache[category]; return this.paletteCache[category];
}; };

Wyświetl plik

@ -0,0 +1,30 @@
// backport from Snap 8.0 - default to nagging dialogs
DialogBoxMorph.prototype.init = function (target, action, environment) {
// additional properties:
this.is3D = false; // for "flat" design exceptions
this.target = target || null;
this.action = action || null;
this.environment = environment || null;
this.key = null; // keep track of my purpose to prevent mulitple instances
this.nag = true;
this.labelString = null;
this.label = null;
this.head = null;
this.body = null;
this.buttons = null;
// initialize inherited properties:
DialogBoxMorph.uber.init.call(this);
// override inherited properites:
this.isDraggable = true;
this.noDropShadow = true;
this.fullShadowSource = false;
this.color = PushButtonMorph.prototype.color;
this.createLabel();
this.createButtons();
this.setExtent(new Point(300, 150));
return this;
};