Roo.docs.init = {
+ classes : false, // flat version of list of classes
+ currentClass : '', // currently viewed class name
+
+
onReady : function()
{
//Roo.XComponent.modules[0].el.fireEvent('render');
this.loadTree();
}, this);
-
+ Roo.get(document.body).on('click', this.onClick, this);
},
{
var d = Roo.decode(res.responseText);
Roo.log(d);
+ this.classes = [];
+ // our classes witch children first..
d.forEach(function(e) {
if (e.cn.length) {
this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem');
+
}
}, this);
+
d.forEach(function(e) {
if (!e.cn.length) {
this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem');
var roo = Roo.docs.navGroup.items[1].menu;
roo.show(roo.triggerEl, '?', false);
+
},
scope : this
});
},
addTreeItem : function(parent, e, type) {
+
+ this.classes[e.name] = e;
// add a node..
var node = parent.addxtypeChild(Roo.factory({
html: e.name.split('.').pop(),
}, this);
},
+
+ loadClass : function(name)
+ {
+ if(typeof(this.classes[name]) != 'undefined') {
+ this.loadDoc(this.classes[name]);
+ }
+
+
+
+ },
+
+ loadSource : function( )
+ {
+
+
+ Roo.Ajax.request({
+ url : 'src/' +this.currentClass.replace(/\./g,'_') + '.js.html',
+ method : 'GET',
+ success : function(res, o)
+ {
+ Roo.docs.ViewSource.show({
+ source : res.responseText,
+ fname : this.currentClass.replace(/\./g,'/') + ".js"
+ });
+
+ },
+ scope : this
+ });
+
+
+ },
+
loadDoc : function(cls)
{
Roo.docs.doc_body_content.hide();
},
+
fillDoc : function(d)
{
/*{
document.body.scrollTop = 0;
for (var k in d) {
if (typeof(Roo.docs['doc_' + k]) != 'undefined') {
- Roo.docs['doc_' + k].el.dom.innerHTML = d[k].split("\n").join("<br/>");
+ Roo.docs['doc_' + k].el.dom.innerHTML = Roo.docs.template.resolveLinks(d[k]);;
}
}
Roo.docs.doc_extends.hide();
}
+ },
+ onClick : function(e)
+ {
+ if (e.target.nodeName != 'A') {
+ return;
+ }
+ if (!e.target.href.match(/#/)) {
+ return;
+ }
+ e.stopPropagation();
+ var link = e.target.href.split('#')[1];
+ this.loadClass(link);
+
}