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