examples/bootstrap/Editor.js
[roojs1] / examples / bootstrap / Editor.js
1
2
3 Roo.example = Roo.example || {};
4
5 Roo.example.Editor = new Roo.XComponent({
6     part     :  ["layout","viewpanel"],
7     order    : '001-viewpanel',
8     region   : '',
9     parent   : '#bootstrap',
10     name     : "unnamed module",
11     disabled : false, 
12     permname : '', 
13     _tree : function()
14     {
15         this.parent = {
16             el : new Roo.bootstrap.Body()
17         }
18         this.parent.el.layout = false;
19         this.parent.el.render(document.body);
20         
21         var _this = this;
22         var MODULE = this;
23         var baseURL = '/web.campaign/index.local.php';
24         
25         Roo.log('getting data : ' + baseURL + '/CampaignEdit/237');
26         Roo.Ajax.request({
27             url : baseURL + '/CampaignEdit/237',
28             method: 'GET',
29             params: {
30                 _editor : 1
31             },
32             success : function(r)
33             {
34                 Roo.log(r);
35             }
36         });
37         
38         return {
39             xtype: 'Body',
40             xns: Roo.bootstrap,
41             items : [
42                  {
43                     xtype : 'Container',
44                     cls : 'content',
45                     xns : Roo.bootstrap,
46                     style : 'margin-top:100px',
47                     items : [
48                         {
49                             xtype : 'Container',
50                             cls : 'pad-wrapper',
51                             xns : Roo.bootstrap,
52                             items : [
53                                 {
54                                     xtype : 'Container',
55                                     cls : 'container alpha',
56                                     xns : Roo.bootstrap,
57                                     items : [
58                                         {
59                                             level : 4,
60                                             xtype : 'Header',
61                                             html : 'Inline Editor',
62                                             xns : Roo.bootstrap
63                                         },
64                                         {
65                                             xtype : 'Panel',
66                                             xns : Roo.bootstrap.editor,
67                                             width : 1000,
68                                             height : 1000,
69                                             name : 'email-inline-editor',
70                                             stylesheets : (function(){
71                                                 var css = [];
72                                                 
73                                                 css.push(rootURL + '/roojs1/css-bootstrap/bootstrap.css');
74                                                 css.push(rootURL + '/roojs1/css-bootstrap/font-awesome.css');
75                                                 css.push(rootURL + '/Campaign/editor/editor.css');
76                                                 
77                                                 return css;
78                                             })(),
79                                             items : [
80                                                 {
81                                                     xtype : 'TextBlock',
82                                                     xns : Roo.bootstrap.editor,
83                                                     listeners : {
84                                                         render : function (_self)
85                                                         {
86                                                             _this.block1 = _self;
87                                                         }
88                                                     }
89                                                 },
90                                                 {
91                                                     xtype : 'ImageBlock',
92                                                     xns : Roo.bootstrap.editor,
93                                                     style : 'margin-top:20px;',
94                                                     listeners : {
95                                                         render : function (_self)
96                                                         {
97                                                             _this.block2 = _self;
98                                                         }
99                                                     }
100                                                 }
101                                             ]
102                                         }
103                                         
104                                     ]
105
106                                 }
107                             ]
108
109                         }
110                     ]
111
112                 }
113             ]
114         };
115     }
116 });