<%function welcome(){ %>
<div class="welcome">
<div class="classblock">
    <div class="classblock-inner">
        <H3>相关资源</H3>
        <UL>
            <LI><A href="http://www.edojs.com/demo/" target="_blank">示例</A></LI>            
            <LI><A href="http://www.edojs.com/tutorial/" target="_blank">教程</A></LI>
            <LI><A href="http://bbs.edojs.com" target="_blank">论坛</A></LI>
            <LI><A href="http://www.edojs.com/faq/" target="_blank">FAQ</A></LI>
        </UL>
    </div>
</div>
<div class="classblock">
    <div class="classblock-inner">
        <H3>高级组件</H3>
        <UL>
            <LI><A href="http://www.edojs.com/ide/" target="_blank">IDE可视化设计器</A></LI>            
            <LI><A href="http://www.edogantt.com" target="_blank">Gantt甘特图</A></LI>            
        </UL>
    </div>
</div> 
<div class="classblock icon-legend">
    <div class="classblock-inner ">
        <H3>Icon Legend</H3>
        <div class="icon-pkg">Package</div>
        <div class="icon-cls">Class</div>
        <div class="icon-static">Singleton</div>
        <div class="icon-method">Method</div>
        <div class="icon-prop">Property</div>
        <div class="icon-event">Event</div>       
    </div>
</div> 
</div>
<%} %>
<%function createInheritance(name){%>
    <%var sbCls = [];%>
    <%while(name){%>
        <%
        var cls = api.getClass(name);
        sbCls.push(cls);
        name = cls.extend;%>
    <%}%>
    <%sbCls.reverse();%>
<div class="classblock">
    <div class="classblock-inner">
        <%var offset = 0;%>
        <%for(var i=0; i<sbCls.length; i++){%>
            <%var cls = sbCls[i];%>
            <div style="margin-bottom:2px;padding-bottom:2px;margin-left:<%=offset%>px;<%if(i!=0){%>background:url(images/elbow-end.gif) no-repeat 0px 3px;padding-left:20px;<%}%>"><a href="javascript:api.showClass('<%=cls.name%>')"><%=cls.shortname%></a></div>
            <%offset+=15%>
        <%}%>
    </div>
</div>
<%} %>
<%function createMethodString(name, params, ret){%>
<div style=" font-size:12px; ">
    <span style="color:#1e4eaa;font-weight:bold; font-size:14px;"><%=name%></span> (  
    <%if(params){%>
        <%for(var i=0,l=params.length; i<l; i++){%>
            <%=params[i].name%>
            <%if(i!=l-1){%> , <%}%>
        <%}%>
    <%}%>      
    ) <%if(ret && ret.type){%> : <%=ret.type%><%}%>
</div>
<%}%>

<%function createDescs(name, list, classname, cls, icon){%>
<%var baseClassName = api.getBaseClassName(cls); %>
<div id="<%=classname%>" style="padding:10px;padding-top:0;padding-right:0;">
<div class="e-tree-expanded" style="height:28px;overflow:hidden;">
    <div onclick="toggletable('<%=classname%>link', this);" class="<%=icon %>" style="font-weight:bold;font-size:14px;line-height:26px;padding-left:0px;background-position:20px center; background-repeat:no-repeat;cursor:pointer;">
        <div class="e-tree-nodeicon" style="position:static;padding-left:42px;"><%=name %></div>        
    </div>    
</div>
<%if(list && list.length>0){%>    
    <table id="<%=classname%>link" class="bd-table" style="width:96%;border-bottom:solid 1px #bbb;" cellpadding="0" cellspacing="0" border="0">
        <tr class="head">
            <td class="td1">&nbsp;</td>
            <td class="td2"><%=name %></td>
            <!--<td class="td3">Defined By</td>-->
        </tr>        
    <%for(var i=0; i<list.length; i++){ %>
        <%var li = list[i];
        var ret = li['return']; %>
        <tr id="<%=li.name %>" <%if(li.definedby != cls.name){ %>class="inherited"<%} %> style="<%if(li.exception){%>display:table-row;<%}%>">
            <td class="td1">&nbsp;</td>
            <td class="td2">                
                <div class="<%=icon %>" style="padding-left:22px;background-repeat:no-repeat;margin:5px;margin-top:2; background-position:2px 5px;">
                <%if(name == 'Methods'){ %>
                    <%=createMethodString(li.name, li.params, ret) %>
                <%}else{ %>
                <div style=" font-weight:bold; color:#1e4eaa;font-size:14px;"><%=li.name %> <%if(li.type){ %>:<%} %> <span style="color:#222;font-weight:normal;font-size:12px;"><%=li.type %></span></div>
                <%} %>
                <%if(li['default']){%><div style="margin-left:10px;color:#999;">默认值 : <%=li['default'] %></div><%} %>
                <%if(li.readOnly){%><div style="margin-left:10px;color:#555;">readOnly</div><%} %>
                <div style="padding-right:20px;margin-left:10px;"><%=li.description %>
                    
                    <div class="mdetail-params" style="margin-top:0; padding-left:15px;">                        
                        <%if(li.params && li.params.length>0){ %>
                            <div style="font-weight:bold;">参数 :</div> 
                            <ul style="margin-top:0;margin-bottom:0;padding-left:20px;">
                                <%for(var j=0;j<li.params.length; j++){ %>
                                    <%var p=li.params[j] %>
                                    <li><code><%=p.name %></code> : <b><%=p.type %></b><div style="margin-left:15px;"><%=p.description %></div></li>
                                <%} %>
                            </ul>
                        <%} %>
                        <%if(li.properties && li.properties.length>0){ %>
                            <div style="font-weight:bold;">参数 :</div> 
                            <ul style="margin-top:0;margin-bottom:0;padding-left:20px;">
                                <%for(var j=0;j<li.properties.length; j++){ %>
                                    <%var p=li.properties[j] %>
                                    <li><code><%=p.name %></code> : <b><%=p.type %></b><div style="margin-left:15px;"><%=p.description %></div></li>
                                <%} %>
                            </ul>
                        <%} %>
                        <%if(ret){ %>
                            <div style="font-weight:bold;">返回值 :</div> 
                            <ul style="margin-top:0;padding-left:20px;"><li><code><%=ret.type %></code><div style="margin-left:15px;"><%=ret.description %></div></li></ul>
                        <%} %>
                    </div>
                </div> 
                </div>               
            </td>
            <!--<td class="td3" valign="top" style="">
                <%if(li.definedby == cls.name){ %>
                    <%=li.definedby %>
                <%}else{ %>
                    <a href="javascript:api.showClass('<%=li.definedby%>')"><%=li.definedby %></a>
                <%} %>            
            </td>-->
        </tr>
    <%} %>
    </table>     
<%}%>

<!--    <%if(baseClassName){ %>
    <div id="<%=classname%>link">
        <div style="padding:8px;padding-left:25px;">
        查看基类<a style="font-weight:bold;font-size:13px;" href="javascript:api.showClass('<%=baseClassName%>')"><%= baseClassName%></a> <%=name %>
        </div>
    </div>
    
    <%} %>-->
</div>    
<%} %>
<div class="classview" style="height:100%;width:100%;overflow:auto;position:relative;">
    <div class="body-wrap" style="position:relative;width:92%;overflow:hidden;padding-top:0;">
        <div>
            <H1 style="width:auto;white-space:nowrap;">Class <span style="color:#1e4eaa;"><%=this.name %></span></H1>
            <TABLE cellSpacing="0"><TBODY><TR>            
                <%if(this.typeName){%><TD class="label">TypeName:</TD><TD class="hd-info"><%=this.typeName%></TD></TR><TR><%} %>
                <TD class="label">Namespace:</TD><TD class="hd-info"><%=this.namespace%></TD></TR><TR>            
                <TD class="label">ClassName:</TD><TD class="hd-info"><%=this.shortname%></TD></TR><TR>
                <%if(this.single){%><TD class="label"> </TD><TD class="hd-info">Single</TD></TR><TR><%} %>
                <%if(this.extend){%><TD class="label">Extend:</TD><TD class="hd-info"><A style="text-decoration:underline;color:Blue;" href="javascript:api.showClass('<%=this.extend%>')"><%=this.extend%></A></TD></TR><%} %>
            </TBODY></TABLE>
        </div>        
        <div class="description" style="clear:both;padding:10px;text-indent:20px;"><%=this.description%></div>
        <div style="overflow:hidden;border-bottom:solid 1px #d0d0d0; height:0px;margin-bottom:10px;"></div>
        <div style="position:absolute;top:5px;right:0;width:250px;">
            <div class="top-tools">
                <a class="inner-link icon-prop" href="#<%=this.name%>-properties">properties</a> <a class="inner-link icon-method" href="#<%=this.name%>-methods">methods</a> <a class="inner-link icon-event" href="#<%=this.name%>-events">events</a>
            </div>  
            <%=createInheritance(this.name)%> 
            <div class="e-clear"></div>   
        </div>
    </div>        
    <%=createDescs('Properties', api.getInheritedProperties(this.name), this.name+'-properties', this, 'icon-prop') %>
    <%=createDescs('Methods', api.getInheritedFunctions(this.name), this.name+'-methods', this, 'icon-method') %>
    <%=createDescs('Events', api.getInheritedEvents(this.name), this.name+'-events', this, 'icon-event') %>
</div>