X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Froom.js;fp=public%2Fjavascripts%2Fcomponents%2Froom.js;h=c807109447886c0da97cb69c9c0291f48f13a1de;hb=a3ab5fdb6e9d614f55bb7ecef5887ddb7875df4b;hp=f5daee28b4b4100c6a64f83062259553446a180d;hpb=d337a94cd6d38bb743a8935017d03fe21d4ad324;p=vchess.git diff --git a/public/javascripts/components/room.js b/public/javascripts/components/room.js index f5daee28..c8071094 100644 --- a/public/javascripts/components/room.js +++ b/public/javascripts/components/room.js @@ -7,18 +7,8 @@ div(role="dialog" aria-labelledby="newGameTxt") h3#newGameTxt= translations["New game"] p= translations["Waiting for opponent..."] */ - - - - -// TODO: my-challenge-list, gérant clicks sur challenges, affichage, réception/émission des infos sur challenges -// de même, my-player-list - - - - +// TODO: my-challenge-list, gérant clicks sur challenges, affichage, réception/émission des infos sur challenges ; de même, my-player-list // TODO: si on est en train de jouer une partie, le notifier aux nouveaux connectés - /* Players + challenges : == "room" home of variant (surligner si nouveau défi perso et pas affichage courant) joueurs en ligne (dte), @@ -29,14 +19,20 @@ chat général (gauche, activé ou non (bool global storage)). quand je poste un lastMove corr, supprimer mon ancien lastMove le cas échéant (tlm l'a eu) fin de partie corr: garder maxi nbPlayers lastMove sur serveur, pendant 7 jours (arbitraire) */ - case "newgame": //opponent found - // oppid: opponent socket ID +Vue.component('my-room', { + props: ["conn","settings"], + data: { + something: "", //TODO + }, + +}); + + case "newgame": //challenge accepted + // oppid: opponent socket ID (or DB id if registered) this.newGame("human", data.fen, data.color, data.oppid, data.gameid); break; - // TODO: elsewhere, probably (new game button) clickGameSeek: function(e) { - this.getRidOfTooltip(e.currentTarget); if (this.mode == "human" && this.score == "*") return; //no newgame while playing if (this.seek) @@ -48,7 +44,6 @@ fin de partie corr: garder maxi nbPlayers lastMove sur serveur, pendant 7 jours this.newGame("human"); }, clickComputerGame: function(e) { - this.getRidOfTooltip(e.currentTarget); if (this.mode == "computer" && this.score == "*" && this.vr.turn != this.mycolor) { @@ -57,11 +52,6 @@ fin de partie corr: garder maxi nbPlayers lastMove sur serveur, pendant 7 jours } this.newGame("computer"); }, - clickFriendGame: function(e) { - this.getRidOfTooltip(e.currentTarget); - document.getElementById("modal-fenedit").checked = true; - }, - // In main hall : newGame: function(mode, fenInit, color, oppId, gameId) { const fen = fenInit || VariantRules.GenRandInitFen(); console.log(fen); //DEBUG @@ -183,7 +173,7 @@ fin de partie corr: garder maxi nbPlayers lastMove sur serveur, pendant 7 jours }, - // TODO: option du bouton "new game" + // TODO: option du bouton "new game" :: seulement pour challenge indiv const modalFenEdit = [ h('input', {