diff --git a/index.html b/index.html index 726957c..8d11a8d 100644 --- a/index.html +++ b/index.html @@ -44,6 +44,10 @@ var likepng = "\"likes\""; var cuppng = "\"pts\""; +//function get_websocket_ip(){ +// return "ws://192.168.43.13:8001/" +//} + function latinize(nonlatin){ //This function is broken, does different shit on all browsers! FUCK THIS HORRIBLE MESS! I HATE FUCKING NON-ASCII CHARACTERS! var latin_map = {'É':'E','Á':'A','Ű':'U','Ü':'U','Ö':'O','Ő':'O','Ú':'U','Í':'I','Ó':'O','é':'e','á':'a','ű':'u','ü':'u','ö':'o','ő':'o','ú':'u','í':'i','ó':'o'}; @@ -115,8 +119,8 @@ var output = document.getElementById("viewerdivbody"); output.innerHTML = ''; //clear body if (jsonobj.state == 'pregame' && viewer){ - document.getElementById("viewerdivhead").innerHTML = '
QR code Waiting for players to join at '+ - gameaddress +'
Total players:' + jsonobj.players.length + '
'; + document.getElementById("viewerdivhead").innerHTML = '
QR code Varakozunk a tobbi jatekosra: '+ + gameaddress +'
Jatekosok:' + jsonobj.players.length + '
'; var pre = document.createElement("b"); var playerlist = [] for (var player = 0; playerEnter your lies:
'; + document.getElementById("viewerdivhead").innerHTML = jsonobj.question+'
Add meg a hazugsagod!
'; var pre = document.createElement("p"); var playerlist = []; @@ -148,7 +152,7 @@ if (jsonobj.state == 'lieselection' ){ if (viewer){ - document.getElementById("viewerdivhead").innerHTML = jsonobj.question+'
Select the truth:
'; + document.getElementById("viewerdivhead").innerHTML = jsonobj.question+'
Valaszd ki az igazat:
'; //display all lies lies = sortlies(); @@ -172,18 +176,18 @@ }else{ //show lie selector ui showonly("#selectliediv"); output = document.getElementById("selectliediv") ; - output.innerHTML = '

'+jsonobj.question+'
Select the truth

'; + output.innerHTML = '

'+jsonobj.question+'
Valaszd ki az igazat!

'; // sort lies in alphabetical order to prevent the truth from floating upper-alpha lies = sortlies(); for (var l = 0; l'+lies[l]+ '
\n').trigger('create'); } - $("#selectliediv").append('

 

'); //to make sure last lie isnt hidden + $("#selectliediv").append('

___

'); } }; if (jsonobj.state == 'scoring'){ //scoring is identical in viewer and player showonly("#viewerdiv"); - document.getElementById("viewerdivhead").innerHTML = "Scoring"; + document.getElementById("viewerdivhead").innerHTML = "Pontozas"; var pre = document.createElement("h1"); var playerswholiedthis = []; var playerswhochosethis = []; @@ -198,15 +202,15 @@ } if (jsonobj.currentlie != jsonobj.answer){ - pretext += jsonobj.currentlie + " is a lie! Submitted by: " + playerswholiedthis.join(", ")+"
Players fooled: "+playerswhochosethis.join(", "); + pretext += jsonobj.currentlie + " egy hazugsag! Bekuldte: " + playerswholiedthis.join(", ")+"
Jatekosok akik elhittek: "+playerswhochosethis.join(", "); }else{ - pretext += jsonobj.currentlie + " is the truth!
" - if (playerswhochosethis.length >0) pretext += " Players correct: " + playerswhochosethis.join(", "); - else pretext += "No players were correct!"; + pretext += jsonobj.currentlie + " az igazsag!
" + if (playerswhochosethis.length >0) pretext += " A helyesen valaszolo jatekosok: " + playerswhochosethis.join(", "); + else pretext += "Senki nem tudta az igazat!"; } if (playerswholikedthis.length > 0){ - pretext += "
Players who like this answer: "+playerswholikedthis.join(", "); + pretext += "
Jatekosok akiknek tetszett a valasz: "+playerswholikedthis.join(", "); } pre.innerHTML = pretext; output.appendChild(pre); @@ -214,7 +218,7 @@ }; if (jsonobj.state == "finalscoring") {//scoring is identical in viewer and player //var pre = document.createElement("h1"); - document.getElementById("viewerdivhead").innerHTML = jsonobj.question + ' (' + jsonobj.answer + ')' + '
Total scores:'; + document.getElementById("viewerdivhead").innerHTML = jsonobj.question + ' (' + jsonobj.answer + ')' + ' Pontok osszesitese:'; //console.log(pre.innerHTML); //output.appendChild(pre); @@ -239,13 +243,13 @@ var stepsize = Math.ceil(jsonobj.players.length); var numtables = 1; - if (viewer && jsonobj.players.length >=3 ) { + if (viewer) { numtables = 3; stepsize = Math.ceil(jsonobj.players.length/3.0); } for (var tablecount = 0; tablecount < numtables; tablecount++) { tabletext += ''; - tabletext += ""; + tabletext += "
#PlayerLie"+cuppng+""+likepng+"
"; for (var player = stepsize *tablecount ; player < Math.min(jsonobj.players.length, (stepsize*(tablecount+1))); player++) { var p = jsonobj.players[player]; @@ -317,7 +321,7 @@ connection.send("lie:"+mylie); $("#mylie").hide(); $("#liebtn").hide(); - document.getElementById("questionh").innerHTML = "Lie submitted"; + document.getElementById("questionh").innerHTML = "Hazugsag bekuldve"; } } function sortlies(){ @@ -330,28 +334,28 @@ } function selectlie(me){ if (me == mylie){ // you cant select your own lie! - $("#selectliediv").append('

You cant select your own lie!

\n').trigger('create'); + $("#selectliediv").append('

Nem valaszthatod a sajat hazugsagodat, valassz mast!

\n').trigger('create'); return; } - console.log("Selected lie:",me); + console.log("Kivalasztott hazugsag:",me); connection.send("choice:"+me); output = document.getElementById("selectliediv") ; - output.innerHTML = '

Choice submitted.

Like the answers for:

'+jsonobj.question+'

'; + output.innerHTML = '

Valasztasod bekuldve.

Valaszd ki a szerinted legkreativabb valaszt:

'+jsonobj.question+'

'; // sort lies in alphabetical order to prevent the truth from floating upper-alpha lies = sortlies(); for (var l = 0; l'+lies[l]+ '
\n').trigger('create'); } - $("#selectliediv").append('

 

'); + $("#selectliediv").append('

___

'); } function like(me){ if (me == mylie){ // you cant select your own lie! - $("#selectliediv").append('

You cant like your own lie!

\n').trigger('create'); + $("#selectliediv").append('

A sajat hazugsagodat nem valaszthatod!

\n').trigger('create'); return; } console.log("liked:"+me); connection.send('like:'+me); - document.getElementById("selectliediv").innerHTML = '

Waiting for everyone else...

' ; + document.getElementById("selectliediv").innerHTML = '

Varakozas a tobbiekre...

' ; } @@ -373,7 +377,7 @@ showonly("#enterliediv"); $("#mylie").show(); $("#liebtn").show(); - $("#mylie").val("RandomLie"+Math.floor(Math.random()*1000)); + $("#mylie").val("Ird be a hazugsagodat"+Math.floor(Math.random()*1000)); document.getElementById("questionh").innerHTML = q; } @@ -418,7 +422,7 @@

Submit a question:

Enter your lie!

- Submit lie + Hazugsag bekuldese
@@ -433,11 +437,6 @@

QR code View waiting for nobody in yet - -
-

 

-
-

#JatekosHazugsaga"+cuppng+""+likepng+"