1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 modKey : '001-Pman.Tab.BuilderView',
12 module : Pman.Tab.BuilderView,
14 parent : Pman.Tab.BuilderTab,
15 name : "Pman.Tab.BuilderView",
21 Pman.Tab.BuilderView = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
34 xtype: 'ContentPanel',
37 activate : function (_self)
44 clearAll : function(isAuto) {
45 // this.renderObj = { isBuilder : true };
49 this.scroll = this.panelroot.el.getScroll();
50 this.layout.remove('center', this.panelroot);
51 this.panelroot = false;
53 if (this.dialogroot) {
54 this.dialogroot.remove();
55 this.dialogroot = false;
58 munge : function(cfg) {
65 if (typeof(cfg.background) != 'undefined') {
66 cfg.background = false;
71 // key is not string?!?!?!!?
72 if (typeof(p) != 'string') {
76 if (typeof(cfg[p]) == 'object') { // listeners!!!
81 if (p.charAt(0) == '|') {
88 if (str.match(/\s*function/)) {
89 var btz = str.split('{');
90 str = btz.shift() +'{ try {' + btz.join('{') +
91 ' catch (e) { Roo.log(e) } }';
95 var _this = this.renderObj; /// fake '_this' object..
96 // stupid IE can not return objects evaluated..
103 eval('_tmp =(' + str + ')');
104 cfg[p.substr(1)] = _tmp;
105 //if (typeof(_tmp) == 'undefined') {
109 } catch(e) { console.log('Error evaluating: ' + str); };
116 if ((p.charAt(0) == '*') || (p.charAt(0) == '+')) {
123 // now for all the children.. (items)
124 if (xitems === false) {
128 for (var i = 0; i < xitems.length; i++) {
129 // if +builderhide set !!!! drop it!!
133 if (typeof(xi['*prop']) != 'undefined') {
134 var pr = xi['*prop'];
136 // if prop is an array - then it's items are really the value..
137 if (pr.match(/\[\]$/)) {
138 pr = pr.replace(/\[\]$/, '');
139 if (typeof(cfg[pr]) == 'undefined') {
145 if (xi.xtype && xi.xtype == 'Array') {
158 if (cfg.items.length == 0) {
164 redraw : function(isAuto)
167 // top level is not relivant
169 // var btop = Pman.Tab.BuilderTop2;
170 // if (isAuto && btop.redrawBtn && !btop.redrawBtn.auto) {
171 // return; /// auto redraw is turned off..
174 this.clearAll(isAuto);
176 var cfg = this.toJS();
182 this.munge(cfg.items[0]);
184 // we draw either a dialog or a tab..
186 if (cfg.items[0].xtype == 'LayoutDialog') {
188 cfg.items[0].modal = false;
189 var xy = this.el.getXY();
190 cfg.items[0].x = xy[0];
191 cfg.items[0].y = xy[1];
192 cfg.items[0].constraintoviewport = false;
194 this.dialogroot = Roo.get( document.body).createChild();
196 this.dialog = new Roo[cfg.items[0].xtype](this.dialogroot, cfg.items[0]);
197 this.dialog.el.on('click', this.panelClick, this);
203 // force center region..
204 cfg.items[0].region = 'center';
205 cfg.items[0].background = false;
207 this.panelroot = this.layout.addxtype(cfg.items[0]);
210 //this.highlightElement(Pman.Tab.BuilderTree.currentNode);
212 if (this.panelroot.el) {
213 this.panelroot.el.scrollTo('top', this.scroll.top);
214 this.panelroot.el.scrollTo('left', this.scroll.left);
219 var bt = Pman.Tab.BuilderTree.tree;
221 return this.toJS(bt.root);
225 var ret = bt.cloneConfig(n.elConfig);
227 // flag to prevent rendering..
228 if ((typeof(ret['+buildershow']) != 'undefined') && !ret['+buildershow']) {
232 ret.id = typeof(ret.id) == 'undefined' ? 'builder-' + n.id : ret.id;
234 if (n.childNodes.length) {
236 n.eachChild(function(cn) {
237 var add = _this.toJS(cn);
250 this.layout = this.panel.layout;