details.tmpl 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?js
  2. var data = obj;
  3. var self = this;
  4. var defaultObjectClass = '';
  5. // Check if the default value is an object or array; if so, apply code highlighting
  6. if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvaluetype === 'array')) {
  7. data.defaultvalue = "<pre class=\"prettyprint\"><code>" + data.defaultvalue + "</code></pre>";
  8. defaultObjectClass = ' class="object-value"';
  9. }
  10. ?>
  11. <?js
  12. var properties = data.properties;
  13. if (properties && properties.length && properties.forEach && !data.hideconstructor) {
  14. ?>
  15. <h5 class="subsection-title">Properties:</h5>
  16. <?js= this.partial('properties.tmpl', data) ?>
  17. <?js } ?>
  18. <dl class="details">
  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 ?></li></ul></dd>
  26. <?js } ?>
  27. <?js if (data.inherited && data.inherits && !data.overrides) { ?>
  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></ul></dd>
  32. <?js } ?>
  33. <?js if (data.overrides) { ?>
  34. <dt class="tag-overrides">Overrides:</dt>
  35. <dd class="tag-overrides"><ul class="dummy"><li>
  36. <?js= this.linkto(data.overrides, this.htmlsafe(data.overrides)) ?>
  37. </li></ul></dd>
  38. <?js } ?>
  39. <?js if (data.implementations && data.implementations.length) { ?>
  40. <dt class="implementations">Implementations:</dt>
  41. <dd class="implementations"><ul>
  42. <?js data.implementations.forEach(function(impl) { ?>
  43. <li><?js= self.linkto(impl, self.htmlsafe(impl)) ?></li>
  44. <?js }); ?>
  45. </ul></dd>
  46. <?js } ?>
  47. <?js if (data.implements && data.implements.length) { ?>
  48. <dt class="implements">Implements:</dt>
  49. <dd class="implements"><ul>
  50. <?js data.implements.forEach(function(impl) { ?>
  51. <li><?js= self.linkto(impl, self.htmlsafe(impl)) ?></li>
  52. <?js }); ?>
  53. </ul></dd>
  54. <?js } ?>
  55. <?js if (data.mixes && data.mixes.length) { ?>
  56. <dt class="mixes">Mixes In:</dt>
  57. <dd class="mixes"><ul>
  58. <?js data.mixes.forEach(function(a) { ?>
  59. <li><?js= self.linkto(a, a) ?></li>
  60. <?js }); ?>
  61. </ul></dd>
  62. <?js } ?>
  63. <?js if (data.deprecated) { ?>
  64. <dt class="important tag-deprecated">Deprecated:</dt><?js
  65. if (data.deprecated === true) { ?><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd><?js }
  66. else { ?><dd><ul class="dummy"><li><?js= data.deprecated ?></li></ul></dd><?js }
  67. ?>
  68. <?js } ?>
  69. <?js if (data.author && author.length) {?>
  70. <dt class="tag-author">Author:</dt>
  71. <dd class="tag-author">
  72. <ul><?js author.forEach(function(a) { ?>
  73. <li><?js= self.resolveAuthorLinks(a) ?></li>
  74. <?js }); ?></ul>
  75. </dd>
  76. <?js } ?>
  77. <?js if (data.copyright) {?>
  78. <dt class="tag-copyright">Copyright:</dt>
  79. <dd class="tag-copyright"><ul class="dummy"><li><?js= copyright ?></li></ul></dd>
  80. <?js } ?>
  81. <?js if (data.license) {?>
  82. <dt class="tag-license">License:</dt>
  83. <dd class="tag-license"><ul class="dummy"><li><?js= license ?></li></ul></dd>
  84. <?js } ?>
  85. <?js if (data.defaultvalue) {?>
  86. <dt class="tag-default">Default Value:</dt>
  87. <dd class="tag-default"><ul class="dummy">
  88. <li<?js= defaultObjectClass ?>><?js= data.defaultvalue ?></li>
  89. </ul></dd>
  90. <?js } ?>
  91. <?js if (data.meta && self.outputSourceFiles) {?>
  92. <dt class="tag-source">Source:</dt>
  93. <dd class="tag-source"><ul class="dummy"><li>
  94. <?js= self.linkto(meta.shortpath) ?>, <?js= self.linkto(meta.shortpath, 'line ' + meta.lineno, null, 'line' + meta.lineno) ?>
  95. </li></ul></dd>
  96. <?js } ?>
  97. <?js if (data.tutorials && tutorials.length) {?>
  98. <dt class="tag-tutorial">Tutorials:</dt>
  99. <dd class="tag-tutorial">
  100. <ul><?js tutorials.forEach(function(t) { ?>
  101. <li><?js= self.tutoriallink(t) ?></li>
  102. <?js }); ?></ul>
  103. </dd>
  104. <?js } ?>
  105. <?js if (data.see && see.length) {?>
  106. <dt class="tag-see">See:</dt>
  107. <dd class="tag-see">
  108. <ul><?js see.forEach(function(s) { ?>
  109. <li><?js= self.linkto(s) ?></li>
  110. <?js }); ?></ul>
  111. </dd>
  112. <?js } ?>
  113. <?js if (data.todo && todo.length) {?>
  114. <dt class="tag-todo">To Do:</dt>
  115. <dd class="tag-todo">
  116. <ul><?js todo.forEach(function(t) { ?>
  117. <li><?js= t ?></li>
  118. <?js }); ?></ul>
  119. </dd>
  120. <?js } ?>
  121. </dl>