Roo/doc/Param.js
authorAlan Knowles <alan@roojs.com>
Thu, 8 Sep 2016 09:02:03 +0000 (17:02 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 8 Sep 2016 09:02:03 +0000 (17:02 +0800)
Roo/doc/Param.js [new file with mode: 0644]

diff --git a/Roo/doc/Param.js b/Roo/doc/Param.js
new file mode 100644 (file)
index 0000000..31a4b30
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * - LGPL
+ *
+ */
+
+/**
+ * @class Roo.doc.Param
+ * @extends Roo.bootstrap.Component
+ * Param Element class
+ * @cfg {bool} is_optional 
+ * @cfg {String} type  argument type
+ * @cfg {String} name
+ * @cfg {String} desc  short description
+ * @cfg {String} defaultvalue default value
+ * 
+ * @constructor
+ * Create a new Param
+ * @param {Object} config The config object
+ */
+
+Roo.mailer.Param = function(config){
+    Roo.mailer.Param.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.mailer.Param, Roo.bootstrap.Component,  {
+    
+    is_optional : false,
+    type : '',
+    name: '',
+    defaultvalue:   '',
+    desc: '',
+     
+    getAutoCreate : function(){
+        
+        //?? this is the synopsis type....
+        
+        
+        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
+                    ]
+                }
+                
+         }
+       
+        
+        
+        // this is not very fancy...
+        
+        var cfg ={
+            tag: 'span',
+            cn : [
+                is_optional ? '[' : '',
+                this.type,
+                ' ',
+                this.name,
+                this.defaultvalue == '' ? '' : ' = ',
+                this.defaultvalue,
+                ',' // not really.. but let's do it anyway...
+            ]
+        }
+         
+        
+        
+       
+        return cfg;
+    }
+     
+    
+    
+    
+    
+   
+});
+
+
\ No newline at end of file