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-11-29 08:52:09 +08:00
|
|
|
<script type="text/javascript" src="../../../frameworks/jquery.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">
|
2010-09-17 01:14:39 +08:00
|
|
|
<form action="index.html#" method="get">
|
2010-07-27 13:20:18 +08:00
|
|
|
<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-08-24 12:38:20 +08:00
|
|
|
$(function(){
|
|
|
|
$("#twit_search form").submit(function(e){
|
|
|
|
e.preventDefault();
|
|
|
|
var search_query = $("#query").val();
|
2010-08-01 09:43:10 +08:00
|
|
|
new TwitterApi().search(
|
|
|
|
search_query, {
|
|
|
|
onSuccess: TwitSearch.displayResults,
|
2010-08-24 12:38:20 +08:00
|
|
|
onFailure: TwitSearch.searchFailure
|
|
|
|
// onComplete: TwitSearch.cleanup,
|
|
|
|
// onFailWhale: TwitSearch.failWhale
|
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
|
|
|
});
|
2010-08-24 12:38:20 +08:00
|
|
|
|
|
|
|
// document.observe('dom:loaded', function(){
|
|
|
|
// $$("#twit_search form").first().observe("submit", function(event) {
|
|
|
|
// event.preventDefault();
|
|
|
|
// var search_query = $("query").value
|
|
|
|
// new TwitterApi().search(
|
|
|
|
// search_query, {
|
|
|
|
// onSuccess: TwitSearch.displayResults,
|
|
|
|
// onFailure: TwitSearch.searchFailure,
|
|
|
|
// onComplete: TwitSearch.cleanup,
|
|
|
|
// onFailWhale: TwitSearch.failWhale
|
|
|
|
// }
|
|
|
|
// );
|
|
|
|
// });
|
|
|
|
// });
|
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>
|