Made a slight change to window position randomization; now only non-modal windows...
[philo.git] / contrib / gilbert / media / gilbert / lib / ui / windows.js
1 Gilbert.lib.ui.DjangoForm = Ext.extend(Ext.FormPanel, {
2         initComponent: function () {
3                 /*if (this.djangoFields) {
4                         this.initDjangoForm();
5                 }*/
6                 Gilbert.lib.ui.DjangoForm.superclass.initComponent.call(this);
7         },
8 /*      initDjangoForm: function () {
9                 this.items = this.items || [];
10                 Ext.each(this.djangoFields, this.addDjangoField, this);
11         },
12         addDjangoField: function(field, index, all) {
13                 this.items.push(Gilbert.lib.ui.DjangoFormHelper.get_field_converter(field.type)(field));
14         },*/
15 });
16
17
18 Gilbert.lib.ui.HTMLWindow = Ext.extend(Ext.Window, {
19         html_source: undefined,
20         onRender: function() {
21                 if (this.html_source) {
22                         this.bodyCfg = {
23                                 tag: 'iframe',
24                                 cls: this.bodyCls,
25                         };
26                         Gilbert.lib.ui.HTMLWindow.superclass.onRender.apply(this, arguments);
27                         var iframe = this.body.dom;
28                         var doc = iframe.document;
29                         if (iframe.contentDocument) {
30                                 doc = iframe.contentDocument;
31                         } else if (iframe.contentWindow) {
32                                 doc = iframe.contentWindow.document;
33                         }
34                         doc.open();
35                         doc.writeln(this.html_source);
36                         doc.close();
37                 } else {
38                         Gilbert.lib.ui.HTMLWindow.superclass.onRender.apply(this, arguments);
39                 }
40         }
41 });