From 9015d36306c6f20dd6db5861c65ace4e9487e206 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 9 Sep 2016 10:59:37 +0800 Subject: [PATCH] roojs-doc.js roojs-doc-debug.js --- roojs-doc-debug.js | 17 +++++++++++++---- roojs-doc.js | 9 +++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/roojs-doc-debug.js b/roojs-doc-debug.js index 8708eeff93..9df36f48a1 100644 --- a/roojs-doc-debug.js +++ b/roojs-doc-debug.js @@ -282,7 +282,7 @@ Roo.extend(Roo.doc.Param, Roo.bootstrap.Component, { var cfg ={ tag: 'span', cn : [ - is_optional ? '[' : '', + this.is_optional ? '[' : '', this.type, ' ', this.name, @@ -334,6 +334,9 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, { getAutoCreate : function(){ + + + var cfg ={ cls : 'refsection', @@ -342,7 +345,7 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, { { tag: 'h1', cls : 'title', - html : this.stype.charAt(0).toUpperCase() + this.stype.slice(1) //ucfirst + html : Roo.doc.Section.map[this.stype] } ] }; @@ -372,8 +375,14 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, { }); - - /* +Roo.doc.Section.map = { + 'desc' : 'Description', + 'parameter' : 'Parameters', + 'return' : 'Return Value', + 'note' : 'Notes', + 'example' : 'Examples' +} +/* * - LGPL * */ diff --git a/roojs-doc.js b/roojs-doc.js index 3472196ac0..9a2d387aba 100644 --- a/roojs-doc.js +++ b/roojs-doc.js @@ -10,11 +10,12 @@ Roo.doc.Para=function(A){Roo.doc.Para.superclass.constructor.call(this,A);};Roo. ;}return A;}}); // Roo/doc/Param.js 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} -,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:[is_optional?'[':'',this.type,' ',this.name,this.defaultvalue==''?'':' = ',this.defaultvalue,',']};return A;}}); - +,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,' ',this.name,this.defaultvalue==''?'':' = ',this.defaultvalue,',']};return A; +}}); // Roo/doc/Section.js -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:this.stype.charAt(0).toUpperCase()+this.stype.slice(1)} -]};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=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]}]} +;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'}; + // Roo/doc/Synopsis.js 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} ,'(',{tag:'span',cls:'roo-params'},')']}}]}]};return A;},getChildContainer:function(A){return this.el.select('.roo-params',true).first();}}); -- 2.39.2