update info form with new Fieldify (partial)
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Mon, 8 Feb 2016 06:18:58 +0000 (07:18 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Mon, 8 Feb 2016 06:18:58 +0000 (07:18 +0100)
web/index.php
web/info.js
web/room.css

index e82d415..d9a52c3 100644 (file)
@@ -803,7 +803,7 @@ google_color_url = "000000";
    title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
 
 </div>
-</div>'. ($ACTION == "room" ? '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div><img class="nobo" style="cursor: pointer;" src="img/brisk_commands'.langtolng($G_lang).'.png" onmouseover="menu_hide(0,0); menu_show(\'menu_commands\');">
+</div>'. ($ACTION == "room" ? '<div style="padding: 0px; margin: 0px; width: 50px; height: 8px; font-size: 1px;"></div><img class="nobo" style="cursor: pointer;" src="img/brisk_commands'.langtolng($G_lang).'.png" onmouseover="menu_hide(0,0); menu_show(\'menu_commands\');">
 
 <div class="webstart" id="menu_commands" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
 
@@ -1432,27 +1432,29 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi
 <td class="le info-opt data">Amico: <span class="friend_id"></span></td>
 <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();">Da evitare</td></tr>
+<td class="le data triple">
+<input type="radio" name="friend" class="friend_id" value="black" onclick="info_onlyifknown_isvisible();">
+<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();">Sconosciuto</td>
+    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();">In prova</td>
+    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();">Amico</td>
+    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();">Amico fidato</td>
+    onclick="info_onlyifknown_isvisible();"><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>
 <td class="data">
     <table class="fiverank" style="margin: auto;">
-       <tr><td class="c1t">1</td>
-           <td class="c2t">2</td>
-           <td class="c3t">3</td>
-           <td class="c4t">4</td>
-           <td class="c5t">5</td></tr>
+       <tr><td class="c1t"><span class="skill_t_id" data-ffy-value="1">1</span></td>
+           <td class="c2t"><span class="skill_t_id" data-ffy-value="2">2</span></td>
+           <td class="c3t"><span class="skill_t_id" data-ffy-value="3">3</span></td>
+           <td class="c4t"><span class="skill_t_id" data-ffy-value="4">4</span></td>
+           <td class="c5t"><span class="skill_t_id" data-ffy-value="5">5</span></td></tr>
        <tr><td class="c1b"><input type="radio" name="skill" class="skill_id" value="1"></td>
            <td class="c2b"><input type="radio" name="skill" class="skill_id" value="2"></td>
            <td class="c3b"><input type="radio" name="skill" class="skill_id" value="3"></td>
@@ -1464,11 +1466,11 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi
 <td class="le"><b>Credibilità:</b></td>
 <td class="data">
     <table class="fiverank" style="margin: auto;">
-       <tr><td class="c1t">1</td>
-           <td class="c2t">2</td>
-           <td class="c3t">3</td>
-           <td class="c4t">4</td>
-           <td class="c5t">5</td></tr>
+       <tr><td class="c1t"><span class="trust_t_id" data-ffy-value="1">1</span></td>
+           <td class="c2t"><span class="trust_t_id" data-ffy-value="2">2</span></td>
+           <td class="c3t"><span class="trust_t_id" data-ffy-value="3">3</span></td>
+           <td class="c4t"><span class="trust_t_id" data-ffy-value="4">4</span></td>
+           <td class="c5t"><span class="trust_t_id" data-ffy-value="5">5</span></td></tr>
        <tr><td class="c1b"><input type="radio" name="trust" class="trust_id" value="1"></td>
            <td class="c2b"><input type="radio" name="trust" class="trust_id" value="2"></td>
            <td class="c3b"><input type="radio" name="trust" class="trust_id" value="3"></td>
index 35058fb..8a3a73d 100644 (file)
@@ -28,7 +28,7 @@ var mlang_info = { 'btn_close' : { 'it' : 'Chiudi.',
 
 function info_fld(dobj)
 {
-    var fields = { login: { type: 'value' },
+    var fields = { login: { type: 'value', perms: 'key' },
                    state: { type: 'value', perms: 'ro' },
                    guar: { type: 'value', perms: 'ro' },
 
@@ -90,21 +90,19 @@ function info_reset()
 {
     var ret, target;
 
-    target = $('info').getElementsByClassName('login_id')[0].innerHTML;
-    return info_show(target);
+    Fieldify.reset($('info'));
 }
 
 function info_save()
 {
     var info, jinfo, ret;
 
-    info = info_fld($('info'));
-    jinfo = info.dom2json();
+    jinfo = Fieldify.dom2json($('info'));
 
     ret = server_request('index_wr.php', sess, 'mesg', 'info|save','__POST__', 'info', JSON.stringify(jinfo));
 
     if (ret == 1) {
-        $('info').style.visibility = 'hidden';
+        Fieldify.actualize($('info'));
     }
     else {
         alert(ret);
@@ -113,7 +111,7 @@ function info_save()
 function info_onlyifknown_isvisible()
 {
     var vis = 'inherit';
-    var arr = fieldify_get_dom_element([$('info')], 'friend');
+    var arr = Fieldify.get_dom_elements([$('info')], 'friend');
     var obj = null;
 
     for (var k = 0 ; k < arr.length ; k++) {
index 02d8cd6..54b188b 100644 (file)
@@ -634,3 +634,15 @@ body.explain h5 {
     font-size: 120%;
     background-color: #fafafa;
 }
+
+.ffy_highlight_empty {
+background-color: pink;
+}
+
+.ffy_highlight {
+color: red;
+}
+
+.ffy_normal {
+color: black;
+}