remove debugging code
[roojs1] / Roo / doc / Param.js
index 31a4b30..3e7b009 100644 (file)
@@ -7,9 +7,9 @@
  * @class Roo.doc.Param
  * @extends Roo.bootstrap.Component
  * Param Element class
- * @cfg {bool} is_optional 
+ * @cfg {bool} is_optional is the argument optional
  * @cfg {String} type  argument type
- * @cfg {String} name
+ * @cfg {String} name name of the parameter
  * @cfg {String} desc  short description
  * @cfg {String} defaultvalue default value
  * 
  * @param {Object} config The config object
  */
 
-Roo.mailer.Param = function(config){
-    Roo.mailer.Param.superclass.constructor.call(this, config);
+Roo.doc.Param = function(config){
+    Roo.doc.Param.superclass.constructor.call(this, config);
 };
 
-Roo.extend(Roo.mailer.Param, Roo.bootstrap.Component,  {
+Roo.extend(Roo.doc.Param, Roo.bootstrap.Component,  {
     
     is_optional : false,
     type : '',
@@ -34,6 +34,7 @@ Roo.extend(Roo.mailer.Param, Roo.bootstrap.Component,  {
         
         //?? this is the synopsis type....
         
+        var desc = Roo.Markdown.toHtml(this.desc);
         
         if (this.parent().stype == 'parameter') {
             
@@ -48,7 +49,7 @@ Roo.extend(Roo.mailer.Param, Roo.bootstrap.Component,  {
                                 tag: 'code',
                                 html : this.type + ' ' + this.name
                             },
-                            this.desc
+                            desc
                         ]
                     }
                 ]
@@ -64,9 +65,9 @@ Roo.extend(Roo.mailer.Param, Roo.bootstrap.Component,  {
                             tag: 'code',
                             html : this.type
                         },
-                        this.desc
+                        desc
                     ]
-                }
+                };
                 
          }
        
@@ -77,21 +78,50 @@ Roo.extend(Roo.mailer.Param, Roo.bootstrap.Component,  {
         var cfg ={
             tag: 'span',
             cn : [
-                is_optional ? '[' : '',
+                this.is_optional ? '[' : '',
                 this.type,
                 ' ',
-                this.name,
+                {
+                    tag : 'b',
+                    html : this.name
+                },
                 this.defaultvalue == '' ? '' : ' = ',
                 this.defaultvalue,
+                this.is_optional ? ']' : '',
                 ',' // not really.. but let's do it anyway...
             ]
-        }
+        };
          
         
         
        
         return cfg;
+    },
+    getAutoCreateParamSection : function()
+    {
+        var desc = Roo.Markdown.toHtml(this.desc);
+        
+      
+        return {
+               tag : 'li',
+               cn : [
+                   {
+                       tag : 'p',
+                       cls: 'para',
+                       cn : [
+                           {
+                               tag: 'code',
+                               html : this.type + ' ' + this.name
+                           },
+                           desc
+                       ]
+                   }
+               ]
+           };
+        
+        
     }
+