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     is_constructor : false,
35     
36     getAutoCreate : function(){
37         
38         var syn = this.items[0]; // hopefully...
39         
40         
41         
42         var nmp = (this.is_static ? '' : '$') +
43             this.memberof +
44             (this.is_static ? '::' : '->');
45             
46         var nm = this.name;
47         // this should probably do the params....?? then we need to disable the rendering..
48         if () {
49             
50         }
51         
52          
53         var cfg ={
54             tag: 'h5',
55             cls : 'refsynopsisdiv',
56             cn : [
57                 {
58                     cls: 'funcsynopsis',
59                     cn: [
60                         {
61                             tag: 'p',
62                             cn: {
63                                 tag:'code',
64                                 cls : 'funcprototype',
65                                 cn: [
66                                     this.returntype + ' ' + nmp,
67                                     {
68                                         tag: 'strong',
69                                         cls : this.stype,
70                                         html : nm
71                                     },
72                                     '(',
73                                     {
74                                         tag: 'span',
75                                         cls : 'roo-params'
76                                     },
77                                     ')'
78                                 ]
79                                 
80                             }
81                         }
82                     ]
83                 }
84                 
85             ]
86         };
87         
88         
89         
90         return cfg;
91     },
92     getChildContainer : function(build_call)
93     {
94          
95         
96         return this.el.select('.roo-params',true).first();
97     }
98     
99     
100     
101     
102    
103 });
104
105  
106
107