Roo/doc/Synopsis.js
[roojs1] / Roo / doc / Synopsis.js
1 /*
2  * - LGPL
3  *
4  */
5
6 /**
7  * @class Roo.doc.Synopsis
8  * @extends Roo.bootstrap.Component
9  * Synopsis Element class
10  * @cfg {String} returntype return value
11  * @cfg {String} returndesc description of return value. (used in the return section if set..)
12  * @cfg {String} name title really..
13  * @cfg {String} stype (function|constant)
14  * @cfg {String} memberof class name
15  * @cfg {bool} is_static is a static member
16  * @cfg {bool} is_constructor is a static member
17  * 
18  * @constructor
19  * Create a new Synopsis
20  * @param {Object} config The config object
21  */
22
23 Roo.doc.Synopsis = function(config){
24     Roo.doc.Synopsis.superclass.constructor.call(this, config);
25 };
26
27 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component,  {
28     
29     memberof : '',
30     is_static : false,
31     returntype : '',
32     returndesc : '',
33     name: '',
34     stype:   'function',
35     is_constructor : false,
36     
37     getAutoCreate : function(){
38         
39         var syn = this.items[0]; // hopefully...
40         
41         
42         
43         var nmp = (this.is_static ? '' : '$') +
44             this.memberof +
45             (this.is_static ? '::' : '->');
46             
47         var nm = this.name;
48         // this should probably do the params....?? then we need to disable the rendering..
49         if () {
50             
51         }
52         
53          
54         var cfg ={
55             tag: 'h5',
56             cls : 'refsynopsisdiv',
57             cn : [
58                 {
59                     cls: 'funcsynopsis',
60                     cn: [
61                         {
62                             tag: 'p',
63                             cn: {
64                                 tag:'code',
65                                 cls : 'funcprototype',
66                                 cn: [
67                                     this.returntype + ' ' + nmp,
68                                     {
69                                         tag: 'strong',
70                                         cls : this.stype,
71                                         html : nm
72                                     },
73                                     '(',
74                                     {
75                                         tag: 'span',
76                                         cls : 'roo-params'
77                                     },
78                                     ')'
79                                 ]
80                                 
81                             }
82                         }
83                     ]
84                 }
85                 
86             ]
87         };
88         
89         
90         
91         return cfg;
92     },
93     getChildContainer : function(build_call)
94     {
95          
96         
97         return this.el.select('.roo-params',true).first();
98     }
99     
100     
101     
102     
103    
104 });
105
106  
107
108