- display: "", //do not show anything...
- problem: undefined, //current problem in view
+ display: "undefined", //default to main hall; see "created()" function
+ gameid: undefined, //...yet
+
+ conn: null,
+
+ // TEMPORARY: DEBUG
+ mode: "analyze",
+ orientation: "w",
+ userColor: "w",
+
+ allowChat: false,
+ allowMovelist: true,
+ fen: V.GenRandInitFen(),
+ },
+ created: function() {
+ // TODO: navigation becomes a little more complex
+ this.setDisplay();
+ window.onhashchange = this.setDisplay;
+
+ this.myid = "abcdefghij";
+//console.log(this.myid + " " + variant);
+ //myid: localStorage.getItem("myid"), //our ID, always set
+
+ this.conn = new WebSocket(socketUrl + "/?sid=" + this.myid + "&page=" + variant.id);
+ const socketCloseListener = () => {
+ this.conn = new WebSocket(socketUrl + "/?sid=" + this.myid + "&page=" + variant.id);
+ }
+ this.conn.onclose = socketCloseListener;
+
+ //this.vr = new VariantRules( V.GenRandInitFen() );