diff options
author | Patrick Simianer <p@simianer.de> | 2016-06-07 17:11:08 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-06-07 17:11:08 +0200 |
commit | 83db5f918da692f13bd0fd886caf5374337e1d00 (patch) | |
tree | e3907077889037e31221c072d793f40558447187 /js/pool.js | |
parent | 2380944390691789dfaea133cd76f3c921820272 (diff) |
pool
Diffstat (limited to 'js/pool.js')
-rw-r--r-- | js/pool.js | 29 |
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."); + } + }}); + }); +}); + |