Roo/doc/Param.js
[roojs1] / roojs-doc.js
1 // Roo/doc/Entry.js
2 Roo.doc=Roo.doc||{};Roo.doc.Entry=function(A){Roo.doc.Entry.superclass.constructor.call(this,A);var B=Roo.get(document.body);B.attr({leftmargin:0,marginwidth:0,topmargin:0,marginheight:0,offset:0});this.onRender(B);this.el=B;};Roo.doc.Entry._calls=0;Roo.extend(Roo.doc.Entry,Roo.bootstrap.Component,{name:'',purpose:'',getAutoCreate:function(){var A={cls:'refentry',cn:[{tag:'h1',cls:'refname',html:this.name}
3 ,{cls:'refnamediv',html:this.purpose}]};return A;},addxtype:function(A,B){return this.addxtypeChild(A,B);},onRender:function(ct,A){Roo.doc.Entry._calls++;if(Roo.doc.Entry._calls>1||!ct){return;}Roo.bootstrap.Component.prototype.onRender.call(this,ct,A);}}
4 );
5 // Roo/doc/Example.js
6 Roo.doc.Example=function(A){Roo.doc.Example.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Example,Roo.bootstrap.Component,{lang:'php',code:'',getAutoCreate:function(){var A={cls:this.lang,cn:[{tag:'code',html:String.format('{0}',this.code).replace(/\n/g,'<br/>')}
7 ]};return A;}});
8 // Roo/doc/Para.js
9 Roo.doc.Para=function(A){Roo.doc.Para.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Para,Roo.bootstrap.Component,{html:'',getAutoCreate:function(){var A={tag:'p',cls:'para',html:this.html};if(this.parent().is_list){return {tag:'li',cls:listitme,cn:[A]}
10 ;}return A;}});
11 // Roo/doc/Param.js
12 Roo.doc.Param=function(A){Roo.doc.Param.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Param,Roo.bootstrap.Component,{is_optional:false,type:'',name:'',defaultvalue:'',desc:'',getAutoCreate:function(){if(this.parent().stype=='parameter'){return {tag:'li',cn:[{tag:'p',cls:'para',cn:[{tag:'code',html:this.type+' '+this.name}
13 ,this.desc]}]};}if(this.parent().stype=='return'){return {tag:'p',cls:'para',cn:[{tag:'code',html:this.type},this.desc]};}var A={tag:'span',cn:[this.is_optional?'[':'',this.type,' ',{tag:'b',html:this.name},this.defaultvalue==''?'':' = ',this.defaultvalue,this.is_optional?']':'',',']}
14 ;return A;}});
15 // Roo/doc/Section.js
16 Roo.doc.Section=function(A){Roo.doc.Section.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Section,Roo.bootstrap.Component,{stype:'',getAutoCreate:function(){var A={cls:'refsection',cn:[{tag:'h1',cls:'title',html:Roo.doc.Section.map[this.stype]}]}
17 ;if(this.stype=='parameter'){A.cn.push({tag:'ul',cls:'itemizedlist roo-params'});}return A;},getChildContainer:function(A){if(this.stype=='parameter'){return this.el.select('.roo-params',true).first();}return this.el;}});Roo.doc.Section.map={'desc':'Description','parameter':'Parameters','return':'Return Value','note':'Notes','example':'Examples'};
18
19 // Roo/doc/Synopsis.js
20 Roo.doc.Synopsis=function(A){Roo.doc.Synopsis.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Synopsis,Roo.bootstrap.Component,{returntype:'',name:'',stype:'function',getAutoCreate:function(){var A={tag:'h2',cls:'refsynopsisdiv',cn:[{cls:'funcsynopsis',cn:[{tag:'p',cn:{tag:'code',cls:'funcprototype',cn:[this.returntype+' ',{tag:'strong',cls:this.stype,html:this.name}
21 ,'(',{tag:'span',cls:'roo-params'},')']}}]}]};return A;},getChildContainer:function(A){return this.el.select('.roo-params',true).first();}});