Permalink
Browse files

properties template added

  • Loading branch information...
1 parent bbc5bc2 commit 84789166a0cc2cf622e1825214e3eda0c2e243ff ilan committed Mar 19, 2013
@@ -102,6 +102,10 @@ class jqapi.Entry
for arg in args # for every argument
if arg and arg.name
argsEl.append $(templates.argumentsItem(arg)) # build and append element from template
+ if arg.property
+ for prop in arg.property
+ argsEl.append $(templates.propertyItem(prop))
+
insertExamples: (examples, el) ->
examples = [examples] unless $.isArray(examples)
@@ -68,14 +68,35 @@ class jqapi.Templates
"""
argumentsItem: (arg) ->
+ argn = arg.name
+ if arg and arg.optional
+ argn = "[#{arg.name}]"
+
"""
<tr>
- <td class='name'>#{arg.name}</td>
+ <td class='name'>#{argn}</td>
<td class='type'>#{arg.type}</td>
<td class='desc'>#{arg.desc}</td>
</tr>
"""
+ propertyItem: (prop) ->
+ if prop.default?
+ prop.def = "(default: <em>#{prop.default}</em>)"
+ else
+ prop.def = ""
+
+ """
+ <tr class="property"><td colspan=3>
+ <strong>#{prop.name}</strong>
+ #{prop.def}
+ <br>
+ Type:
+ <a href="//api.jquery.com/Types##{prop.type}">#{prop.type}</a>
+ <p>#{prop.desc}</p>
+ </td></tr>
+ """
+
examplesItem: (example) ->
"""
<li class='example clearfix'>
@@ -259,4 +259,38 @@
color: #888
tr:nth-child(even)
- background: #e5edf9
+ background: #e5edf9
+
+ tr.property
+
+ strong
+ font-weight: bold
+
+ code
+ font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace
+ padding: 1px 2px
+ font-size: 0.92em
+
+ em
+ font-style: italic
+
+ td
+ color: white
+
+ padding-left: 30px
+ background: rgb(34, 34, 34)
+
+ p
+ font-size: 1em
+ margin: 0
+ ul
+ padding-left: 30px
+
+ li::after
+ content: "\00a0"
+ display: block
+ border: 0
+ border-top: 1px dashed #ccc
+ line-height: 4px
+
+

0 comments on commit 8478916

Please sign in to comment.