1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.BuilderSourceEdit = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
37 _this.dialog.layout.getRegion('south').collapse();
40 _this.dialog.layout.getRegion('south').showPanel(0);
41 _this.help = _this.dialog.layout.getRegion('south').getPanel(0).el.createChild( {tag: 'iframe', src : Roo.rootURL + 'docs'});
44 if (_this.isBuilder) {
48 dlg.getLayout().beginUpdate();
49 var w = Roo.lib.Dom.getViewWidth();
50 var h = Roo.lib.Dom.getViewHeight();
51 dlg.resizeTo( w - 70, h - 70);
53 var val = _this.form.findField('value');
54 val.setSize(w-100, h-170);
55 dlg.getLayout().endUpdate();
56 this.setTitle('Callback for ' + _this.data.title);
65 title : "Source Code Edit",
69 xtype: 'ContentPanel',
80 rendered : function (form)
90 fieldLabel : 'Enter Code for Function or Property',
94 specialkey : function (f, e)
99 if (document.selection) { // IE
101 var sel =document.selection.createRange();
105 if (fe.selectionStart || fe.selectionStart == '0') {
106 var startPos = fe.selectionStart;
107 var endPos = fe.selectionEnd;
108 var restoreTop = fe.scrollTop;
109 fe.value = fe.value.substring(0, startPos) +
110 v + fe.value.substring(endPos, fe.value.length);
111 fe.selectionStart = startPos + v.length;
112 fe.selectionEnd = startPos + v.length;
114 fe.scrollTop = restoreTop;
121 if (e.getKey() == 9) {
125 if (e.getKey() == 13) {
132 style : 'font-family:monospace;'
139 xtype: 'ContentPanel',
144 title : "Help / Manual"
148 xtype: 'LayoutRegion',
153 xtype: 'LayoutRegion',
157 resized : function (_self, newSize)
159 var sz = _this.dialog.size;
160 _this.form.findField('value').setSize(sz.width-30, sz.height- newSize - 100);
161 if (_this.help && newSize > 21) {
162 _this.help.setSize(sz.width-25, newSize-28);
165 collapsed : function (_self)
167 this.fireEvent('resized', this, 20);
169 expanded : function (_self)
171 this.fireEvent('resized', this, this.getBox().height);
177 collapsedTitle : 'Help / Manual'
185 click : function (_self, e)
196 click : function (_self, e)
198 _this.callback.call(_this, {
199 value : _this.form.findField('value').getValue()