2010-07-27 11:35:13 +08:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
|
|
|
|
|
|
<title>Jasmine BDD</title>
|
2010-08-01 09:43:10 +08:00
|
|
|
<link rel="stylesheet" type="text/css" href="css/reset.css" />
|
|
|
|
<link rel="stylesheet" type="text/css" href="css/master.css" />
|
2010-07-27 11:35:13 +08:00
|
|
|
<script type="text/javascript" src="javascripts/prototype.js"></script>
|
2010-08-01 09:43:10 +08:00
|
|
|
<script type="text/javascript" src="javascripts/TwitSearch.js"></script>
|
|
|
|
<script type="text/javascript" src="javascripts/TwitterApi.js"></script>
|
|
|
|
<script type="text/javascript" src="javascripts/Tweet.js"></script>
|
2010-07-27 11:35:13 +08:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2010-08-01 09:43:10 +08:00
|
|
|
<div id="wrap">
|
2010-07-27 13:20:18 +08:00
|
|
|
<div id="twit_search">
|
|
|
|
<form action="#" method="get">
|
|
|
|
<input type="text" name="query" id="query" />
|
|
|
|
<input type="submit" value="Search Twitter" />
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<ul id="results"></ul>
|
2010-07-27 11:35:13 +08:00
|
|
|
<script type="text/javascript">
|
2010-07-27 13:20:18 +08:00
|
|
|
|
2010-07-27 11:35:13 +08:00
|
|
|
document.observe('dom:loaded', function(){
|
2010-07-27 13:20:18 +08:00
|
|
|
$$("#twit_search form").first().observe("submit", function(event) {
|
2010-08-01 09:43:10 +08:00
|
|
|
event.preventDefault();
|
2010-07-27 13:20:18 +08:00
|
|
|
var search_query = $("query").value
|
2010-08-01 09:43:10 +08:00
|
|
|
new TwitterApi().search(
|
|
|
|
search_query, {
|
|
|
|
// onSuccess should parse the JSON, then hand off the array of tweet objects to this method
|
|
|
|
onSuccess: TwitSearch.displayResults,
|
|
|
|
onFailure: TwitSearch.searchFailure,
|
|
|
|
onComplete: TwitSearch.cleanup,
|
|
|
|
on403: function(){
|
|
|
|
alert("fail whale");
|
|
|
|
}
|
2010-07-27 13:20:18 +08:00
|
|
|
}
|
2010-08-01 09:43:10 +08:00
|
|
|
);
|
2010-07-27 13:20:18 +08:00
|
|
|
});
|
2010-07-27 11:35:13 +08:00
|
|
|
});
|
|
|
|
</script>
|
2010-08-01 09:43:10 +08:00
|
|
|
</div>
|
2010-07-27 11:35:13 +08:00
|
|
|
</body>
|
|
|
|
</html>
|