X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fsettings.js;h=85f89c1fdd108e37ed5beda670493325dfa62dce;hp=c9adbf16f0e5e3d5d61bb3f13b1815da646f58b3;hb=81da2786f2f497b4416e0488c34a48fb794c28df;hpb=c5fa5762dc441fb1cb669908fae01d0d128e372d diff --git a/public/javascripts/settings.js b/public/javascripts/settings.js index c9adbf16..85f89c1f 100644 --- a/public/javascripts/settings.js +++ b/public/javascripts/settings.js @@ -1,3 +1,23 @@ // TODO: //à chaque onChange, envoyer matching event settings update //(par exemple si mise à jour du nom, juste envoyer cet update aux autres connectés ...etc) + setMyname: function(e) { + this.myname = e.target.value; + localStorage["username"] = this.myname; + }, + showSettings: function(e) { + this.getRidOfTooltip(e.currentTarget); + document.getElementById("modal-settings").checked = true; + }, + toggleHints: function() { + this.hints = !this.hints; + localStorage["hints"] = (this.hints ? "1" : "0"); + }, + setBoardColor: function(e) { + this.bcolor = e.target.options[e.target.selectedIndex].value; + localStorage["bcolor"] = this.bcolor; + }, + setSound: function(e) { + this.sound = parseInt(e.target.options[e.target.selectedIndex].value); + localStorage["sound"] = this.sound; + },