-
Notifications
You must be signed in to change notification settings - Fork 1
/
signIn.html
129 lines (115 loc) · 4.73 KB
/
signIn.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
<!DOCTYPE html>
<head>
<title>Twivia</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" type="text/javascript"></script>
<link href="css/style1.css" rel=" stylesheet" type="text/css"/>
<link href="css/endGame.css" rel="stylesheet" type="text/css">
</head>
<body onload="parseInit();">
<img src="https://g.twimg.com/dev/sites/default/files/images_documentation/sign-in-with-twitter-gray.png" id = "login">
<form>
PIN: <br>
<input type="text" name="pin" id = "PINFIELD">
<input type="submit" value="submit" onclick="return getPin();" />
</form>
<script type="text/javascript">
document.getElementById("login").onclick = function() {myFunction()};
function myFunction() {
//document.getElementById("login").innerHTML = "yo";
var cb = new Codebird;
cb.setConsumerKey("2jCvFchz3pa5CrVxTITm3DbJ0", "3wZizuZjWjwpGnACuxwJbyQNdL8KUTW2zwY8g9rQDyApW9ahGE");
//cb.setToken("403332774-Fn288SA96MuJnd6OzMyRWtjLyoZ509TLiLwTv6pl", "XyMg5eHaf5ahQHKle72EPruXgJx4ifUq2VAmG1j5xCbnD");
$("#login").click(function(){
cb.__call(
"oauth_requestToken",
{oauth_callback: "oob"},
function (reply) {
// stores it
cb.setToken(reply.oauth_token, reply.oauth_token_secret);
// gets the authorize screen URL
cb.__call(
"oauth_authorize",
{},
function (auth_url) {
window.open(auth_url, "Sign into Twitter");
}
);
}
);
});
}
</script>
<script type="text/javascript">
function getPin() {
alert("Submit button clicked!");
var cb = new Codebird;
cb.setConsumerKey("2jCvFchz3pa5CrVxTITm3DbJ0", "3wZizuZjWjwpGnACuxwJbyQNdL8KUTW2zwY8g9rQDyApW9ahGE");
cb.__call(
"oauth_accessToken",
{oauth_verifier: document.getElementById("PINFIELD").value},
function (reply) {
// store the authenticated token, which may be different from the request token (!)
cb.setToken(reply.oauth_token, reply.oauth_token_secret);
localStorage.setItem("user",cb);
//fetch object
alert(localStorage.getItem("user"));
// if you need to persist the login after page reload,
// consider storing the token in a cookie or HTML5 local storage
}
);
}
</script>
<div id="title">
<p>Tweetrivia</p>
</div>
<div>
<br />
<br />
<p id="timer">10</p>
<br />
<!-- Temporary elements for testing tweet retrieval -->
<div id="tempDiv" style="background-color:#000000; display:block; width:300px; height: 75px; margin: 10px auto 50px auto">
<p style="color:#FFFFFF">Temporary</p>
<input type="button" id="tempButton" value="Get Tweet" style="display:block; float:left" onclick="getTweet()">
<input type="text" id="tempTextField" placeholder="Enter name of Twitter user" style="display:block; float:left">
</div>
<!---------------------------------------------------->
<div id="tweet">
<p>Tweet goes here</p>
</div>
<br />
<div id="mc">
<button id="choice" onclick="answer()">Choice A</button>
<button id="choice" onclick="answer()">Choice B</button>
<br />
<br />
<button id="choice" onclick="answer()">Choice C</button>
<button id="choice"onclick="answer()">Choice D</button>
</div>
</div>
<div id="mask2"> </div>
<div id="popup2">
<h2>Pick A Category..</h2>
<div class="flexable">
<select id="category">
<option>Category 1</option>
<br />
<input type="button" value="Start" onclick="start()" class="button" />
</select>
</div>
</div>
<div id="mask" class="hide"> </div>
<div id="popup" class="hide">
<h2>Time's Up!</h2>
<div class="flexable">
<input type="button" value="Restart" onclick="restart()" class="button"/>
<input type="button" value="Change Category" class="button" onclick="change()"/>
</div>
</div>
<script src="http://www.parsecdn.com/js/parse-1.3.4.min.js" type="text/javascript"></script>
<script src="js/parseDB.js" type="text/javascript"></script>
<script src="js/index.js" type="text/javascript"></script>
<script src="js/codebird.js" type="text/javascript"></script>
<!--script data-main="js/index.js" src="js/require.js" type="text/javascript"></script-->
</body>
</html>