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                     this.setValue('<b>test</b>');
33                 }
34             },
35             items : [
36                  {
37                     xtype : 'Container',
38                     cls : 'content',
39                     xns : Roo.bootstrap,
40                     style : 'margin-top:100px',
41                     items : [
42                         {
43                             xtype : 'Container',
44                             cls : 'pad-wrapper',
45                             xns : Roo.bootstrap,
46                             items : [
47                                 {
48                                     xtype : 'Container',
49                                     cls : 'container alpha',
50                                     xns : Roo.bootstrap,
51                                     items : [
52                                         {
53                                             level : 4,
54                                             xtype : 'Header',
55                                             html : 'Inline Editor',
56                                             xns : Roo.bootstrap
57                                         },
58                                         {
59                                             xtype : 'Panel',
60                                             xns : Roo.bootstrap.editor,
61                                             width : 1000,
62                                             height : 1000,
63                                             name : 'email-inline-editor',
64                                             stylesheets : (function(){
65                                                 var css = [];
66                                                 
67                                                 css.push(rootURL + '/roojs1/css-bootstrap/bootstrap.css');
68                                                 css.push(rootURL + '/roojs1/css-bootstrap/font-awesome.css');
69                                                 css.push(rootURL + '/Campaign/editor/editor.css');
70                                                 
71                                                 return css;
72                                             })(),
73                                             items : [
74                                                 {
75                                                     xtype : 'TextBlock',
76                                                     xns : Roo.bootstrap.editor,
77                                                     listeners : {
78                                                         render : function (_self)
79                                                         {
80                                                             _this.block1 = _self;
81                                                         }
82                                                     }
83                                                 },
84                                                 {
85                                                     xtype : 'ImageBlock',
86                                                     xns : Roo.bootstrap.editor,
87                                                     style : 'margin-top:20px;',
88                                                     listeners : {
89                                                         render : function (_self)
90                                                         {
91                                                             _this.block2 = _self;
92                                                         }
93                                                     }
94                                                 }
95                                             ]
96                                         }
97                                         
98                                     ]
99
100                                 }
101                             ]
102
103                         }
104                     ]
105
106                 }
107             ]
108         };
109     }
110 });