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