docs/Roo.docs.init.js
[roojs1] / docs / Roo.docs.init.js
index 239025f..e9932a7 100644 (file)
@@ -20,9 +20,14 @@ Roo.docs.init = {
             
             //Roo.XComponent.modules[0].el.fireEvent('render');
             this.loadTree();
+            if (window.location.search.length > 0) {
+                Roo.docs.roo_title.el.dom.innerHTML = "Flutter Documentation";
+            }
+            
         }, this);
         if (window.location.search.length > 0) {
-            this.prefix = window.location.search.substring(1);
+            this.prefix = "/flutter/";
+            
         }
         
         window.onhashchange = function() { Roo.docs.init.onHashChange(); }
@@ -42,6 +47,9 @@ Roo.docs.init = {
                 var d = Roo.decode(res.responseText);
                 //Roo.log(d);
                 this.classes = {};
+                
+                d = d.sort(Roo.docs.template.makeSortby("name"));
+                
                 // our classes witch children first..
                 d.forEach(function(e) {
                     if (e.cn.length) {
@@ -121,7 +129,7 @@ Roo.docs.init = {
                     
                     ev.stopEvent();
                      
-                    if (c.cn.length && !Roo.docs.init.prefix.length) {
+                    if (c.cn.length && mi.xtype == 'MenuItem') {
                         //Roo.log(ev);
                         if (mi.menu.el.hasClass('show')) {
                             this.hideChildren(c); //mi.menu.hide();
@@ -271,8 +279,14 @@ Roo.docs.init = {
             {
                 
                 var d = Roo.decode(res.responseText);
-                if (this.prefix.length) {
-                    this.fillAugments(d, Roo.docs.init.fillDoc);
+                
+                if (typeof(d.augments) == 'undefined') {
+                    d.augments = [];
+                    d.config = []; // props for ctor?
+                    d.isFlutter  = true;
+                    d.config= d.props; // hack..
+                    Roo.docs.init.n = 0;
+                    this.fillAugments(d, d.extends, Roo.docs.init.fillDoc);
                     return;
                 }
                 this.fillDoc(d);
@@ -284,20 +298,38 @@ Roo.docs.init = {
         });
         
     },
-    fillAugments : function(d, cb)
+    n : 0,
+    fillAugments : function(d, ext, cb )
     {
-        if (!d.extends.lenght) {
-            cb(d)
+        Roo.docs.init.n++;
+        if (Roo.docs.init.n > 20) {
+            return;
         }
-        Roo.Ajax.request({
-            url : this.prefix + 'symbols/' + d.extends + '.json',
+        if (!ext.length) {
+            cb(d);
+            return;
+        }
+        var next = ext.shift();
+        d.augments.push(next);
+        var ax =   new Roo.data.Connection({});
+        ax.request({
+            url : this.prefix + 'symbols/' + next + '.json',
             method : 'GET',
             success : function(res, o)
             {
                 
                 var r = Roo.decode(res.responseText);
-                // copy methods that are not constructors..
+                
+                
+                    // copy methods that are not constructors..
+                
                 r.methods.forEach(function(m) {
+                    
+                    if (d.methods.find(function(e) {
+                        return e.name == m.name;
+                    })) {
+                        return;
+                    }
                     if (m.isConstructor || m.static) {
                         return;
                     }
@@ -308,13 +340,27 @@ Roo.docs.init = {
                     if (m.isConstant) {
                         return;
                     }
+                    if (d.props.find(function(e) {
+                        return e.name == m.name;
+                    })) {
+                        return;
+                    }
+                    
                     d.props.push(m);  
                 });
                 
                 r.events.forEach(function(m) {
-                    
+                    if (d.events.find(function(e) {
+                        return e.name == m.name;
+                    })) {
+                        return;
+                    }
                     d.events.push(m);  
                 });
+             
+            
+            
+                this.fillAugments(d,ext, cb)
                 
             },
             scope : this
@@ -337,6 +383,17 @@ Roo.docs.init = {
             "config" : [
               {
         */
+        
+        Roo.docs.classType.el.dom.firstChild.textContent  = 'Class ';
+        if (d.isAbstract) {
+            Roo.docs.classType.el.dom.firstChild.textContent  = 'abstract class ';
+        }
+        if (d.is_enum) {
+            Roo.docs.classType.el.dom.firstChild.textContent  = 'enum ';
+        }
+        if (d.is_mixin) {
+            Roo.docs.classType.el.dom.firstChild.textContent  = 'mixin ';
+        }
         document.body.scrollTop  = 0;
         Roo.docs.doc_name.el.dom.innerHTML = Roo.docs.template.resolveLinks(d.name);
         Roo.docs.doc_desc.el.dom.innerHTML = Roo.docs.template.summary(d);
@@ -346,8 +403,13 @@ Roo.docs.init = {
             Roo.docs.doc_extends.show();
             Roo.docs.doc_extends_sep.show();
             Roo.docs.doc_extends.el.dom.innerHTML = d.augments[0];
+            Roo.docs.doc_extends.el.dom.href= '#' + d.augments[0];
         }
         Roo.docs.doc_source.el.dom.innerHTML = d.name.replace(/\./g,"/") + ".js";
+        if (Roo.docs.init.prefix.length) {
+            Roo.docs.doc_source_row.hide();
+        }
+        
         
         if (d.augments.length) {
             Roo.docs.augments.show();
@@ -356,6 +418,12 @@ Roo.docs.init = {
             Roo.docs.augments.hide();
         }
         
+        if (d.realImplementors.length) {
+            Roo.docs.implementors.show();
+            Roo.docs.implementors.bodyEl().dom.innerHTML = Roo.docs.template.implementors(d);
+        } else {
+            Roo.docs.implementors.hide();
+        }
         
         
         Roo.docs.configTableContainer.hide();