Comments by wmwragg
That makes sense. I was more focused on the current caching issues people have, but the other issues seem to bleed into it as well. There is another issue with the betzaNew.js script, which I think relates to the .style.aspectRatio calculation, which is that it creates a large gap above the board in the diagram, at least in Safari on iOS, iPadOS and MacOS, setting that calculation to zero fixes it for Safari, though you obviously loose the aspect ratio adjustment.
It happens on a page with nothing but the diagram code on it, not just when embedded in a page with other HTML, so it doesn't seem to be dependent on something being to the right or left of the diagram. The board itself looks the same with either betza.js or betzaNew.js, except for the gap, and on an iPhone (for both scripts) a square board will be squeezed so that the squares are vertically rectangular, as well as the board. I just tried it in Firefox of MacOS and there was no gap, so looks to be a Safari (Webkit) specific thing.
It looks like Safari from 15 does support aspect-ratio as a CSS property and not just in @media queries, and it supports the N / M format as well, so not sure what is happening
Not sure it matters as the code still works, but I also get a javascript error in the console:
ReferenceError: Can't find variable: ranks
betzaNew.js:964
For me it's pointing to this line (I may be using an older version of the script):
...
function Display() {
var p;
for(i=0; i<ranks; i++) for(j=0; j<files; j++) { <<<< This line
if(flip) {
../
OK just updated to the latest script and it shows error on line 976, which is the same line as posted below.
EDIT: My understanding was that if a variable wasn't declared globally it expects it to be defined locally if referenced from within a function, and ranks isn't declared globally at the point the function is first called. It may be that Safari assumes strict mode for scopes?
7 comments displayed
Permalink to the exact comments currently displayed.
Just a thought on the issue with caching of the betza.js and betzaNew.js scripts. Perhaps using a version number might be useful either directly in the name e.g. betzaNew-1.2.0.js, or tagged on as a parameter betzaNew.js?nocache=true&ver=1.2.0. Obviously they both have their issues. Including the version in the name means that all versions of the script need to exist so people keep access to their diagrams, and including the version number as a parameter doesn't guarantee that the version of the script will match the version in the parameter. Personally I've used both, but the version number as a parameter is a useful cache busting mechanism, and helps users know what version is current, and that they may need to update their version number to get the latest features, without effecting other users. It's easier to manage as well. Just include the latest version number on the page, and in the generated examples so users know something has changed.