Mercurial > pub > site.implab
view view/layout/default/library.tt @ 12:d9551c7e7101
improved dox library
author | sergey |
---|---|
date | Fri, 16 May 2014 16:47:50 +0400 |
parents | 573272ec604b |
children |
line wrap: on
line source
[% labels( CollectionTitle = "Home (%name%)" ); document.dojo.enable = 1; document.class.push('library'); document.css.push(css.library); CollectionClass = 'Benzin::Doxygen::Model::Collection'; CompoundClass = 'Benzin::Doxygen::Model::Compound'; MemberClass = 'Benzin::Doxygen::Model::Member'; Icons = { namespace = 'NS', class = 'C', variable = 'Var', function = 'F', property = 'P', interface = 'I', struct = 'S', enum = 'E', event = 'Ev' }; NullIcon = ' '; coll = resource.Seek('doxygenCollection'); compounds = coll.location.compounds; members = resource.Seek('compound').location || coll.location.members; document.title = model.canonicalName; MACRO GetLocationFor(model) BLOCK; members.Child(model.doxId) IF model.isa(MemberClass); compounds.Child(model.doxId) IF model.isa(CompoundClass); END; %] [% MACRO IconKind(model) BLOCK %]<span class="icon">[% Icons.item(model.kind) || NullIcon %]</span>[% END %] [% MACRO Link(model,label,title) BLOCK %]<a class="$model.kind $model.protection" [% IF title %]title="$title" [% END %]href="[% GetLocationFor(model) %]">[% IconKind(model) %] [% label | html %]</a>[% END %] [% MACRO CompoundSiblings(model) BLOCK %] [% compound = model.isa(MemberClass) ? model.compound : model %] <ul class="members"> [% FOREACH item IN compound.GetSiblings({ kind = { '-not_in' = [ 'file', 'dir' ] } }) %] <li [% IF item.doxId == compound.doxId %]class="active"[% END %]>[% Link(item,item.shortName, item.canonicalName) %]</li> [% END %] </ul> [% END %] [% MACRO Members(model) BLOCK %] [% compound = model.isa(MemberClass) ? model.compound : model %] <ul class="members"> [% FOREACH item IN compound.GetMembers({ kind = { '-not_in' = [ 'file', 'dir' ] } }) %] <li [% IF item.doxId == model.doxId %]class="active"[% END %]>[% Link(item,item.shortName, item.canonicalName) %]</li> [% END %] </ul> [% END %] [% BLOCK LAYOUT; render('base', content = content); END %] [% WRAPPER LAYOUT %] <div id="content-expando" style="float: right; height: 10px; width: 0px;overflow: hidden;"> </div> <div class="library-pane"> <div id="toc-nav" class="nav-pane left"> [% IF model.isa(CollectionClass) %] <ul class="dox-nav-menu"> <li class="last"><a href="$coll.location" title="$coll.model.description">[% CollectionTitle( name = coll.model.name) %]</a></li> [% Members(model) %] </ul> [% ELSE %] [% parents = model.GetParents({ kind = { '-not_in' = [ 'file', 'dir' ] } }); parents.push(model) IF model.isa(CompoundClass); %] <ul class="dox-nav-menu"> <li [% IF !parents.size %]class="last"[% END %]><a href="$coll.location" title="$coll.model.description">[% CollectionTitle( name = coll.model.name) %]</a></li> [% FOREACH parent IN parents %] <li [% IF loop.last %]class="last"[% END %]> [% Link(parent, parent.shortName, parent.canonicalName) %] </li> [% END %] </ul> [%- Members(model) %] [% END %] </div> <div id="siblings-nav" class="nav-pane right"> [% CompoundSiblings(model) %] </div> <div id="content-pane" class="content-pane"> $content <div style="clear:both;"></div> </div> <script type="text/javascript"> require(['implab/sticky','dojo/on', 'dojo/dom-geometry', 'dojo/dom-style'],function(sticky,on,g,css) { sticky('toc-nav',{ along: 'content-pane', alongContent: true }); sticky('siblings-nav', { along: 'content-pane', stick: 'right', alongContent: true }); var sfn = function() { var h = window.innerHeight; var header = g.position('header'); var expand = h - header.h - 10; // windowHeight - headerHeight - contentBottomPadding if (expand < 0) expand = 0; css.set('content-expando', 'height', expand + 'px'); }; sfn(); on(window,'resize',sfn); }); </script> </div> [% END %]