From 6cdf09812dd13531acb29f1413de87ce7cd5218f Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 22 Nov 2011 16:00:48 +0100 Subject: Builders and collections for fields and widgets Introduced IPA.field_container and IPA.widget_container. IPA.field_container: collection for fields. Can set logical container (facet, dialog...) to fields. IPA.widget_container: collection for widgets. Has basic searching capability withing widget tree. Introduced field_builder, widget_builder, section_builder, details_builder. All are used for building fields and widgets. Field_builder and widget_builder have the main building logic. Section_builder can create content based on current section spec. Details builder defines a strategy for building content. https://fedorahosted.org/freeipa/ticket/2040 --- install/ui/field.js | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'install/ui/field.js') diff --git a/install/ui/field.js b/install/ui/field.js index fb14f2eb..c1b74ab5 100644 --- a/install/ui/field.js +++ b/install/ui/field.js @@ -572,6 +572,103 @@ IPA.link_field = function(spec) { return that; }; +IPA.field_container = function(spec) { + + spec = spec || {}; + + var that = {}; + + that.container = spec.container; //usually facet or dialog + + that.fields = $.ordered_map(); + + that.get_field = function(name) { + return that.fields.get(name); + }; + + that.get_fields = function(name) { + return that.fields.values; + }; + + that.add_field = function(field) { + field.container = that.container; + that.fields.put(field.name, field); + }; + + that.widgets_created = function() { + var fields = that.fields.values; + + for (var i=0; i