From 3326f44b155cc6e08e9a9735a567c1cc18a00ae4 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 17 Sep 2016 08:29:59 +0200 Subject: [PATCH] =?UTF-8?q?Form-Builder=20d=C3=A9but=20impl=C3=A9mentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/lib/form-builder-min.js | 4 ++-- js/lib/form-builder.js | 31 ++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/js/lib/form-builder-min.js b/js/lib/form-builder-min.js index 312f11f..fb69bdf 100644 --- a/js/lib/form-builder-min.js +++ b/js/lib/form-builder-min.js @@ -1,3 +1,3 @@ -var FormBuilder=function(a,b){this.parent_element=a;this.form_object=b;FormBuilder.formatFormObject(this.form_object)}; +var FormBuilder=function(a,d){this.parent_element=a;this.form_object=d;FormBuilder.formatFormObject(this.form_object)}; FormBuilder.prototype={form_object:this.form_object,defs_object:{},parent_element:this.parent_element,allowed_attr:"node node_type node_attr node_children next_nodes prev_nodes attributes children text repeat".split(" "),built_form:null,regex:{primitive_ouput_value:/\{([a-z-]+)\}/g,primitive_input_key:/^\$([a-z-]+)$/,array_output_set:/\{\{([a-z-]+)\}\}/g,array_output_value:/\{([a-z-]+)\.([a-z-]+)\}/g,array_input_key:/^\$\$([a-z-]+)$/}}; -FormBuilder.formatFormObject=function(a){if(a.hasOwnProperty("children"))for(var b in a.children)a.children[b].parent=a,FormBuilder.formatFormObject(a.children[b]);return a};FormBuilder.replaceStatements=function(a,b){for(var c in a)"string"==typeof a[c]&&(/a/.exec(a[c]),console.log(RegExp.$0));return a}; +FormBuilder.formatFormObject=function(a){if(a.hasOwnProperty("children"))for(var d in a.children)a.children[d].parent=a,FormBuilder.formatFormObject(a.children[d]);return a};FormBuilder.replaceStatements=function(a,d){for(var e in a)if("string"==typeof a[e]){for(var b=FormBuilder.prototype.regex.primitive_ouput_value,c=[];null!==c[c.push(b.exec(a[e]))-1];);for(b=0;b