X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=d76ab0117d828a3722ac2568b409f9c0c6aaf372;hb=32cfcea44bf00b0c6c4d172cca715823076ff490;hp=f5b7eda2a0980d5602e6544c6e6f9d75215317b3;hpb=05290bf9c98d159a3f45d4961b26ef5806834b89;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index f5b7eda2..d76ab011 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -20,11 +20,12 @@ Vue.component('my-game', { hints: (getCookie("hints") === "1" ? true : false), color: getCookie("color", "lichess"), //lichess, chesscom or chesstempo // sound level: 0 = no sound, 1 = sound only on newgame, 2 = always - sound: getCookie("sound", "2"), + sound: parseInt(getCookie("sound", "2")), }; }, render(h) { const [sizeX,sizeY] = VariantRules.size; + console.log(sizeX + " " + sizeY); const smallScreen = (screen.width <= 420); // Precompute hints squares to facilitate rendering let hintSquares = doubleArray(sizeX, sizeY, false); @@ -660,6 +661,7 @@ Vue.component('my-game', { "value": "0", innerHTML: "None" }, + attrs: { "selected": this.sound==0 }, } ), h("option", @@ -668,6 +670,7 @@ Vue.component('my-game', { "value": "1", innerHTML: "Newgame" }, + attrs: { "selected": this.sound==1 }, } ), h("option", @@ -676,6 +679,7 @@ Vue.component('my-game', { "value": "2", innerHTML: "All" }, + attrs: { "selected": this.sound==2 }, } ), ], @@ -700,7 +704,10 @@ Vue.component('my-game', { { elementArray.push( h('div', - { attrs: { id: "pgn-div" } }, + { + attrs: { id: "pgn-div" }, + "class": { "section-content": true }, + }, [ h('a', { @@ -713,10 +720,16 @@ Vue.component('my-game', { h('p', { attrs: { id: "pgn-game" }, - on: { click: this.download }, domProps: { innerHTML: this.pgnTxt } } - ) + ), + h('button', + { + attrs: { "id": "downloadBtn" }, + on: { click: this.download }, + domProps: { innerHTML: "Download game" }, + } + ), ] ) ); @@ -726,7 +739,10 @@ Vue.component('my-game', { // Show current FEN elementArray.push( h('div', - { attrs: { id: "fen-div" } }, + { + attrs: { id: "fen-div" }, + "class": { "section-content": true }, + }, [ h('p', {