forked from taye/interact.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drjs-template.dot
124 lines (124 loc) · 7.2 KB
/
drjs-template.dot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{= (it.title || '') + ' ' + (it.subtitle || 'API Reference') }}</title>
<meta name="viewport" content="device-width">
<link rel="stylesheet" href="fonts/stylesheet.css">
<link rel="stylesheet" href="css/topcoat-desktop-light.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/dr.css">
<link rel="stylesheet" href="css/prism.css">
<link rel="icon" href="img/ijs-32.png"/>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body class="light">
<div id="wrapper">
<div class="max-width">
<div id="sideNav">
<div class="combo">
<input type="search" id="dr-filter" value="" placeholder="search" class="topcoat-search-input">
</div>
<div id="pageNav">
<ol id="dr-toc">
{{ for (var i = 0; i < it.toc.length; i++) { }}
<li class="dr-lvl{{=it.toc[i].indent}}">
<a href="#{{=it.toc[i].name}}" class="{{=it.toc[i].clas}}"><span>{{=it.toc[i].name}}{{=it.toc[i].brackets}}</span></a>
</li>
{{ } }}
</ol>
</div>
</div>
</div>
<div id="site">
<header id="main-header">
<div class="max-width">
<hgroup>
<h1><a href="/"><img src="img/ijs-anim-short.svg" style="background-color:#dfe2e2;height:80px" alt="{{= it.title }}"></a></h1>
<p>{{= it.subtitle || 'API Reference' }}</p>
</hgroup>
</div>
</header>
<div id="content" class="max-width">
{{~it.out :item:index}}
<article id="{{=item[0].title}}">
<header>
<h3 class="{{=item[0].clas}}">{{=item[0].name}}<a href="#{{=item[0].title}}" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line {{=item[0].line}} in the source" href="{{=item[0].sourceFileName}}#L{{=item[0].line}}">➭</a></h3>
</header>
<section>
<div class="extra" id="{{=item[0].title}}-extra"></div>
<div class="{{=item[0].clas}}">
{{~item :line:i}}
{{ if (i > 0) { }}
{{ if (line.text) { }}<p>{{=line.text.join("</p><p>")}}</p>{{ } }}
{{ if (line.attr) { }}<div class="topcoat-list__container">
<h3 class="topcoat-list__header">Parameters</h3>
<ol class="topcoat-list">
{{~line.attr :attr:j}}<li class="topcoat-list__item"><span class="dr-param">{{=attr.name}}</span>
<span class="dr-type">{{~attr.type :type:k}}<em class="dr-type-{{=type}}">{{=type}}</em> {{~}}</span>
<span class="dr-description">{{=attr.desc}}</span></li>
{{~}}
</ol>
</div>{{ } }}
{{ if (line.html) { }}{{=line.html}}
{{ } }}
{{ if (line.head) { }}<h3>{{=line.head}}</h3>
{{ } }}
{{ if (line.code) { }}<section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">{{=line.code.join("\n")}}</code></pre></section>
{{ } }}
{{ if (line.rtrn) { }}<p class="dr-returns">
<strong class="dr-title">Returns:</strong>
{{~line.rtrn.type :type:k}}
<em class="dr-type-{{=type}}">{{=type}}</em>
{{~}}
<span class="dr-description">{{=line.rtrn.desc}}</span>
</p>
{{ } }}
{{ if (line.json) { }}<ol class="dr-json">
{{~line.json :a:j}}
{{ if (a.key) { }}
<li>
<span class="dr-json-key">{{=a.key}}</span>
<span class="dr-type">{{~a.type :type:k}}<em class="dr-type-{{=type}}">{{=type}}</em> {{~}}</span>
<span class="dr-json-description">{{=a.desc}}</span>
</li>
{{ } else if (a.start) { }}
<li>{{=a.start}}<ol class="dr-json">
{{ } else if (a.end) { }}
</ol></li><li>{{=a.end}}</li>
{{ } else { }}
<li>{{=a}}</li>
{{ } }}
{{~}}
</ol>{{ } }}
{{ } }}
{{~}}
</div>
</section>
</article>
{{~}}
</div>
<footer></footer>
</div>
</div>
<script src="js/prism.js"></script>
{{~ it.scripts :scriptPath }}
<script src="{{= scriptPath }}"></script>
{{~}}
<script>!function(e){if(e){for(var t=function(e,t){var n=t.toUpperCase().split(""),r=n.shift(),a=RegExp("^["+r.toLowerCase()+r+"][a-z]*"+n.join("[a-z]*")+"[a-z]*$")
return!!(e+"").match(a)},n=function(e,n){e+="",n+=""
var r,a=0
if(e==n)return 1
if(!e||!n)return 0
if(t(e,n))return.9
a=0,r=e.toLowerCase()
for(var i,o=0,l=n.length;l>o;o++)i=r.indexOf(n.charAt(o)),~i&&(r=r.substring(i+1),a+=1/(i+1))
return a=Math.max(a/l-Math.abs(e.length-l)/e.length/2,0)},r=e.getElementsByTagName("span"),a=[],i=/[^\.\(]*(?=(\(\))?$)/,o=0,l=r.length;l>o;o++)a[o]={li:r[o].parentNode.parentNode,text:r[o].innerHTML.match(i)[0]}
var h=document.getElementById("dr-filter"),f=function(e,t){return t.weight-e.weight}
h.onclick=h.onchange=h.onkeydown=h.onkeyup=function(){var t=h.value,r=[]
if(t.length>1){for(var i=0,o=a.length;o>i;i++)r[i]={li:a[i].li,weight:n(a[i].text,t)}
r.sort(f)}else r=a
for(i=0,o=r.length;o>i;i++)e.appendChild(r[i].li)}}}(document.getElementById("dr-toc"))</script>
</body></html>