type 'fields' added to Fieldify class
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Thu, 10 Dec 2015 10:24:26 +0000 (11:24 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Thu, 10 Dec 2015 10:24:26 +0000 (11:24 +0100)
web/fieldify.js
web/index.php
web/info.js

index 19bf23f..cb14c6e 100644 (file)
@@ -7,6 +7,10 @@ function Fieldify(ancestor, fieldsdescr)
     this.field = new Array();
     for (k in fieldsdescr) {
         this.field[k] = fieldsdescr[k];
+        if (this.field[k].type == 'fields') {
+            this.field[k].obj = new Fieldify(this.ancestor.getElementsByClassName(k + '_id')[0],
+                                             this.field[k].fields);
+        }
     }
 }
 
@@ -28,6 +32,9 @@ Fieldify.prototype = {
             else if (this.field[k].type == 'radio') {
                 this.fld_radio_set(k, field_values[k]);
             }
+            else if (this.field[k].type == 'fields') {
+                this.field[k].obj.json2dom(field_values[k]);
+            }
         }
     },
 
@@ -43,6 +50,9 @@ Fieldify.prototype = {
             else if (this.field[k].type == 'radio') {
                 ret[k] = this.fld_radio_get(k);
             }
+            else if (this.field[k].type == 'fields') {
+                ret[k] = this.field[k].obj.dom2json();
+            }
         }
         return ret;
     },
index 3178264..12972e9 100644 (file)
@@ -1385,18 +1385,23 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi
 <tr><td><b><?php echo $mlang_room['info_guar'][$G_lang]; ?></b></td><td class="ri"><span class="guar_id"></span></td><td></td><td></td></tr>
 <tr><td><b><?php echo $mlang_room['info_match'][$G_lang]; ?></b></td><td class="ri"><span class="match_id"></span></td>
 <td><b><?php echo $mlang_room['info_game'][$G_lang]; ?></b></td><td class="ri"><span class="game_id"></span></td></tr>
+<!-- <tr class="widefriendh_id"><td colspan="3"><b>Cosa ne pensano gli amici.</b></td>
+<td class="le info-opt">Bravura: <span class="skill_id"></span></td></tr> -->
 <tr><td colspan="4"><b>Cosa ne pensano gli amici.</b></td></tr>
 
-<tr><td class="le info-opt">Da evitare:<span class="frie_black"></span></td>
-<td class="le info-opt">In prova:<span class="frie_test"></span></td>
-<td class="le info-opt">Amico:<span class="frie_friend"></span></td>
-<td class="le info-opt">Amico fidato:<span class="frie_bff"></span></td></tr>
+<tr class="widefriend_id"><td class="le info-opt">Da evitare: <span class="black_id"></span></td>
+<td class="le info-opt">In prova: <span class="test_id"></span></td>
+<td class="le info-opt">Amico: <span class="friend_id"></span></td>
+<td class="le info-opt">Fidato: <span class="bff_id"></span></td><td></td></tr>
 
+<!-- <tr class="narrowfriendh_id"><td colspan="3"><b>Cosa ne pensano gli amici fidati:</b></td>
+<td class="le info-opt">Bravura: <span class="skill_id"></span></td></tr> -->
 <tr><td colspan="4"><b>Cosa ne pensano gli amici fidati:</b></td></tr>
-<tr><td class="le info-opt">Da evitare:<span class="frie_black"></span></td>
-<td class="le info-opt">In prova:<span class="frie_test"></span></td>
-<td class="le info-opt">Amico:<span class="frie_friend"></span></td>
-<td class="le info-opt">Amico fidato:<span class="frie_bff"></span></td></tr>
+
+<tr class="narrowfriend_id"><td class="le info-opt">Da evitare: <span class="black_id"></span></td>
+<td class="le info-opt">In prova: <span class="test_id"></span></td>
+<td class="le info-opt">Amico: <span class="friend_id"></span></td>
+<td class="le info-opt">Fidato: <span class="bff_id"></span></td></tr>
 <!-- 
 <tr><td class="le ri" colspan="2"><b><?php echo $mlang_room['info_frie'][$G_lang]; ?></b></td></tr>
 <tr><td class="le info-opt"><input type="radio" name="friend" class="friend_id" value="black">Da evitare</td>
index 8587e98..9cba917 100644 (file)
@@ -25,11 +25,23 @@ var mlang_info = { 'btn_close' : { 'it' : 'Chiudi.',
                                    'en' : 'Close.' }
                  };
 
+
 function info_fld(dobj)
 {
     var fields = { login: { type: 'value' },
                    state: { type: 'value', perms: 'ro' },
                    guar: { type: 'value', perms: 'ro' },
+
+                   widefriend: { type: 'fields', fields: { black: { type: 'value', perms: 'ro' },
+                                                           test: { type: 'value', perms: 'ro'},
+                                                           friend: { type: 'value', perms: 'ro'},
+                                                           bff: { type: 'value', perms: 'ro'}
+                                                         } },
+                   narrowfriend: { type: 'fields', fields: { black: { type: 'value', perms: 'ro'},
+                                                             test: { type: 'value', perms: 'ro'},
+                                                             friend: { type: 'value', perms: 'ro'},
+                                                             bff: { type: 'value', perms: 'ro'}
+                                                         } },
                    match: { type: 'value', perms: 'ro' },
                    game: { type: 'value', perms: 'ro' },
                    friend: { type: 'radio' },