From 83db5f918da692f13bd0fd886caf5374337e1d00 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 7 Jun 2016 17:11:08 +0200 Subject: pool --- js/pool.js | 29 +++++++++++++++++++++++++ pool.php | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pool_save.php | 25 ++++++++++++++++++++++ static/pool.css | 14 +++++++++++++ static/pool.html | 36 +++++++++++++++++++++++++++++++ 5 files changed, 168 insertions(+) create mode 100644 js/pool.js create mode 100644 pool.php create mode 100644 pool_save.php create mode 100644 static/pool.css create mode 100644 static/pool.html diff --git a/js/pool.js b/js/pool.js new file mode 100644 index 0000000..4cb2af8 --- /dev/null +++ b/js/pool.js @@ -0,0 +1,29 @@ +var ids = []; +var clicked = false; +var clicked_sess = ""; + +$().ready(function() +{ + $(".item").click(function () { + var id = $(this).attr("id"); + if (!ids.includes(id) && !clicked) { + $(this).append(""); + ids.push(id); + clicked = true; + clicked_sess = $(this).attr("session"); + } + }); + + $("#button").click(function () { + if (!clicked) return; + if ($("#name").val()=="") return; + $.ajax({url: "pool_save.php?name="+encodeURIComponent($("#name").val())+"&session="+encodeURIComponent(clicked_sess), success: function(result){ + if (result=="ok") { + window.location = "http://postedit.cl.uni-heidelberg.de/interface.php?key="+clicked_sess+"&ui_type=t"; // FIXME + } else { + alert("Session taken, choose another session."); + } + }}); + }); +}); + diff --git a/pool.php b/pool.php new file mode 100644 index 0000000..6ea0e2a --- /dev/null +++ b/pool.php @@ -0,0 +1,64 @@ + + + + + + Pool + + + + + + + +

Click on a table cell, enter your name, and click 'Begin' to begin your session. Reload the page if you clicked on the wrong cell.

+ + +
#0
+
+
+
+
+
+ + + + + + $max) { + $max = $j; + } + } + fclose($f); + + for ($i=1; $i<=$max; $i++) { + echo "\n"; + if ($i%5 == 0) { + echo "\n"; + } + } + ?> + + +
#".$i."
".$b[$i]."
+ + + +
+ + + diff --git a/pool_save.php b/pool_save.php new file mode 100644 index 0000000..5d67a25 --- /dev/null +++ b/pool_save.php @@ -0,0 +1,25 @@ + diff --git a/static/pool.css b/static/pool.css new file mode 100644 index 0000000..98fde49 --- /dev/null +++ b/static/pool.css @@ -0,0 +1,14 @@ +body { background: #fff; color: #fff} + +td { + background:#eee; + color: #000; + padding: 2em; + font-weight: bold; + font-size: 1.2em; + text-align:center; +} + +td:hover { + background: #fff +} diff --git a/static/pool.html b/static/pool.html new file mode 100644 index 0000000..4e4aad3 --- /dev/null +++ b/static/pool.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + + Pool + + + + + + + +
#0
+
+
+
+ + + + + + +
#1#2#3#4#5
#6#7#8#9#10
#11#12#13#14#15
#16#17#18#19#20
#21#22#23#24#25
+ +
+ + + -- cgit v1.2.3