4 * Documentation - designed to generate HTML+Docbook!?!
6 Roo.doc = Roo.doc || {};
10 * @extends Roo.bootstrap.Component
11 * Entry Element class - describes a method etc...
12 * @cfg name {String} name of method
13 * @cfg purpose {String} short description of method.
17 * @param {Object} config The config object
22 Roo.doc.Entry = function(config){
23 Roo.doc.Entry.superclass.constructor.call(this, config);
24 //this.el = Roo.get(document.body);
25 var body = Roo.get(document.body);
33 Roo.mailer.Body._calls++;
34 if (Roo.mailer.Body._calls > 1) {
37 // call onRender once... and block next call...?
39 this.onRender = function() { };
43 Roo.doc.Entry._calls = 0;
45 Roo.extend(Roo.doc.Entry, Roo.bootstrap.Component, {
51 getAutoCreate : function(){
74 addxtype : function (tree, cntr)
76 return this.addxtypeChild(tree,cntr);
92 * @class Roo.doc.Example
93 * @extends Roo.bootstrap.Component
94 * Example Element class
95 * @cfg {String} lang (phpcode|programlisting) section type.
100 * Create a new Synopsis
101 * @param {Object} config The config object
104 Roo.doc.Example = function(config){
105 Roo.doc.Example.superclass.constructor.call(this, config);
108 Roo.extend(Roo.doc.Example, Roo.bootstrap.Component, {
114 getAutoCreate : function(){
116 // no colour highlighting in here....
125 html : String.format('{0}',this.code).replace(/\n/g, '<br/>')
147 * @class Roo.doc.Para
148 * @extends Roo.bootstrap.Component
149 * Param Element class
153 * Create a new Paragraph
154 * @param {Object} config The config object
157 Roo.doc.Para = function(config){
158 Roo.doc.Para.superclass.constructor.call(this, config);
161 Roo.extend(Roo.doc.Para, Roo.bootstrap.Component, {
164 getAutoCreate : function(){
166 //?? this is the synopsis type....
168 // this is not very fancy...
176 if (this.parent().is_list) {
203 * @class Roo.doc.Param
204 * @extends Roo.bootstrap.Component
205 * Param Element class
206 * @cfg {bool} is_optional is the argument optional
207 * @cfg {String} type argument type
208 * @cfg {String} name name of the parameter
209 * @cfg {String} desc short description
210 * @cfg {String} defaultvalue default value
214 * @param {Object} config The config object
217 Roo.doc.Param = function(config){
218 Roo.doc.Param.superclass.constructor.call(this, config);
221 Roo.extend(Roo.doc.Param, Roo.bootstrap.Component, {
229 getAutoCreate : function(){
231 //?? this is the synopsis type....
234 if (this.parent().stype == 'parameter') {
245 html : this.type + ' ' + this.name
254 if (this.parent().stype == 'return') {
271 // this is not very fancy...
276 is_optional ? '[' : '',
280 this.defaultvalue == '' ? '' : ' = ',
282 ',' // not really.. but let's do it anyway...
307 * @class Roo.doc.Section
308 * @extends Roo.bootstrap.Component
309 * SectionElement class
310 * @cfg {String} stype (desc|parameter|return|note|example) section type.
313 * Create a new Synopsis
314 * @param {Object} config The config object
317 Roo.doc.Section = function(config){
318 Roo.doc.Section.superclass.constructor.call(this, config);
321 Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, {
326 getAutoCreate : function(){
336 html : this.stype.charAt(0).toUpperCase() + this.stype.slice(1) //ucfirst
340 if (this.stype == 'parameter') {
342 // db package uses variable list here... - it results in dd/dl but the layout is messed up..
345 cls: 'itemizedlist roo-params'
352 getChildContainer : function(build_call)
355 if (this.stype == 'parameter') {
356 return this.el.select('.roo-params',true).first();
373 * @class Roo.doc.Synopsis
374 * @extends Roo.bootstrap.Component
375 * Synopsis Element class
376 * @cfg {String} returntype return value
377 * @cfg {String} name title really..
378 * @cfg {String} stype (function|constant)
381 * Create a new Synopsis
382 * @param {Object} config The config object
385 Roo.doc.Synopsis = function(config){
386 Roo.doc.Synopsis.superclass.constructor.call(this, config);
389 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component, {
396 getAutoCreate : function(){
400 cls : 'refsynopsisdiv',
409 cls : 'funcprototype',
411 this.returntype + ' ',
436 getChildContainer : function(build_call)
440 return this.el.select('.roo-params',true).first();