-
Notifications
You must be signed in to change notification settings - Fork 1
/
pebble-todo-config.html
executable file
·81 lines (78 loc) · 3.05 KB
/
pebble-todo-config.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
<!-- Copyright (c) 2014 Woozilli, Inc. All rights reserved. -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Google Fonts -->
<!--[if IE]>
<link href="http://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lato:400" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lato:700" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lato:300" rel="stylesheet" type="text/css">
<![endif]-->
<link href="css/bootstrap.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<!--page-->
<div id="banner">
<div class="container intro_wrapper">
<div class="inner_content">
<div class="row">
<div class="span8">
<h1>Pebble Todo List</h1>
<h3>(On the watch, long press on select to delete an item)</h3>
<form id="form_pebble_todo" class="form-inline">
<input type="text" id="todo_item" name="todo_item" placeholder="Todo Item" maxlength="16">
<input type="hidden" name="pebble_token" value="{{pebble_token}}">
<button type="submit" id="btn_add" class="btn btn-primary">Add</button>
</form>
<hr>
<table class="table table-hover">
<thead>
<tr>
<th>Todo Items</th>
</tr>
</thead>
<tbody>
{% for entry in data %}
<tr><td>{{ entry['Todo Item'] }}</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div><!-- row -->
<div class="row"><div class="span12"><button id="btn_back" class="btn btn-primary">Back</button></div></div>
</div>
</div>
</div>
<!-- SCRIPTS -->
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$("#btn_add").click(function(){
event.preventDefault();
event.stopPropagation();
var todoItem = $("#todo_item").val();
if (todoItem !== undefined && todoItem !== "" && todoItem !== null) {
$.ajax({
type : 'POST',
url : '/pebble_todo_add',
data : $('#form_pebble_todo').serialize(),
success: function(data, textStatus, jqXHR){
location.reload();
}
});
};
})
$("#btn_back").click(function() {
console.log("Cancel");
document.location = "pebblejs://close";
});
});
</script>
</body>
</html>