From c8708cf21f70a8cb1717759eed49df037b250035 Mon Sep 17 00:00:00 2001 From: Luca Facchini <45771235+lucafano04@users.noreply.github.com> Date: Mon, 7 Dec 2020 18:15:32 +0100 Subject: [PATCH] V1.0.1 (#1) * Create pregame.html * Adding pregame and Updating README * Pre-game graphic works Now the pre-game graphic works, you can use this before game start. * Update README.md * Post-game graphic works Now the post-game graphic works, you can use this after the end of the game for sowing the result. * Update update.php Aggiunta contollo delle richieste * Delete gest1.html * cache bug fix Now browser cache fixed. * Update Inning Arrow Now using 0/1/2 for all variable 0=two dash line 1=top 2=bottom * Bugfix Fixed Inning Arrow bug * LIVE SCOREBOARD Now the scoreboard updates live. * Update README.md Update README.md for the new version. * Update postgame.html * Delete of console.log for debugging. * Update of README.md added Installation and Italian translation --- .gitignore | 3 ++ README.md | 50 ++++++++++++++++++++++ data.json | 2 +- gest1.html | 22 ---------- postgame.html | 71 +++++++++++++++++++++++++++++++ pregame.html | 65 ++++++++++++++++++++++++++++ scoreboard.html | 36 +++++++--------- script.js | 110 ++++++++++++++++++++---------------------------- update.php | 13 +++--- 9 files changed, 259 insertions(+), 113 deletions(-) create mode 100644 .gitignore delete mode 100644 gest1.html create mode 100644 postgame.html create mode 100644 pregame.html mode change 100644 => 100755 update.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a7fbe92 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ + +*.json +data.json diff --git a/README.md b/README.md index cb1cdce..4c42432 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,26 @@ # Baseball Scoreboard This is a HTML and JS baseted scoreboard for basball live. +# Installation (English) +Download and unzip the compressed folder +## IMPORTANT +check the file data.json have read and write permission (give it via `chmod 666 data.json`) and make sure update.php have execution rights (Again give it via: `chmod 711 update.php`) + +# Installation (Italiano) +Scarica e decomprimi la cartella compressa +## IMPORTANTE +controlla che il file data.json abbia i permessi di lettura e scrittura (forniscilo tramite `chmod 666 data.json`) e assicurati che update.php abbia i diritti di esecuzione (di nuovo dallo:` chmod 711 update.php`) +# UPDATE LOG (English) +## V1.0.1 +### New Features: +* LIVE scoreboard: Now scoreboard updates live +* Pre-game and Post-game overlays used for not leaving blank the camera, them will adjust whit name, colour and score (Post-game only) +* Fixed cache with all files now the browser will not cache files +* Ining arrow more reactive (before dash had a problem) +* Removed debug log on console +### Know Bugs: +* we don't find any other bug if you find please advise me +======= # UPDATE LOG (English) ## V1.0.0 ### Features: @@ -16,3 +36,33 @@ This is a HTML and JS baseted scoreboard for basball live. * initial cache about ALL BROWSERS (Just repeat the action for 3/4 times and it's gone) * Scoreboard don't update live yo have to wait minus then 5s * we don't find any other bug if you find please advise me +# Update Log (Italiano) +## V1.0.1 +### Nuove Funzioni: +* SEGNAPUNTI LIVE: ora il segnapunti si aggiorna in live +* Sovrapposizioni pre-partita e post-partita utilizzate per non lasciare vuota la telecamera, verranno regolate con nome, colore e punteggio (solo dopo la partita) +* Risolto il problema con la cache con tutti i file ora il browser non memorizzerà i file nella cache +* Freccia ining più reattiva (prima il trattino aveva problemi) +* Rimosso il debug log nella console del browser +### Bug conosciuti: +* non troviamo nessun altro bug se trovi per favore avvisami +## V1.0.0 +### Funzioni: +* Aggiunta e rimozione punteggio +* Strike, Ball, Out +* Cambio Automatico Battitore +* Grafica occupazione basi +* Reset Ining Automatico +* Ining con Alto/Basso +* Cambio colore e nome delle squadre +* Reset COMPLETO +### Bug conosciuti: +* icache iniziale su TUTTI I BROWSER (Ripeti l'azione per 3/4 volte e non c'è più) +* Il tabellone non si aggiorna dal vivo, devi aspettare meno di 5 secondi +* non troviamo nessun altro bug se trovi per favore avvisami + +# LICENCE +[![Licenza Creative Commons](https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc-nd/4.0/) +Baseball-Scoreboard di [Luca Facchini e Kristian Ceribashi](https://github.com/luca-ceri/) è distribuito con Licenza [Creative Commons Attribuzione - Non commerciale - Non opere derivate 4.0 Internazionale](http://creativecommons.org/licenses/by-nc-nd/4.0/). +Permessi ulteriori rispetto alle finalità della presente licenza possono essere disponibili presso [https://github.com/lucafano04](https://github.com/lucafano04). +======= \ No newline at end of file diff --git a/data.json b/data.json index 65449fb..6278c19 100644 --- a/data.json +++ b/data.json @@ -1 +1 @@ -var data='{"Away":"PESARO","ScoreA":0,"ColorA":"#ff0000","Home":"FANO","ScoreH":0,"ColorH":"#ff8800","Ball":0,"Strike":0,"Out":0,"Ining":1,"bot":null,"b1":false,"b2":false,"b3":false}' \ No newline at end of file +var data='{"Away":"PESARO","ScoreA":0,"ColorA":"#ff0000","Home":"FANO","ScoreH":0,"ColorH":"#ff8800","Ball":0,"Strike":0,"Out":0,"Ining":0,"bot":0,"b1":false,"b2":false,"b3":false}' \ No newline at end of file diff --git a/gest1.html b/gest1.html deleted file mode 100644 index 4fd714e..0000000 --- a/gest1.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
BALLSTRIKEOUT
\ No newline at end of file diff --git a/postgame.html b/postgame.html new file mode 100644 index 0000000..68b11da --- /dev/null +++ b/postgame.html @@ -0,0 +1,71 @@ + + + Baseball Scoreboard + + + + + + + + +
+ + + + +
+ + + X + + 10 + + + + + 10 + + X + +
+ + + + + + + \ No newline at end of file diff --git a/pregame.html b/pregame.html new file mode 100644 index 0000000..9e38ad1 --- /dev/null +++ b/pregame.html @@ -0,0 +1,65 @@ + + + Baseball Scoreboard + + + + + + + + +
+ + + + +
+ + + X + + + + + X + +
+ + + + + + + \ No newline at end of file diff --git a/scoreboard.html b/scoreboard.html index 0332430..43c4756 100644 --- a/scoreboard.html +++ b/scoreboard.html @@ -39,18 +39,16 @@ \ No newline at end of file diff --git a/script.js b/script.js index e9ae390..a0c782f 100644 --- a/script.js +++ b/script.js @@ -9,91 +9,88 @@ document.getElementById("nameA").value = obj.Away; document.getElementById("colorH").value = obj.ColorH; document.getElementById("colorA").value = obj.ColorA; function ball(op){ - if(obj.Ball<3&&op == "+"){ + if(obj.Ball<3&&op == "+") nball = obj.Ball + 1; - }else if(obj.Ball>0&&op == "-"){ + else if(obj.Ball>0&&op == "-") nball = obj.Ball - 1; - }else if(op == "0"){ + else if(op == "0") nball = 0; - }else{ + else{ alert("Non puoi eseguire questa operazione"); return; } update() } -function nul(){ - obj.bot = null; - update() -} function strike(op){ - if(obj.Strike<2&&op == "+"){ + if(obj.Strike<2&&op == "+") nStrike = obj.Strike + 1; - }else if(obj.Strike>0&&op == "-"){ + else if(obj.Strike>0&&op == "-") nStrike = obj.Strike - 1; - }else if(op == "0"){ + else if(op == "0") nStrike = 0; - }else{ + else{ alert("Non puoi eseguire questa operazione"); return; } update() } function out(op){ - if(obj.Out<2&&op == "+"){ + if(obj.Out<2&&op == "+") nOut = obj.Out + 1 - }else if(obj.Out>0&&op=="-"){ + else if(obj.Out>0&&op=="-") nOut = obj.Out -1; - }else if(op == "0"){ + else if(op == "0") nOut = 0; - }else{ + else{ alert("Non puoi eseguire questa operazione"); return; } update() } function ining(op){ - if(op == "+"){ + if(op == "+") nIning = obj.Ining + 1; - }else if(op == "-"&&obj.Ining > 0){ + else if(op == "-"&&obj.Ining > 0) nIning = obj.Ining - 1; - }else if(op == "0"){ + else if(op == "0") nIning = 0; - }else{ + else{ alert("Non puoi eseguire questa operazione"); return; } update() } function top1(){ - nBot = false + obj.bot = 2 update() } function bot(){ - nBot = true + obj.bot = 1 + update() +} +function nul(){ + obj.bot = 0; update() } function b1(){ - if(obj.b1){ + if(obj.b1) obj.b1 = false; - }else{ + else obj.b1 = true; - } update() } function b2(){ - if(obj.b2){ + if(obj.b2) obj.b2 = false; - }else{ + else obj.b2 = true; - } update() } function b3(){ - if(obj.b3){ + if(obj.b3) obj.b3 = false; - }else{ - obj.b3 = true; - } + else + obj.b3 = true update() } function resetc(){ @@ -108,19 +105,18 @@ function reseti(){ obj.b1 = false; obj.b2 = false; obj.b3 = false; - if(obj.bot){ + if(obj.bot==1){ nIning = obj.Ining + 1; - nBot = false; + nBot = 2; }else{ - nBot = true; + nBot = 1; } update() } function reseta(){ var c=confirm("Una volta eseguita questa operazione non potrai annullarla\nSei Sicuro?"); - if(c==false){ + if(c==false) return; - } nball = 0; nStrike = 0; nOut = 0; @@ -135,45 +131,34 @@ function reseta(){ location.reload(); } function sHome(op){ - if(op == "+"){ + if(op == "+") obj.ScoreH = obj.ScoreH + 1; - } - if(op == "-"&&obj.ScoreH > 0){ + else if(op == "-"&&obj.ScoreH > 0) obj.ScoreH = obj.ScoreH - 1; - } - if(op == "0"){ - obj.ScoreH = 0; - } + else if(op == "0") + obj.ScoreH = 0 update() } function sAway(op){ - if(op == "+"){ + if(op == "+") obj.ScoreA = obj.ScoreA + 1; - } - if(op == "-"&&obj.ScoreA > 0){ + else if(op == "-"&&obj.ScoreA > 0) obj.ScoreA = obj.ScoreA - 1; - } - if(op == "0"){ + else if(op == "0") obj.ScoreA = 0; - } update() } function update(par){ - if(nball!=null){ + if(nball!=null) obj.Ball = nball; - } - if(nStrike!=null){ + if(nStrike!=null) obj.Strike = nStrike; - } - if(nOut!=null){ + if(nOut!=null) obj.Out = nOut; - } - if(nIning!=null){ + if(nIning!=null) obj.Ining = nIning - } - if(nBot!=null){ + if(nBot!=null) obj.bot = nBot - } obj.Away=document.getElementById("nameA").value; obj.Home=document.getElementById("nameH").value; obj.ColorA=document.getElementById("colorA").value; @@ -191,10 +176,7 @@ function update(par){ xhr.open("POST", './update.php', true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { // Call a function when the state changes. - if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { - var iframe = document.getElementById('scoreboard'); - iframe.src = iframe.src; - } + if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {} } xhr.send("d="+ndata); } \ No newline at end of file diff --git a/update.php b/update.php old mode 100644 new mode 100755 index 778802f..56b83ca --- a/update.php +++ b/update.php @@ -1,8 +1,9 @@ \ No newline at end of file