From: Matteo Nastasi (mop) Date: Thu, 10 Dec 2015 10:24:26 +0000 (+0100) Subject: type 'fields' added to Fieldify class X-Git-Tag: v5.3.0~30 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=19cfa94e8731ace1ea643d295e1ec57f383952de;p=brisk.git type 'fields' added to Fieldify class --- diff --git a/web/fieldify.js b/web/fieldify.js index 19bf23f..cb14c6e 100644 --- a/web/fieldify.js +++ b/web/fieldify.js @@ -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; }, diff --git a/web/index.php b/web/index.php index 3178264..12972e9 100644 --- a/web/index.php +++ b/web/index.php @@ -1385,18 +1385,23 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi + Cosa ne pensano gli amici. -Da evitare: -In prova: -Amico: -Amico fidato: +Da evitare: +In prova: +Amico: +Fidato: + Cosa ne pensano gli amici fidati: -Da evitare: -In prova: -Amico: -Amico fidato: + +Da evitare: +In prova: +Amico: +Fidato: