anatomy 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/anatomy/data.ay +5 -0
- data/lib/anatomy/renderers/html.ay +25 -18
- data/public/anatomy.css +79 -47
- data/public/highlight.css +56 -56
- data/public/main.js +134 -181
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9311046d401a0d15a452eec56f8f868007228622
|
4
|
+
data.tar.gz: cf129729337533d951cbb7645a5443e43e9cb903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df53430925e40d018243f582067035b83ec028a88aa13aa237ecc572d8c85af2d1e11359bfa83bda98f8b5fd425eee17aa2dbca8072f633611b888889185500
|
7
|
+
data.tar.gz: 0036bb071e4d09f701d1c7f76598e4f2861c14926a48939da62b534ff78d2445e7fde57073ad82c4756f233125c23c32b4ba6062a9d32c81475214f1bda7227f
|
data/lib/anatomy/data.ay
CHANGED
@@ -128,6 +128,11 @@ def(Part top):
|
|
128
128
|
then: @parent top
|
129
129
|
else: self
|
130
130
|
|
131
|
+
def(Part contains-part?(other)):
|
132
|
+
if(self == other)
|
133
|
+
then: true
|
134
|
+
else: @parts any? &.contains-part?(other)
|
135
|
+
|
131
136
|
def(content?(String)): true
|
132
137
|
def(content?(Element)): true
|
133
138
|
def(content?(nil)): true
|
@@ -63,6 +63,7 @@ def(over(b & data Block)):
|
|
63
63
|
<div: over(b content)
|
64
64
|
|
65
65
|
in-reference? = dynamic(false)
|
66
|
+
in-sidebar? = dynamic(false)
|
66
67
|
|
67
68
|
def(over(t & data Target)):
|
68
69
|
<a(name = t name): nil
|
@@ -122,7 +123,7 @@ def(over(e & data Element)):
|
|
122
123
|
<script(async = true, defer = true, src = url) {}
|
123
124
|
|
124
125
|
.aux:
|
125
|
-
unless(^(in-reference?)):
|
126
|
+
unless(^(in-reference?) || ^(in-sidebar?)):
|
126
127
|
over(e content)
|
127
128
|
|
128
129
|
def(over(nil)): nil
|
@@ -157,14 +158,22 @@ def(url(p, anchor = nil)):
|
|
157
158
|
filename(p)
|
158
159
|
|
159
160
|
|
160
|
-
def(toc-leaf(part)):
|
161
|
-
|
161
|
+
def(toc-leaf(current-part, part)):
|
162
|
+
classes = []
|
163
|
+
|
164
|
+
when(part == current-part):
|
165
|
+
classes << "current"
|
166
|
+
|
167
|
+
when(part contains-part?(current-part)):
|
168
|
+
classes << "active"
|
169
|
+
|
170
|
+
<li(class = classes join(" ")):
|
162
171
|
<a(href = url(part)):
|
163
172
|
over(part title)
|
164
173
|
|
165
174
|
unless(part omit-children-from-table-of-contents? || part parts empty?):
|
166
175
|
<ol:
|
167
|
-
part parts collect
|
176
|
+
part parts collect &.(Self toc-leaf(current-part, _))
|
168
177
|
|
169
178
|
|
170
179
|
def(render(part, out = ".")):
|
@@ -212,19 +221,15 @@ def(render(part, out = ".")):
|
|
212
221
|
|
213
222
|
<ul(.search-results) {}
|
214
223
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
part parts collect [s]: toc-leaf(s)
|
221
|
-
]
|
224
|
+
with(in-sidebar? = true):
|
225
|
+
<div(#sidebar):
|
226
|
+
<h2:
|
227
|
+
<a(href = url(part top)):
|
228
|
+
over(part top title)
|
222
229
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
toc-leaf(part parent)
|
227
|
-
]
|
230
|
+
<ol(.toc):
|
231
|
+
part top parts collect [p]:
|
232
|
+
toc-leaf(part, p)
|
228
233
|
|
229
234
|
when(analytics-id = ENV["ANALYTICS_ID"]):
|
230
235
|
<script: UnescapedString new(i"
|
@@ -257,7 +262,7 @@ def(render-part(part, out = ".", depth = 1)):
|
|
257
262
|
<ol(.toc, #table-of-contents):
|
258
263
|
part parts collect [sub]:
|
259
264
|
render(sub, out)
|
260
|
-
toc-leaf(sub)
|
265
|
+
toc-leaf(part, sub)
|
261
266
|
else:
|
262
267
|
part parts collect [sub]:
|
263
268
|
render-part(sub, out, depth + 1)
|
@@ -307,6 +312,8 @@ def(all-css-additions(p)):
|
|
307
312
|
assets = p css-additions to-a
|
308
313
|
|
309
314
|
p parts each [sub]:
|
310
|
-
|
315
|
+
-- exclude parts that have their own page
|
316
|
+
unless(top(sub) == sub):
|
317
|
+
assets += all-css-additions(sub)
|
311
318
|
|
312
319
|
assets
|
data/public/anatomy.css
CHANGED
@@ -10,17 +10,18 @@ input,textarea,select { font-family: inherit; font-size: inherit; font-weight: i
|
|
10
10
|
a { text-decoration: none; color: inherit; }
|
11
11
|
|
12
12
|
html {
|
13
|
-
|
14
|
-
|
13
|
+
background-color: #f5f5f5;
|
14
|
+
color: #151515;
|
15
15
|
}
|
16
16
|
|
17
17
|
body {
|
18
|
-
font-family:
|
18
|
+
font-family: Helvetica, Arial, sans-serif;
|
19
19
|
}
|
20
20
|
|
21
21
|
code {
|
22
22
|
font-size: 14px;
|
23
|
-
background: #
|
23
|
+
background: #fbfbfb;
|
24
|
+
color: #202020;
|
24
25
|
padding: 2px 5px;
|
25
26
|
border-radius: 5px;
|
26
27
|
}
|
@@ -61,7 +62,7 @@ h2 {
|
|
61
62
|
font-size: 20px;
|
62
63
|
font-weight: 500;
|
63
64
|
line-height: 20px;
|
64
|
-
border-bottom: 1px dotted #
|
65
|
+
border-bottom: 1px dotted #d0d0d0;
|
65
66
|
padding-bottom: .25em;
|
66
67
|
margin-bottom: .75em;
|
67
68
|
}
|
@@ -80,15 +81,15 @@ p {
|
|
80
81
|
}
|
81
82
|
|
82
83
|
pre {
|
83
|
-
|
84
|
-
|
85
|
-
|
84
|
+
font-size: 14px;
|
85
|
+
font-weight: 400;
|
86
|
+
line-height: 24px;
|
86
87
|
}
|
87
88
|
|
88
89
|
blockquote {
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
font-size: 17px;
|
91
|
+
font-weight: 400;
|
92
|
+
line-height: 23px;
|
92
93
|
}
|
93
94
|
|
94
95
|
.section img {
|
@@ -118,17 +119,17 @@ dd {
|
|
118
119
|
|
119
120
|
#main {
|
120
121
|
width: 700px;
|
121
|
-
margin-left:
|
122
|
+
margin-left: 250px;
|
122
123
|
}
|
123
124
|
|
124
125
|
#content {
|
125
|
-
padding: 32px
|
126
|
+
padding: 32px;
|
126
127
|
}
|
127
128
|
|
128
129
|
#sidebar {
|
129
|
-
|
130
|
-
|
131
|
-
width:
|
130
|
+
background: #202020;
|
131
|
+
color: #e0e0e0;
|
132
|
+
width: 250px;
|
132
133
|
height: 100%;
|
133
134
|
overflow: auto;
|
134
135
|
position: fixed;
|
@@ -136,6 +137,57 @@ dd {
|
|
136
137
|
top: 0;
|
137
138
|
bottom: 0;
|
138
139
|
}
|
140
|
+
#sidebar h2 {
|
141
|
+
padding: 0;
|
142
|
+
border: none;
|
143
|
+
}
|
144
|
+
#sidebar h2 a {
|
145
|
+
padding: .5em;
|
146
|
+
color: #f5f5f5;
|
147
|
+
background: #151515;
|
148
|
+
display: block;
|
149
|
+
font-weight: bold;
|
150
|
+
}
|
151
|
+
#sidebar h2 a:hover {
|
152
|
+
text-decoration: none;
|
153
|
+
background: #303030;
|
154
|
+
}
|
155
|
+
#sidebar .toc {
|
156
|
+
font-size: 1em;
|
157
|
+
margin: 0;
|
158
|
+
padding: 0;
|
159
|
+
}
|
160
|
+
#sidebar .toc ol {
|
161
|
+
margin: 0;
|
162
|
+
padding: 0 0 0 1em;
|
163
|
+
}
|
164
|
+
#sidebar .toc li {
|
165
|
+
list-style-type: none;
|
166
|
+
}
|
167
|
+
#sidebar .toc a {
|
168
|
+
padding: .5em 1em;
|
169
|
+
display: block;
|
170
|
+
color: #e0e0e0;
|
171
|
+
}
|
172
|
+
#sidebar .toc a:hover {
|
173
|
+
color: #f5f5f5;
|
174
|
+
background: #505050;
|
175
|
+
text-decoration: none;
|
176
|
+
}
|
177
|
+
#sidebar .toc code {
|
178
|
+
background: #151515;
|
179
|
+
color: #f5f5f5;
|
180
|
+
}
|
181
|
+
#sidebar .toc li ol {
|
182
|
+
display: none;
|
183
|
+
}
|
184
|
+
#sidebar .toc li.active ol {
|
185
|
+
display: block;
|
186
|
+
}
|
187
|
+
#sidebar .toc li.current > a {
|
188
|
+
background: #303030;
|
189
|
+
}
|
190
|
+
|
139
191
|
.search {
|
140
192
|
width: 200px;
|
141
193
|
position: fixed;
|
@@ -149,11 +201,11 @@ div.search:hover {
|
|
149
201
|
.search #search {
|
150
202
|
width: 186px;
|
151
203
|
padding: 5px;
|
152
|
-
border: 2px solid #
|
204
|
+
border: 2px solid #e0e0e0;
|
153
205
|
}
|
154
206
|
.search .search_results {
|
155
207
|
margin: 0;
|
156
|
-
border: 2px solid #
|
208
|
+
border: 2px solid #e0e0e0;
|
157
209
|
border-top: 0;
|
158
210
|
display: none;
|
159
211
|
background: #fff;
|
@@ -165,36 +217,20 @@ div.search:hover {
|
|
165
217
|
.search .search_results .parent {
|
166
218
|
font-size: 12px;
|
167
219
|
font-style: italic;
|
168
|
-
color: #
|
220
|
+
color: #505050;
|
169
221
|
}
|
170
222
|
.search .search_results .parent a {
|
171
|
-
color: #
|
223
|
+
color: #202020;
|
172
224
|
}
|
173
225
|
.search .search_results .tag {
|
174
226
|
font-style: italic;
|
175
|
-
color: #
|
176
|
-
}
|
177
|
-
#sidebar h4 {
|
178
|
-
font-style: italic;
|
179
|
-
}
|
180
|
-
#sidebar .toc {
|
181
|
-
margin-left: 1em;
|
182
|
-
font-size: 0.9em;
|
183
|
-
}
|
184
|
-
#sidebar .toc .toggle {
|
185
|
-
margin-left: .5em;
|
186
|
-
font-size: 10px;
|
187
|
-
cursor: pointer;
|
188
|
-
color: #777;
|
189
|
-
}
|
190
|
-
#sidebar .toc ol {
|
191
|
-
margin: 0 0 0 1em;
|
227
|
+
color: #505050;
|
192
228
|
}
|
193
229
|
|
194
230
|
.section .section {
|
195
231
|
margin: 1em 0;
|
196
232
|
padding: 1em 0;
|
197
|
-
border-bottom: .1em dotted #
|
233
|
+
border-bottom: .1em dotted #151515;
|
198
234
|
}
|
199
235
|
.section .section .section {
|
200
236
|
margin: 0;
|
@@ -204,17 +240,13 @@ div.search:hover {
|
|
204
240
|
.definition {
|
205
241
|
margin: 2em 0;
|
206
242
|
padding: 2em 0 0;
|
207
|
-
border-top: .1em dotted #
|
243
|
+
border-top: .1em dotted #d0d0d0;
|
208
244
|
}
|
209
245
|
.definition .thumb pre {
|
210
246
|
background: #e0e0e0;
|
211
247
|
padding: .6em .75em;
|
212
248
|
margin-bottom: 1em;
|
213
249
|
}
|
214
|
-
.definition.macro .thumb pre {
|
215
|
-
/* same as unquote background */
|
216
|
-
background: #fff0f0;
|
217
|
-
}
|
218
250
|
|
219
251
|
.verbatim, .interaction {
|
220
252
|
margin: 0 1em 1em;
|
@@ -240,11 +272,11 @@ code a:link,
|
|
240
272
|
code a:visited {
|
241
273
|
color: inherit;
|
242
274
|
text-decoration: none;
|
243
|
-
border-bottom: .1em solid #
|
275
|
+
border-bottom: .1em solid #d0d0d0;
|
244
276
|
}
|
245
277
|
pre a:hover,
|
246
278
|
code a:hover {
|
247
|
-
border-bottom-color: #
|
279
|
+
border-bottom-color: #303030;
|
248
280
|
}
|
249
281
|
|
250
282
|
blockquote {
|
@@ -264,7 +296,7 @@ table th, table td {
|
|
264
296
|
margin-top: -1.5em;
|
265
297
|
margin-right: -15em;
|
266
298
|
padding: .5em;
|
267
|
-
color: #
|
299
|
+
color: #b0b0b0;
|
268
300
|
}
|
269
301
|
|
270
302
|
.centered {
|
@@ -286,7 +318,7 @@ table th, table td {
|
|
286
318
|
}
|
287
319
|
.interaction .caret {
|
288
320
|
font-weight: bold;
|
289
|
-
color: #
|
321
|
+
color: #d0d0d0;
|
290
322
|
}
|
291
323
|
|
292
324
|
.error_output {
|
data/public/highlight.css
CHANGED
@@ -1,60 +1,60 @@
|
|
1
1
|
.hll { background-color: #ffffcc }
|
2
|
-
.c { color: #
|
3
|
-
.err { color: #
|
4
|
-
.k { color: #
|
5
|
-
.cm { color: #
|
6
|
-
.cp { color: #
|
7
|
-
.c1 { color: #
|
8
|
-
.cs { color: #
|
9
|
-
.gd { color: #
|
2
|
+
.c { color: #b0b0b0 } /* Comment */
|
3
|
+
.err { color: #ac4142; } /* Error */
|
4
|
+
.k { color: #90a959; font-weight: bold } /* Keyword */
|
5
|
+
.cm { color: #b0b0b0 } /* Comment.Multiline */
|
6
|
+
.cp { color: #ac4142; font-weight: bold } /* Comment.Preproc */
|
7
|
+
.c1 { color: #b0b0b0 } /* Comment.Single */
|
8
|
+
.cs { color: #ac4142; font-weight: bold; } /* Comment.Special */
|
9
|
+
.gd { color: #151515; background-color: #ffdddd } /* Generic.Deleted */
|
10
10
|
.ge { font-style: italic } /* Generic.Emph */
|
11
|
-
.gr { color: #
|
11
|
+
.gr { color: #ac4142 } /* Generic.Error */
|
12
12
|
.gh { color: #303030 } /* Generic.Heading */
|
13
|
-
.gi { color: #
|
14
|
-
.go { color: #
|
15
|
-
.gp { color: #
|
13
|
+
.gi { color: #151515; background-color: #ddffdd } /* Generic.Inserted */
|
14
|
+
.go { color: #b0b0b0 } /* Generic.Output */
|
15
|
+
.gp { color: #505050 } /* Generic.Prompt */
|
16
16
|
.gs { font-weight: bold } /* Generic.Strong */
|
17
|
-
.gu { color: #
|
18
|
-
.gt { color: #
|
19
|
-
.kc { color: #
|
20
|
-
.kd { color: #
|
21
|
-
.kn { color: #
|
22
|
-
.kp { color: #
|
23
|
-
.kr { color: #
|
24
|
-
.kt { color: #
|
25
|
-
.m { color: #
|
26
|
-
.s { color: #
|
27
|
-
.na { color: #
|
28
|
-
.nb { color: #
|
29
|
-
.nc { color: #
|
30
|
-
.no { color: #
|
31
|
-
.nd { color: #
|
32
|
-
.ne { color: #
|
33
|
-
.nf { color: #
|
34
|
-
.nl { color: #
|
35
|
-
.nn { color: #
|
36
|
-
.py { color: #
|
37
|
-
.nt { color: #
|
38
|
-
.nv { color: #
|
39
|
-
.ow { color: #
|
40
|
-
.w { color: #
|
41
|
-
.mf { color: #
|
42
|
-
.mh { color: #
|
43
|
-
.mi { color: #
|
44
|
-
.mo { color: #
|
45
|
-
.sb { color: #
|
46
|
-
.sc { color: #
|
47
|
-
.sd { color: #
|
48
|
-
.s2 { color: #
|
49
|
-
.se { color: #
|
50
|
-
.sh { color: #
|
51
|
-
.si { color: #
|
52
|
-
.sx { color: #
|
53
|
-
.sr { color: #
|
54
|
-
.s1 { color: #
|
55
|
-
.ss { color: #
|
56
|
-
.bp { color: #
|
57
|
-
.vc { color: #
|
58
|
-
.vg { color: #
|
59
|
-
.vi { color: #
|
60
|
-
.il { color: #
|
17
|
+
.gu { color: #b0b0b0 } /* Generic.Subheading */
|
18
|
+
.gt { color: #ac4142 } /* Generic.Traceback */
|
19
|
+
.kc { color: #90a959; font-weight: bold } /* Keyword.Constant */
|
20
|
+
.kd { color: #90a959; font-weight: bold } /* Keyword.Declaration */
|
21
|
+
.kn { color: #90a959; font-weight: bold } /* Keyword.Namespace */
|
22
|
+
.kp { color: #90a959 } /* Keyword.Pseudo */
|
23
|
+
.kr { color: #90a959; font-weight: bold } /* Keyword.Reserved */
|
24
|
+
.kt { color: #b0b0b0; font-weight: bold } /* Keyword.Type */
|
25
|
+
.m { color: #75b5aa; font-weight: bold } /* Literal.Number */
|
26
|
+
.s { color: #ac4142; } /* Literal.String */
|
27
|
+
.na { color: #6a9fb5 } /* Name.Attribute */
|
28
|
+
.nb { color: #8f5536 } /* Name.Builtin */
|
29
|
+
.nc { color: #aa759f; font-weight: bold } /* Name.Class */
|
30
|
+
.no { color: #75b5aa; font-weight: bold } /* Name.Constant */
|
31
|
+
.nd { color: #505050 } /* Name.Decorator */
|
32
|
+
.ne { color: #aa759f; font-weight: bold } /* Name.Exception */
|
33
|
+
.nf { color: #75b5aa; font-weight: bold } /* Name.Function */
|
34
|
+
.nl { color: #6a9fb5; font-style: italic } /* Name.Label */
|
35
|
+
.nn { color: #aa759f; font-weight: bold } /* Name.Namespace */
|
36
|
+
.py { color: #6a9fb5; font-weight: bold } /* Name.Property */
|
37
|
+
.nt { color: #aa759f; font-weight: bold } /* Name.Tag */
|
38
|
+
.nv { color: #6a9fb5 } /* Name.Variable */
|
39
|
+
.ow { color: #90a959 } /* Operator.Word */
|
40
|
+
.w { color: #d0d0d0 } /* Text.Whitespace */
|
41
|
+
.mf { color: #75b5aa; font-weight: bold } /* Literal.Number.Float */
|
42
|
+
.mh { color: #75b5aa; font-weight: bold } /* Literal.Number.Hex */
|
43
|
+
.mi { color: #75b5aa; font-weight: bold } /* Literal.Number.Integer */
|
44
|
+
.mo { color: #75b5aa; font-weight: bold } /* Literal.Number.Oct */
|
45
|
+
.sb { color: #d28445; } /* Literal.String.Backtick */
|
46
|
+
.sc { color: #d28445; } /* Literal.String.Char */
|
47
|
+
.sd { color: #d28445; } /* Literal.String.Doc */
|
48
|
+
.s2 { color: #d28445; } /* Literal.String.Double */
|
49
|
+
.se { color: #6a9fb5; } /* Literal.String.Escape */
|
50
|
+
.sh { color: #d28445; } /* Literal.String.Heredoc */
|
51
|
+
.si { color: #75b5aa; } /* Literal.String.Interpol */
|
52
|
+
.sx { color: #f4bf75; } /* Literal.String.Other */
|
53
|
+
.sr { color: #90a959; } /* Literal.String.Regex */
|
54
|
+
.s1 { color: #ac4142; } /* Literal.String.Single */
|
55
|
+
.ss { color: #f4bf75; } /* Literal.String.Symbol */
|
56
|
+
.bp { color: #8f5536 } /* Name.Builtin.Pseudo */
|
57
|
+
.vc { color: #6a9fb5 } /* Name.Variable.Class */
|
58
|
+
.vg { color: #f4bf75 } /* Name.Variable.Global */
|
59
|
+
.vi { color: #75b5aa } /* Name.Variable.Instance */
|
60
|
+
.il { color: #75b5aa; font-weight: bold } /* Literal.Number.Integer.Long */
|
data/public/main.js
CHANGED
@@ -8,230 +8,183 @@ var X_OFFSET = 50,
|
|
8
8
|
SLIDE_HEIGHT;
|
9
9
|
|
10
10
|
$(function(){
|
11
|
-
|
12
|
-
sidebarTree();
|
11
|
+
bindSearch();
|
13
12
|
|
14
|
-
|
15
|
-
|
13
|
+
if (!$(".slides").length)
|
14
|
+
return;
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
SLIDE_WIDTH = $(".slide").outerWidth();
|
17
|
+
SLIDE_HEIGHT = $(".slide").outerHeight();
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
positionSlides();
|
20
|
+
bindKeys();
|
21
|
+
bindTouch();
|
23
22
|
});
|
24
23
|
|
25
24
|
function positionSlides() {
|
26
|
-
|
27
|
-
|
28
|
-
if (window.location.hash) {
|
29
|
-
where = window.location.hash.slice(1).split(",");
|
30
|
-
position = parseInt(where[0]);
|
31
|
-
detail[position] = parseInt(where[1]) || 0;
|
32
|
-
initialPos -= (SLIDE_WIDTH + X_OFFSET) * position;
|
33
|
-
}
|
25
|
+
var initialPos = -(SLIDE_WIDTH / 2);
|
34
26
|
|
35
|
-
|
36
|
-
|
37
|
-
|
27
|
+
if (window.location.hash) {
|
28
|
+
where = window.location.hash.slice(1).split(",");
|
29
|
+
position = parseInt(where[0]);
|
30
|
+
detail[position] = parseInt(where[1]) || 0;
|
31
|
+
initialPos -= (SLIDE_WIDTH + X_OFFSET) * position;
|
32
|
+
}
|
38
33
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
"margin-left": initialPos,
|
43
|
-
"margin-top": yPos
|
44
|
-
});
|
34
|
+
$(".slide:not(.continue)").each(function(i){
|
35
|
+
$(this).css("margin-left", initialPos);
|
36
|
+
$(this).addClass("group-" + i);
|
45
37
|
|
46
|
-
|
38
|
+
var yPos = (SLIDE_HEIGHT / 2) + Y_OFFSET;
|
39
|
+
$(this).nextUntil(":not(.continue)").each(function(){
|
40
|
+
$(this).css({
|
41
|
+
"margin-left": initialPos,
|
42
|
+
"margin-top": yPos
|
43
|
+
});
|
47
44
|
|
48
|
-
|
49
|
-
});
|
45
|
+
$(this).addClass("group-" + i);
|
50
46
|
|
51
|
-
|
47
|
+
yPos += (SLIDE_HEIGHT + Y_OFFSET);
|
52
48
|
});
|
49
|
+
|
50
|
+
initialPos += SLIDE_WIDTH + X_OFFSET;
|
51
|
+
});
|
53
52
|
}
|
54
53
|
|
55
54
|
function bindKeys() {
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
$(document).bind("keydown", "left", function(){
|
56
|
+
if (animating || position == 0)
|
57
|
+
return;
|
59
58
|
|
60
|
-
|
61
|
-
|
59
|
+
$(".slide").each(moveX(1));
|
60
|
+
});
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
$(document).bind("keydown", "right", function(){
|
63
|
+
if (animating || position + 1 == $(".slide:not(.continue)").length)
|
64
|
+
return;
|
66
65
|
|
67
|
-
|
68
|
-
|
66
|
+
$(".slide").each(moveX(-1));
|
67
|
+
});
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
$(document).bind("keydown", "up", function(){
|
70
|
+
var d = detail[position],
|
71
|
+
group = $(".group-" + position);
|
73
72
|
|
74
|
-
|
75
|
-
|
73
|
+
if (animating || d == 0)
|
74
|
+
return;
|
76
75
|
|
77
|
-
|
78
|
-
|
76
|
+
group.each(moveY(1));
|
77
|
+
});
|
79
78
|
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
$(document).bind("keydown", "down", function(){
|
80
|
+
var d = detail[position],
|
81
|
+
group = $(".group-" + position);
|
83
82
|
|
84
|
-
|
85
|
-
|
83
|
+
if (animating || d + 1 == group.length)
|
84
|
+
return;
|
86
85
|
|
87
|
-
|
88
|
-
|
86
|
+
group.each(moveY(-1));
|
87
|
+
});
|
89
88
|
}
|
90
89
|
|
91
90
|
function bindTouch() {
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
91
|
+
var startX, endX;
|
92
|
+
$(".slides").bind("touchstart", function(e){
|
93
|
+
startX = e.originalEvent.touches[0].pageX;
|
94
|
+
});
|
95
|
+
|
96
|
+
$(".slides").bind("touchmove", function(e){
|
97
|
+
endX = e.originalEvent.touches[0].pageX;
|
98
|
+
e.preventDefault();
|
99
|
+
});
|
100
|
+
|
101
|
+
$(".slides").bind("touchend", function(e){
|
102
|
+
if ((startX - endX) > 50)
|
103
|
+
$(".slide").each(moveX(-1));
|
104
|
+
else if ((endX - startX) > 50)
|
105
|
+
$(".slide").each(moveX(1));
|
106
|
+
});
|
108
107
|
}
|
109
108
|
|
110
109
|
function bindSearch() {
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
console.log(q, SEARCH_TAGS);
|
123
|
-
$.each(SEARCH_TAGS, function(i, t){
|
124
|
-
var k = t[0].toLowerCase(),
|
125
|
-
n = t[1],
|
126
|
-
url = t[2],
|
127
|
-
item = "<li>" + n + "</li>";
|
128
|
-
|
129
|
-
if (k.indexOf(q) == -1 || matches.indexOf(url) != -1)
|
130
|
-
return;
|
131
|
-
|
132
|
-
matches.push(url);
|
133
|
-
|
134
|
-
if (k == q)
|
135
|
-
$(".search_results").prepend(item);
|
136
|
-
else
|
137
|
-
$(".search_results").append(item);
|
138
|
-
});
|
139
|
-
|
140
|
-
if (matches.length == 0)
|
141
|
-
$(".search_results").hide();
|
142
|
-
else
|
143
|
-
$(".search_results").show();
|
144
|
-
});
|
145
|
-
}
|
110
|
+
$("#search").keyup(function(){
|
111
|
+
$(".search_results").empty();
|
112
|
+
|
113
|
+
if (!$("#search").val().length) {
|
114
|
+
$(".search_results").hide();
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
|
118
|
+
var q = $("#search").val().toLowerCase(),
|
119
|
+
matches = [];
|
146
120
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
} else {
|
164
|
-
if (sub.css("display") == "none")
|
165
|
-
$(toggle).html("▽");
|
166
|
-
else
|
167
|
-
$(toggle).html("△")
|
168
|
-
}
|
169
|
-
}
|
170
|
-
|
171
|
-
$(toggle).html("▽");
|
172
|
-
$(toggle).click(function(){
|
173
|
-
$(this).next("ol").slideToggle("fast", function(){
|
174
|
-
face(false);
|
175
|
-
});
|
176
|
-
});
|
177
|
-
|
178
|
-
$(toggle).mouseenter(function(){
|
179
|
-
face(true);
|
180
|
-
});
|
181
|
-
|
182
|
-
$(toggle).mouseleave(function(){
|
183
|
-
face(false);
|
184
|
-
});
|
185
|
-
|
186
|
-
$(toggle).insertAfter($(this).find("a:first"));
|
121
|
+
console.log(q, SEARCH_TAGS);
|
122
|
+
$.each(SEARCH_TAGS, function(i, t){
|
123
|
+
var k = t[0].toLowerCase(),
|
124
|
+
n = t[1],
|
125
|
+
url = t[2],
|
126
|
+
item = "<li>" + n + "</li>";
|
127
|
+
|
128
|
+
if (k.indexOf(q) == -1 || matches.indexOf(url) != -1)
|
129
|
+
return;
|
130
|
+
|
131
|
+
matches.push(url);
|
132
|
+
|
133
|
+
if (k == q)
|
134
|
+
$(".search_results").prepend(item);
|
135
|
+
else
|
136
|
+
$(".search_results").append(item);
|
187
137
|
});
|
188
138
|
|
189
|
-
if (
|
190
|
-
|
139
|
+
if (matches.length == 0)
|
140
|
+
$(".search_results").hide();
|
141
|
+
else
|
142
|
+
$(".search_results").show();
|
143
|
+
});
|
191
144
|
}
|
192
145
|
|
193
146
|
function moveX(diff) {
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
147
|
+
animating = true;
|
148
|
+
position -= diff;
|
149
|
+
|
150
|
+
if (detail[position] == undefined)
|
151
|
+
detail[position] = 0;
|
152
|
+
|
153
|
+
return function(){
|
154
|
+
$(this).animate({
|
155
|
+
"margin-left": getLeft($(this)) + ((SLIDE_WIDTH + X_OFFSET) * diff)
|
156
|
+
}, {
|
157
|
+
"duration": 250,
|
158
|
+
"complete": (function(){
|
159
|
+
animating = false;
|
160
|
+
window.location.hash =
|
161
|
+
position + "," + detail[position];
|
162
|
+
})
|
163
|
+
});
|
164
|
+
};
|
212
165
|
}
|
213
166
|
|
214
167
|
function moveY(diff) {
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
168
|
+
animating = true;
|
169
|
+
detail[position] -= diff;
|
170
|
+
return function(){
|
171
|
+
$(this).animate({
|
172
|
+
"margin-top": getTop($(this)) + ((SLIDE_HEIGHT + Y_OFFSET) * diff)
|
173
|
+
}, {
|
174
|
+
"duration": 250,
|
175
|
+
"complete": (function(){
|
176
|
+
animating = false;
|
177
|
+
window.location.hash =
|
178
|
+
position + "," + detail[position];
|
179
|
+
})
|
180
|
+
});
|
181
|
+
};
|
229
182
|
}
|
230
183
|
|
231
184
|
function getLeft(ele) {
|
232
|
-
|
185
|
+
return parseInt(ele.css("margin-left"), 10);
|
233
186
|
}
|
234
187
|
|
235
188
|
function getTop(ele) {
|
236
|
-
|
189
|
+
return parseInt(ele.css("margin-top"), 10);
|
237
190
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anatomy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Suraci
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: atomy
|