| 
116 | 116 |     Object.extend(Squeak,  | 
117 | 117 |     "version", {  | 
118 | 118 |         // system attributes  | 
119 |  | -        vmVersion: "SqueakJS 1.3.0",  | 
120 |  | -        vmDate: "2025-03-28",               // Maybe replace at build time?  | 
 | 119 | +        vmVersion: "SqueakJS 1.3.1",  | 
 | 120 | +        vmDate: "2025-03-29",               // Maybe replace at build time?  | 
121 | 121 |         vmBuild: "unknown",                 // this too?  | 
122 | 122 |         vmPath: "unknown",                  // Replace at runtime  | 
123 | 123 |         vmFile: "vm.js",  | 
 | 
2907 | 2907 |         },  | 
2908 | 2908 |         hackImage: function() {  | 
2909 | 2909 |             // hack methods to make work / speed up  | 
2910 |  | -            var opts = typeof location === 'object' ? location.hash : "",  | 
2911 |  | -                sista = this.method.methodSignFlag();  | 
 | 2910 | +            var sista = this.method.methodSignFlag();  | 
2912 | 2911 |             [  | 
2913 | 2912 |                 // Etoys fallback for missing translation files is hugely inefficient.  | 
2914 | 2913 |                 // This speeds up opening a viewer by 10x (!)  | 
 | 
2918 | 2917 |                 // 64 bit Squeak does not flush word size on snapshot  | 
2919 | 2918 |                 {method: "SmalltalkImage>>wordSize", literal: {index: 1, old: 8, hack: 4}, enabled: true},  | 
2920 | 2919 |                 // Squeak 5.3 disable wizard by replacing #open send with pop  | 
2921 |  | -                {method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {pc: 28, old: 0xD8, hack: 0x87}, enabled: opts.includes("wizard=false")},  | 
 | 2920 | +                {method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {pc: 28, old: 0xD8, hack: 0x87}, enabled: !sista & this.options.wizard===false},  | 
 | 2921 | +                // Squeak 6.0 disable wizard by replacing #open send with pop  | 
 | 2922 | +                {method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {closure: 9, pc: 5, old: 0x81, hack: 0xD8}, enabled: sista & this.options.wizard===false},  | 
2922 | 2923 |                 // Squeak source file should use UTF8 not MacRoman (both V3 and Sista)  | 
2923 | 2924 |                 {method: "Latin1Environment class>>systemConverterClass", bytecode: {pc: 53, old: 0x45, hack: 0x49}, enabled: !this.image.isSpur},  | 
2924 | 2925 |                 {method: "Latin1Environment class>>systemConverterClass", bytecode: {pc: 38, old: 0x16, hack: 0x13}, enabled: this.image.isSpur && sista},  | 
 | 
2931 | 2932 |                             byte = each.bytecode,  | 
2932 | 2933 |                             lit = each.literal,  | 
2933 | 2934 |                             hacked = true;  | 
 | 2935 | +                        if (byte && byte.closure) m = m.pointers[byte.closure];  | 
2934 | 2936 |                         if (prim) m.pointers[0] |= prim;  | 
2935 | 2937 |                         else if (byte && m.bytes[byte.pc] === byte.old) m.bytes[byte.pc] = byte.hack;  | 
2936 | 2938 |                         else if (byte && m.bytes[byte.pc] === byte.hack) hacked = false; // already there  | 
 | 
20580 | 20582 |                 canvas.classList.add("b3daccel");  | 
20581 | 20583 |                 canvas.width = w;  | 
20582 | 20584 |                 canvas.height = h;  | 
 | 20585 | +                canvas.style.position = "absolute";  | 
20583 | 20586 |                 canvas.style.backgroundColor = "transparent";  | 
20584 | 20587 |                 canvas.style.pointerEvents = "none";  | 
20585 | 20588 |                 canvas.style.cursor = "normal";  | 
 | 
59619 | 59622 |             display.fullscreen = fullscreen;  | 
59620 | 59623 |             var fullwindow = fullscreen || options.fullscreen;  | 
59621 | 59624 |             box.style.background = fullwindow ? 'black' : '';  | 
 | 59625 | +            box.style.border = fullwindow ? 'none' : '';  | 
 | 59626 | +            box.style.borderRadius = fullwindow ? '0px' : '';  | 
59622 | 59627 |             setTimeout(onresize, 0);  | 
59623 | 59628 |         }  | 
59624 | 59629 | 
 
  | 
@@ -59674,10 +59679,12 @@  | 
59674 | 59679 |             display.cursorCanvas.style.top = (evtY + canvas.offsetTop + display.cursorOffsetY) + "px";  | 
59675 | 59680 |         }  | 
59676 | 59681 |         var x = (evtX * canvas.width / canvas.offsetWidth) | 0,  | 
59677 |  | -            y = (evtY * canvas.height / canvas.offsetHeight) | 0;  | 
 | 59682 | +            y = (evtY * canvas.height / canvas.offsetHeight) | 0,  | 
 | 59683 | +            w = display.width || canvas.width,  | 
 | 59684 | +            h = display.height || canvas.height;  | 
59678 | 59685 |         // clamp to display size  | 
59679 |  | -        display.mouseX = Math.max(0, Math.min(display.width, x));  | 
59680 |  | -        display.mouseY = Math.max(0, Math.min(display.height, y));  | 
 | 59686 | +        display.mouseX = Math.max(0, Math.min(w, x));  | 
 | 59687 | +        display.mouseY = Math.max(0, Math.min(h, y));  | 
59681 | 59688 |     }  | 
59682 | 59689 | 
 
  | 
59683 | 59690 |     function recordMouseEvent(what, evt, canvas, display, options) {  | 
 | 
59834 | 59841 |         if (options.fullscreen) {  | 
59835 | 59842 |             document.body.style.margin = 0;  | 
59836 | 59843 |             document.body.style.backgroundColor = 'black';  | 
 | 59844 | +            canvas.style.border = 'none';  | 
 | 59845 | +            canvas.style.borderRadius = '0px';  | 
59837 | 59846 |             document.ontouchmove = function(evt) { evt.preventDefault(); };  | 
59838 | 59847 |         }  | 
59839 | 59848 |         var display = {  | 
 | 
60560 | 60569 |                 h - paddingY  | 
60561 | 60570 |             );  | 
60562 | 60571 |         }  | 
60563 |  | -        onresize();  | 
60564 |  | -        window.onresize = onresize;  | 
 | 60572 | +        if (!options.embedded) {  | 
 | 60573 | +            onresize();  | 
 | 60574 | +            window.onresize = onresize;  | 
 | 60575 | +        }  | 
60565 | 60576 | 
 
  | 
60566 | 60577 |         return display;  | 
60567 | 60578 |     }  | 
 | 
60676 | 60687 |         Squeak.dirCreate(root, true);  | 
60677 | 60688 |         if (!/\/$/.test(root)) root += "/";  | 
60678 | 60689 |         options.root = root;  | 
 | 60690 | +        if (options.w) options.fixedWidth = options.w;  | 
 | 60691 | +        if (options.h) options.fixedHeight = options.h;  | 
 | 60692 | +        if (options.fixedWidth && !options.fixedHeight) options.fixedHeight = options.fixedWidth * 3 / 4 | 0;  | 
 | 60693 | +        if (options.fixedHeight && !options.fixedWidth) options.fixedWidth = options.fixedHeight * 4 / 3 | 0;  | 
 | 60694 | +        if (options.fixedWidth && options.fixedHeight) options.fullscreen = true;  | 
60679 | 60695 |         SqueakJS.options = options;  | 
60680 | 60696 |     }  | 
60681 | 60697 | 
 
  | 
 | 
60840 | 60856 |         }  | 
60841 | 60857 |         // we need to fetch all files first, then run the image  | 
60842 | 60858 |         processOptions(options);  | 
 | 60859 | +        if (imageUrl && imageUrl.endsWith(".zip")) {  | 
 | 60860 | +            options.zip = imageUrl.match(/[^\/]*$/)[0];  | 
 | 60861 | +            options.url = imageUrl.replace(/[^\/]*$/, "");  | 
 | 60862 | +            imageUrl = null;  | 
 | 60863 | +        }  | 
60843 | 60864 |         if (!imageUrl && options.image) imageUrl = options.image;  | 
60844 | 60865 |         var baseUrl = options.url || "";  | 
60845 | 60866 |         if (!baseUrl && imageUrl && imageUrl.replace(/[^\/]*$/, "")) {  | 
 | 
0 commit comments