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  * 
17  * @constructor
18  * Create a new Synopsis
19  * @param {Object} config The config object
20  */
21
22 Roo.doc.Synopsis = function(config){
23     Roo.doc.Synopsis.superclass.constructor.call(this, config);
24 };
25
26 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component,  {
27     
28     memberof : '',
29     is_static : false,
30     returntype : '',
31     returndesc : '',
32     name: '',
33     stype:   'function',
34      
35     getAutoCreate : function(){
36         
37         var syn = this.items[0]; // hopefully...
38         
39         
40         
41         var nmp = (this.is_static ? '' : '$') +
42             this.memberof +
43             (this.is_static ? '::' : '->');
44             
45         
46         // this should probably do the params....?? then we need to disable the rendering..
47         
48          
49         var cfg ={
50             tag: 'h5',
51             cls : 'refsynopsisdiv',
52             cn : [
53                 {
54                     cls: 'funcsynopsis',
55                     cn: [
56                         {
57                             tag: 'p',
58                             cn: {
59                                 tag:'code',
60                                 cls : 'funcprototype',
61                                 cn: [
62                                     this.returntype + ' ' + nmp,
63                                     {
64                                         tag: 'strong',
65                                         cls : this.stype,
66                                         html : this.name
67                                     },
68                                     '(',
69                                     {
70                                         tag: 'span',
71                                         cls : 'roo-params'
72                                     },
73                                     ')'
74                                 ]
75                                 
76                             }
77                         }
78                     ]
79                 }
80                 
81             ]
82         };
83         
84         
85         
86         return cfg;
87     },
88     getChildContainer : function(build_call)
89     {
90          
91         
92         return this.el.select('.roo-params',true).first();
93     }
94     
95     
96     
97     
98    
99 });
100
101  
102
103