summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-06-07 17:16:22 +0200
committerPatrick Simianer <p@simianer.de>2016-06-07 17:16:22 +0200
commit9df3b86e6a5b087d441c161c03a6fb3298943864 (patch)
treed9e1c9f8d8e6794ba6834ec5938d5c08975f48f7 /js
parent6c62dc57ae90fc6b016da507cae22d96fc128af2 (diff)
parent457ab6312a19281e1c33b54411cb13878913e774 (diff)
Merge branch 'master' of github.com:pks/lfpe
Diffstat (limited to 'js')
-rw-r--r--js/pool.js29
1 files changed, 29 insertions, 0 deletions
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("<input id='name' />");
+ 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.");
+ }
+ }});
+ });
+});
+