From 2558f367009cc3eb1b0e2b4d50295f180615f36f Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Mon, 19 Oct 2015 18:39:32 +0200 Subject: [PATCH] new info system: event management --- TODO.txt | 11 +++++++---- web/room.js | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/TODO.txt b/TODO.txt index a84c3e9..eebcac9 100644 --- a/TODO.txt +++ b/TODO.txt @@ -12,12 +12,15 @@ DONE - usermgmt extension DONE - add close button DONE - add apprentice icon - - match counters - . sql for match counters - . migration script for old users + DONE - match counters (part 1) + DONE . sql for match counters + WIP - new info system + WIP - click management + - show user info (RO) Phase2 - - new info system + - match counters (part 2) + . migration script for old users - guarantee for apprentice - MENTORS diff --git a/web/room.js b/web/room.js index 89ee03c..4222b1e 100644 --- a/web/room.js +++ b/web/room.js @@ -421,11 +421,13 @@ function j_stand_cont(ddata) table_add($("standup"), td); } - standup_data_old = data; - return; } - // $("esco").innerHTML = ''; + + var usr = $("standup").getElementsByClassName("id_usr"); + for (i = 0 ; i < usr.length ; i++) { + addEvent(usr[i], "click", click_update_cb); + } } function esco_cb() { @@ -435,7 +437,11 @@ function esco_cb() { act_logout(0); }; - +function click_update_cb(e) +{ + console.log("qui"); + console.log(e.target.innerHTML); +} function j_tab_cont(table_idx, data) { @@ -443,13 +449,15 @@ function j_tab_cont(table_idx, data) var content = ''; for (i = 0 ; i < data.length ; i++) { - // content += user_decorator(data[i]); - // content += state_add(data[i][0]); content += j_stand_tdcont(data[i]); content += '
'; } $("table"+table_idx).innerHTML = content; + var usr = $("table"+table_idx).getElementsByClassName("id_usr"); + for (i = 0 ; i < usr.length ; i++) { + addEvent(usr[i], "click", click_update_cb); + } } function j_tab_act_cont(idx, act) -- 2.17.1