<td class="le data">Fidato: <span class="bff_id"></span></td></tr>
<tr><td class="le ri triple" colspan="3"><b><?php echo $mlang_room['info_frie'][$G_lang]; ?></b></td>
<td class="le data triple">
-<input type="radio" name="friend" class="friend_id" value="black" onclick="info_onlyifknown_isvisible();">
+<input type="radio" name="friend" class="friend_id" value="black">
<span class="friend_t_id" data-ffy-value="black">Da evitare</span>
</td></tr>
<tr>
-<td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="unknown"
- onclick="info_onlyifknown_isvisible();"><span class="friend_t_id" data-ffy-value="unknown">Sconosciuto</span></td>
-<td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="test"
- onclick="info_onlyifknown_isvisible();"><span class="friend_t_id" data-ffy-value="test">In prova</span></td>
-<td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="friend"
- onclick="info_onlyifknown_isvisible();"><span class="friend_t_id" data-ffy-value="friend">Amico</span></td>
-<td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="bff"
- onclick="info_onlyifknown_isvisible();"><span class="friend_t_id" data-ffy-value="bff">Amico fidato</span></td>
+<td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="unknown">
+ <span class="friend_t_id" data-ffy-value="unknown">Sconosciuto</span></td>
+<td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="test">
+ <span class="friend_t_id" data-ffy-value="test">In prova</span></td>
+<td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="friend">
+ <span class="friend_t_id" data-ffy-value="friend">Amico</span></td>
+<td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="bff">
+ <span class="friend_t_id" data-ffy-value="bff">Amico fidato</span></td>
</tr>
<tr class="onlyifknown_gid">
<td class="le head"><span><?php echo $mlang_room['info_skill'][$G_lang]; ?>:</span></td>
'en' : 'Close.' }
};
+function info_onlyifknown_isvisible_cb(item)
+{
+ var vis = 'inherit';
+
+ if (item.value == 'black' || item.value == 'unknown') {
+ vis = 'hidden';
+ }
+
+ $('info').getElementsByClassName('onlyifknown_gid')[0].style.visibility = vis;
+ return true;
+}
function info_fld(dobj)
{
match: { type: 'value', perms: 'ro' },
game: { type: 'value', perms: 'ro' },
party: { type: 'value', perms: 'ro' },
- friend: { type: 'radio' },
+ friend: { type: 'radio', cb: info_onlyifknown_isvisible_cb },
skill: { type: 'radio' },
trust: { type: 'radio' }
};
if (info_in.ret == 0) {
info = info_fld($('info'));
info.json2dom(info_in);
- info_onlyifknown_isvisible();
info.visible(true);
}
else {
alert(ret);
}
}
-function info_onlyifknown_isvisible()
-{
- var vis = 'inherit';
- var arr = Fieldify.get_dom_elements([$('info')], 'friend');
- 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_gid')[0].style.visibility = vis;
- return true;
-}