-
Notifications
You must be signed in to change notification settings - Fork 0
/
enumerables.html
498 lines (396 loc) · 24.1 KB
/
enumerables.html
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<!-- plugin styles -->
<link rel="stylesheet" type="text/css" href="stylesheets/highlight-github.css" />
<!-- guides styles -->
<link rel="stylesheet" type="text/css" href="stylesheets/reset.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/main.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="stylesheets/guides.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/overrides.style.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/overrides.print.css" media="print" />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<meta name="generator" content="DocPad v6.79.0" />
</head>
<body class="guide">
<header role="banner">
<div class="container">
<h1 id="logo">
<a href="http://www.sproutcore.com"><img src="images/header/logo.png" alt="SproutCore" /></a>
</h1>
<nav role="navigation">
<ul>
<li><a href="http://sproutcore.com/about/">About</a></li>
<li><a href="http://showcase.sproutcore.com">Showcase</a></li>
<li class="active"><a href="http://guides.sproutcore.com">Guides</a></li>
<li><a href="http://docs.sproutcore.com">Docs</a></li>
<li><a href="http://sproutcore.com/community/">Community</a></li>
<li><a href="http://blog.sproutcore.com">Blog</a></li>
</ul>
</nav>
</div>
</header>
<div id="feature">
<div class="wrapper">
<div class="feature_header">
<a href="/"><img src="images/graphics/guides.png"></a>
<h2><a href="/">SproutCore Guides</a></h2>
<p>These guides are designed to help you write and perfect your code.</p>
</div>
<div class="feature_sidebar">
<a href="index.html" id="guidesMenu">
Guides Index <span id="guidesArrow">▸</span>
</a>
<div id="guides" class="clearfix" style="display: none;">
<a href="index.html" class="guidesMenu">
Guides Index <span class="guidesArrow">▾</span>
</a>
<hr style="clear:both;">
<dl class='L'><dt>Start Here</dt>
<dd><a href='/getting_started.html'>Getting Started: Part 1</a></dd>
<dd><a href='/getting_started_2.html'>Getting Started: Part 2</a></dd>
<dd><a href='/getting_started_3.html'>Getting Started: Part 3</a></dd>
<dd><a href='/core_concepts_sc_object.html'>Classes and SC.Object</a></dd>
<dd><a href='/core_concepts_kvo.html'>Computed Properties, Observers and Bindings</a></dd><dt>Views</dt>
<dd><a href='/views.html'>Core View Concepts</a></dd><dt>Models</dt>
<dd><a href='/records.html'>SproutCore Records</a></dd>
<dd><a href='/fixtures.html'>Using Fixtures</a></dd><dt>Theming</dt>
<dd><a href='/chance.html'>Using Chance, SproutCore's CSS Framework</a></dd>
<dd><a href='/theming_app.html'>Theming Your App</a></dd></dl><dl class='R'><dt>Testing</dt>
<dd><a href='/adding_unit_test.html'>Adding a Unit Test</a></dd>
<dd><a href='/unit_test_framework.html'>Unit Testing</a></dd>
<dd><a href='/writing_unit_tests.html'>Writing Unit Tests</a></dd>
<dd><a href='/running_unit_tests.html'>Running Unit Tests</a></dd>
<dd><a href='/todos_tdd.html'>SproutCore Development Using TDD</a></dd><dt>Extras</dt>
<dd><a href='/build_tools.html'>SproutCore's Build Tools</a></dd>
<dd><a href='/run_loop.html'>The Run Loop</a></dd>
<dd><a href='/enumerables.html'>Enumerables</a></dd><dt>Contributing to SproutCore</dt>
<dd><a href='/style_guide.html'>Javascript Guidelines</a></dd>
<dd><a href='/commit_code.html'>Committer Guidelines</a></dd>
<dd><a href='/documentation_guidelines.html'>Documentation Guidelines</a></dd>
<dd><a href='/contribute.html'>Contributing Guides</a></dd><dt>Thanks</dt>
<dd><a href='/credits.html'>Credits</a></dd></dl>
</div>
</div>
</div>
</div>
<div id="container">
<div class="wrapper">
<div id="mainCol">
<div class='headerSection'>
<h2>Enumerables - The SproutCore Enumerable API</h2>
<p>This guide covers how to work with enumerable SproutCore objects, like Arrays, Sets, ArrayControllers, and RecordArrays. When you are done with this guide, you should be able to:</p>
<ul>
<li>Identify the SproutCore enumerable objects.</li>
<li>Fluently work with enumerable objects using the Enumerable interface.</li>
</ul>
</div>
<h3 id='-What-Are-Enumerables--'>1 - What Are Enumerables?
</h3>
<p>In SproutCore, an Enumerable is any object that contains a number of child
objects, and which allows you to work with those children using the Enumerable
interface. The most basic Enumerable is the built-in JavaScript Array.</p>
<p>For instance, all Enumerables support the standard <tt>forEach</tt> method:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>].forEach(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">item</span>) </span>{
<span class="hljs-built_in">console</span>.log(item);
});</code></div></pre>
<p>In general, Enumerable methods, like <tt>forEach</tt>, take an optional second
parameter, which will become the value of <tt>this</tt> in the callback function:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript"><span class="hljs-keyword">var</span> array = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>];
array.forEach(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">item</span>) </span>{
<span class="hljs-built_in">console</span>.log(item, <span class="hljs-keyword">this</span>.indexOf(item));
}, array)</code></div></pre>
<p>Among other reasons, you will find this useful when using another Enumerable
method as a callback to <tt>forEach</tt>:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript"><span class="hljs-keyword">var</span> array = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>];
array.forEach(array.removeObject, array);</code></div></pre>
<div class='note'><p> This second parameter helps work around a limitation of JavaScript which
sets the value of <tt>this</tt> to <tt>window</tt> in methods used this way.
</p></div>
<h3 id='-Enumerables-in-SproutCore-'>2 - Enumerables in SproutCore
</h3>
<p>In general, SproutCore objects that represent lists implement the Enumerable
interface. Some examples:</p>
<ul>
<li><a href="http://docs.sproutcore.com/#doc=Array">Array</a>: SproutCore extends the
native JavaScript Array with the Enumerable interface.</li>
<li><a href="http://docs.sproutcore.com/#doc=SC.ArrayController">SC.ArrayController</a>: A
construct that wraps a native Array and adds additional functionality for
the view layer.</li>
<li><a href="http://docs.sproutcore.com/#doc=SC.SparseArray">SC.SparseArray</a>: An
Array-like object that will incrementally load in ranges as they are needed
by the view layer.</li>
<li><a href="http://docs.sproutcore.com/#doc=SC.RecordArray">SC.RecordArray</a>: An
Array-like object that represents a list of Record objects. RecordArray's
are "live", and the Data Store can update them when new data comes in from
the backend.</li>
<li><a href="http://docs.sproutcore.com/#doc=SC.Set">SC.Set</a>: An object that can quickly
answer whether it includes an object.</li>
</ul>
<h3 id='-The-Enumerable-Interface-'>3 - The Enumerable Interface
</h3>
<h4 id='-Parameters-'>3.1 - Parameters
</h4>
<p>The callbacks to Enumerable methods take three arguments:</p>
<ul>
<li><em>item</em>: the item for the current iteration.</li>
<li><em>index</em>: an Integer, counting up from 0.</li>
<li><em>self</em>: the Enumerable itself.</li>
</ul>
<h4 id='-Enumeration-'>3.2 - Enumeration
</h4>
<p>To enumerate all the values of an enumerable object, use the <tt>forEach</tt> method:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">enumerable.forEach(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">item, index, self</span>) </span>{
<span class="hljs-built_in">console</span>.log(item);
});</code></div></pre>
<p>To invoke some method on each element of an enumerable object, use the <tt>invoke</tt>
method:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">Person = SC.Object.extend({
<span class="hljs-attr">sayHello</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Hello from "</span> + <span class="hljs-keyword">this</span>.get(<span class="hljs-string">'name'</span>));
}
});
<span class="hljs-keyword">var</span> people = [
Person.create({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Juan"</span> }),
Person.create({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Charles"</span> }),
Person.create({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Majd"</span> })
]
people.invoke(<span class="hljs-string">'sayHello'</span>);
<span class="hljs-comment">// Hello from Juan</span>
<span class="hljs-comment">// Hello from Charles</span>
<span class="hljs-comment">// Hello from Majd</span></code></div></pre>
<h4 id='-First-and-Last-'>3.3 - First and Last
</h4>
<p>You can get the first or last object from an Enumerable by
getting <tt>firstObject</tt> or <tt>lastObject</tt>.</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>].get(<span class="hljs-string">'firstObject'</span>) <span class="hljs-comment">// 1</span>
[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>].get(<span class="hljs-string">'lastObject'</span>) <span class="hljs-comment">// 3</span></code></div></pre>
<h4 id='-Converting-to-Array-'>3.4 - Converting to Array
</h4>
<p>This one is simple. To convert an Enumerable into an Array, simply call
its <tt>toArray</tt> method.</p>
<h4 id='-Transforming-'>3.5 - Transforming
</h4>
<p>You can transform an Enumerable into a derived Array by using the <tt>map</tt> method:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">[<span class="hljs-string">'Goodbye'</span>, <span class="hljs-string">'cruel'</span>, <span class="hljs-string">'world'</span>].map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">item, index, self</span>) </span>{
<span class="hljs-keyword">return</span> item + <span class="hljs-string">"!"</span>;
});
<span class="hljs-comment">// returns ["Goodbye!", "cruel!", "world!"]</span></code></div></pre>
<h4 id='-Setting-and-Getting-on-Each-Object-'>3.6 - Setting and Getting on Each Object
</h4>
<p>A very common use of <tt>forEach</tt> and <tt>map</tt> is to get (or set) a property on each
element. You can use the <tt>getEach</tt> and <tt>setEach</tt> methods to accomplish these
goals.</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript"><span class="hljs-keyword">var</span> arr = [SC.Object.create(), SC.Object.create()];
<span class="hljs-comment">// we now have an Array containing two SC.Objects</span>
arr.setEach(<span class="hljs-string">'name'</span>, <span class="hljs-string">'unknown'</span>);
arr.getEach(<span class="hljs-string">'name'</span>) <span class="hljs-comment">// ['unknown', 'unknown']</span></code></div></pre>
<h4 id='-Filtering-'>3.7 - Filtering
</h4>
<p>Another common task to perform on an Enumerable is to take the Enumerable as
input, and return an Array after sorting or filtering it based on some
criteria.</p>
<p>For arbitrary filtering, use the (you guessed it) <tt>filter</tt> method. The filter
method expects the callback to return <tt>true</tt> if SproutCore should include it in
the final Array, and <tt>false</tt> or <tt>undefined</tt> if SproutCore should not.</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>];
arr.filter(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">item, index, self</span>) </span>{
<span class="hljs-keyword">if</span> (item < <span class="hljs-number">4</span>) { <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>; }
<span class="hljs-comment">// Note, this could also be written as:</span>
<span class="hljs-keyword">return</span> item < <span class="hljs-number">4</span>;
})
<span class="hljs-comment">// returns [1,2,3]</span></code></div></pre>
<p>When working with a collection of SproutCore objects, you will often want to
filter a set of objects based upon the value of some property.
The <tt>filterProperty</tt> method provides a shortcut.</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">Todo = SC.Object.extend({
<span class="hljs-attr">title</span>: <span class="hljs-literal">null</span>,
<span class="hljs-attr">isDone</span>: <span class="hljs-literal">false</span>
});
todos = [
Todo.create({ <span class="hljs-attr">title</span>: <span class="hljs-string">'Write code'</span>, <span class="hljs-attr">isDone</span>: <span class="hljs-literal">true</span> }),
Todo.create({ <span class="hljs-attr">title</span>: <span class="hljs-string">'Go to sleep'</span> })
];
todos.filterProperty(<span class="hljs-string">'isDone'</span>, <span class="hljs-literal">true</span>);
<span class="hljs-comment">// returns an Array containing just the first item</span></code></div></pre>
<p>If you want to return just the first matched value, rather than an Array
containing all of the matched values, you can use <tt>find</tt> and <tt>findProperty</tt>,
which work just like <tt>filter</tt> and <tt>filterProperty</tt>, but return only one item.</p>
<h4 id='-Sorting-'>3.8 - Sorting
</h4>
<p>You can sort an Enumerable based on the value of some property or list of
properties using <tt>sortProperty</tt>. If you pass in multiple properties, SproutCore
will sort items with the same value for the first property by the value of the
second parameter, and so on.</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript"><span class="hljs-keyword">var</span> todos = [
Todo.create({ <span class="hljs-attr">title</span>: <span class="hljs-string">'Write code'</span>, <span class="hljs-attr">isDone</span>: <span class="hljs-literal">true</span> }),
Todo.create({ <span class="hljs-attr">title</span>: <span class="hljs-string">'Go to sleep'</span> }),
Todo.create({ <span class="hljs-attr">title</span>: <span class="hljs-string">'Eat lunch'</span>, <span class="hljs-attr">isDone</span>: <span class="hljs-literal">true</span> })
];
todos.sortProperty(<span class="hljs-string">'isDone'</span>, <span class="hljs-string">'title'</span>);
<span class="hljs-comment">// returns an Array containing</span>
<span class="hljs-comment">// * Go to sleep</span>
<span class="hljs-comment">// * Eat lunch</span>
<span class="hljs-comment">// * Write code</span></code></div></pre>
<p>Internally, the <tt>sortProperty</tt> method uses <tt>SC.compare</tt>, which uses
SproutCore's comparable semantics. You can override the default comparison
behavior for a custom object by using
the <tt><a href="http://docs.sproutcore.com/#doc=SC.Comparable">SC.Comparable</a></tt> mixin.</p>
<h4 id='-Aggregate-Information--All-or-Any--'>3.9 - Aggregate Information (All or Any)
</h4>
<p>If you want to find out whether every item in an Enumerable matches some
condition, you can use the <tt>every</tt> method:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">Person = SC.Object.extend({
<span class="hljs-attr">name</span>: <span class="hljs-literal">null</span>,
<span class="hljs-attr">isHappy</span>: <span class="hljs-literal">false</span>
});
<span class="hljs-keyword">var</span> people = [
Person.create({ <span class="hljs-attr">name</span>: <span class="hljs-string">'Yehuda'</span>, <span class="hljs-attr">isHappy</span>: <span class="hljs-literal">true</span> }),
Person.create({ <span class="hljs-attr">name</span>: <span class="hljs-string">'Majd'</span>, <span class="hljs-attr">isHappy</span>: <span class="hljs-literal">false</span> })
];
people.every(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">person, index, self</span>) </span>{
<span class="hljs-keyword">if</span>(person.get(<span class="hljs-string">'isHappy'</span>)) { <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>; }
});
<span class="hljs-comment">// returns false</span></code></div></pre>
<p>If you want to find out whether at least one item in an Enumerable matches some
conditions, you can use the <tt>some</tt> method:</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">people.some(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">person, index, self</span>) </span>{
<span class="hljs-keyword">if</span>(person.get(<span class="hljs-string">'isHappy'</span>)) { <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>; }
});
<span class="hljs-comment">// returns true</span></code></div></pre>
<p>Just like the filtering methods, the <tt>every</tt> and <tt>some</tt> methods have
analogous <tt>everyProperty</tt> and <tt>someProperty</tt> methods.</p>
<pre class="highlighted"><div class="code_container"><code class="hljs javascript">people.everyProperty(<span class="hljs-string">'isHappy'</span>, <span class="hljs-literal">true</span>) <span class="hljs-comment">// false</span>
people.someProperty(<span class="hljs-string">'isHappy'</span>, <span class="hljs-literal">true</span>) <span class="hljs-comment">// true</span></code></div></pre>
<h3 id='-Changelog-'>4 - Changelog
</h3>
<ul>
<li>May 3, 2011: initial version by <a href="credits.html#wycats">Yehuda Katz</a></li>
<li>August 14, 2013: converted to Markdown format for DocPad guides by <a href="credits.html#topherfangio">Topher Fangio</a></li>
<li>August 14, 2013: minor formatting and example updates by <a href="credits.html#topherfangio">Topher Fangio</a></li>
</ul>
</div>
<!-- TODO: re-add index_items //-->
<div id="subCol">
<h3 class="chapter"><img src="images/graphics/chapters.png" alt="">Chapters</h3>
<ol class='chapters'>
<li>
<a href='#-What-Are-Enumerables--'><p> What Are Enumerables?
</p></a>
<ul>
</ul>
</li>
<li>
<a href='#-Enumerables-in-SproutCore-'><p> Enumerables in SproutCore
</p></a>
<ul>
</ul>
</li>
<li>
<a href='#-The-Enumerable-Interface-'><p> The Enumerable Interface
</p></a>
<ul>
<li><a href='#-Parameters-'><p> Parameters
</p></a></li>
<li><a href='#-Enumeration-'><p> Enumeration
</p></a></li>
<li><a href='#-First-and-Last-'><p> First and Last
</p></a></li>
<li><a href='#-Converting-to-Array-'><p> Converting to Array
</p></a></li>
<li><a href='#-Transforming-'><p> Transforming
</p></a></li>
<li><a href='#-Setting-and-Getting-on-Each-Object-'><p> Setting and Getting on Each Object
</p></a></li>
<li><a href='#-Filtering-'><p> Filtering
</p></a></li>
<li><a href='#-Sorting-'><p> Sorting
</p></a></li>
<li><a href='#-Aggregate-Information--All-or-Any--'><p> Aggregate Information (All or Any)
</p></a></li>
</ul>
</li>
<li>
<a href='#-Changelog-'><p> Changelog
</p></a>
<ul>
</ul>
</li>
</ol>
</div>
</div>
</div>
<hr class="hide" />
<footer>
<div class="container">
<div class="col">
<a href="index.html"><img src="images/footer/sc_logo_medium.png" alt="SproutCore" /></a>
<p id="license">
SproutCore framework is under MIT License.
</p>
</div>
<nav class="col">
<h1>Site Navigation</h1>
<ul>
<li><a href="http://www.sproutcore.com/about/">About</a></li>
<li><a href="http://docs.sproutcore.com">Docs</a></li>
<li><a href="http://blog.sproutcore.com">Blog</a></li>
<li><a href="http://www.sproutcore.com/install/?redirect=1">Download</a></li>
<li><a href="http://www.sproutcore.com/community/">Community</a></li>
<li><a href="https://github.com/sproutcore/sproutcore">GitHub</a></li>
<li><a href="mailto:community@sproutcore.com">Contact Us</a></li>
<li><a href="http://guides.sproutcore.com">Guides</a></li>
</ul>
<a href="http://www.w3.org/html/logo/"><img src="images/footer/html5_tech.png" alt="HTML5 Powered" /></a>
</nav>
<div class="col">
<h1>Get in Touch, Stay Informed</h1>
<ul class="social">
<li><a href="http://twitter.com/sproutcore"><img src="images/footer/twitter.png" alt="Twitter" /></a></li>
<li><a href="http://www.facebook.com/sproutcore"><img src="images/footer/facebook.png" alt="Facebook" /></a></li>
<li><a href="http://groups.google.com/group/sproutcore"><img src="images/footer/google.png" alt="Google Groups" /></a></li>
<li><a href="http://groups.google.com/group/sproutcore">Subscribe To Mailing List</a></li>
</ul>
<a href="http://eepurl.com/dK1-Y" target="_blank" id="newsletter" class="button secondary">Sign Up For Our Newsletter!</a>
<!-- Commented out until we have mailchimp API integration.
<h2>Subscribe To Newsletter</h2>
<div id="subscribe">
<form>
<input type="text" name="email" />
<button name="subscribe">Sign-Up</button>
<div class="processing"><img src="/img/spinner.gif"></div>
<div class="error"></div>
</form>
</div>
-->
</div>
<a href="#feature" class="top">Back To Top</a>
</div>
</footer>
<script type='text/javascript' src='/javascripts/jquery.min.js'></script>
<script type='text/javascript'>
/*
* Make the guides link clickable
*/
function guideMenu(e){
if (document.getElementById('guides').style.display == "none") {
document.getElementById('guides').style.display = "block";
document.getElementById('guidesArrow').innerHTML = "▾";
$('body').click(function(e){ guideMenu(e); });
} else {
document.getElementById('guides').style.display = "none";
document.getElementById('guidesArrow').innerHTML = "▸";
$('body').unbind('click');
}
return false;
}
$('#guidesMenu, .guidesMenu').click(guideMenu);
</script>
</body>
</html>