This repository has been archived by the owner on May 2, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
142 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{#each history}} | ||
<ul class="history" data-id="{{this.id}}"> | ||
<li class="query">{{this.query}}</li> | ||
<li class="service">({{this.service}})</li> | ||
<li class="search-buttons"> | ||
<button class="btn btn-mini btn-danger btn-delete"> | ||
<i class="icon-remove-sign icon-white"></i> | ||
</button> | ||
</li> | ||
</ul> | ||
{{/each}} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
<!DOCTYPE html> | ||
<!--[if lt IE 7 ]> <html lang="ja" class="no-js ie6"> <![endif]--> | ||
<!--[if IE 7 ]> <html lang="ja" class="no-js ie7"> <![endif]--> | ||
<!--[if IE 8 ]> <html lang="ja" class="no-js ie8"> <![endif]--> | ||
<!--[if IE 9 ]> <html lang="ja" class="no-js ie9"> <![endif]--> | ||
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="ja" class="no-js"> <!--<![endif]--> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="description" content="" /> | ||
<meta name="author" content="" /> | ||
<title>How to build single page application with Backbone.js</title> | ||
|
||
<link href="assets/css/bootstrap-2.3.0.css" rel="stylesheet" media="screen" /> | ||
<!-- <link href="assets/css/bootstrap-responsive-2.3.0.css" rel="stylesheet" media="screen" />--> | ||
<link href="assets/css/bootstrap-narrow-0.0.1.css" rel="stylesheet" media="screen" /> | ||
<link href="css/main.css" rel="stylesheet" media="screen" /> | ||
|
||
</head> | ||
<body> | ||
|
||
<!--app root --> | ||
<div id="app"></div> | ||
|
||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | ||
<!--[if lt IE 9]> | ||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
<script type="text/javascript" src="assets/js/bootstrap-2.3.0.js"></script> | ||
<script type="text/javascript" src="assets/js/underscore-1.4.4.js"></script> | ||
<script type="text/javascript" src="assets/js/backbone-0.9.10.js"></script> | ||
<script type="text/javascript" src="assets/js/backbone.localStorage-1.1.0.js"></script> | ||
<script type="text/javascript" src="assets/js/moment-2.0.0.js"></script> | ||
<script type="text/javascript" src="assets/js/handlebars-1.0.0-rc.3.js"></script> | ||
<script type="text/javascript" src="assets/js/twitter-text.js"></script> | ||
|
||
<script type="text/javascript" src="js/namespace.js"></script> | ||
<script type="text/javascript" src="js/template.js"></script> | ||
<script type="text/javascript" src="js/models/twitter.js"></script> | ||
<script type="text/javascript" src="js/models/hotpepper.js"></script> | ||
<script type="text/javascript" src="js/collections/search_list.js"></script> | ||
<script type="text/javascript" src="js/collections/twitter_list.js"></script> | ||
<script type="text/javascript" src="js/collections/hotpepper_list.js"></script> | ||
<script type="text/javascript" src="js/views/search_bar.js"></script> | ||
<script type="text/javascript" src="js/views/tabs.js"></script> | ||
<script type="text/javascript" src="js/views/search_results.js"></script> | ||
<script type="text/javascript" src="js/views/history.js"></script> | ||
<script type="text/javascript" src="js/views/footer.js"></script> | ||
<script type="text/javascript" src="js/app.js"></script> | ||
|
||
</body> | ||
<!DOCTYPE html> | ||
<!--[if lt IE 7 ]> <html lang="ja" class="no-js ie6"> <![endif]--> | ||
<!--[if IE 7 ]> <html lang="ja" class="no-js ie7"> <![endif]--> | ||
<!--[if IE 8 ]> <html lang="ja" class="no-js ie8"> <![endif]--> | ||
<!--[if IE 9 ]> <html lang="ja" class="no-js ie9"> <![endif]--> | ||
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="ja" class="no-js"> <!--<![endif]--> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="description" content="" /> | ||
<meta name="author" content="" /> | ||
<title>How to build single page application with Backbone.js</title> | ||
|
||
<link href="assets/css/bootstrap-2.3.0.css" rel="stylesheet" media="screen" /> | ||
<!-- <link href="assets/css/bootstrap-responsive-2.3.0.css" rel="stylesheet" media="screen" />--> | ||
<link href="assets/css/bootstrap-narrow-0.0.1.css" rel="stylesheet" media="screen" /> | ||
<link href="css/main.css" rel="stylesheet" media="screen" /> | ||
|
||
</head> | ||
<body> | ||
|
||
<!--app root --> | ||
<div id="app"></div> | ||
|
||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | ||
<!--[if lt IE 9]> | ||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
<script type="text/javascript" src="assets/js/bootstrap-2.3.0.js"></script> | ||
<script type="text/javascript" src="assets/js/underscore-1.4.4.js"></script> | ||
<script type="text/javascript" src="assets/js/backbone-0.9.10.js"></script> | ||
<script type="text/javascript" src="assets/js/backbone.localStorage-1.1.0.js"></script> | ||
<script type="text/javascript" src="assets/js/moment-2.0.0.js"></script> | ||
<script type="text/javascript" src="assets/js/handlebars-1.0.0-rc.3.js"></script> | ||
<script type="text/javascript" src="assets/js/twitter-text.js"></script> | ||
|
||
<script type="text/javascript" src="js/namespace.js"></script> | ||
<script type="text/javascript" src="js/template.js"></script> | ||
<script type="text/javascript" src="js/models/twitter.js"></script> | ||
<script type="text/javascript" src="js/models/hotpepper.js"></script> | ||
<script type="text/javascript" src="js/collections/search_list.js"></script> | ||
<script type="text/javascript" src="js/collections/twitter_list.js"></script> | ||
<script type="text/javascript" src="js/collections/hotpepper_list.js"></script> | ||
<script type="text/javascript" src="js/views/search_bar.js"></script> | ||
<script type="text/javascript" src="js/views/tabs.js"></script> | ||
<script type="text/javascript" src="js/views/search_results.js"></script> | ||
<script type="text/javascript" src="js/views/history.js"></script> | ||
<script type="text/javascript" src="js/views/footer.js"></script> | ||
<script type="text/javascript" src="js/app.js"></script> | ||
|
||
</body> | ||
</html> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 25 additions & 25 deletions
50
app/js/collections/twitter_list.js → js/collections/twitter_list.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
MyApp.Collections.TwitterList = Backbone.Collection.extend({ | ||
|
||
url: 'http://search.twitter.com/search.json', | ||
|
||
model: MyApp.Models.Twitter, | ||
|
||
search: function (param) { | ||
|
||
this.fetch({ | ||
data: { | ||
q: encodeURIComponent(param.query), | ||
}, | ||
dataType: 'jsonp' | ||
}); | ||
|
||
}, | ||
|
||
parse: function (response, options) { | ||
|
||
this.response = response; | ||
|
||
return response.results; | ||
|
||
} | ||
|
||
MyApp.Collections.TwitterList = Backbone.Collection.extend({ | ||
|
||
url: 'http://search.twitter.com/search.json', | ||
|
||
model: MyApp.Models.Twitter, | ||
|
||
search: function (param) { | ||
|
||
this.fetch({ | ||
data: { | ||
q: encodeURIComponent(param.query), | ||
}, | ||
dataType: 'jsonp' | ||
}); | ||
|
||
}, | ||
|
||
parse: function (response, options) { | ||
|
||
this.response = response; | ||
|
||
return response.results; | ||
|
||
} | ||
|
||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
MyApp.Views.Footer = Backbone.View.extend({ | ||
|
||
tmpl: _.template( | ||
'<div class="navbar navbar-inverse navbar-fixed-bottom">' + | ||
' <div class="navbar-inner">' + | ||
' <div class="container">Copyright (C) 2013 <a href="https://twitter.com/mitsuruog" target="_blank">@mitsuruog</a> All Rights Reserved.</div>' + | ||
' </div>' + | ||
'</div>' ), | ||
|
||
initialize: function() { | ||
this.$el.html(this.tmpl()); | ||
} | ||
|
||
MyApp.Views.Footer = Backbone.View.extend({ | ||
|
||
tmpl: _.template( | ||
'<div class="navbar navbar-inverse navbar-fixed-bottom">' + | ||
' <div class="navbar-inner">' + | ||
' <div class="container">Copyright (C) 2013 <a href="https://twitter.com/mitsuruog" target="_blank">@mitsuruog</a> All Rights Reserved.</div>' + | ||
' </div>' + | ||
'</div>' ), | ||
|
||
initialize: function() { | ||
this.$el.html(this.tmpl()); | ||
} | ||
|
||
}); |
File renamed without changes.
File renamed without changes.
62 changes: 31 additions & 31 deletions
62
app/js/views/search_results.js → js/views/search_results.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
MyApp.Views.SearchResults = Backbone.View.extend({ | ||
|
||
initialize: function (options) { | ||
|
||
_.bindAll(this); | ||
|
||
this.collections = options.collections; | ||
this.tmpl = options.tmpl; | ||
this.service = options.service; | ||
|
||
MyApp.Mediator.on('search:add:' + this.service + ' search:history:' + this.service, this.search); | ||
|
||
this.collections.on('reset', this.render); | ||
}, | ||
|
||
search: function (search) { | ||
|
||
this.collections.search(search); | ||
|
||
}, | ||
|
||
render: function () { | ||
|
||
this.$el.html(this.tmpl({ | ||
models: this.collections.toJSON() | ||
})); | ||
|
||
MyApp.Mediator.trigger('select:tab', this.$el.data('service')); | ||
|
||
} | ||
|
||
MyApp.Views.SearchResults = Backbone.View.extend({ | ||
|
||
initialize: function (options) { | ||
|
||
_.bindAll(this); | ||
|
||
this.collections = options.collections; | ||
this.tmpl = options.tmpl; | ||
this.service = options.service; | ||
|
||
MyApp.Mediator.on('search:add:' + this.service + ' search:history:' + this.service, this.search); | ||
|
||
this.collections.on('reset', this.render); | ||
}, | ||
|
||
search: function (search) { | ||
|
||
this.collections.search(search); | ||
|
||
}, | ||
|
||
render: function () { | ||
|
||
this.$el.html(this.tmpl({ | ||
models: this.collections.toJSON() | ||
})); | ||
|
||
MyApp.Mediator.trigger('select:tab', this.$el.data('service')); | ||
|
||
} | ||
|
||
}); |
File renamed without changes.