Skip to content

Commit

Permalink
old
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristerNilsson committed Dec 2, 2024
1 parent b8c2fa8 commit 5d7eb86
Show file tree
Hide file tree
Showing 74 changed files with 209 additions and 549 deletions.
6 changes: 6 additions & 0 deletions assets/styles.sass
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ body[theme="dark"]
tr:nth-child(odd)
background-color: #888

.old
color: #bbb

body[theme="light"]
background-color: white
color: black
Expand All @@ -66,6 +69,9 @@ body[theme="light"]
tr:nth-child(odd)
background-color: #eee

.old
color: #aaa

a:hover
cursor: pointer

Expand Down
24 changes: 11 additions & 13 deletions content/api/sketch.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
table = (s) -> "<table>\n" + s + "</table>"
td = (s,attrs="") -> "<td #{attrs}>" + s + "</td>"
tr = (s,attrs="") -> "<tr #{attrs}>" + s + "</tr>\n"
th = (s,attrs="") -> "<th #{attrs}>" + s + "</th>"
table = (s) -> "<table>\n#{s}</table>"
tr = (s,attrs="") -> "<tr #{attrs}>#{s}</tr>\n"
td = (s,attrs="") -> "<td #{attrs}>#{s}</td>"
th = (s,attrs="") -> "<th #{attrs}>#{s}</th>"

turneringar = {
14507: "Klass M",
Expand Down Expand Up @@ -29,20 +29,18 @@ process = (data_t, data_r, tid, pid) ->
stable += th "mot"
stable += th "resultat"
stable = tr stable
good = 0
n = 0

played = 0
n = data_r.length

center = 'style="text-align: center"'
grå = 'style="color:#444444"'
grå = 'class="old"'
now = new Date()
nu = now.toLocaleDateString "sv-SE"

for r in data_r
g = r.games[0]
if r.finalized
n += 1
# if r.homeResult != 0 or r.awayResult != 0 then good += 1
if g.result in [-1,0,1] then good += 1
# console.log r.awayId,r.homeId
if r.finalized and g.result in [-1,0,1] then played += 1
if r.awayId == pid or r.homeId == pid
rg = if r.homeId==pid then "vit" else "svart"
s = ""
Expand All @@ -69,4 +67,4 @@ process = (data_t, data_r, tid, pid) ->
turnering.innerHTML = "<a href='https://member.schack.se/ShowTournamentServlet?id=#{tid}'>#{turneringar[tid]}</a>"
spelare.innerText = "Spelare: " + players[pid]
app.innerHTML = table stable
statistik.innerText = "#{good} of #{n} games played (#{(100*good/n).toFixed 1}%)"
statistik.innerText = "#{played} av #{n} partier spelade i turneringen. (#{(100*played/n).toFixed 1}%)"
33 changes: 14 additions & 19 deletions content/api/sketch.js

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions docs/api/sketch.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
table = (s) -> "<table>\n" + s + "</table>"
td = (s,attrs="") -> "<td #{attrs}>" + s + "</td>"
tr = (s,attrs="") -> "<tr #{attrs}>" + s + "</tr>\n"
th = (s,attrs="") -> "<th #{attrs}>" + s + "</th>"
table = (s) -> "<table>\n#{s}</table>"
tr = (s,attrs="") -> "<tr #{attrs}>#{s}</tr>\n"
td = (s,attrs="") -> "<td #{attrs}>#{s}</td>"
th = (s,attrs="") -> "<th #{attrs}>#{s}</th>"

turneringar = {
14507: "Klass M",
Expand Down Expand Up @@ -29,20 +29,18 @@ process = (data_t, data_r, tid, pid) ->
stable += th "mot"
stable += th "resultat"
stable = tr stable
good = 0
n = 0

played = 0
n = data_r.length

center = 'style="text-align: center"'
grå = 'style="color:#444444"'
grå = 'class="old"'
now = new Date()
nu = now.toLocaleDateString "sv-SE"

for r in data_r
g = r.games[0]
if r.finalized
n += 1
# if r.homeResult != 0 or r.awayResult != 0 then good += 1
if g.result in [-1,0,1] then good += 1
# console.log r.awayId,r.homeId
if r.finalized and g.result in [-1,0,1] then played += 1
if r.awayId == pid or r.homeId == pid
rg = if r.homeId==pid then "vit" else "svart"
s = ""
Expand All @@ -69,4 +67,4 @@ process = (data_t, data_r, tid, pid) ->
turnering.innerHTML = "<a href='https://member.schack.se/ShowTournamentServlet?id=#{tid}'>#{turneringar[tid]}</a>"
spelare.innerText = "Spelare: " + players[pid]
app.innerHTML = table stable
statistik.innerText = "#{good} of #{n} games played (#{(100*good/n).toFixed 1}%)"
statistik.innerText = "#{played} av #{n} partier spelade i turneringen. (#{(100*played/n).toFixed 1}%)"
33 changes: 14 additions & 19 deletions docs/api/sketch.js

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2012/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -106,8 +102,7 @@ <h1>2012</h1>

</main>





</body>
</html>
9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2013/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -147,8 +143,7 @@ <h2 id="dokument">Dokument</h2>

</main>





</body>
</html>
9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2014/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -138,8 +134,7 @@ <h2 id="dokument">Dokument</h2>

</main>





</body>
</html>
9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2015/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -143,8 +139,7 @@ <h2 id="dokument">Dokument</h2>

</main>





</body>
</html>
9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2016/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -132,8 +128,7 @@ <h2 id="dokument">Dokument</h2>

</main>





</body>
</html>
9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2017/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -150,8 +146,7 @@ <h2 id="dokument">Dokument</h2>

</main>





</body>
</html>
9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2018/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -148,8 +144,7 @@ <h2 id="dokument">Dokument</h2>

</main>





</body>
</html>
9 changes: 2 additions & 7 deletions docs/arkiv/dokument/2019/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@




<main>






<script>
<script>

function setStorage(key,value){
document.body.setAttribute(key, value);
Expand All @@ -48,7 +45,6 @@




<a href="/SrS/">Home</a>
<a href="/SrS/arkiv/">Arkiv</a>
<a href="/SrS/arkiv/dokument/">Dokument</a>
Expand Down Expand Up @@ -156,8 +152,7 @@ <h2 id="dokument">Dokument</h2>

</main>





</body>
</html>
Loading

0 comments on commit 5d7eb86

Please sign in to comment.