Since you have made various modifications to betzaNew.js since I made betzaFlex.js, I compared betzaFlex.js with a copy of betzaNew.js I placed in /fergus/ before making betzaFlex.js. Based on this comparison, which was facilitated by the Compare plugin for Notepad++, I noted these changes I made to betzaFlex.js. I have listed them in the order they appear in the script, and not in the order I made them.
I made all URLs relative.
I added a variable called displayPieces, initially set to 0.
I changed CreateBoard() to use the CSS min function for determining the size to display squares and borders. This is to make sure the entire board remains on the screen even on small mobile devices.
I changed some default values in ParseGameDef().
I added a line for displayPieces to ParseGameDef().
I modified CreateAnchors() to use flexbox and to hide hidden sections by setting visibility to hidden and height to 0 instead of setting display to none. I also replaced hardcoded colors with CSS custom properties.
I commented out one line of Display().
I modified PromoQuery() to use CSS custom properties for colors, and I modified one condition to check that visibility was not set to hidden instead of checking that display was not set to none.
I modified NewClick() to use CSS custom properties for colors.
I modified BetzaCompile() to use CSS custom properties for colors and corrected a typo, changing alignn to align.
I changed OpenDiv() to change the values of visibliity and height instead of the value of display.
Since you have made various modifications to betzaNew.js since I made betzaFlex.js, I compared betzaFlex.js with a copy of betzaNew.js I placed in /fergus/ before making betzaFlex.js. Based on this comparison, which was facilitated by the Compare plugin for Notepad++, I noted these changes I made to betzaFlex.js. I have listed them in the order they appear in the script, and not in the order I made them.
displayPieces
, initially set to 0.displayPieces
to ParseGameDef().visibility
tohidden
andheight
to 0 instead of settingdisplay
tonone
. I also replaced hardcoded colors with CSS custom properties.visibility
was not set tohidden
instead of checking thatdisplay
was not set tonone
.alignn
toalign
.visibliity
andheight
instead of the value ofdisplay
.