forked from jcubic/lips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo.html
86 lines (86 loc) · 3.51 KB
/
todo.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
<!DOCTYPE html>
<html>
<head>
<title>TODO lips</title>
<meta name="description" content="Example app for LIPS programming language - Simple Lisp in JavaScript"/>
<script src="dist/lips.js"></script>
<link rel="shortcut icon" href="favicon.ico">
<script src="https://unpkg.com/handlebars/dist/handlebars.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://unpkg.com/director@1.2.8/build/director.min.js"></script>
<script src="https://codepen.io/jcubic/pen/WZjbgq.js?v=5"></script>
<link href="https://rawgit.com/tastejs/todomvc/gh-pages/examples/jquery/node_modules/todomvc-app-css/index.css"
rel="stylesheet"/>
<link href="https://rawgit.com/tastejs/todomvc/gh-pages/examples/jquery/node_modules/todomvc-common/base.css"
rel="stylesheet"/>
<script id="todo-template" type="text/x-handlebars-template">
{{#this}}
<li {{#if completed}}class="completed"{{/if}} data-id="{{id}}">
<div class="view">
<input class="toggle" type="checkbox" {{#if completed}}checked{{/if}}>
<label>{{title}}</label>
<button class="destroy"></button>
</div>
<input class="edit" value="{{title}}">
</li>
{{/this}}
</script>
<script id="footer-template" type="text/x-handlebars-template">
<span class="todo-count"><strong>{{activeTodoCount}}</strong> {{activeTodoWord}} left</span>
<ul class="filters">
<li>
<a {{#eq filter 'all'}}class="selected"{{/eq}} href="#/all">All</a>
</li>
<li>
<a {{#eq filter 'active'}}class="selected"{{/eq}}href="#/active">Active</a>
</li>
<li>
<a {{#eq filter 'completed'}}class="selected"{{/eq}}href="#/completed">Completed</a>
</li>
</ul>
{{#if completedTodos}}<button class="clear-completed">Clear completed</button>{{/if}}
</script>
<script>
// we create helper in JS because lips don't expose this context
Handlebars.registerHelper('eq', function (a, b, options) {
return a === b ? options.fn(this) : options.inverse(this);
});
github('jcubic/lips');
</script>
<style>
.learn-bar .learn {
height: 100%;
}
</style>
</head>
<body class="learn-bar">
<aside class="learn">
<header><h3>LIPS TODO example</h3></header>
<p>source:
<ul>
<li><a href="https://github.com/jcubic/lips/blob/master/todo.html">todo.html</a></li>
<li><a href="https://github.com/jcubic/lips/blob/master/todo.lips">todo.lips</a></li>
</ul>
</p>
<hr/>
</aside>
<section class="todoapp">
<header class="header">
<h1>todos</h1>
<input class="new-todo" placeholder="What needs to be done?" autofocus>
</header>
<section class="main" style="display: none">
<input id="toggle-all" class="toggle-all" type="checkbox">
<label for="toggle-all">Mark all as complete</label>
<ul class="todo-list"></ul>
</section>
<footer class="footer" style="display: none"></footer>
</section>
<footer class="info">
<p>Double-click to edit a todo</p>
<p>Author <a href="https://jcubic.pl/jakub-jankiewicz">Jakub T. Jankiewicz</a> based on jQuery <a href="http://todomvc.com">TodoMVC</a> by <a href="http://sindresorhus.com">Sindre Sorhus</a></p>
</footer>
<script type="text/x-lips" src="examples/helpers.lips"></script>
<script type="text/x-lips" src="todo.lips"></script>
</body>
</html>