members.tmpl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?js
  2. var data = obj;
  3. var self = this;
  4. ?>
  5. <div class="member">
  6. <h3 class="name" id="<?js= id ?>" translate="no">.<a href="#<?js= id ?>"><?js= name ?></a><?js= (data.signature ? data.signature : '') ?> <?js= data.attribs ?></h3>
  7. <?js if (data.summary) { ?>
  8. <p class="summary"><?js= summary ?></p>
  9. <?js } ?>
  10. <?js if (data.description) { ?>
  11. <div class="description">
  12. <?js
  13. var desc = data.description;
  14. if (typeof data.defaultvalue !== 'undefined') {
  15. var defaultText = '<br/>Default is <code>' + self.htmlsafe(data.defaultvalue) + '</code>.';
  16. // If description ends with </p>, insert default before closing tag
  17. if (desc.trim().endsWith('</p>')) {
  18. desc = desc.trim().slice(0, -4) + defaultText + '</p>';
  19. } else {
  20. desc = desc + defaultText;
  21. }
  22. }
  23. ?><?js= desc ?>
  24. </div>
  25. <?js } ?>
  26. <?js= this.partial('details.tmpl', data) ?>
  27. <?js if (data.fires && fires.length) { ?>
  28. <h5>Fires:</h5>
  29. <ul>
  30. <?js fires.forEach(function(f) { ?>
  31. <li><?js= self.linkto(f) ?></li>
  32. <?js }); ?>
  33. </ul>
  34. <?js } ?>
  35. <?js if (data.examples && examples.length) { ?>
  36. <h5>Example<?js= examples.length > 1? 's':'' ?></h5>
  37. <?js= this.partial('examples.tmpl', examples) ?>
  38. <?js } ?>
  39. </div>
粤ICP备19079148号