Remove TodoMVCs from examples/
Fixes #1154. Added a README to point to TodoMVC's site instead.
Cheng Lou committed
Feb 21, 2014 at 14:21 UTC
2f0507f73030d95dac77b7dd2af61cbc9e5e0115
17 files changed
+5
-1418
examples/README.md
new
+5
@@ -0,0 +1,5 @@
1
+# React Examples
2
+
3
+Here are some demo usages of React, with optional [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) and third-party integration.
4
+
5
+For more fully-featured examples, check out [React TodoMVC](http://todomvc.com/architecture-examples/react/) and [React + Backbone TodoMVC](http://todomvc.com/labs/architecture-examples/react-backbone/).
examples/todomvc-backbone/README.md
deleted
-3
@@ -1,3 +0,0 @@
1
-# TodoMVC-Backbone
2
-
3
-This is a lightweight version of TodoMVC. Its primary purpose is to demo the Backbone integration rather than being feature-complete (refer to `todomvc-director` for a full TodoMVC-compilant app).
examples/todomvc-backbone/css/base.css
deleted
-556
@@ -1,556 +0,0 @@
1
-html,
2
-body {
3
- margin: 0;
4
- padding: 0;
5
-}
6
-
7
-button {
8
- margin: 0;
9
- padding: 0;
10
- border: 0;
11
- background: none;
12
- font-size: 100%;
13
- vertical-align: baseline;
14
- font-family: inherit;
15
- color: inherit;
16
- -webkit-appearance: none;
17
- /*-moz-appearance: none;*/
18
- -ms-appearance: none;
19
- -o-appearance: none;
20
- appearance: none;
21
-}
22
-
23
-body {
24
- font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
25
- line-height: 1.4em;
26
- background: #eaeaea url('bg.png');
27
- color: #4d4d4d;
28
- width: 550px;
29
- margin: 0 auto;
30
- -webkit-font-smoothing: antialiased;
31
- -moz-font-smoothing: antialiased;
32
- -ms-font-smoothing: antialiased;
33
- -o-font-smoothing: antialiased;
34
- font-smoothing: antialiased;
35
-}
36
-
37
-#todoapp {
38
- background: #fff;
39
- background: rgba(255, 255, 255, 0.9);
40
- margin: 130px 0 40px 0;
41
- border: 1px solid #ccc;
42
- position: relative;
43
- border-top-left-radius: 2px;
44
- border-top-right-radius: 2px;
45
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.2),
46
- 0 25px 50px 0 rgba(0, 0, 0, 0.15);
47
-}
48
-
49
-#todoapp:before {
50
- content: '';
51
- border-left: 1px solid #f5d6d6;
52
- border-right: 1px solid #f5d6d6;
53
- width: 2px;
54
- position: absolute;
55
- top: 0;
56
- left: 40px;
57
- height: 100%;
58
-}
59
-
60
-#todoapp input::-webkit-input-placeholder {
61
- font-style: italic;
62
-}
63
-
64
-#todoapp input::-moz-placeholder {
65
- font-style: italic;
66
- color: #a9a9a9;
67
-}
68
-
69
-#todoapp h1 {
70
- position: absolute;
71
- top: -120px;
72
- width: 100%;
73
- font-size: 70px;
74
- font-weight: bold;
75
- text-align: center;
76
- color: #b3b3b3;
77
- color: rgba(255, 255, 255, 0.3);
78
- text-shadow: -1px -1px rgba(0, 0, 0, 0.2);
79
- -webkit-text-rendering: optimizeLegibility;
80
- -moz-text-rendering: optimizeLegibility;
81
- -ms-text-rendering: optimizeLegibility;
82
- -o-text-rendering: optimizeLegibility;
83
- text-rendering: optimizeLegibility;
84
-}
85
-
86
-#header {
87
- padding-top: 15px;
88
- border-radius: inherit;
89
-}
90
-
91
-#header:before {
92
- content: '';
93
- position: absolute;
94
- top: 0;
95
- right: 0;
96
- left: 0;
97
- height: 15px;
98
- z-index: 2;
99
- border-bottom: 1px solid #6c615c;
100
- background: #8d7d77;
101
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(132, 110, 100, 0.8)),to(rgba(101, 84, 76, 0.8)));
102
- background: -webkit-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8));
103
- background: -moz-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8));
104
- background: -o-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8));
105
- background: -ms-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8));
106
- background: linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8));
107
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#9d8b83', EndColorStr='#847670');
108
- border-top-left-radius: 1px;
109
- border-top-right-radius: 1px;
110
-}
111
-
112
-#new-todo,
113
-.edit {
114
- position: relative;
115
- margin: 0;
116
- width: 100%;
117
- font-size: 24px;
118
- font-family: inherit;
119
- line-height: 1.4em;
120
- border: 0;
121
- outline: none;
122
- color: inherit;
123
- padding: 6px;
124
- border: 1px solid #999;
125
- box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
126
- -webkit-box-sizing: border-box;
127
- -moz-box-sizing: border-box;
128
- -ms-box-sizing: border-box;
129
- -o-box-sizing: border-box;
130
- box-sizing: border-box;
131
- -webkit-font-smoothing: antialiased;
132
- -moz-font-smoothing: antialiased;
133
- -ms-font-smoothing: antialiased;
134
- -o-font-smoothing: antialiased;
135
- font-smoothing: antialiased;
136
-}
137
-
138
-#new-todo {
139
- padding: 16px 16px 16px 60px;
140
- border: none;
141
- background: rgba(0, 0, 0, 0.02);
142
- z-index: 2;
143
- box-shadow: none;
144
-}
145
-
146
-#main {
147
- position: relative;
148
- z-index: 2;
149
- border-top: 1px dotted #adadad;
150
-}
151
-
152
-label[for='toggle-all'] {
153
- display: none;
154
-}
155
-
156
-#toggle-all {
157
- position: absolute;
158
- top: -42px;
159
- left: -4px;
160
- width: 40px;
161
- text-align: center;
162
- border: none; /* Mobile Safari */
163
-}
164
-
165
-#toggle-all:before {
166
- content: '»';
167
- font-size: 28px;
168
- color: #d9d9d9;
169
- padding: 0 25px 7px;
170
-}
171
-
172
-#toggle-all:checked:before {
173
- color: #737373;
174
-}
175
-
176
-#todo-list {
177
- margin: 0;
178
- padding: 0;
179
- list-style: none;
180
-}
181
-
182
-#todo-list li {
183
- position: relative;
184
- font-size: 24px;
185
- border-bottom: 1px dotted #ccc;
186
-}
187
-
188
-#todo-list li:last-child {
189
- border-bottom: none;
190
-}
191
-
192
-#todo-list li.editing {
193
- border-bottom: none;
194
- padding: 0;
195
-}
196
-
197
-#todo-list li.editing .edit {
198
- display: block;
199
- width: 506px;
200
- padding: 13px 17px 12px 17px;
201
- margin: 0 0 0 43px;
202
-}
203
-
204
-#todo-list li.editing .view {
205
- display: none;
206
-}
207
-
208
-#todo-list li .toggle {
209
- text-align: center;
210
- width: 40px;
211
- /* auto, since non-WebKit browsers doesn't support input styling */
212
- height: auto;
213
- position: absolute;
214
- top: 0;
215
- bottom: 0;
216
- margin: auto 0;
217
- border: none; /* Mobile Safari */
218
- -webkit-appearance: none;
219
- /*-moz-appearance: none;*/
220
- -ms-appearance: none;
221
- -o-appearance: none;
222
- appearance: none;
223
-}
224
-
225
-#todo-list li .toggle:after {
226
- content: '✔';
227
- line-height: 43px; /* 40 + a couple of pixels visual adjustment */
228
- font-size: 20px;
229
- color: #d9d9d9;
230
- text-shadow: 0 -1px 0 #bfbfbf;
231
-}
232
-
233
-#todo-list li .toggle:checked:after {
234
- color: #85ada7;
235
- text-shadow: 0 1px 0 #669991;
236
- bottom: 1px;
237
- position: relative;
238
-}
239
-
240
-#todo-list li label {
241
- white-space: pre;
242
- word-break: break-word;
243
- padding: 15px 60px 15px 15px;
244
- margin-left: 45px;
245
- display: block;
246
- line-height: 1.2;
247
- -webkit-transition: color 0.4s;
248
- -moz-transition: color 0.4s;
249
- -ms-transition: color 0.4s;
250
- -o-transition: color 0.4s;
251
- transition: color 0.4s;
252
-}
253
-
254
-#todo-list li.completed label {
255
- color: #a9a9a9;
256
- text-decoration: line-through;
257
-}
258
-
259
-#todo-list li .destroy {
260
- display: none;
261
- position: absolute;
262
- top: 0;
263
- right: 10px;
264
- bottom: 0;
265
- width: 40px;
266
- height: 40px;
267
- margin: auto 0;
268
- font-size: 22px;
269
- color: #a88a8a;
270
- -webkit-transition: all 0.2s;
271
- -moz-transition: all 0.2s;
272
- -ms-transition: all 0.2s;
273
- -o-transition: all 0.2s;
274
- transition: all 0.2s;
275
-}
276
-
277
-#todo-list li .destroy:hover {
278
- text-shadow: 0 0 1px #000,
279
- 0 0 10px rgba(199, 107, 107, 0.8);
280
- -webkit-transform: scale(1.3);
281
- -moz-transform: scale(1.3);
282
- -ms-transform: scale(1.3);
283
- -o-transform: scale(1.3);
284
- transform: scale(1.3);
285
-}
286
-
287
-#todo-list li .destroy:after {
288
- content: '✖';
289
-}
290
-
291
-#todo-list li:hover .destroy {
292
- display: block;
293
-}
294
-
295
-#todo-list li .edit {
296
- display: none;
297
-}
298
-
299
-#todo-list li.editing:last-child {
300
- margin-bottom: -1px;
301
-}
302
-
303
-#footer {
304
- color: #777;
305
- padding: 0 15px;
306
- position: absolute;
307
- right: 0;
308
- bottom: -31px;
309
- left: 0;
310
- height: 20px;
311
- z-index: 1;
312
- text-align: center;
313
-}
314
-
315
-#footer:before {
316
- content: '';
317
- position: absolute;
318
- right: 0;
319
- bottom: 31px;
320
- left: 0;
321
- height: 50px;
322
- z-index: -1;
323
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3),
324
- 0 6px 0 -3px rgba(255, 255, 255, 0.8),
325
- 0 7px 1px -3px rgba(0, 0, 0, 0.3),
326
- 0 43px 0 -6px rgba(255, 255, 255, 0.8),
327
- 0 44px 2px -6px rgba(0, 0, 0, 0.2);
328
-}
329
-
330
-#todo-count {
331
- float: left;
332
- text-align: left;
333
-}
334
-
335
-#filters {
336
- margin: 0;
337
- padding: 0;
338
- list-style: none;
339
- position: absolute;
340
- right: 0;
341
- left: 0;
342
-}
343
-
344
-#filters li {
345
- display: inline;
346
-}
347
-
348
-#filters li a {
349
- color: #83756f;
350
- margin: 2px;
351
- text-decoration: none;
352
-}
353
-
354
-#filters li a.selected {
355
- font-weight: bold;
356
-}
357
-
358
-#clear-completed {
359
- float: right;
360
- position: relative;
361
- line-height: 20px;
362
- text-decoration: none;
363
- background: rgba(0, 0, 0, 0.1);
364
- font-size: 11px;
365
- padding: 0 10px;
366
- border-radius: 3px;
367
- box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.2);
368
-}
369
-
370
-#clear-completed:hover {
371
- background: rgba(0, 0, 0, 0.15);
372
- box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.3);
373
-}
374
-
375
-#info {
376
- margin: 65px auto 0;
377
- color: #a6a6a6;
378
- font-size: 12px;
379
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
380
- text-align: center;
381
-}
382
-
383
-#info a {
384
- color: inherit;
385
-}
386
-
387
-/*
388
- Hack to remove background from Mobile Safari.
389
- Can't use it globally since it destroys checkboxes in Firefox and Opera
390
-*/
391
-@media screen and (-webkit-min-device-pixel-ratio:0) {
392
- #toggle-all,
393
- #todo-list li .toggle {
394
- background: none;
395
- }
396
-
397
- #todo-list li .toggle {
398
- height: 40px;
399
- }
400
-
401
- #toggle-all {
402
- top: -56px;
403
- left: -15px;
404
- width: 65px;
405
- height: 41px;
406
- -webkit-transform: rotate(90deg);
407
- transform: rotate(90deg);
408
- -webkit-appearance: none;
409
- appearance: none;
410
- }
411
-}
412
-
413
-.hidden {
414
- display: none;
415
-}
416
-
417
-hr {
418
- margin: 20px 0;
419
- border: 0;
420
- border-top: 1px dashed #C5C5C5;
421
- border-bottom: 1px dashed #F7F7F7;
422
-}
423
-
424
-.learn a {
425
- font-weight: normal;
426
- text-decoration: none;
427
- color: #b83f45;
428
-}
429
-
430
-.learn a:hover {
431
- text-decoration: underline;
432
- color: #787e7e;
433
-}
434
-
435
-.learn h3,
436
-.learn h4,
437
-.learn h5 {
438
- margin: 10px 0;
439
- font-weight: 500;
440
- line-height: 1.2;
441
- color: #000;
442
-}
443
-
444
-.learn h3 {
445
- font-size: 24px;
446
-}
447
-
448
-.learn h4 {
449
- font-size: 18px;
450
-}
451
-
452
-.learn h5 {
453
- margin-bottom: 0;
454
- font-size: 14px;
455
-}
456
-
457
-.learn ul {
458
- padding: 0;
459
- margin: 0 0 30px 25px;
460
-}
461
-
462
-.learn li {
463
- line-height: 20px;
464
-}
465
-
466
-.learn p {
467
- font-size: 15px;
468
- font-weight: 300;
469
- line-height: 1.3;
470
- margin-top: 0;
471
- margin-bottom: 0;
472
-}
473
-
474
-.quote {
475
- border: none;
476
- margin: 20px 0 60px 0;
477
-}
478
-
479
-.quote p {
480
- font-style: italic;
481
-}
482
-
483
-.quote p:before {
484
- content: '“';
485
- font-size: 50px;
486
- opacity: .15;
487
- position: absolute;
488
- top: -20px;
489
- left: 3px;
490
-}
491
-
492
-.quote p:after {
493
- content: '”';
494
- font-size: 50px;
495
- opacity: .15;
496
- position: absolute;
497
- bottom: -42px;
498
- right: 3px;
499
-}
500
-
501
-.quote footer {
502
- position: absolute;
503
- bottom: -40px;
504
- right: 0;
505
-}
506
-
507
-.quote footer img {
508
- border-radius: 3px;
509
-}
510
-
511
-.quote footer a {
512
- margin-left: 5px;
513
- vertical-align: middle;
514
-}
515
-
516
-.speech-bubble {
517
- position: relative;
518
- padding: 10px;
519
- background: rgba(0, 0, 0, .04);
520
- border-radius: 5px;
521
-}
522
-
523
-.speech-bubble:after {
524
- content: '';
525
- position: absolute;
526
- top: 100%;
527
- right: 30px;
528
- border: 13px solid transparent;
529
- border-top-color: rgba(0, 0, 0, .04);
530
-}
531
-
532
-/**body*/.learn-bar > .learn {
533
- position: absolute;
534
- width: 272px;
535
- top: 8px;
536
- left: -300px;
537
- padding: 10px;
538
- border-radius: 5px;
539
- background-color: rgba(255, 255, 255, .6);
540
- transition-property: left;
541
- transition-duration: 500ms;
542
-}
543
-
544
-@media (min-width: 899px) {
545
- /**body*/.learn-bar {
546
- width: auto;
547
- margin: 0 0 0 300px;
548
- }
549
- /**body*/.learn-bar > .learn {
550
- left: 8px;
551
- }
552
- /**body*/.learn-bar #todoapp {
553
- width: 550px;
554
- margin: 130px auto 40px auto;
555
- }
556
-}
examples/todomvc-backbone/css/bg.png
Binary files a/examples/todomvc-backbone/css/bg.png and /dev/null differ
examples/todomvc-backbone/index.html
deleted
-22
@@ -1,22 +0,0 @@
1
-<!doctype html>
2
-<html lang="en">
3
-<head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
- <title>React • TodoMVC</title>
7
- <link rel="stylesheet" href="css/base.css">
8
- <!--[if IE]>
9
- <script src="js/ie.js"></script>
10
- <![endif]-->
11
-</head>
12
-<body>
13
- <div id="container"></div>
14
- <script src="../../build/react.js"></script>
15
- <script src="../../build/JSXTransformer.js"></script>
16
- <script type="text/javascript" src="../shared/thirdparty/jquery.min.js" charset="utf-8"></script>
17
- <script type="text/javascript" src="thirdparty/lodash.min.js" charset="utf-8"></script>
18
- <script type="text/javascript" src="thirdparty/backbone-min.js" charset="utf-8"></script>
19
- <script type="text/javascript" src="thirdparty/backbone.localStorage-min.js" charset="utf-8"></script>
20
- <script type="text/jsx" src="js/app.js"></script>
21
-</body>
22
-</html>
examples/todomvc-backbone/js/app.js
deleted
-303
@@ -1,303 +0,0 @@
1
-/** @jsx React.DOM */
2
-
3
-var Todo = Backbone.Model.extend({
4
- // Default attributes for the todo
5
- // and ensure that each todo created has `title` and `completed` keys.
6
- defaults: {
7
- title: '',
8
- completed: false
9
- },
10
-
11
- // Toggle the `completed` state of this todo item.
12
- toggle: function() {
13
- this.save({
14
- completed: !this.get('completed')
15
- });
16
- }
17
-});
18
-
19
-var TodoList = Backbone.Collection.extend({
20
-
21
- // Reference to this collection's model.
22
- model: Todo,
23
-
24
- // Save all of the todo items under the `"todos"` namespace.
25
- localStorage: new Store('todos-react-backbone'),
26
-
27
- // Filter down the list of all todo items that are finished.
28
- completed: function() {
29
- return this.filter(function( todo ) {
30
- return todo.get('completed');
31
- });
32
- },
33
-
34
- remaining: function() {
35
- return this.without.apply(this, this.completed());
36
- },
37
-
38
- // We keep the Todos in sequential order, despite being saved by unordered
39
- // GUID in the database. This generates the next order number for new items.
40
- nextOrder: function () {
41
- if (!this.length) {
42
- return 1;
43
- }
44
- return this.last().get('order') + 1;
45
- },
46
-
47
- // Todos are sorted by their original insertion order.
48
- comparator: function (todo) {
49
- return todo.get('order');
50
- }
51
-});
52
-
53
-var Utils = {
54
- pluralize: function( count, word ) {
55
- return count === 1 ? word : word + 's';
56
- },
57
-
58
- stringifyObjKeys: function(obj) {
59
- var s = '';
60
- for (var key in obj) {
61
- if (!obj.hasOwnProperty(key)) {
62
- continue;
63
- }
64
- if (obj[key]) {
65
- s += key + ' ';
66
- }
67
- }
68
- return s;
69
- }
70
-};
71
-
72
-// Begin React stuff
73
-
74
-var TodoItem = React.createClass({
75
- handleSubmit: function(event) {
76
- var val = this.refs.editField.getDOMNode().value.trim();
77
- if (val) {
78
- this.props.onSave(val);
79
- } else {
80
- this.props.onDestroy();
81
- }
82
- return false;
83
- },
84
-
85
- onEdit: function() {
86
- this.props.onEdit();
87
- this.refs.editField.getDOMNode().focus();
88
- },
89
-
90
- render: function() {
91
- var classes = Utils.stringifyObjKeys({
92
- completed: this.props.todo.get('completed'), editing: this.props.editing
93
- });
94
- return (
95
- <li className={classes}>
96
- <div className="view">
97
- <input
98
- className="toggle"
99
- type="checkbox"
100
- checked={this.props.todo.get('completed')}
101
- onChange={this.props.onToggle}
102
- key={this.props.key}
103
- />
104
- <label onDoubleClick={this.onEdit}>
105
- {this.props.todo.get('title')}
106
- </label>
107
- <button className="destroy" onClick={this.props.onDestroy} />
108
- </div>
109
- <form onSubmit={this.handleSubmit}>
110
- <input
111
- ref="editField"
112
- className="edit"
113
- defaultValue={this.props.todo.get('title')}
114
- onBlur={this.handleSubmit}
115
- autoFocus="autofocus"
116
- />
117
- </form>
118
- </li>
119
- );
120
- }
121
-});
122
-
123
-var TodoFooter = React.createClass({
124
- render: function() {
125
- var activeTodoWord = Utils.pluralize(this.props.count, 'todo');
126
- var clearButton = null;
127
-
128
- if (this.props.completedCount > 0) {
129
- clearButton = (
130
- <button id="clear-completed" onClick={this.props.onClearCompleted}>
131
- Clear completed ({this.props.completedCount})
132
- </button>
133
- );
134
- }
135
-
136
- return (
137
- <footer id="footer">
138
- <span id="todo-count">
139
- <strong>{this.props.count}</strong>{' '}
140
- {activeTodoWord}{' '}left
141
- </span>
142
- {clearButton}
143
- </footer>
144
- );
145
- }
146
-});
147
-
148
-// An example generic Mixin that you can add to any component that should react
149
-// to changes in a Backbone component. The use cases we've identified thus far
150
-// are for Collections -- since they trigger a change event whenever any of
151
-// their constituent items are changed there's no need to reconcile for regular
152
-// models. One caveat: this relies on getBackboneModels() to always return the
153
-// same model instances throughout the lifecycle of the component. If you're
154
-// using this mixin correctly (it should be near the top of your component
155
-// hierarchy) this should not be an issue.
156
-var BackboneMixin = {
157
- componentDidMount: function() {
158
- // Whenever there may be a change in the Backbone data, trigger a reconcile.
159
- this.getBackboneModels().forEach(function(model) {
160
- model.on('add change remove', this.forceUpdate.bind(this, null), this);
161
- }, this);
162
- },
163
-
164
- componentWillUnmount: function() {
165
- // Ensure that we clean up any dangling references when the component is
166
- // destroyed.
167
- this.getBackboneModels().forEach(function(model) {
168
- model.off(null, null, this);
169
- }, this);
170
- }
171
-};
172
-
173
-var TodoApp = React.createClass({
174
- mixins: [BackboneMixin],
175
- getInitialState: function() {
176
- return {editing: null};
177
- },
178
-
179
- componentDidMount: function() {
180
- // Additional functionality for todomvc: fetch() the collection on init
181
- this.props.todos.fetch();
182
- this.refs.newField.getDOMNode().focus();
183
- },
184
-
185
- componentDidUpdate: function() {
186
- // If saving were expensive we'd listen for mutation events on Backbone and
187
- // do this manually. however, since saving isn't expensive this is an
188
- // elegant way to keep it reactively up-to-date.
189
- this.props.todos.forEach(function(todo) {
190
- todo.save();
191
- });
192
- },
193
-
194
- getBackboneModels: function() {
195
- return [this.props.todos];
196
- },
197
-
198
- handleSubmit: function(event) {
199
- event.preventDefault();
200
- var val = this.refs.newField.getDOMNode().value.trim();
201
- if (val) {
202
- this.props.todos.create({
203
- title: val,
204
- completed: false,
205
- order: this.props.todos.nextOrder()
206
- });
207
- this.refs.newField.getDOMNode().value = '';
208
- }
209
- },
210
-
211
- toggleAll: function(event) {
212
- var checked = event.nativeEvent.target.checked;
213
- this.props.todos.forEach(function(todo) {
214
- todo.set('completed', checked);
215
- });
216
- },
217
-
218
- edit: function(todo) {
219
- this.setState({editing: todo.get('id')});
220
- },
221
-
222
- save: function(todo, text) {
223
- todo.set('title', text);
224
- this.setState({editing: null});
225
- },
226
-
227
- clearCompleted: function() {
228
- this.props.todos.completed().forEach(function(todo) {
229
- todo.destroy();
230
- });
231
- },
232
-
233
- render: function() {
234
- var footer = null;
235
- var main = null;
236
- var todoItems = this.props.todos.map(function(todo) {
237
- return (
238
- <TodoItem
239
- key={todo.cid}
240
- todo={todo}
241
- onToggle={todo.toggle.bind(todo)}
242
- onDestroy={todo.destroy.bind(todo)}
243
- onEdit={this.edit.bind(this, todo)}
244
- editing={this.state.editing === todo.get('id')}
245
- onSave={this.save.bind(this, todo)}
246
- />
247
- );
248
- }, this);
249
-
250
- var activeTodoCount = this.props.todos.remaining().length;
251
- var completedCount = todoItems.length - activeTodoCount;
252
- if (activeTodoCount || completedCount) {
253
- footer =
254
- <TodoFooter
255
- count={activeTodoCount}
256
- completedCount={completedCount}
257
- onClearCompleted={this.clearCompleted}
258
- />;
259
- }
260
-
261
- if (todoItems.length) {
262
- main = (
263
- <section id="main">
264
- <input id="toggle-all" type="checkbox" onChange={this.toggleAll} />
265
- <ul id="todo-list">
266
- {todoItems}
267
- </ul>
268
- </section>
269
- );
270
- }
271
-
272
- return (
273
- <div>
274
- <section id="todoapp">
275
- <header id="header">
276
- <h1>todos</h1>
277
- <form onSubmit={this.handleSubmit}>
278
- <input
279
- ref="newField"
280
- id="new-todo"
281
- placeholder="What needs to be done?"
282
- />
283
- </form>
284
- </header>
285
- {main}
286
- {footer}
287
- </section>
288
- <footer id="info">
289
- <p>Double-click to edit a todo</p>
290
- <p>
291
- Created by{' '}
292
- <a href="http://github.com/petehunt/">petehunt</a>
293
- </p>
294
- <p>Part of{' '}<a href="http://todomvc.com">TodoMVC</a></p>
295
- </footer>
296
- </div>
297
- );
298
- }
299
-});
300
-
301
-React.renderComponent(
302
- <TodoApp todos={new TodoList()} />, document.getElementById('container')
303
-);
examples/todomvc-backbone/js/ie.js
deleted
-34
@@ -1,34 +0,0 @@
1
-/*! HTML5 Shiv pre3.6 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
2
- Uncompressed source: https://github.com/aFarkas/html5shiv */
3
- (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
4
- a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
5
- c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
6
- "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
7
- for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
8
-
9
-/* ES5-shim
10
-https://github.com/kriskowal/es5-shim
11
-Copyright 2009-2012 by contributors, MIT License */
12
-(function(definition){if(typeof define=="function")define(definition);else if(typeof YUI=="function")YUI.add("es5",definition);else definition()})(function(){if(!Function.prototype.bind)Function.prototype.bind=function bind(that){var target=this;if(typeof target!="function")throw new TypeError("Function.prototype.bind called on incompatible "+target);var args=slice.call(arguments,1);var bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));if(Object(result)===
13
-result)return result;return this}else return target.apply(that,args.concat(slice.call(arguments)))};if(target.prototype)bound.prototype=Object.create(target.prototype);return bound};var call=Function.prototype.call;var prototypeOfArray=Array.prototype;var prototypeOfObject=Object.prototype;var slice=prototypeOfArray.slice;var _toString=call.bind(prototypeOfObject.toString);var owns=call.bind(prototypeOfObject.hasOwnProperty);var defineGetter;var defineSetter;var lookupGetter;var lookupSetter;var supportsAccessors;
14
-if(supportsAccessors=owns(prototypeOfObject,"__defineGetter__")){defineGetter=call.bind(prototypeOfObject.__defineGetter__);defineSetter=call.bind(prototypeOfObject.__defineSetter__);lookupGetter=call.bind(prototypeOfObject.__lookupGetter__);lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)}if([1,2].splice(0).length!=2){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){if(!arguments.length)return[];else return array_splice.apply(this,[start===void 0?
15
-0:start,deleteCount===void 0?this.length-start:deleteCount].concat(slice.call(arguments,2)))}}if(!Array.isArray)Array.isArray=function isArray(obj){return _toString(obj)=="[object Array]"};var boxedString=Object("a"),splitString=boxedString[0]!="a"||!(0 in boxedString);if(!Array.prototype.forEach)Array.prototype.forEach=function forEach(fun){var object=toObject(this),self=splitString&&_toString(this)=="[object String]"?this.split(""):object,thisp=arguments[1],i=-1,length=self.length>>>0;if(_toString(fun)!=
16
-"[object Function]")throw new TypeError;while(++i<length)if(i in self)fun.call(thisp,self[i],i,object)};if(!Array.prototype.map)Array.prototype.map=function map(fun){var object=toObject(this),self=splitString&&_toString(this)=="[object String]"?this.split(""):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if(_toString(fun)!="[object Function]")throw new TypeError(fun+" is not a function");for(var i=0;i<length;i++)if(i in self)result[i]=fun.call(thisp,self[i],i,object);return result};
17
-if(!Array.prototype.filter)Array.prototype.filter=function filter(fun){var object=toObject(this),self=splitString&&_toString(this)=="[object String]"?this.split(""):object,length=self.length>>>0,result=[],value,thisp=arguments[1];if(_toString(fun)!="[object Function]")throw new TypeError(fun+" is not a function");for(var i=0;i<length;i++)if(i in self){value=self[i];if(fun.call(thisp,value,i,object))result.push(value)}return result};if(!Array.prototype.every)Array.prototype.every=function every(fun){var object=
18
-toObject(this),self=splitString&&_toString(this)=="[object String]"?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if(_toString(fun)!="[object Function]")throw new TypeError(fun+" is not a function");for(var i=0;i<length;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return false;return true};if(!Array.prototype.some)Array.prototype.some=function some(fun){var object=toObject(this),self=splitString&&_toString(this)=="[object String]"?this.split(""):object,length=self.length>>>
19
-0,thisp=arguments[1];if(_toString(fun)!="[object Function]")throw new TypeError(fun+" is not a function");for(var i=0;i<length;i++)if(i in self&&fun.call(thisp,self[i],i,object))return true;return false};if(!Array.prototype.reduce)Array.prototype.reduce=function reduce(fun){var object=toObject(this),self=splitString&&_toString(this)=="[object String]"?this.split(""):object,length=self.length>>>0;if(_toString(fun)!="[object Function]")throw new TypeError(fun+" is not a function");if(!length&&arguments.length==
20
-1)throw new TypeError("reduce of empty array with no initial value");var i=0;var result;if(arguments.length>=2)result=arguments[1];else{do{if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError("reduce of empty array with no initial value");}while(true)}for(;i<length;i++)if(i in self)result=fun.call(void 0,result,self[i],i,object);return result};if(!Array.prototype.reduceRight)Array.prototype.reduceRight=function reduceRight(fun){var object=toObject(this),self=splitString&&_toString(this)==
21
-"[object String]"?this.split(""):object,length=self.length>>>0;if(_toString(fun)!="[object Function]")throw new TypeError(fun+" is not a function");if(!length&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else{do{if(i in self){result=self[i--];break}if(--i<0)throw new TypeError("reduceRight of empty array with no initial value");}while(true)}do if(i in this)result=fun.call(void 0,result,
22
-self[i],i,object);while(i--);return result};if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function indexOf(sought){var self=splitString&&_toString(this)=="[object String]"?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;if(arguments.length>1)i=toInteger(arguments[1]);i=i>=0?i:Math.max(0,length+i);for(;i<length;i++)if(i in self&&self[i]===sought)return i;return-1};if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!=-1)Array.prototype.lastIndexOf=
23
-function lastIndexOf(sought){var self=splitString&&_toString(this)=="[object String]"?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;if(arguments.length>1)i=Math.min(i,toInteger(arguments[1]));i=i>=0?i:length-Math.abs(i);for(;i>=0;i--)if(i in self&&sought===self[i])return i;return-1};if(!Object.keys){var hasDontEnumBug=true,dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=
24
-dontEnums.length;for(var key in{"toString":null})hasDontEnumBug=false;Object.keys=function keys(object){if(typeof object!="object"&&typeof object!="function"||object===null)throw new TypeError("Object.keys called on a non-object");var keys=[];for(var name in object)if(owns(object,name))keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;i<ii;i++){var dontEnum=dontEnums[i];if(owns(object,dontEnum))keys.push(dontEnum)}return keys}}var negativeDate=-621987552E5,negativeYearString="-000001";
25
-if(!Date.prototype.toISOString||(new Date(negativeDate)).toISOString().indexOf(negativeYearString)===-1)Date.prototype.toISOString=function toISOString(){var result,length,value,year,month;if(!isFinite(this))throw new RangeError("Date.prototype.toISOString called on non-finite value.");year=this.getUTCFullYear();month=this.getUTCMonth();year+=Math.floor(month/12);month=(month%12+12)%12;result=[month+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()];year=(year<0?"-":
26
-year>9999?"+":"")+("00000"+Math.abs(year)).slice(0<=year&&year<=9999?-4:-6);length=result.length;while(length--){value=result[length];if(value<10)result[length]="0"+value}return year+"-"+result.slice(0,2).join("-")+"T"+result.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};var dateToJSONIsSupported=false;try{dateToJSONIsSupported=Date.prototype.toJSON&&(new Date(NaN)).toJSON()===null&&(new Date(negativeDate)).toJSON().indexOf(negativeYearString)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(e){}if(!dateToJSONIsSupported)Date.prototype.toJSON=
27
-function toJSON(key){var o=Object(this),tv=toPrimitive(o),toISO;if(typeof tv==="number"&&!isFinite(tv))return null;toISO=o.toISOString;if(typeof toISO!="function")throw new TypeError("toISOString property is not callable");return toISO.call(o)};if(!Date.parse||"Date.parse is buggy")Date=function(NativeDate){function Date(Y,M,D,h,m,s,ms){var length=arguments.length;if(this instanceof NativeDate){var date=length==1&&String(Y)===Y?new NativeDate(Date.parse(Y)):length>=7?new NativeDate(Y,M,D,h,m,s,ms):
28
-length>=6?new NativeDate(Y,M,D,h,m,s):length>=5?new NativeDate(Y,M,D,h,m):length>=4?new NativeDate(Y,M,D,h):length>=3?new NativeDate(Y,M,D):length>=2?new NativeDate(Y,M):length>=1?new NativeDate(Y):new NativeDate;date.constructor=Date;return date}return NativeDate.apply(this,arguments)}var isoDateExpression=new RegExp("^"+"(\\d{4}|[+-]\\d{6})"+"(?:-(\\d{2})"+"(?:-(\\d{2})"+"(?:"+"T(\\d{2})"+":(\\d{2})"+"(?:"+":(\\d{2})"+"(?:\\.(\\d{3}))?"+")?"+"("+"Z|"+"(?:"+"([-+])"+"(\\d{2})"+":(\\d{2})"+")"+")?)?)?)?"+
29
-"$");var months=[0,31,59,90,120,151,181,212,243,273,304,334,365];function dayFromMonth(year,month){var t=month>1?1:0;return months[month]+Math.floor((year-1969+t)/4)-Math.floor((year-1901+t)/100)+Math.floor((year-1601+t)/400)+365*(year-1970)}for(var key in NativeDate)Date[key]=NativeDate[key];Date.now=NativeDate.now;Date.UTC=NativeDate.UTC;Date.prototype=NativeDate.prototype;Date.prototype.constructor=Date;Date.parse=function parse(string){var match=isoDateExpression.exec(string);if(match){var year=
30
-Number(match[1]),month=Number(match[2]||1)-1,day=Number(match[3]||1)-1,hour=Number(match[4]||0),minute=Number(match[5]||0),second=Number(match[6]||0),millisecond=Number(match[7]||0),offset=!match[4]||match[8]?0:Number(new NativeDate(1970,0)),signOffset=match[9]==="-"?1:-1,hourOffset=Number(match[10]||0),minuteOffset=Number(match[11]||0),result;if(hour<(minute>0||second>0||millisecond>0?24:25)&&minute<60&&second<60&&millisecond<1E3&&month>-1&&month<12&&hourOffset<24&&minuteOffset<60&&day>-1&&day<dayFromMonth(year,
31
-month+1)-dayFromMonth(year,month)){result=((dayFromMonth(year,month)+day)*24+hour+hourOffset*signOffset)*60;result=((result+minute+minuteOffset*signOffset)*60+second)*1E3+millisecond+offset;if(-864E13<=result&&result<=864E13)return result}return NaN}return NativeDate.parse.apply(this,arguments)};return Date}(Date);if(!Date.now)Date.now=function now(){return(new Date).getTime()};if("0".split(void 0,0).length){var string_split=String.prototype.split;String.prototype.split=function(separator,limit){if(separator===
32
-void 0&&limit===0)return[];return string_split.apply(this,arguments)}}if("".substr&&"0b".substr(-1)!=="b"){var string_substr=String.prototype.substr;String.prototype.substr=function(start,length){return string_substr.call(this,start<0?(start=this.length+start)<0?0:start:start,length)}}var ws="\t\n\x0B\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";if(!String.prototype.trim||ws.trim()){ws="["+ws+"]";var trimBeginRegexp=
33
-new RegExp("^"+ws+ws+"*"),trimEndRegexp=new RegExp(ws+ws+"*$");String.prototype.trim=function trim(){if(this===undefined||this===null)throw new TypeError("can't convert "+this+" to object");return String(this).replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}function toInteger(n){n=+n;if(n!==n)n=0;else if(n!==0&&n!==1/0&&n!==-(1/0))n=(n>0||-1)*Math.floor(Math.abs(n));return n}function isPrimitive(input){var type=typeof input;return input===null||type==="undefined"||type==="boolean"||type===
34
-"number"||type==="string"}function toPrimitive(input){var val,valueOf,toString;if(isPrimitive(input))return input;valueOf=input.valueOf;if(typeof valueOf==="function"){val=valueOf.call(input);if(isPrimitive(val))return val}toString=input.toString;if(typeof toString==="function"){val=toString.call(input);if(isPrimitive(val))return val}throw new TypeError;}var toObject=function(o){if(o==null)throw new TypeError("can't convert "+o+" to object");return Object(o)}});
examples/todomvc-backbone/thirdparty/backbone-min.js
deleted
-4
@@ -1,4 +0,0 @@
1
-(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.0.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o<u;o++){t=a[o];if(n=this._events[t]){this._events[t]=r=[];if(e||i){for(c=0,f=n.length;c<f;c++){s=n[c];if(e&&e!==s.callback&&e!==s.callback._callback||i&&i!==s.context){r.push(s)}}}if(!r.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!l(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)c(i,e);if(r)c(r,arguments);return this},stopListening:function(t,e,i){var r=this._listeners;if(!r)return this;var s=!e&&!i;if(typeof e==="object")i=this;if(t)(r={})[t._listenerId]=t;for(var n in r){r[n].off(e,i,this);if(s)delete this._listeners[n]}return this}};var u=/\s+/;var l=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(u.test(i)){var n=i.split(u);for(var a=0,h=n.length;a<h;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var c=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],h=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,h);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e)}};var f={listenTo:"on",listenToOnce:"once"};h.each(f,function(t,e){o[e]=function(e,i,r){var s=this._listeners||(this._listeners={});var n=e._listenerId||(e._listenerId=h.uniqueId("l"));s[n]=e;if(typeof i==="object")r=this;e[t](i,r,this);return this}});o.bind=o.on;o.unbind=o.off;h.extend(a,o);var d=a.Model=function(t,e){var i;var r=t||{};e||(e={});this.cid=h.uniqueId("c");this.attributes={};h.extend(this,h.pick(e,p));if(e.parse)r=this.parse(r,e)||{};if(i=h.result(this,"defaults")){r=h.defaults({},r,i)}this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};var p=["url","urlRoot","collection"];h.extend(d.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return h.clone(this.attributes)},sync:function(){return a.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return h.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,i){var r,s,n,a,o,u,l,c;if(t==null)return this;if(typeof t==="object"){s=t;i=e}else{(s={})[t]=e}i||(i={});if(!this._validate(s,i))return false;n=i.unset;o=i.silent;a=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=h.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in s)this.id=s[this.idAttribute];for(r in s){e=s[r];if(!h.isEqual(c[r],e))a.push(r);if(!h.isEqual(l[r],e)){this.changed[r]=e}else{delete this.changed[r]}n?delete c[r]:c[r]=e}if(!o){if(a.length)this._pending=true;for(var f=0,d=a.length;f<d;f++){this.trigger("change:"+a[f],this,c[a[f]],i)}}if(u)return this;if(!o){while(this._pending){this._pending=false;this.trigger("change",this,i)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,h.extend({},e,{unset:true}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,h.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!h.isEmpty(this.changed);return h.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?h.clone(this.changed):false;var e,i=false;var r=this._changing?this._previousAttributes:this.attributes;for(var s in t){if(h.isEqual(r[s],e=t[s]))continue;(i||(i={}))[s]=e}return i},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return h.clone(this._previousAttributes)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var i=t.success;t.success=function(r){if(!e.set(e.parse(r,t),t))return false;if(i)i(e,r,t);e.trigger("sync",e,r,t)};R(this,t);return this.sync("read",this,t)},save:function(t,e,i){var r,s,n,a=this.attributes;if(t==null||typeof t==="object"){r=t;i=e}else{(r={})[t]=e}if(r&&(!i||!i.wait)&&!this.set(r,i))return false;i=h.extend({validate:true},i);if(!this._validate(r,i))return false;if(r&&i.wait){this.attributes=h.extend({},a,r)}if(i.parse===void 0)i.parse=true;var o=this;var u=i.success;i.success=function(t){o.attributes=a;var e=o.parse(t,i);if(i.wait)e=h.extend(r||{},e);if(h.isObject(e)&&!o.set(e,i)){return false}if(u)u(o,t,i);o.trigger("sync",o,t,i)};R(this,i);s=this.isNew()?"create":i.patch?"patch":"update";if(s==="patch")i.attrs=r;n=this.sync(s,this,i);if(r&&i.wait)this.attributes=a;return n},destroy:function(t){t=t?h.clone(t):{};var e=this;var i=t.success;var r=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(s){if(t.wait||e.isNew())r();if(i)i(e,s,t);if(!e.isNew())e.trigger("sync",e,s,t)};if(this.isNew()){t.success();return false}R(this,t);var s=this.sync("delete",this,t);if(!t.wait)r();return s},url:function(){var t=h.result(this,"urlRoot")||h.result(this.collection,"url")||U();if(this.isNew())return t;return t+(t.charAt(t.length-1)==="/"?"":"/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},isValid:function(t){return this._validate({},h.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=h.extend({},this.attributes,t);var i=this.validationError=this.validate(t,e)||null;if(!i)return true;this.trigger("invalid",this,i,h.extend(e||{},{validationError:i}));return false}});var v=["keys","values","pairs","invert","pick","omit"];h.each(v,function(t){d.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.attributes);return h[t].apply(h,e)}});var g=a.Collection=function(t,e){e||(e={});if(e.url)this.url=e.url;if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,h.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,merge:false,remove:false};h.extend(g.prototype,o,{model:d,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return a.sync.apply(this,arguments)},add:function(t,e){return this.set(t,h.defaults(e||{},y))},remove:function(t,e){t=h.isArray(t)?t.slice():[t];e||(e={});var i,r,s,n;for(i=0,r=t.length;i<r;i++){n=this.get(t[i]);if(!n)continue;delete this._byId[n.id];delete this._byId[n.cid];s=this.indexOf(n);this.models.splice(s,1);this.length--;if(!e.silent){e.index=s;n.trigger("remove",n,this,e)}this._removeReference(n)}return this},set:function(t,e){e=h.defaults(e||{},m);if(e.parse)t=this.parse(t,e);if(!h.isArray(t))t=t?[t]:[];var i,s,a,o,u,l;var c=e.at;var f=this.comparator&&c==null&&e.sort!==false;var d=h.isString(this.comparator)?this.comparator:null;var p=[],v=[],g={};for(i=0,s=t.length;i<s;i++){if(!(a=this._prepareModel(t[i],e)))continue;if(u=this.get(a)){if(e.remove)g[u.cid]=true;if(e.merge){u.set(a.attributes,e);if(f&&!l&&u.hasChanged(d))l=true}}else if(e.add){p.push(a);a.on("all",this._onModelEvent,this);this._byId[a.cid]=a;if(a.id!=null)this._byId[a.id]=a}}if(e.remove){for(i=0,s=this.length;i<s;++i){if(!g[(a=this.models[i]).cid])v.push(a)}if(v.length)this.remove(v,e)}if(p.length){if(f)l=true;this.length+=p.length;if(c!=null){n.apply(this.models,[c,0].concat(p))}else{r.apply(this.models,p)}}if(l)this.sort({silent:true});if(e.silent)return this;for(i=0,s=p.length;i<s;i++){(a=p[i]).trigger("add",a,this,e)}if(l)this.trigger("sort",this,e);return this},reset:function(t,e){e||(e={});for(var i=0,r=this.models.length;i<r;i++){this._removeReference(this.models[i])}e.previousModels=this.models;this._reset();this.add(t,h.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return this},push:function(t,e){t=this._prepareModel(t,e);this.add(t,h.extend({at:this.length},e));return t},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){t=this._prepareModel(t,e);this.add(t,h.extend({at:0},e));return t},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(t,e){return this.models.slice(t,e)},get:function(t){if(t==null)return void 0;return this._byId[t.id!=null?t.id:t.cid||t]},at:function(t){return this.models[t]},where:function(t,e){if(h.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(h.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(h.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},sortedIndex:function(t,e,i){e||(e=this.comparator);var r=h.isFunction(e)?e:function(t){return t.get(e)};return h.sortedIndex(this.models,t,r,i)},pluck:function(t){return h.invoke(this.models,"get",t)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var i=this;t.success=function(r){var s=t.reset?"reset":"set";i[s](r,t);if(e)e(i,r,t);i.trigger("sync",i,r,t)};R(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?h.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var i=this;var r=e.success;e.success=function(s){if(e.wait)i.add(t,e);if(r)r(t,s,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof d){if(!t.collection)t.collection=this;return t}e||(e={});e.collection=this;var i=new this.model(t,e);if(!i._validate(t,e)){this.trigger("invalid",this,t,e);return false}return i},_removeReference:function(t){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];h.each(_,function(t){g.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.models);return h[t].apply(h,e)}});var w=["groupBy","countBy","sortBy"];h.each(w,function(t){g.prototype[t]=function(e,i){var r=h.isFunction(e)?e:function(t){return t.get(e)};return h[t](this.models,r,i)}});var b=a.View=function(t){this.cid=h.uniqueId("view");this._configure(t||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];h.extend(b.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,e){if(this.$el)this.undelegateEvents();this.$el=t instanceof a.$?t:a.$(t);this.el=this.$el[0];if(e!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=h.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var i=t[e];if(!h.isFunction(i))i=this[t[e]];if(!i)continue;var r=e.match(x);var s=r[1],n=r[2];i=h.bind(i,this);s+=".delegateEvents"+this.cid;if(n===""){this.$el.on(s,i)}else{this.$el.on(s,n,i)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_configure:function(t){if(this.options)t=h.extend({},h.result(this,"options"),t);h.extend(this,h.pick(t,E));this.options=t},_ensureElement:function(){if(!this.el){var t=h.extend({},h.result(this,"attributes"));if(this.id)t.id=h.result(this,"id");if(this.className)t["class"]=h.result(this,"className");var e=a.$("<"+h.result(this,"tagName")+">").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=k[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)return n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var k={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var S=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var $=/\((.*?)\)/g;var T=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(S.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history.trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace($,"(?:$1)?").replace(T,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var P=/^\/+|\/+$/g;var O=/msie [\w.]+/;var C=/\/$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.substr(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({},{root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=O.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(P,"/");if(r&&this._wantsHashChange){this.iframe=a.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;this.navigate(e)}if(this._hasPushState){a.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!r){a.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=e;var s=this.location;var n=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!n){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._wantsPushState&&this._hasPushState&&n&&s.hash){this.fragment=this.getHash().replace(N,"");this.history.replaceState({},document.title,this.root+this.fragment+s.search)}if(!this.options.silent)return this.loadUrl()},stop:function(){a.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);I.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(t){var e=this.fragment=this.getFragment(t);var i=h.any(this.handlers,function(t){if(t.route.test(e)){t.callback(e);return true}});return i},navigate:function(t,e){if(!I.started)return false;if(!e||e===true)e={trigger:e};t=this.getFragment(t||"");if(this.fragment===t)return;this.fragment=t;var i=this.root+t;if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});a.history=new I;var j=function(t,e){var i=this;var r;if(t&&h.has(t,"constructor")){r=t.constructor}else{r=function(){return i.apply(this,arguments)}}h.extend(r,i,e);var s=function(){this.constructor=r};s.prototype=i.prototype;r.prototype=new s;if(t)h.extend(r.prototype,t);r.__super__=i.prototype;return r};d.extend=g.extend=S.extend=b.extend=I.extend=j;var U=function(){throw new Error('A "url" property or function must be specified')};var R=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}}}).call(this);
2
-/*
3
-//@ sourceMappingURL=backbone-min.map
4
-*/
\ No newline at end of file
examples/todomvc-backbone/thirdparty/backbone.localStorage-min.js
deleted
-6
@@ -1,6 +0,0 @@
1
-/**
2
- * Backbone localStorage Adapter
3
- * Version 1.1.4
4
- *
5
- * https://github.com/jeromegn/Backbone.localStorage
6
- */(function(a,b){typeof exports=="object"?module.exports=b(require("underscore"),require("backbone")):typeof define=="function"&&define.amd?define(["underscore","backbone"],function(c,d){return b(c||a._,d||a.Backbone)}):b(_,Backbone)})(this,function(a,b){function c(){return((1+Math.random())*65536|0).toString(16).substring(1)}function d(){return c()+c()+"-"+c()+"-"+c()+"-"+c()+"-"+c()+c()+c()}return b.LocalStorage=window.Store=function(a){if(!this.localStorage)throw"Backbone.localStorage: Environment does not support localStorage.";this.name=a;var b=this.localStorage().getItem(this.name);this.records=b&&b.split(",")||[]},a.extend(b.LocalStorage.prototype,{save:function(){this.localStorage().setItem(this.name,this.records.join(","))},create:function(a){return a.id||(a.id=d(),a.set(a.idAttribute,a.id)),this.localStorage().setItem(this.name+"-"+a.id,JSON.stringify(a)),this.records.push(a.id.toString()),this.save(),this.find(a)},update:function(b){return this.localStorage().setItem(this.name+"-"+b.id,JSON.stringify(b)),a.include(this.records,b.id.toString())||this.records.push(b.id.toString()),this.save(),this.find(b)},find:function(a){return this.jsonData(this.localStorage().getItem(this.name+"-"+a.id))},findAll:function(){return(a.chain||a)(this.records).map(function(a){return this.jsonData(this.localStorage().getItem(this.name+"-"+a))},this).compact().value()},destroy:function(b){return b.isNew()?!1:(this.localStorage().removeItem(this.name+"-"+b.id),this.records=a.reject(this.records,function(a){return a===b.id.toString()}),this.save(),b)},localStorage:function(){return localStorage},jsonData:function(a){return a&&JSON.parse(a)},_clear:function(){var b=this.localStorage(),c=new RegExp("^"+this.name+"-");b.removeItem(this.name),(a.chain||a)(b).keys().filter(function(a){return c.test(a)}).each(function(a){b.removeItem(a)})},_storageSize:function(){return this.localStorage().length}}),b.LocalStorage.sync=window.Store.sync=b.localSync=function(a,c,d){var e=c.localStorage||c.collection.localStorage,f,g,h=b.$.Deferred&&b.$.Deferred();try{switch(a){case"read":f=c.id!=undefined?e.find(c):e.findAll();break;case"create":f=e.create(c);break;case"update":f=e.update(c);break;case"delete":f=e.destroy(c)}}catch(i){i.code===DOMException.QUOTA_EXCEEDED_ERR&&e._storageSize()===0?g="Private browsing is unsupported":g=i.message}return f?(d&&d.success&&(b.VERSION==="0.9.10"?d.success(c,f,d):d.success(f)),h&&h.resolve(f)):(g=g?g:"Record Not Found",d&&d.error&&(b.VERSION==="0.9.10"?d.error(c,g,d):d.error(g)),h&&h.reject(g)),d&&d.complete&&d.complete(f),h&&h.promise()},b.ajaxSync=b.sync,b.getSyncMethod=function(a){return a.localStorage||a.collection&&a.collection.localStorage?b.localSync:b.ajaxSync},b.sync=function(a,c,d){return b.getSyncMethod(c).apply(this,[a,c,d])},b.LocalStorage});
\ No newline at end of file
examples/todomvc-backbone/thirdparty/lodash.min.js
deleted
-39
@@ -1,39 +0,0 @@
1
-/*!
2
- Lo-Dash 0.8.2 lodash.com/license
3
- Underscore.js 1.4.2 underscorejs.org/LICENSE
4
-*/
5
-;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||H),s=i?{}:e;if(i)for(n=t-1;++n<r;){var o=e[n]+"";(Z.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(e){if(i){var n=e+"";return Z.call(s,n)&&-1<T(s[n],e)}return-1<T(s,e,t)}}function u(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1;if(e<n||n===t)return-1}return r<i?-1:1}function a(e,t,n){function r(){var u=arguments
6
-,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(nt.call(u)):n),this instanceof r?(p.prototype=e.prototype,a=new p,(u=e.apply(a,u))&&Ht[typeof u]?u:a):e.apply(a,u)}var i=m(e),s=!n,o=e;return s&&(n=t),r}function f(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:A}function l(){for(var e={e:"",g:Et,i:"",j:Mt,m:Tt,n:kt,o:J,p:"",q:n,r:_t,c:{d:""},l:{d:""}},t,i=-1;t=arguments[++i];)for(var s in t){var o=t[s];/d|h/.test(s)?("string"==typeof
7
-o&&(o={b:o,k:o}),e.c[s]=o.b,e.l[s]=o.k):e[s]=o}t=e.a;if("d"!=(e.f=/^[^,]+/.exec(t)[0])||!e.c.h)e.c=r;i="",e.r&&(i+="'use strict';"),i+="var i,A,j="+e.f+",t="+(e.i||e.f)+";if(!"+e.f+")return t;"+e.p+";",e.c&&(i+="var k=j.length;i=-1;",e.l&&(i+="if(k===+k){"),e.n&&(i+="if(y.call(j)==w){j=j.split('')}"),i+=e.c.d+";while(++i<k){A=j[i];"+e.c.h+"}",e.l&&(i+="}"));if(e.l){e.c?i+="else {":e.m&&(i+="var k=j.length;i=-1;if(k&&O(j)){while(++i<k){A=j[i+=''];"+e.l.h+"}}else {"),e.g||(i+="var u=typeof j=='function'&&q.call(j,'prototype');"
8
-);if(e.j&&e.q)i+="var n=-1,o=Y[typeof j]?l(j):[],k=o.length;"+e.l.d+";while(++n<k){i=o[n];",e.g||(i+="if(!(u&&i=='prototype')){"),i+="A=j[i];"+e.l.h+"",e.g||(i+="}");else{i+=e.l.d+";for(i in j){";if(!e.g||e.q)i+="if(",e.g||(i+="!(u&&i=='prototype')"),!e.g&&e.q&&(i+="&&"),e.q&&(i+="h.call(j,i)"),i+="){";i+="A=j[i];"+e.l.h+";";if(!e.g||e.q)i+="}"}i+="}";if(e.g){i+="var g=j.constructor;";for(s=0;7>s;s++)i+="i='"+e.o[s]+"';if(","constructor"==e.o[s]&&(i+="!(g&&g.prototype===j)&&"),i+="h.call(j,i)){A=j[i];"+
9
-e.l.h+"}"}if(e.c||e.m)i+="}"}return i+=e.e+";return t",Function("D,E,F,I,e,f,J,h,M,O,Q,S,T,X,Y,l,q,v,w,y,z","var G=function("+t+"){"+i+"};return G")(Dt,_,L,u,Q,f,en,Z,T,v,$t,m,Jt,mt,Ht,ut,tt,nt,yt,rt)}function c(e){return"\\"+Bt[e]}function h(e){return Qt[e]}function p(){}function d(e){return Gt[e]}function v(e){return rt.call(e)==ct}function m(e){return"function"==typeof e}function g(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Lt||"function"==typeof e.toString||"string"!=typeof
10
-(e+""))&&(!m(n)||n instanceof n)?xt?(en(e,function(e,n,r){return t=!Z.call(r,n),i}),t===i):(en(e,function(e,n){t=n}),t===i||Z.call(e,t)):t}function y(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=Ht[typeof e]){var u=rt.call(e);if(!Pt[u]||Nt&&v(e))return e;var a=u==ht,n=a||(u==mt?Jt(e):n)}if(!n||!t)return n?a?nt.call(e):Zt({},e):e;n=e.constructor;switch(u){case pt:case dt:return new n(+e);case vt:case yt:return new n(e);case gt:return n(e.source,U.exec(e))}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[
11
-u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?mn:tn)(e,function(e,n){f[n]=y(e,t,r,s,o)}),f}function b(e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Ht[typeof e]||Ht[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=rt.call(e);if(u!=rt.call(t))return i;switch(u){case pt:case dt:return+e==+t;case vt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case gt:case yt:return e==t+""}var a=Dt[u];if(Nt&&!a&&(a=v(e))&&!v(t)||!a&&(u!=mt||Lt&&("function"!=typeof e.
12
-toString&&"string"==typeof (e+"")||"function"!=typeof t.toString&&"string"==typeof (t+""))))return i;s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=b(e[l],t[l],s,o)););return f}a=e.constructor,f=t.constructor;if(a!=f&&(!m(a)||!(a instanceof a&&m(f)&&f instanceof f)))return i;for(var c in e)if(Z.call(e,c)&&(l++,!Z.call(t,c)||!b(e[c],t[c],s,o)))return i;for(c in t)if(Z.call(t,c)&&!(l--))return i;if(
13
-Et)for(;7>++u;)if(c=J[u],Z.call(e,c)&&(!Z.call(t,c)||!b(e[c],t[c],s,o)))return i;return n}function w(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=f(t,n),mn(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,o=e)});else for(;++i<s;)e[i]>o&&(o=e[i]);return o}function E(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if(o!==+o)var a=sn(e),o=a.length;else kt&&rt.call(e)==yt&&(s=e.split(""));return mn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function S(e,t,n){
14
-if(e)return t==r||n?e[0]:nt.call(e,0,t)}function x(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];$t(s)?et.apply(i,t?s:x(s)):i.push(s)}return i}function T(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?at(0,i+n):n||0)-1;else if(n)return r=C(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function N(e,t,n){return e?nt.call(e,t==r||n?1:t):[]}function C(e,t,n,r){var i=0,s=e?e.length:i;if(n){n=f(n,r);for(t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+
15
-s>>>1,e[r]<t?i=r+1:s=r;return i}function k(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=f(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>T(a,r))a.push(r),u.push(e[s]);return u}function L(e,t){return Ot||it&&2<arguments.length?it.call.apply(it,arguments):a(e,t,nt.call(arguments,2))}function A(e){return e}function O(e){mn(nn(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return arguments.length&&et.apply(e,arguments)
16
-,e=r.apply(s,e),this.__chain__&&(e=new s(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,M="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),_=Array.prototype,D=Object.prototype,P=0,H=30,B=e._,j=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,F=/&(?:amp|lt|gt|quot|#x27);/g,I=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,R=/(__e\(.*?\)|\b__t\))\+'';/g,U=/\w*$/,z=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,W=RegExp("^"+(D.valueOf+""
17
-).replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),X=/($^)/,V=/[&<>"']/g,$=/['\n\r\t\u2028\u2029\\]/g,J="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),K=Math.ceil,Q=_.concat,G=Math.floor,Y=W.test(Y=Object.getPrototypeOf)&&Y,Z=D.hasOwnProperty,et=_.push,tt=D.propertyIsEnumerable,nt=_.slice,rt=D.toString,it=W.test(it=nt.bind)&&it,st=W.test(st=Array.isArray)&&st,ot=e.isFinite,ut=W.test(ut=Object.keys)&&ut
18
-,at=Math.max,ft=Math.min,lt=Math.random,ct="[object Arguments]",ht="[object Array]",pt="[object Boolean]",dt="[object Date]",vt="[object Number]",mt="[object Object]",gt="[object RegExp]",yt="[object String]",bt=e.clearTimeout,wt=e.setTimeout,Et,St,xt,Tt=n;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments)Tt=!r;Et=4>(n+"").length,xt="x"!=n[0],St=(n.splice.call(t,0,1),t[0])})(1);var Nt=!v(arguments),Ct="x"!=nt.call("x"
19
-)[0],kt="xx"!="x"[0]+Object("x")[0];try{var Lt=("[object Object]",rt.call(e.document||0)==mt)}catch(At){}var Ot=it&&/\n|Opera/.test(it+rt.call(e.opera)),Mt=ut&&/^.+$|true/.test(ut+!!e.attachEvent),_t=!Ot,Dt={};Dt[pt]=Dt[dt]=Dt["[object Function]"]=Dt[vt]=Dt[mt]=Dt[gt]=i,Dt[ct]=Dt[ht]=Dt[yt]=n;var Pt={};Pt[ct]=Pt["[object Function]"]=i,Pt[ht]=Pt[pt]=Pt[dt]=Pt[vt]=Pt[mt]=Pt[gt]=Pt[yt]=n;var Ht={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Bt={"\\":"\\","'":"'","\n":"n"
20
-,"\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var jt={a:"d,c,x",p:"c=f(c,x)",h:"if(c(A,i,d)===false)return t"},Ft={i:"{}",p:"c=f(c,x)",h:"var p=c(A,i,d);(h.call(t,p)?t[p]++:t[p]=1)"},It={i:"true",h:"if(!c(A,i,d))return!t"},qt={q:i,r:i,a:"m",p:"for(var a=1,b=arguments.length;a<b;a++){if(j=arguments[a]){",h:"t[i]=A",e:"}}"},Rt={i:"[]",h:"c(A,i,d)&&t.push(A)"},Ut={p:"c=f(c,x)"}
21
-,zt={h:{k:jt.h}},Wt={i:"d||[]",d:{b:"t=Array(k)",k:"t="+(Mt?"Array(k)":"[]")},h:{b:"t[i]=c(A,i,d)",k:"t"+(Mt?"[n]=":".push")+"(c(A,i,d))"}},Xt={q:i,a:"m,c,x",i:"{}",p:"var R=typeof c=='function';if(R)c=f(c,x);else var s=e.apply(E,arguments)",h:"if(R?!c(A,i,m):M(s,i)<0)t[i]=A"},Vt=l({a:"m",i:"{}",h:"t[A]=i"});Nt&&(v=function(e){return e?Z.call(e,"callee"):i});var $t=st||function(e){return rt.call(e)==ht};m(/x/)&&(m=function(e){return"[object Function]"==rt.call(e)});var Jt=Y?function(e){if(!e||"object"!=typeof
22
-e)return i;var t=e.valueOf,n="function"==typeof t&&(n=Y(t))&&Y(n);return n?e==n||Y(e)==n&&!v(e):g(e)}:g,Kt=l({a:"m",i:"[]",h:"t.push(i)"}),Qt={"&":"&","<":"<",">":">",'"':""","'":"'"},Gt=Vt(Qt),Yt=l(qt,{h:"if(t[i]==null)"+qt.h}),Zt=l(qt),en=l(jt,Ut,zt,{q:i}),tn=l(jt,Ut,zt),nn=l({q:i,a:"m",i:"[]",h:"S(A)&&t.push(i)",e:"t.sort()"}),rn=l({a:"A",i:"true",p:"var H=y.call(A),k=A.length;if(D[H]"+(Nt?"||O(A)":"")+"||(H==X&&k===+k&&S(A.splice)))return!k",h:{k:"return false"}}),sn=ut?function(
23
-e){var t=typeof e;return"function"==t&&tt.call(e,"prototype")?Kt(e):e&&Ht[t]?ut(e):[]}:Kt,on=l(qt,{a:"m,dd,N",p:"var P,C=arguments,a=0;if(N==I){var b=2,ee=C[3],ff=C[4]}else var b=C.length,ee=[],ff=[];while(++a<b){if(j=C[a]){",h:"if((dd=A)&&((P=Q(dd))||T(dd))){var K=false,gg=ee.length;while(gg--)if(K=ee[gg]==dd)break;if(K){t[i]=ff[gg]}else {ee.push(dd);ff.push(A=(A=t[i],P)?(Q(A)?A:[]):(T(A)?A:{}));t[i]=G(A,dd,I,ee,ff)}}else if(dd!=null)t[i]=dd"}),un=l(Xt),an=l({a:"m",i:"[]",h:"t"+(Mt?"[n]=":".push"
24
-)+"([i,A])"}),fn=l(Xt,{p:"if(typeof c!='function'){var i=0,s=e.apply(E,arguments),k=s.length;while(++i<k){var p=s[i];if(p in m)t[p]=m[p]}}else {c=f(c,x)",h:"if(c(A,i,m))t[i]=A",e:"}"}),ln=l({a:"m",i:"[]",h:"t.push(A)"}),cn=l({a:"d,hh",i:"false",n:i,d:{b:"if(y.call(d)==w)return d.indexOf(hh)>-1"},h:"if(A===hh)return true"}),hn=l(jt,Ft),pn=l(jt,It),dn=l(jt,Rt),vn=l(jt,Ut,{i:"z",h:"if(c(A,i,d))return A"}),mn=l(jt,Ut),gn=l(jt,Ft,{h:"var p=c(A,i,d);(h.call(t,p)?t[p]:t[p]=[]).push(A)"}),yn=l(Wt,{a:"d,U"
25
-,p:"var C=v.call(arguments,2),R=typeof U=='function'",h:{b:"t[i]=(R?U:A[U]).apply(A,C)",k:"t"+(Mt?"[n]=":".push")+"((R?U:A[U]).apply(A,C))"}}),bn=l(jt,Wt),wn=l(Wt,{a:"d,bb",h:{b:"t[i]=A[bb]",k:"t"+(Mt?"[n]=":".push")+"(A[bb])"}}),En=l({a:"d,c,B,x",i:"B",p:"var V=arguments.length<3;c=f(c,x)",d:{b:"if(V)t=j[++i]"},h:{b:"t=c(t,A,i,d)",k:"t=V?(V=false,A):c(t,A,i,d)"}}),Sn=l(jt,Rt,{h:"!"+Rt.h}),xn=l(jt,It,{i:"false",h:It.h.replace("!","")}),Tn=l(jt,Ft,Wt,{h:{b:"t[i]={a:c(A,i,d),b:i,c:A}",k:"t"+(Mt?"[n]="
26
-:".push")+"({a:c(A,i,d),b:i,c:A})"},e:"t.sort(I);k=t.length;while(k--)t[k]=t[k].c"}),Nn=l(Rt,{a:"d,aa",p:"var s=[];J(aa,function(A,p){s.push(p)});var cc=s.length",h:"for(var Z=true,r=0;r<cc;r++){var p=s[r];if(!(Z=A[p]===aa[p]))break}Z&&t.push(A)"}),Cn=l({q:i,r:i,a:"m",p:"var L=arguments,i=0,k=L.length;if(k>1){while(++i<k)t[L[i]]=F(t[L[i]],t);return t}",h:"if(S(A))t[i]=F(A,t)"});s.VERSION="0.8.2",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=L,s.bindAll=
27
-Cn,s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=y,s.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},s.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},s.contains=cn,s.countBy=hn,s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,bt(a),a=wt(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=
28
-Yt,s.defer=function(e){var n=nt.call(arguments,1);return wt(function(){return e.apply(t,n)},1)},s.delay=function(e,n){var r=nt.call(arguments,2);return wt(function(){return e.apply(t,r)},n)},s.difference=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=Q.apply(_,arguments),i=o(i,r);++n<r;){var s=e[n];i(s)||t.push(s)}return t},s.escape=function(e){return e==r?"":(e+"").replace(V,h)},s.every=pn,s.extend=Zt,s.filter=dn,s.find=vn,s.first=S,s.flatten=x,s.forEach=mn,s.forIn=en,s.forOwn=tn,
29
-s.functions=nn,s.groupBy=gn,s.has=function(e,t){return e?Z.call(e,t):i},s.identity=A,s.indexOf=T,s.initial=function(e,t,n){return e?nt.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=arguments.length,n=[],r=-1,i=e?e.length:0,s=[];e:for(;++r<i;){var u=e[r];if(0>T(s,u)){for(var a=1;a<t;a++)if(!(n[a]||(n[a]=o(arguments[a])))(u))continue e;s.push(u)}}return s},s.invert=Vt,s.invoke=yn,s.isArguments=v,s.isArray=$t,s.isBoolean=function(e){return e===n||e===i||rt.call(e)==pt},s.isDate=function(
30
-e){return rt.call(e)==dt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=rn,s.isEqual=b,s.isFinite=function(e){return ot(e)&&rt.call(e)==vt},s.isFunction=m,s.isNaN=function(e){return rt.call(e)==vt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return rt.call(e)==vt},s.isObject=function(e){return e?Ht[typeof e]:i},s.isPlainObject=Jt,s.isRegExp=function(e){return rt.call(e)==gt},s.isString=function(e){return rt.call(e)==yt},s.isUndefined=function(e){return e===t},s
31
-.keys=sn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:nt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?at(0,r+n):ft(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,nt.call(arguments,2))},s.map=bn,s.max=w,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Z.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=on,s.min=function(e,t,n){var r=
32
-Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=f(t,n),mn(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,o=e)});else for(;++i<s;)e[i]<o&&(o=e[i]);return o},s.mixin=O,s.noConflict=function(){return e._=B,this},s.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},s.omit=un,s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=an,s.partial=function(e){return a(e,nt.call(arguments,1))},s.pick=fn,s.pluck=
33
-wn,s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+G(lt()*((+t||0)-e+1))},s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=at(0,K((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=En,s.reduceRight=E,s.reject=Sn,s.rest=N,s.result=function(e,t){var n=e?e[t]:r;return m(n)?e[t]():n},s.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return mn(e,function(e){var r=G(lt()*(++t+1));n[t]=n[r],n[r]=e}),n},s.size=function(e){var t=e?e.length:0;return t===+
34
-t?t:sn(e).length},s.some=xn,s.sortBy=Tn,s.sortedIndex=C,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,o=0,u=s.templateSettings,a="__p += '",f=n.variable||u.variable,l=f;e.replace(RegExp((n.escape||u.escape||X).source+"|"+(n.interpolate||u.interpolate||X).source+"|"+(n.evaluate||u.evaluate||X).source+"|$","g"),function(t,n,i,s,u){a+=e.slice(o,u).replace($,c),a+=n?"'+__e("+n+")+'":s?"';"+s+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=s||j.test(
35
-n||i)),o=u+t.length}),a+="';",l||(f="obj",r?a="with("+f+"){"+a+"}":(n=RegExp("(\\(\\s*)"+f+"\\."+f+"\\b","g"),a=a.replace(z,"$&"+f+".").replace(n,"$1__d"))),a=(r?a.replace(I,""):a).replace(q,"$1").replace(R,"$1;"),a="function("+f+"){"+(l?"":f+"||("+f+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+f+"."+f+"||"+f)+";")+a+"return __p}";try{i=Function("_","return "+a)(s)}catch(h){throw h.source=a,h}return t?i(t):(i.source=
36
-a,i)},s.throttle=function(e,t){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(bt(u),a=r,s=e.apply(o,i)):u||(u=wt(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},s.toArray=function(e){if(!e)return[];var t=e.length;return t===+t?(Ct?rt.call(e)==yt:"string"==typeof e)?e.split(""):nt.call(e):ln(e)},s.unescape=function(e){return e==r?"":(e+"").replace(F,d)},s.union=
37
-function(){for(var e=-1,t=Q.apply(_,arguments),n=t.length,r=[];++e<n;){var i=t[e];0>T(r,i)&&r.push(i)}return r},s.uniq=k,s.uniqueId=function(e){var t=P++;return e?e+t:t},s.values=ln,s.where=Nn,s.without=function(e){for(var t=-1,n=e?e.length:0,r=o(arguments,1,20),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&et.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=e?w(wn(arguments,"length")):0,r=Array(n);++
38
-t<n;)r[t]=wn(arguments,t);return r},s.all=pn,s.any=xn,s.collect=bn,s.detect=vn,s.drop=N,s.each=mn,s.foldl=En,s.foldr=E,s.head=S,s.include=cn,s.inject=En,s.methods=nn,s.select=dn,s.tail=N,s.take=S,s.unique=k,O(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__},mn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=_[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),St&&e.length===0&&delete
39
-e[0],this.__chain__&&(e=new s(e),e.__chain__=n),e}}),mn(["concat","join","slice"],function(e){var t=_[e];s.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new s(e),e.__chain__=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):M?"object"==typeof module&&module&&module.exports==M?(module.exports=s)._=s:M._=s:e._=s})(this);
\ No newline at end of file
examples/todomvc-director/README.md
deleted
-11
@@ -1,11 +0,0 @@
1
-# TodoMVC-director
2
-
3
-This is the exact copy of the React-powered [TodoMVC](http://todomvc.com/labs/architecture-examples/react/). To test it, use [bower](http://bower.io) to fetch the dependencies:
4
-
5
-`bower install`
6
-
7
-Then fire up a server here:
8
-
9
-`python -m SimpleHTTPServer`
10
-
11
-And go visit `localhost:8000`.
examples/todomvc-director/bower.json
deleted
-9
@@ -1,9 +0,0 @@
1
-{
2
- "name": "todomvc-react",
3
- "version": "0.0.0",
4
- "dependencies": {
5
- "todomvc-common": "~0.1.7",
6
- "react": "~0.4.0",
7
- "director": "~1.2.0"
8
- }
9
-}
examples/todomvc-director/index.html
deleted
-24
@@ -1,24 +0,0 @@
1
-<!doctype html>
2
-<html lang="en" data-framework="react">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>React • TodoMVC</title>
7
- <link rel="stylesheet" href="bower_components/todomvc-common/base.css">
8
- </head>
9
- <body>
10
- <section id="todoapp"></section>
11
- <footer id="info"></footer>
12
- <div id="benchmark"></div>
13
-
14
- <script src="bower_components/todomvc-common/base.js"></script>
15
- <script src="bower_components/react/react.js"></script>
16
- <script src="bower_components/react/JSXTransformer.js"></script>
17
- <script src="bower_components/director/build/director.min.js"></script>
18
-
19
- <script type="text/jsx" src="js/utils.jsx"></script>
20
- <script type="text/jsx" src="js/todoItem.jsx"></script>
21
- <script type="text/jsx" src="js/footer.jsx"></script>
22
- <script type="text/jsx" src="js/app.jsx"></script>
23
- </body>
24
-</html>
examples/todomvc-director/js/app.jsx
deleted
-207
@@ -1,207 +0,0 @@
1
-/**
2
- * @jsx React.DOM
3
- */
4
-/*jshint quotmark:false */
5
-/*jshint white:false */
6
-/*jshint trailing:false */
7
-/*jshint newcap:false */
8
-/*global Utils, ALL_TODOS, ACTIVE_TODOS, COMPLETED_TODOS,
9
- TodoItem, TodoFooter, React, Router*/
10
-
11
-(function (window, React) {
12
- 'use strict';
13
-
14
- window.ALL_TODOS = 'all';
15
- window.ACTIVE_TODOS = 'active';
16
- window.COMPLETED_TODOS = 'completed';
17
-
18
- var ENTER_KEY = 13;
19
-
20
- var TodoApp = React.createClass({
21
- getInitialState: function () {
22
- var todos = Utils.store('react-todos');
23
- return {
24
- todos: todos,
25
- nowShowing: ALL_TODOS,
26
- editing: null
27
- };
28
- },
29
-
30
- componentDidMount: function () {
31
- var router = Router({
32
- '/': this.setState.bind(this, {nowShowing: ALL_TODOS}),
33
- '/active': this.setState.bind(this, {nowShowing: ACTIVE_TODOS}),
34
- '/completed': this.setState.bind(this, {nowShowing: COMPLETED_TODOS})
35
- });
36
- router.init();
37
- this.refs.newField.getDOMNode().focus();
38
- },
39
-
40
- handleNewTodoKeyDown: function (event) {
41
- if (event.which !== ENTER_KEY) {
42
- return;
43
- }
44
-
45
- var val = this.refs.newField.getDOMNode().value.trim();
46
- var todos;
47
- var newTodo;
48
-
49
- if (val) {
50
- todos = this.state.todos;
51
- newTodo = {
52
- id: Utils.uuid(),
53
- title: val,
54
- completed: false
55
- };
56
- this.setState({todos: todos.concat([newTodo])});
57
- this.refs.newField.getDOMNode().value = '';
58
- }
59
-
60
- return false;
61
- },
62
-
63
- toggleAll: function (event) {
64
- var checked = event.target.checked;
65
-
66
- this.state.todos.forEach(function (todo) {
67
- todo.completed = checked;
68
- });
69
-
70
- this.setState({todos: this.state.todos});
71
- },
72
-
73
- toggle: function (todo) {
74
- todo.completed = !todo.completed;
75
- this.setState({todos: this.state.todos});
76
- },
77
-
78
- destroy: function (todo) {
79
- var newTodos = this.state.todos.filter(function (candidate) {
80
- return candidate.id !== todo.id;
81
- });
82
-
83
- this.setState({todos: newTodos});
84
- },
85
-
86
- edit: function (todo, callback) {
87
- // refer to todoItem.js `handleEdit` for the reasoning behind the
88
- // callback
89
- this.setState({editing: todo.id}, function () {
90
- callback();
91
- });
92
- },
93
-
94
- save: function (todo, text) {
95
- todo.title = text;
96
- this.setState({todos: this.state.todos, editing: null});
97
- },
98
-
99
- cancel: function () {
100
- this.setState({editing: null});
101
- },
102
-
103
- clearCompleted: function () {
104
- var newTodos = this.state.todos.filter(function (todo) {
105
- return !todo.completed;
106
- });
107
-
108
- this.setState({todos: newTodos});
109
- },
110
-
111
- componentDidUpdate: function () {
112
- Utils.store('react-todos', this.state.todos);
113
- },
114
-
115
- render: function () {
116
- var footer = null;
117
- var main = null;
118
- var todoItems = {};
119
- var activeTodoCount;
120
- var completedCount;
121
-
122
- var shownTodos = this.state.todos.filter(function (todo) {
123
- switch (this.state.nowShowing) {
124
- case ACTIVE_TODOS:
125
- return !todo.completed;
126
- case COMPLETED_TODOS:
127
- return todo.completed;
128
- default:
129
- return true;
130
- }
131
- }.bind(this));
132
-
133
- shownTodos.forEach(function (todo) {
134
- todoItems[todo.id] = (
135
- <TodoItem
136
- todo={todo}
137
- onToggle={this.toggle.bind(this, todo)}
138
- onDestroy={this.destroy.bind(this, todo)}
139
- onEdit={this.edit.bind(this, todo)}
140
- editing={this.state.editing === todo.id}
141
- onSave={this.save.bind(this, todo)}
142
- onCancel={this.cancel}
143
- />
144
- );
145
- }.bind(this));
146
-
147
- activeTodoCount = this.state.todos.filter(function (todo) {
148
- return !todo.completed;
149
- }).length;
150
-
151
- completedCount = this.state.todos.length - activeTodoCount;
152
-
153
- if (activeTodoCount || completedCount) {
154
- footer =
155
- <TodoFooter
156
- count={activeTodoCount}
157
- completedCount={completedCount}
158
- nowShowing={this.state.nowShowing}
159
- onClearCompleted={this.clearCompleted}
160
- />;
161
- }
162
-
163
- if (this.state.todos.length) {
164
- main = (
165
- <section id="main">
166
- <input
167
- id="toggle-all"
168
- type="checkbox"
169
- onChange={this.toggleAll}
170
- checked={activeTodoCount === 0}
171
- />
172
- <ul id="todo-list">
173
- {todoItems}
174
- </ul>
175
- </section>
176
- );
177
- }
178
-
179
- return (
180
- <div>
181
- <header id="header">
182
- <h1>todos</h1>
183
- <input
184
- ref="newField"
185
- id="new-todo"
186
- placeholder="What needs to be done?"
187
- onKeyDown={this.handleNewTodoKeyDown}
188
- />
189
- </header>
190
- {main}
191
- {footer}
192
- </div>
193
- );
194
- }
195
- });
196
-
197
- React.renderComponent(<TodoApp />, document.getElementById('todoapp'));
198
- React.renderComponent(
199
- <div>
200
- <p>Double-click to edit a todo</p>
201
- <p>Created by{' '}
202
- <a href="http://github.com/petehunt/">petehunt</a>
203
- </p>
204
- <p>Part of{' '}<a href="http://todomvc.com">TodoMVC</a></p>
205
- </div>,
206
- document.getElementById('info'));
207
-})(window, React);
examples/todomvc-director/js/footer.jsx
deleted
-58
@@ -1,58 +0,0 @@
1
-/**
2
- * @jsx React.DOM
3
- */
4
-/*jshint quotmark:false */
5
-/*jshint white:false */
6
-/*jshint trailing:false */
7
-/*jshint newcap:false */
8
-/*global React, ALL_TODOS, ACTIVE_TODOS, Utils, COMPLETED_TODOS */
9
-(function (window) {
10
- 'use strict';
11
-
12
- window.TodoFooter = React.createClass({
13
- render: function () {
14
- var activeTodoWord = Utils.pluralize(this.props.count, 'item');
15
- var clearButton = null;
16
-
17
- if (this.props.completedCount > 0) {
18
- clearButton = (
19
- <button
20
- id="clear-completed"
21
- onClick={this.props.onClearCompleted}>
22
- {''}Clear completed ({this.props.completedCount}){''}
23
- </button>
24
- );
25
- }
26
-
27
- var show = {
28
- ALL_TODOS: '',
29
- ACTIVE_TODOS: '',
30
- COMPLETED_TODOS: ''
31
- };
32
- show[this.props.nowShowing] = 'selected';
33
-
34
- return (
35
- <footer id="footer">
36
- <span id="todo-count">
37
- <strong>{this.props.count}</strong>
38
- {' '}{activeTodoWord}{' '}left{''}
39
- </span>
40
- <ul id="filters">
41
- <li>
42
- <a href="#/" className={show[ALL_TODOS]}>All</a>
43
- </li>
44
- {' '}
45
- <li>
46
- <a href="#/active" className={show[ACTIVE_TODOS]}>Active</a>
47
- </li>
48
- {' '}
49
- <li>
50
- <a href="#/completed" className={show[COMPLETED_TODOS]}>Completed</a>
51
- </li>
52
- </ul>
53
- {clearButton}
54
- </footer>
55
- );
56
- }
57
- });
58
-})(window);
examples/todomvc-director/js/todoItem.jsx
deleted
-93
@@ -1,93 +0,0 @@
1
-/**
2
- * @jsx React.DOM
3
- */
4
-/*jshint quotmark: false */
5
-/*jshint white: false */
6
-/*jshint trailing: false */
7
-/*jshint newcap: false */
8
-/*global React, Utils */
9
-(function (window) {
10
- 'use strict';
11
-
12
- var ESCAPE_KEY = 27;
13
- var ENTER_KEY = 13;
14
-
15
- window.TodoItem = React.createClass({
16
- handleSubmit: function () {
17
- var val = this.state.editText.trim();
18
- if (val) {
19
- this.props.onSave(val);
20
- this.setState({editText: val});
21
- } else {
22
- this.props.onDestroy();
23
- }
24
- return false;
25
- },
26
- handleEdit: function () {
27
- // react optimizes renders by batching them. This means you can't call
28
- // parent's `onEdit` (which in this case triggeres a re-render), and
29
- // immediately manipulate the DOM as if the rendering's over. Put it as a
30
- // callback. Refer to app.js' `edit` method
31
- this.props.onEdit(function () {
32
- var node = this.refs.editField.getDOMNode();
33
- node.focus();
34
- node.setSelectionRange(node.value.length, node.value.length);
35
- }.bind(this));
36
- },
37
-
38
- handleKeyDown: function (event) {
39
- if (event.keyCode === ESCAPE_KEY) {
40
- this.setState({editText: this.props.todo.title});
41
- this.props.onCancel();
42
- } else if (event.keyCode === ENTER_KEY) {
43
- this.handleSubmit();
44
- } else {
45
- this.setState({editText: event.target.value});
46
- }
47
- },
48
-
49
- handleChange: function (event) {
50
- this.setState({editText: event.target.value});
51
- },
52
-
53
- getInitialState: function () {
54
- return {editText: this.props.todo.title};
55
- },
56
-
57
- componentWillReceiveProps: function (nextProps) {
58
- if (nextProps.todo.title !== this.props.todo.title) {
59
- this.setState(this.getInitialState());
60
- }
61
- },
62
-
63
- render: function () {
64
- return (
65
- <li className={Utils.stringifyObjKeys({
66
- completed: this.props.todo.completed,
67
- editing: this.props.editing
68
- })}>
69
- <div className="view">
70
- <input
71
- className="toggle"
72
- type="checkbox"
73
- checked={this.props.todo.completed ? 'checked' : null}
74
- onChange={this.props.onToggle}
75
- />
76
- <label onDoubleClick={this.handleEdit}>
77
- {this.props.todo.title}
78
- </label>
79
- <button className='destroy' onClick={this.props.onDestroy} />
80
- </div>
81
- <input
82
- ref="editField"
83
- className="edit"
84
- value={this.state.editText}
85
- onBlur={this.handleSubmit}
86
- onChange={this.handleChange}
87
- onKeyDown={this.handleKeyDown}
88
- />
89
- </li>
90
- );
91
- }
92
- });
93
-})(window);
examples/todomvc-director/js/utils.jsx
deleted
-49
@@ -1,49 +0,0 @@
1
-(function (window) {
2
- 'use strict';
3
-
4
- window.Utils = {
5
- uuid: function () {
6
- /*jshint bitwise:false */
7
- var i, random;
8
- var uuid = '';
9
-
10
- for (i = 0; i < 32; i++) {
11
- random = Math.random() * 16 | 0;
12
- if (i === 8 || i === 12 || i === 16 || i === 20) {
13
- uuid += '-';
14
- }
15
- uuid += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random))
16
- .toString(16);
17
- }
18
-
19
- return uuid;
20
- },
21
-
22
- pluralize: function (count, word) {
23
- return count === 1 ? word : word + 's';
24
- },
25
-
26
- store: function (namespace, data) {
27
- if (data) {
28
- return localStorage.setItem(namespace, JSON.stringify(data));
29
- }
30
-
31
- var store = localStorage.getItem(namespace);
32
- return (store && JSON.parse(store)) || [];
33
- },
34
-
35
- stringifyObjKeys: function (obj) {
36
- var s = '';
37
- var key;
38
-
39
- for (key in obj) {
40
- if (obj.hasOwnProperty(key) && obj[key]) {
41
- s += key + ' ';
42
- }
43
- }
44
-
45
- return s.trim();
46
- }
47
- };
48
-
49
-})(window);