try and get ctrl-enter to add a clear all
[roojs1] / docs / Roo.docs.ViewSource.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Roo.docs');
6
7 Roo.docs.ViewSource= function() {}
8 Roo.apply(Roo.docs.ViewSource.prototype, {
9
10  _strings : {
11   'd3d2e617335f08df83599665eef8a418' :"Close",
12   '89babd10371e21bb9eaf39937de7c656' :"View Source"
13  },
14
15  dialog : false,
16  callback:  false,
17
18  show : function(data, cb)
19  {
20   if (!this.dialog) {
21    this.create();
22   }
23
24   this.callback = cb;
25   this.data = data;
26   this.dialog.show(this.data._el);
27   if (this.form) {
28    this.form.reset();
29    this.form.setValues(data);
30    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
31   }
32
33  },
34
35  create : function()
36  {
37   var _this = this;
38   this.dialog = Roo.factory({
39     xtype : 'Modal',
40     fitwindow : true,
41     max_width : 900,
42     size : 'xl',
43     title : _this._strings['89babd10371e21bb9eaf39937de7c656'] /* View Source */,
44     listeners : {
45      show : function (_self)
46       {
47         //  if(_this.data.buttonText){
48           //    _this.acceptBtn.setText(_this.data.buttonText);
49          // }
50           
51           if (typeof( _this.data.source) == 'undefined') {
52               Roo.Ajax.request({
53                   url : _this.data.src,
54                   method : 'GET',
55                   success : function(res, o)
56                   {
57                       Roo.docs.ViewSource.show({
58                           source : String.format("<PRE>{0}</PRE>",res.responseText),
59                           fname : _this.data.src.split('/').pop()
60                       });
61                       
62                   },
63                   scope : this
64               });
65               
66           
67               return;
68           }
69            
70         _this.body_ctr.el.dom.innerHTML = _this.data.source;
71        _this.body_ctr.el.dom.scrollTop = 0;
72        _this.dialog.setTitle("View Source: " + _this.data.fname);
73           _this.dialog.el.setStyle('zIndex', '10002');
74           
75       }
76     },
77     xns : Roo.bootstrap,
78     '|xns' : 'Roo.bootstrap',
79     buttons : [
80      {
81       xtype : 'Button',
82       html : _this._strings['d3d2e617335f08df83599665eef8a418'] /* Close */,
83       weight : 'primary',
84       listeners : {
85        click : function (_self, e)
86         {
87             _this.dialog.hide();
88          
89             
90         },
91        render : function (_self)
92         {
93             _this.acceptBtn = this;
94             
95         }
96       },
97       xns : Roo.bootstrap,
98       '|xns' : 'Roo.bootstrap'
99      }
100     ],
101     items  : [
102      {
103       xtype : 'Container',
104       style : 'width: 100%;overflow:auto;height:100%;',
105       listeners : {
106        render : function (_self)
107         {
108         _this.body_ctr = this;
109         }
110       },
111       xns : Roo.bootstrap,
112       '|xns' : 'Roo.bootstrap'
113      }
114     ]
115    }  );
116  }
117 });
118 Roo.apply(Roo.docs.ViewSource, Roo.docs.ViewSource.prototype);