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