From: Matteo Nastasi (mop) Date: Tue, 15 Dec 2015 10:07:50 +0000 (+0100) Subject: info: hide part of the info when target user is unknown or blacklisted X-Git-Tag: v5.3.0~25 X-Git-Url: http://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=6df7632d387a4b4ce24b28db98fae3ae2fcb647c info: hide part of the info when target user is unknown or blacklisted --- diff --git a/TODO.txt b/TODO.txt index 3751b46..1a94fbb 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,8 +5,8 @@ ------+ DONE - Not sequence of 3 same chars DONE . check server side with test - - Global vars checker + - usermgmt: add user delete DONE - 10002 message when already clicked DONE - trim spaces in apprentice form @@ -24,7 +24,8 @@ DONE - remove entry when set unknown DONE - enhance info interface DONE . SQL to show current evaluation - . disable parts of interface + DONE . disable parts of interface + . add title to items - minisplash at end of the match - differentiate table authorization diff --git a/web/index.php b/web/index.php index b67b0a4..0a6d9ff 100644 --- a/web/index.php +++ b/web/index.php @@ -1401,14 +1401,19 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi Amico: Fidato: -Da evitare +Da evitare -Sconosciuto -In prova -Amico -Amico fidato +Sconosciuto +In prova +Amico +Amico fidato -Bravura: +Bravura: diff --git a/web/info.js b/web/info.js index ec13833..bf63b9c 100644 --- a/web/info.js +++ b/web/info.js @@ -52,7 +52,6 @@ function info_fld(dobj) }; var ret = new Fieldify([dobj], fields); - console.log(ret); return (ret); } @@ -66,6 +65,7 @@ function info_show(username) if (info_in.ret == 0) { info = info_fld($('info')); info.json2dom(info_in); + info_onlyifknown_isvisible(); info.visible(true); } else { @@ -109,3 +109,25 @@ function info_save() alert(ret); } } +function info_onlyifknown_isvisible() +{ + var vis = 'inherit'; + var arr = $('info').getElementsByClassName('friend_id'); + var obj = null; + + for (var k = 0 ; k < arr.length ; k++) { + if (arr[k].checked == true) { + obj = arr[k]; + break; + } + } + if (obj == null) { + return false; + } + + if (obj.value == 'black' || obj.value == 'unknown') { + vis = 'hidden'; + } + $('info').getElementsByClassName('onlyifknown_id')[0].style.visibility = vis; + return true; +}
1