-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
356 lines (305 loc) · 16.4 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>AuraJS - Aura</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name='description' content="" />
<meta property='og:title' content="aura" />
<meta property='og:type' content='company' />
<meta property='og:site_name' content="aura" />
<meta property='og:url' content="http://aurajs.com" />
<link href="/stylesheets/style.css?1409534115" media="screen" rel="stylesheet" type="text/css" />
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" type="text/javascript"></script>
<script src="/javascripts/application.js?1409533889" type="text/javascript"></script>
<script src="/javascripts/modernizr.js?1409533889" type="text/javascript"></script>
<!--[if lte IE 7]>
<script src="/javascripts/lte-ie7.js?1409533889" type="text/javascript"></script>
<![endif]-->
<script src="//d3f5pyioow99x0.cloudfront.net/0.5.2/hull.js"></script>
<script>Hull.init({"appId":"51da11e01234b56ba0000202","orgUrl":"https://aura.hullapp.io","debug":true});</script>
</head>
<body class="landing">
<header>
<nav class="nav" id="secondary-nav" role="navigation">
<ul>
<li class="">
<a href="/about" rel="About">
About
</a>
</li>
<li class="">
<a href="/getting-started" rel="Getting Started">
Getting Started
</a>
</li>
<li class="">
<a href="/api" rel="API">
API
</a>
</li>
<li class="">
<a href="/examples" rel="Examples">
Examples
</a>
</li>
<li>
<form class='search'>
<input type="text" id="st-search-input" class="st-search-input" placeholder="search" />
</form>
<div id="st-results-container"></div>
<script type="text/javascript">
var Swiftype = window.Swiftype || {};
(function() {
Swiftype.key = 'Z619VxpR5vi4c1qrxFS2';
Swiftype.inputElement = '#st-search-input';
Swiftype.resultContainingElement = '#st-results-container';
Swiftype.attachElement = '#st-search-input';
Swiftype.renderStyle = "overlay";
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = "//swiftype.com/embed.js";
var entry = document.getElementsByTagName('script')[0];
entry.parentNode.insertBefore(script, entry);
}());
</script>
</li>
</ul>
</nav>
<div id="toggle"><i class="icon-angle-down"></i></div>
</header>
<section>
<div id="particles"></div>
<header class="hero-unit row">
<div class="logo cell-4">
<img height="220" width="220" src="/images/logos/white_halo.png?1409533889" />
</div>
<div class="cell-8">
<h1>Declarative component sugar for event-driven RequireJS apps</h1>
<div class="row">
<a class="button btn large" title="Download Aura" href="//github.com/aurajs/aura/zipball/master">Download Aura v0.9.2</a>
<a class="button btn" title="Download Boilerplate" href="//github.com/aurajs/boilerplate/tarball/master">Download Boilerplate</a>
</div>
</div>
</header>
<article>
<div class="row">
<div class="cell-4">
<h2><i class="icon-atom"></i>Everything is a Component</h2>
<p>An Aura component represents a unit of a page.
An independent block of reusable code, wrapped
up so that it works well on its own or together with
other components.
<p>Specify a component source, and you can just start
including them in your page on demand
with data attributes.</p>
</p>
<a href="/getting-started" title="Everything is a Component">See More <i class="icon-angle-right"></i></a>
</div>
<div class="cell-4">
<h2><i class="icon-chat-alt-stroke"></i>Messaging & Sandboxing</h2>
<p>Aura Events give components a rich way to communicate between each other
at a global or local level. Subscribe, unsubscribe and emit sandboxed event notifications.
<p>An Aura sandbox is the layer between you and your library.
It gives you the flexibility to switch out libraries with greater ease.</p>
</p>
<a href="/guides" title="Messaging & Sandboxing">See More <i class="icon-angle-right"></i></a>
</div>
<div class="cell-4">
<h2><i class="icon-rocket"></i>Easily extend capabilities</h2>
<p>Aura Extensions help you extend the core capabilities of your app
before any of your components load. Want to ensure all of them have
access to a particular library, like Backbone, or an API wrapper, like GitHub?
<p>It'll make them available via the component's sandbox so you don't have
to worry about importing and setting this up yourself.</p>
</p>
<a href="/api" title="Easily extend capabilities">See More <i class="icon-angle-right"></i></a>
</div>
</div>
<div class="row">
<h2>Examples</h2>
<p>Let's define the simplest possible component. We'll call it <code>cats</code>. This loads in a template <code>cats.hbs</code> used to represent some UI:</p>
<div class="highlight js "><div class="ribbon"></div><div class="scroller"><table class="CodeRay"><tr>
<td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1
2
3
4
5
6
7
</pre></td>
<td class="code"><pre>define([<span class="string"><span class="delimiter">'</span><span class="content">text!./cats.hbs</span><span class="delimiter">'</span></span>], <span class="keyword">function</span>(template) {
<span class="keyword">return</span> {
<span class="function">initialize</span>: <span class="keyword">function</span>() {
<span class="local-variable">this</span>.html(template);
}
};
});
</pre></td>
</tr></table>
</div></div>
<p>Our component <code>cats</code> can now be included on a page using an HTML tag and the <code>data-aura-component</code> attribute:</p>
<div class="highlight html "><div class="ribbon"></div><div class="scroller"><table class="CodeRay"><tr>
<td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1
</pre></td>
<td class="code"><pre><span class="tag"><div</span> <span class="attribute-name">data-aura-component</span>=<span class="string"><span class="delimiter">"</span><span class="content">cats</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></div></span>
</pre></td>
</tr></table>
</div></div>
<p>You can also pass options to your tag to configure the component via data-attributes, too:</p>
<div class="highlight html "><div class="ribbon"></div><div class="scroller"><table class="CodeRay"><tr>
<td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1
2
3
4
</pre></td>
<td class="code"><pre><span class="tag"><div</span> <span class="attribute-name">data-aura-component</span>=<span class="string"><span class="delimiter">"</span><span class="content">cats</span><span class="delimiter">"</span></span>
<span class="attribute-name">data-aura-foo</span>=<span class="string"><span class="delimiter">"</span><span class="content">bar</span><span class="delimiter">"</span></span>
<span class="attribute-name">data-aura-other-option</span>=<span class="string"><span class="delimiter">"</span><span class="content">hihi</span><span class="delimiter">"</span></span><span class="tag">></span>
<span class="tag"></div></span>
</pre></td>
</tr></table>
</div></div>
<p>These will then be available in your component instance as:</p>
<div class="highlight js "><div class="ribbon"></div><div class="scroller"><table class="CodeRay"><tr>
<td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1
2
</pre></td>
<td class="code"><pre><span class="local-variable">this</span>.options.foo <span class="comment">// -> bar</span>
<span class="local-variable">this</span>.options.otherOption <span class="comment">// -> hello again</span>
</pre></td>
</tr></table>
</div></div>
<p>The Aura Mediator supports global and sandboxed event messaging. These allow components to communicate with each other by subscribing, unsubscribing and emitting event notifications. Namespaces, wildcards and more are supported.</p>
<div class="highlight js "><div class="ribbon"></div><div class="scroller"><table class="CodeRay"><tr>
<td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1
2
3
4
5
6
7
8
9
<strong>10</strong>
11
12
13
14
</pre></td>
<td class="code"><pre>define([<span class="string"><span class="delimiter">'</span><span class="content">text!./cats.hbs</span><span class="delimiter">'</span></span>], <span class="keyword">function</span>(template) {
<span class="keyword">return</span> {
<span class="function">initialize</span>: <span class="keyword">function</span>() {
<span class="local-variable">this</span>.sandbox.on(<span class="string"><span class="delimiter">'</span><span class="content">cats.update</span><span class="delimiter">'</span></span>, <span class="local-variable">this</span>.render, <span class="local-variable">this</span>);
},
<span class="function">render</span>: <span class="keyword">function</span>(stats) {
<span class="local-variable">this</span>.html(template(stats || {}));
<span class="local-variable">this</span>.<span class="predefined">$el</span>.find(<span class="string"><span class="delimiter">'</span><span class="content">button</span><span class="delimiter">'</span></span>).on(<span class="string"><span class="delimiter">'</span><span class="content">click</span><span class="delimiter">'</span></span>, _.bind(<span class="local-variable">this</span>.clearKitty, <span class="local-variable">this</span>));
},
<span class="function">clearKitty</span>: <span class="keyword">function</span>() {
<span class="local-variable">this</span>.sandbox.emit(<span class="string"><span class="delimiter">'</span><span class="content">cats.clear</span><span class="delimiter">'</span></span>);
}
}
});
</pre></td>
</tr></table>
</div></div>
<p>Aura also comes with the awesome ability to load components on demand from different sources. Doing this:</p>
<div class="highlight js "><div class="ribbon"></div><div class="scroller"><table class="CodeRay"><tr>
<td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1
2
3
</pre></td>
<td class="code"><pre>aura({
<span class="key">sources</span>: { <span class="keyword">default</span>: <span class="string"><span class="delimiter">'</span><span class="content">https://another.doma.in/path/to/my/components</span><span class="delimiter">'</span></span> }
}).start();
</pre></td>
</tr></table>
</div></div>
<p>...lets us load all sorts of other components from this end-point:</p>
<div class="highlight html "><div class="ribbon"></div><div class="scroller"><table class="CodeRay"><tr>
<td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1
2
3
</pre></td>
<td class="code"><pre><span class="tag"><div</span> <span class="attribute-name">data-aura-component</span>=<span class="string"><span class="delimiter">"</span><span class="content">dogs</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></div></span>
<span class="tag"><div</span> <span class="attribute-name">data-aura-component</span>=<span class="string"><span class="delimiter">"</span><span class="content">fish</span><span class="delimiter">"</span></span> <span class="attribute-name">data-aura-home</span>=<span class="string"><span class="delimiter">"</span><span class="content">bowl</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></div></span>
<span class="tag"><div</span> <span class="attribute-name">data-aura-component</span>=<span class="string"><span class="delimiter">"</span><span class="content">rabbits</span><span class="delimiter">"</span></span> <span class="attribute-name">data-aura-eats</span>=<span class="string"><span class="delimiter">"</span><span class="content">carrots</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></div></span>
</pre></td>
</tr></table>
</div></div>
</div>
<div class="row">
<div class="cell-4">
<h2><i class="icon-wand"></i>It's framework-agnostic</h2>
<figcaption>
<p>Aura is built to be framework-agnostic — you can use it with or without your favorite JS framework.</p>
<p>Aura works well with popular frameworks including Angular, Backbone, Ember and more…</p>
<ul class="secret-list island">
<li>
<a href="//angularjs.org" title="Angular website">
<div class="js-framework angular"></div>
</a>
</li>
<li>
<a href="//backbonejs.org" title="Backbone website">
<div class="js-framework backbone"></div>
</a>
</li>
<li>
<a href="//emberjs.com/" title="Ember website">
<div class="js-framework ember"></div>
</a>
</li>
</ul>
</figcaption>
</div>
<figure class="cell-8">
<img height="auto" width="100%" alt="Aura Architecture Diagram" src="/images/docs/schema.svg?1409533889" />
</figure>
</div>
<div class="secondary-section sub-section">
<div class="row align-center">
<a class="button btn small" href="//github.com/aurajs/aura/zipball/master">Download Aura v0.9.2</a>
<a class="button btn small" href="//github.com/aurajs/boilerplate/tarball/master">Download Boilerplate</a>
</div>
</div>
</article>
</section>
<footer>
<div class="row">
<div class="cell-6">
<a href="//github.com/aurajs/aura" title="Aura on GitHub"><i class="icon-github"></i>GitHub</a>
<a href="//stackoverflow.com/questions/tagged/aura" title="Aura on Stack Overflow"><i class="icon-stackoverflow"></i>Stack Overflow</a>
</div>
<div class="cell-6 small">
<dl>
<dt>Currently maintained by:</dt>
<dd class="pull-left"><a title="Stephane Bellity" href="//github.com/sbellity">Stephane Bellity</a></dd>
<dd class="pull-left"><a title="Addy Osmani" href="//github.com/addyosmani">Addy Osmani</a></dd>
<dd class="pull-left"><a title="Ates Goral" href="//github.com/atesgoral">Ates Goral</a></dd>
<dd class="pull-left"><a title="Juan Pablo Buritica" href="//github.com/Buritica">Juan Pablo Buritica</a></dd>
<dd class="pull-left"><a title="Joel Hooks" href="//github.com/joelhooks">Joel Hooks</a></dd>
<dd class="pull-left"><a title="Dan Lynch" href="//github.com/pyramation">Dan Lynch</a></dd>
<dd class="pull-left"><a title="Robert Djurasaj" href="//github.com/robertd">Robert Djurasaj</a></dd>
<dd class="pull-left"><a title="Peter Rudolfsen" href="//github.com/rudolfrck">Peter Rudolfsen</a></dd>
<dd class="pull-left"><a title="Sindre Sorhus" href="//github.com/sindresorhus">Sindre Sorhus</a></dd>
<dd class="pull-left"><a title="Romain Dardour" href="//github.com/unity">Romain Dardour</a></dd>
<dd class="pull-left"><a title="Tony Narlock" href="//github.com/tony">Tony Narlock</a></dd>
<dd class="pull-left"><a title="Dustin Boston" href="//github.com/dustinboston">Dustin Boston</a></dd>
</dl>
</div>
</div>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42334008-1', 'aurajs.github.io');
ga('send', 'pageview');
</script>
</body>
</html>