details.tmpl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?js
  2. var data = obj;
  3. var self = this;
  4. var defaultObjectClass = '';
  5. // Check if the default value is an object, if so, apply code highlighting
  6. if (data.defaultvalue && data.defaultvaluetype === 'object') {
  7. data.defaultvalue = "<pre class=\"prettyprint\"><code>" + data.defaultvalue + "</code></pre>";
  8. defaultObjectClass = ' class="object-value"';
  9. }
  10. ?>
  11. <dl class="details">
  12. <?js
  13. var properties = data.properties;
  14. if (properties && properties.length && properties.forEach) {
  15. ?>
  16. <h5 class="subsection-title">Properties:</h5>
  17. <dl><?js= this.partial('properties.tmpl', properties) ?></dl>
  18. <?js } ?>
  19. <?js if (data.version) {?>
  20. <dt class="tag-version">Version:</dt>
  21. <dd class="tag-version"><ul class="dummy"><li><?js= version ?></li></ul></dd>
  22. <?js } ?>
  23. <?js if (data.since) {?>
  24. <dt class="tag-since">Since:</dt>
  25. <dd class="tag-since"><ul class="dummy"><li><?js= since ?></dd>
  26. <?js } ?>
  27. <?js if (data.inherited && data.inherits) { ?>
  28. <dt class="inherited-from">Inherited From:</dt>
  29. <dd class="inherited-from"><ul class="dummy"><li>
  30. <?js= this.linkto(data.inherits, this.htmlsafe(data.inherits)) ?>
  31. </li></dd>
  32. <?js } ?>
  33. <?js if (data.deprecated) { ?>
  34. <dt class="important tag-deprecated">Deprecated:</dt><?js
  35. if (data.deprecated === true) { ?><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd><?js }
  36. else { ?><dd><ul class="dummy"><li><?js= data.deprecated ?></li><ul></dd><?js }
  37. ?>
  38. <?js } ?>
  39. <?js if (data.author && author.length) {?>
  40. <dt class="tag-author">Author:</dt>
  41. <dd class="tag-author">
  42. <ul><?js author.forEach(function(a) { ?>
  43. <li><?js= self.resolveAuthorLinks(a) ?></li>
  44. <?js }); ?></ul>
  45. </dd>
  46. <?js } ?>
  47. <?js if (data.copyright) {?>
  48. <dt class="tag-copyright">Copyright:</dt>
  49. <dd class="tag-copyright"><ul class="dummy"><li><?js= copyright ?></li></ul></dd>
  50. <?js } ?>
  51. <?js if (data.license) {?>
  52. <dt class="tag-license">License:</dt>
  53. <dd class="tag-license"><ul class="dummy"><li><?js= license ?></li></ul></dd>
  54. <?js } ?>
  55. <?js if (data.defaultvalue) {?>
  56. <dt class="tag-default">Default Value:</dt>
  57. <dd class="tag-default"><ul class="dummy">
  58. <li<?js= defaultObjectClass ?>><?js= data.defaultvalue ?></li>
  59. </ul></dd>
  60. <?js } ?>
  61. <?js if (data.meta && self.outputSourceFiles) {?>
  62. <dt class="tag-source">Source:</dt>
  63. <dd class="tag-source"><ul class="dummy"><li>
  64. <?js= self.linkto(meta.shortpath) ?>, <?js= self.linkto(meta.shortpath, 'line ' + meta.lineno, null, 'line' + meta.lineno) ?>
  65. </li></ul></dd>
  66. <?js } ?>
  67. <?js if (data.tutorials && tutorials.length) {?>
  68. <dt class="tag-tutorial">Tutorials:</dt>
  69. <dd class="tag-tutorial">
  70. <ul><?js tutorials.forEach(function(t) { ?>
  71. <li><?js= self.tutoriallink(t) ?></li>
  72. <?js }); ?></ul>
  73. </dd>
  74. <?js } ?>
  75. <?js if (data.see && see.length) {?>
  76. <dt class="tag-see">See:</dt>
  77. <dd class="tag-see">
  78. <ul><?js see.forEach(function(s) { ?>
  79. <li><?js= self.linkto(s) ?></li>
  80. <?js }); ?></ul>
  81. </dd>
  82. <?js } ?>
  83. <?js if (data.todo && todo.length) {?>
  84. <dt class="tag-todo">To Do:</dt>
  85. <dd class="tag-todo">
  86. <ul><?js todo.forEach(function(t) { ?>
  87. <li><?js= t ?></li>
  88. <?js }); ?></ul>
  89. </dd>
  90. <?js } ?>
  91. </dl>