forked from bcherry/dropbox-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
60 lines (53 loc) · 1.5 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Dropbox JS API</title>
</head>
<body>
<form id="authenticate-form">
<fieldset>
<legend>Dropbox creds</legend>
<div>
<label for="key">app key</label>
<input type="text" name="key" id="key" placeholder="app key" />
</div>
<div>
<label for="secret">app secret</label>
<input type="text" name="secret" id="secret" placeholder="app secret" />
</div>
<div>
<label for="email">email</label>
<input type="text" name="email" id="email" placeholder="email" />
</div>
<div>
<label for="password">password</label>
<input type="password" name="password" id="password" placeholder="password" />
</div>
<div>
<input type="submit" value="Authenticate" />
</div>
</fieldset>
</form>
<script src="jquery-1.4.3.js"></script>
<script src="oauth.js"></script>
<script src="sha1.js"></script>
<script src="dropbox.js"></script>
<script>
$(function() {
$("#authenticate-form").submit(function() {
var key = $("#key").val(),
secret = $("#secret").val(),
email = $("#email").val(),
password = $("#password").val();
dropbox.setup(key, secret);
dropbox.authenticate(email, password, function() {
$("#authenticate-form").remove();
console.log("authenticated!");
});
return false;
})
});
</script>
</body>
</html>