-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
44 lines (40 loc) · 1.2 KB
/
index.js
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
'use strict';
var tododata = require('./tododata');
var todolist = require('./todolist');
var todomisc = require('./todomisc');
var gizmos = require('./gizmos');
var oTodoData = tododata.createObservableTodoData();
tododata.autoSave(oTodoData);
var oFragment = tododata.createObservableFragment();
module.exports = gizmos.container([
todomisc.todoApp([
todomisc.header([
gizmos.h1('todos'),
todomisc.newTodoItem('What needs to be done?', oTodoData)
]),
todomisc.mainSection([
todomisc.toggleAllCheckbox('Mark all as complete', oTodoData),
todolist.todoList(oTodoData, oFragment)
]),
todomisc.footer([
todomisc.todoItemsLeft(oTodoData),
todomisc.filters([
gizmos.link('#/', 'All', oFragment),
gizmos.link('#/active', 'Active', oFragment),
gizmos.link('#/completed', 'Completed', oFragment)
]),
todomisc.clearCompletedButton('Clear completed', oTodoData)
], oTodoData)
]),
todomisc.infoFooter([
gizmos.paragraph(['Double-click to edit a todo']),
gizmos.paragraph([
'Created by ',
gizmos.link('https://github.com/garious', 'Greg Fitzgerald')
]),
gizmos.paragraph([
'May one day be a part of ',
gizmos.link('http://todomvc.com', 'TodoMVC')
])
])
]);