-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
208 lines (192 loc) · 7.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TaskApp</title>
<!-- inject:css -->
<link rel="stylesheet" href="css/taskapp.min.css">
<!-- endinject -->
<!--link rel="stylesheet" href="test/vendor/mocha.css"-->
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<svg style="display:none;">
<symbol id="icon-clear" viewBox="0 0 8 8">
<path fill="#111111" d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-1.5 1.78l1.5 1.5 1.5-1.5.72.72-1.5 1.5 1.5 1.5-.72.72-1.5-1.5-1.5 1.5-.72-.72 1.5-1.5-1.5-1.5.72-.72z" />
</symbol>
<symbol id="icon-trash" viewBox="0 0 8 8">
<path fill="#444444" d="M3 0c-.55 0-1 .45-1 1h-1c-.55 0-1 .45-1 1h7c0-.55-.45-1-1-1h-1c0-.55-.45-1-1-1h-1zm-2 3v4.81c0 .11.08.19.19.19h4.63c.11 0 .19-.08.19-.19v-4.81h-1v3.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-3.5h-1v3.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-3.5h-1z" />
</symbol>
<symbol id="icon-untrash" viewBox="0 0 8 8">
<path fill="#FFFFFF" d="M3.67,0.086C3.152-0.098,2.577,0.176,2.393,0.694L1.451,0.359C0.933,0.175,0.357,0.448,0.173,0.966 l6.596,2.345C6.953,2.793,6.68,2.218,6.162,2.034L5.219,1.699C5.404,1.181,5.13,0.606,4.612,0.421L3.67,0.086z M1,3v4.81 C1,7.92,1.08,8,1.19,8h4.63c0.11,0,0.19-0.08,0.19-0.19V3h-1v3.5c0,0.28-0.22,0.5-0.5,0.5c-0.28,0-0.5-0.22-0.5-0.5V3h-1v3.5 c0,0.28-0.22,0.5-0.5,0.5c-0.28,0-0.5-0.22-0.5-0.5V3h-1H1z"/>
</symbol>
</svg>
<!--[if lte IE 8]>
<script src="js/html5shiv.js"></script>
<![endif]-->
<!--[if lte IE 10]><Flexbox polyfill>
<script src="js/flexibility.js"></script>
<script type="text/javascript">flexibility(document.getElementById("app"));</script>
<![endif]-->
</head>
<body>
<div id="wrap">
<!-- start of Vue app container -->
<div id="app">
<task-list v-ref:taskList v-bind:list.sync="tasks" v-bind:trash.sync="trash"></task-list>
<task-ui v-ref:taskUi v-bind:tags.sync="tags" v-bind:colours="colours"></task-ui>
</div>
<!-- end of Vue app container -->
<section id="info">
<div>
<h3>About</h3>
<p>A modern, browser-based Task List / To-Do List app with just enough features to enhance your productivity and organise your focus, without being slow or bloated.</p>
</div>
<div>
<h3>Hotkeys</h3>
<dl>
<dt>↑,↓</dt><dd>Navigate list</dd>
<dt>↵</dt><dd>Edit/Save task</dd>
<dt>x</dt><dd>Mark task completed</dd>
<dt>n</dt><dd>New task</dd>
<dt>D</dt><dd>Delete task</dd>
<dt>U</dt><dd>Undelete task</dd>
</dl>
<p>Re-order tasks by dragging and dropping.<br>
Add and remove <span class="tag">tags</span> by clicking them.</p>
</div>
<div>
<h3>My Tasks Will Go On</h3>
<p>The app state is autosaved to the browser session, so no worries about saving, closing or shutting down.</p>
</div>
<div>
<h3>Made With</h3>
<img src="img/logo_html5.png" alt="HTML5" height="40">
<img src="img/logo_css3.png" alt="CSS3" height="40">
<img src="img/logo_vuejs.png" alt="Vue.js">
<p>
<a href="https://github.com/mn113/vuejs-taskapp">github.com/mn113/vuejs-taskapp</a>
</p>
</div>
</section>
</div>
<!-- First component template -->
<template id="task-list-tpl">
<section id="tasks-container">
<h1>My Tasks <span class="subhead">({{ remaining }} remaining)</span></h1>
<span>Filter:</span>
<form id="filter" v-bind:search="search">
<input v-model.trim="search">
<svg class="icon-clear" v-on:click="search = ''"><use xlink:href="#icon-clear"></use></svg>
</form>
<ul id="task-ul" v-show="filteredTasks.length > 0">
<li class="list-item flex-container"
v-for="(index, task) in filteredTasks"
data-id="{{ index }}"
v-bind:class="{completed: task.completed, selected: task.id == selectedId}"
v-on:click="selectTask(task.id)">
<div class="group">
<input type="checkbox" v-model="task.completed">
<!-- Task body: -->
<span v-show="editingId !== task.id" class="task-body">{{ task.body }}</span>
<input v-show="editingId == task.id" v-model="task.body" placeholder="New task"
v-on:keyup.enter="editingId = null">
</div>
<div class="group">
<div class="group-inner">
<!-- Tags: -->
<span v-for="(i, t) in task.tags"
class="tag" v-on:click="deleteTag(task.id, t)">
{{ t }}
</span>
<!-- Colours: -->
<span v-for="(i, c) in task.colours"
class="colour" v-bind:class="c" v-on:click="deleteColour(task.id, c)">
</span>
</div>
<div class="group-inner">
<!-- Task actions: -->
<span class="edit-btn" v-on:click="editTask(task.id)">
{{ editingId == task.id ? 'Save' : 'Edit' }}
</span>
<svg class="icon-trash" v-on:click="deleteTask(task.id)"><use xlink:href="#icon-trash"></use></svg>
</div>
</div>
</li>
</ul>
<p v-else>No tasks here.</p>
<div class="cf">
<form id="task-buttons">
<button v-on:click.prevent="newTask" v-on:keyup.n="newTask">Add Task</button>
<button v-show="remaining < list.length" v-on:click.prevent="clearCompleted">Clear Completed</button>
<button v-show="trash.length > 0">
<svg class="icon-untrash"
v-bind:class="{active: trash.length > 0}"
v-on:click.prevent="unTrashLast"
data-tooltip="{'offset':10}" title="Undelete tasks" aria-hidden="true">
<use xlink:href="#icon-untrash"></use>
</svg>
</button>
</form>
</div>
<!--p style="color:green">{{ list | json }}</p>
<hr />
<p style="color:red">{{ trash | json }}</p-->
</section>
</template>
<!-- Second component template -->
<template id="ui-tpl">
<section id="toolbox">
<h3>Toolbox</h3>
<div id="tag-list" v-bind:class="{editing: editingTags}">
<p>Tags:
<span class="edit-btn" v-on:click="toggleEditingGlobalTags">
{{ editingTags ? 'Close' : 'Edit' }}
</span>
</p>
<div class="flex-container">
<span v-for="t in tags">
<span class="tag" v-on:click="addTag(t)">
{{ t }}
</span>
<svg class="icon-trash" v-show="editingTags" v-on:click="deleteGlobalTag(t)">
<use xlink:href="#icon-trash"></use>
</svg>
</span>
</div>
<form v-show="editingTags">
<input size="10" v-model.trim="newTag" placeholder="tag" v-on:keyup.enter="addGlobalTag(newTag)">
<button type="submit" v-on:click.prevent="addGlobalTag(newTag)">Add Tag</button>
</form>
</div>
<div id="colour-list">
<p>Colours:</p>
<span v-for="c in colours"
class="colour"
:class="c"
v-on:click="addColour(c)">
</span>
</div>
<p> Export tasks as
<abbr v-on:click="exportTasks('csv')">CSV</abbr>
<abbr v-on:click="exportTasks('json')">JSON</abbr>
</p>
</section>
</template>
<!-- inject:js -->
<script src="js/main.min.js"></script>
<!-- endinject -->
<!-- start testing -->
<!--div id="mocha">
<p><a href=".">Mocha</a></p>
</div>
<div id="messages"></div>
<div id="fixtures"></div>
<script src="test/vendor/mocha.js"></script>
<script src="test/vendor/chai.js"></script>
<script src="test/vendor/sinon-1.7.1.js"></script>
<script src="test/taskapp_test.js"></script-->
<!-- end testing -->
</body>
</html>