-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.html
101 lines (75 loc) · 4.43 KB
/
sample.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
<html>
<head>
<title>Test</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<!-- JQUERY -->
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<style>
body{margin:10; padding:20;}
h2{margin:20px 0px;}
</style>
</head>
<body>
<h1>Use the code examples offered here to build your API</h1>
<h4>Status Updates here: <span id="status">No updates</span></h4>
<script>
function logID(button){
var id = button.dataset.id
var detail = button.dataset.something
console.log("Clicked button for image: "+id)
var URL = "http://localhost:4500/write?id="+id+"&other="+detail;
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", URL, true );
xmlHttp.send( null );
return xmlHttp.responseText;
}
</script>
<label>User:
<input id='username' type="textarea" value='Default'></input>
</label>
<h2>Write to stdout with GET request</h2>
<button class="button" data-id="123" data-something="fromtweet1" onClick="logID(this)">BUTTON 1</button>
<h2>POST Request to sqlite</h2>
<button type="button" class="btn btn-light sqlite-button" data-val="0" data-id="1234" data-detail="tweet-for-whatever">SQLITE BUTTON</button>
<button type="button" class="btn btn-light sqlite-button" data-val="0" data-id="5678" data-detail="tweet-for-whatever">SQLITE BUTTON 2</button>
<div style="max-width:500px; margin-top:50px;">
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button" data-val="0" data-id="9" data-detail="tweet">Test SQLite</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button" data-val="0" data-id="8" data-detail="tweet">Test SQLite</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button" data-val="0" data-id="7" data-detail="tweet">Test SQLite</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button" data-val="0" data-id="6" data-detail="tweet">Test SQLite</button><br>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button" data-val="0" data-id="5" data-detail="bilbo">Tweet 5 - Bilbo</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button" data-val="0" data-id="5" data-detail="frodo">Tweet 5 - Frodo</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button" data-val="0" data-id="5" data-detail="sam">Tweet 5 - Sam</button>
</div>
<div style="max-width:500px; margin-top:50px;">
<h1>Testing Status Retriever</h1>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button sqlite-button-with-status" data-val="0" data-id="5" data-detail="bilbo">Tweet 5 - Bilbo</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button sqlite-button-with-status" data-val="0" data-id="5" data-detail="frodo">Tweet 5 - Frodo</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button sqlite-button-with-status" data-val="0" data-id="5" data-detail="sam">Tweet 5 - Sam</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button sqlite-button-with-status" data-val="0" data-id="6" data-detail="alice">Tweet 6 - Alice</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button sqlite-button-with-status" data-val="0" data-id="6" data-detail="bob">Tweet 6 - Bob</button>
<button style="margin:10px;" type="button" class="btn btn-light sqlite-button sqlite-button-with-status" data-val="0" data-id="6" data-detail="charlie">Tweet 6 - Charlie</button>
</div>
<div style="max-width:500px; margin-top:50px;">
<h1>Dropdown Test</h1>
Tweet 5
<select style="margin:10px;" class="sqlite-dropdown-with-status" data-val="0" data-id="5">
<option selected="selected">Not Set</option>
<option value="bilbo">Bilbo</option>
<option value="frodo">Frodo</option>
<option value="sam">Sam</option>
</select>
Tweet 6
<select style="margin:10px;" class="sqlite-dropdown-with-status" data-val="0" data-id="6">
<option selected="selected">Not Set</option>
<option value="alice">Alice</option>
<option value="bob">Bob</option>
<option value="charlie">Charlie</option>
</select>
</div>
<script src="simple-api-front-end.js"></script>
</body>
<html>