From e69a4a99d2865de7cef8f418c506a120df9cd457 Mon Sep 17 00:00:00 2001 From: Gale Harrington Date: Mon, 18 Dec 2017 10:05:55 -0800 Subject: [PATCH 01/13] Add .env to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a360e4d75..9646f9a60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.env + # From https://github.com/github/gitignore/blob/master/Node.gitignore # Logs logs From 4d62fc64dd68748b83e1d7c103f7499768588433 Mon Sep 17 00:00:00 2001 From: Jessica Owens Date: Mon, 18 Dec 2017 15:39:55 -0800 Subject: [PATCH 02/13] Setup Movie model, collections, and views --- dist/index.html | 19 ++++++++++++++++++- src/app.js | 17 +++++++++++++++++ src/collections/result_list.js | 9 +++++++++ src/models/movie.js | 8 ++++++++ src/views/result_list_view.js | 26 ++++++++++++++++++++++++++ src/views/result_view.js | 15 +++++++++++++++ 6 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 src/collections/result_list.js create mode 100644 src/models/movie.js create mode 100644 src/views/result_list_view.js create mode 100644 src/views/result_view.js diff --git a/dist/index.html b/dist/index.html index 559b18ecd..b29368267 100644 --- a/dist/index.html +++ b/dist/index.html @@ -6,9 +6,26 @@
- + +
+
    + +
+
+
+ +
+ + + + diff --git a/src/app.js b/src/app.js index 30c00d594..484320e53 100644 --- a/src/app.js +++ b/src/app.js @@ -6,9 +6,26 @@ import './css/styles.css'; import $ from 'jquery'; import _ from 'underscore'; +// Models & Collections +import ResultList from './collections/result_list'; +import ResultListView from './views/result_list_view'; + + +const resultList = new ResultList(); + // ready to go $(document).ready(function() { + resultList.fetch().done(() => { + + }); $('#main-content').append('

Hello World!

'); + const resultListView = new ResultListView({ + model: resultList, + template: _.template($('#result-template').html()), + el: '#results-container', + }); + resultListView.render(); + }); diff --git a/src/collections/result_list.js b/src/collections/result_list.js new file mode 100644 index 000000000..0be852275 --- /dev/null +++ b/src/collections/result_list.js @@ -0,0 +1,9 @@ +import Backbone from 'backbone'; +import Movie from '../models/movie'; + +const ResultList = Backbone.Collection.extend({ + model: Movie, + url: 'http://localhost:3000/movies', +}); + +export default ResultList; diff --git a/src/models/movie.js b/src/models/movie.js new file mode 100644 index 000000000..aa772a74a --- /dev/null +++ b/src/models/movie.js @@ -0,0 +1,8 @@ +import Backbone from 'backbone'; + +const Movie = Backbone.Model.extend({ + // urlRoot: 'http://localhost:3000/movies', +}) + + +export default Movie diff --git a/src/views/result_list_view.js b/src/views/result_list_view.js new file mode 100644 index 000000000..a64ff4880 --- /dev/null +++ b/src/views/result_list_view.js @@ -0,0 +1,26 @@ +import Backbone from 'backbone'; + +import ResultView from './result_view'; + +const ResultListView = Backbone.View.extend({ + initialize(params) { + this.template = params.template; + this.model = params.model; + this.listenTo(this.model, 'update', this.render); + }, + render() { + this.$('#results').empty(); + this.model.each((result) => { + const resultView = new ResultView({ + model: result, + template: this.template, + tagName: 'li', + className: 'result', + }); + this.$('#results').append(resultView.render().$el); + }); + return this; + } +}); + +export default ResultListView; diff --git a/src/views/result_view.js b/src/views/result_view.js new file mode 100644 index 000000000..932630466 --- /dev/null +++ b/src/views/result_view.js @@ -0,0 +1,15 @@ +import Backbone from 'backbone'; + +const ResultView = Backbone.View.extend({ + initialize(params) { + this.template = params.template; + this.model = params.model; + }, + render() { + const compiledTemplate = this.template(this.model.toJSON()); + this.$el.html(compiledTemplate); + return this; + }, +}); + +export default ResultView; From 9ea9d5d41ca8e0cfbe38476e298d709a7152c707 Mon Sep 17 00:00:00 2001 From: Jessica Owens Date: Mon, 18 Dec 2017 16:47:41 -0800 Subject: [PATCH 03/13] Futzed with some HTML, but pushing for Gale --- dist/index.html | 12 +++++------- src/app.js | 7 ++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/dist/index.html b/dist/index.html index b29368267..767604041 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,22 +7,20 @@
-
    - -
+

DATABASE RESULTS

+
- +

RENTAL LIBRARY COMING SOON!

diff --git a/src/app.js b/src/app.js index 484320e53..31155306a 100644 --- a/src/app.js +++ b/src/app.js @@ -15,17 +15,14 @@ const resultList = new ResultList(); // ready to go $(document).ready(function() { - resultList.fetch().done(() => { - - }); - - $('#main-content').append('

Hello World!

'); + resultList.fetch(); const resultListView = new ResultListView({ model: resultList, template: _.template($('#result-template').html()), el: '#results-container', }); + resultListView.render(); }); From 52c7ae5a35ee0e24dd43937c5460cf1b812637d6 Mon Sep 17 00:00:00 2001 From: Jessica Owens Date: Mon, 18 Dec 2017 17:48:54 -0800 Subject: [PATCH 04/13] Adjusted image rendering in template --- dist/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.html b/dist/index.html index 767604041..9d7e9ba39 100644 --- a/dist/index.html +++ b/dist/index.html @@ -20,7 +20,7 @@

RENTAL LIBRARY COMING SOON!

From 55d7d85d6e89a347c6ca0a867507c93b9bedb67e Mon Sep 17 00:00:00 2001 From: Gale Harrington Date: Mon, 18 Dec 2017 20:05:08 -0800 Subject: [PATCH 05/13] Rename files --- dist/index.html | 8 ++--- src/app.js | 29 ++++++++++--------- .../{result_list.js => library.js} | 4 +-- src/views/library_view.js | 26 +++++++++++++++++ src/views/{result_view.js => movie_view.js} | 4 +-- src/views/result_list_view.js | 26 ----------------- 6 files changed, 49 insertions(+), 48 deletions(-) rename src/collections/{result_list.js => library.js} (63%) create mode 100644 src/views/library_view.js rename src/views/{result_view.js => movie_view.js} (79%) delete mode 100644 src/views/result_list_view.js diff --git a/dist/index.html b/dist/index.html index 9d7e9ba39..a74b8aaae 100644 --- a/dist/index.html +++ b/dist/index.html @@ -11,15 +11,15 @@

SEARCH FORM COMING SOON!

DATABASE RESULTS

-
-
-

RENTAL LIBRARY COMING SOON!

+
+

RENTAL LIBRARY

+
- diff --git a/src/app.js b/src/app.js index 31155306a..e8611b49e 100644 --- a/src/app.js +++ b/src/app.js @@ -1,28 +1,29 @@ -import 'css/_settings.css'; -import 'foundation-sites/dist/css/foundation.css'; -import './css/styles.css'; - // Import jQuery & Underscore import $ from 'jquery'; import _ from 'underscore'; +//Styles +import 'css/_settings.css'; +import 'foundation-sites/dist/css/foundation.css'; +import './css/styles.css'; + // Models & Collections -import ResultList from './collections/result_list'; -import ResultListView from './views/result_list_view'; +import Library from './collections/library'; +import LibraryView from './views/library_view'; -const resultList = new ResultList(); +const library = new Library(); // ready to go $(document).ready(function() { - resultList.fetch(); + library.fetch(); - const resultListView = new ResultListView({ - model: resultList, - template: _.template($('#result-template').html()), - el: '#results-container', + const libraryView = new LibraryView({ + model: library, + template: _.template($('#library-template').html()), + el: '#library', }); - - resultListView.render(); + + libraryView.render(); }); diff --git a/src/collections/result_list.js b/src/collections/library.js similarity index 63% rename from src/collections/result_list.js rename to src/collections/library.js index 0be852275..fc70870dc 100644 --- a/src/collections/result_list.js +++ b/src/collections/library.js @@ -1,9 +1,9 @@ import Backbone from 'backbone'; import Movie from '../models/movie'; -const ResultList = Backbone.Collection.extend({ +const Library= Backbone.Collection.extend({ model: Movie, url: 'http://localhost:3000/movies', }); -export default ResultList; +export default Library; diff --git a/src/views/library_view.js b/src/views/library_view.js new file mode 100644 index 000000000..859cc399c --- /dev/null +++ b/src/views/library_view.js @@ -0,0 +1,26 @@ +import Backbone from 'backbone'; + +import MovieView from './movie_view'; + +const LibraryView = Backbone.View.extend({ + initialize(params) { + this.template = params.template; + this.model = params.model; + this.listenTo(this.model, 'update', this.render); + }, + render() { + this.$('#movie-list').empty(); + this.model.each((movie) => { + const movieView = new MovieView({ + model: movie, + template: this.template, + tagName: 'li', + className: 'movie', + }); + this.$('#movie-list').append(movieView.render().$el); + }); + return this; + } +}); + +export default LibraryView; diff --git a/src/views/result_view.js b/src/views/movie_view.js similarity index 79% rename from src/views/result_view.js rename to src/views/movie_view.js index 932630466..06ee7b640 100644 --- a/src/views/result_view.js +++ b/src/views/movie_view.js @@ -1,6 +1,6 @@ import Backbone from 'backbone'; -const ResultView = Backbone.View.extend({ +const MovieView = Backbone.View.extend({ initialize(params) { this.template = params.template; this.model = params.model; @@ -12,4 +12,4 @@ const ResultView = Backbone.View.extend({ }, }); -export default ResultView; +export default MovieView; diff --git a/src/views/result_list_view.js b/src/views/result_list_view.js deleted file mode 100644 index a64ff4880..000000000 --- a/src/views/result_list_view.js +++ /dev/null @@ -1,26 +0,0 @@ -import Backbone from 'backbone'; - -import ResultView from './result_view'; - -const ResultListView = Backbone.View.extend({ - initialize(params) { - this.template = params.template; - this.model = params.model; - this.listenTo(this.model, 'update', this.render); - }, - render() { - this.$('#results').empty(); - this.model.each((result) => { - const resultView = new ResultView({ - model: result, - template: this.template, - tagName: 'li', - className: 'result', - }); - this.$('#results').append(resultView.render().$el); - }); - return this; - } -}); - -export default ResultListView; From 32551eb165730f6ef94d5274ded17d0fd5e0ce36 Mon Sep 17 00:00:00 2001 From: Gale Harrington Date: Mon, 18 Dec 2017 21:20:23 -0800 Subject: [PATCH 06/13] Can make a request to get movies that match search query --- src/app.js | 7 +++++++ src/collections/library.js | 2 +- src/collections/result_list.js | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/collections/result_list.js diff --git a/src/app.js b/src/app.js index e8611b49e..8d16db182 100644 --- a/src/app.js +++ b/src/app.js @@ -10,6 +10,7 @@ import './css/styles.css'; // Models & Collections import Library from './collections/library'; import LibraryView from './views/library_view'; +import ResultList from './collections/result_list'; const library = new Library(); @@ -26,4 +27,10 @@ $(document).ready(function() { libraryView.render(); + + const resultList = new ResultList({query: 'Psycho'}); + console.log(resultList); + + resultList.fetch() + }); diff --git a/src/collections/library.js b/src/collections/library.js index fc70870dc..46de85539 100644 --- a/src/collections/library.js +++ b/src/collections/library.js @@ -1,7 +1,7 @@ import Backbone from 'backbone'; import Movie from '../models/movie'; -const Library= Backbone.Collection.extend({ +const Library = Backbone.Collection.extend({ model: Movie, url: 'http://localhost:3000/movies', }); diff --git a/src/collections/result_list.js b/src/collections/result_list.js new file mode 100644 index 000000000..ee99fbd72 --- /dev/null +++ b/src/collections/result_list.js @@ -0,0 +1,22 @@ +import Backbone from 'backbone'; +import Movie from '../models/movie'; + +const ResultList = Backbone.Collection.extend({ + initialize: function(options) { + this.query = options.query; + }, + model: Movie, + // sync: function(method, model, options) { + // switch(method) { + // case 'read': + // options.url = 'http://localhost:3000/movies/search?query=' + this.query; + // return Backbone.sync('read', model, options); + // } + // } + sync: function(method, model, options) { + options.url = 'http://localhost:3000/movies/search?query=' + this.query; + return Backbone.sync('read', model, options); + } +}); + +export default ResultList; From 732eaecfe9cdc282463fad5d4747a03ac2ef8c17 Mon Sep 17 00:00:00 2001 From: Gale Harrington Date: Mon, 18 Dec 2017 22:55:01 -0800 Subject: [PATCH 07/13] Can search and see list of titles fetched from movie db --- dist/index.html | 19 ++++++++++++++---- src/app.js | 14 +++++++++++--- src/collections/result_list.js | 7 ++++--- src/views/result_list_view.js | 35 ++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 src/views/result_list_view.js diff --git a/dist/index.html b/dist/index.html index a74b8aaae..b76c7a754 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,10 +7,17 @@
-
-

DATABASE RESULTS

+

Search for Movies:

+
+ + +
+
+

DATABASE RESULTS

+
    + +
+

RENTAL LIBRARY

@@ -23,6 +30,10 @@

RENTAL LIBRARY

<%- title %> + + diff --git a/src/app.js b/src/app.js index 8d16db182..a943b6d31 100644 --- a/src/app.js +++ b/src/app.js @@ -11,9 +11,11 @@ import './css/styles.css'; import Library from './collections/library'; import LibraryView from './views/library_view'; import ResultList from './collections/result_list'; +import ResultListView from './views/result_list_view'; const library = new Library(); +const resultList = new ResultList(); // ready to go $(document).ready(function() { @@ -27,10 +29,16 @@ $(document).ready(function() { libraryView.render(); + const resultListView = new ResultListView({ + model: resultList, + template: _.template($('#result-list-template').html()), + el: '#search' + }) - const resultList = new ResultList({query: 'Psycho'}); - console.log(resultList); + //resultList.set('query', 'psycho'); + //const resultList = new ResultList({query: 'Psycho'}); + //console.log(resultList); - resultList.fetch() + //resultList.fetch() }); diff --git a/src/collections/result_list.js b/src/collections/result_list.js index ee99fbd72..548fa11b0 100644 --- a/src/collections/result_list.js +++ b/src/collections/result_list.js @@ -2,9 +2,10 @@ import Backbone from 'backbone'; import Movie from '../models/movie'; const ResultList = Backbone.Collection.extend({ - initialize: function(options) { - this.query = options.query; - }, + // initialize: function(options) { + // //this.query = options.query; + // }, + // query: this.query, model: Movie, // sync: function(method, model, options) { // switch(method) { diff --git a/src/views/result_list_view.js b/src/views/result_list_view.js new file mode 100644 index 000000000..cd1d876b1 --- /dev/null +++ b/src/views/result_list_view.js @@ -0,0 +1,35 @@ +import Backbone from 'backbone'; +import MovieView from './movie_view' + +const ResultListView = Backbone.View.extend({ + initialize(params) { + this.template = params.template; + this.model = params.model; + this.listenTo(this.model, 'update', this.render); + }, + events: { + 'click #search-btn': 'getResults', + }, + render() { + this.$('#results-list').empty(); + this.model.each((movie) => { + const movieView = new MovieView({ + model: movie, + template: this.template, + tagName: 'li', + className: 'movie', + }); + console.log(movie) + this.$('#results-list').append(movieView.render().$el); + }); + return this; + }, + getResults: function(event) { + event.preventDefault(); + const searchTerm = this.$('[name="search"]').val(); + this.model.query = searchTerm + this.model.fetch() + } +}); + +export default ResultListView; From 48e47519c89ec8be161c8ddff3239c4f664fa8f7 Mon Sep 17 00:00:00 2001 From: Jessica Owens Date: Tue, 19 Dec 2017 11:05:31 -0800 Subject: [PATCH 08/13] Added image tag to result list --- dist/index.html | 2 +- src/views/result_view.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/views/result_view.js diff --git a/dist/index.html b/dist/index.html index b76c7a754..9bceae014 100644 --- a/dist/index.html +++ b/dist/index.html @@ -31,7 +31,7 @@

RENTAL LIBRARY

diff --git a/src/views/result_view.js b/src/views/result_view.js new file mode 100644 index 000000000..932630466 --- /dev/null +++ b/src/views/result_view.js @@ -0,0 +1,15 @@ +import Backbone from 'backbone'; + +const ResultView = Backbone.View.extend({ + initialize(params) { + this.template = params.template; + this.model = params.model; + }, + render() { + const compiledTemplate = this.template(this.model.toJSON()); + this.$el.html(compiledTemplate); + return this; + }, +}); + +export default ResultView; From 704cfb50b51c00052e45af0bfa97d87d9384345b Mon Sep 17 00:00:00 2001 From: Jessica Owens Date: Tue, 19 Dec 2017 11:31:11 -0800 Subject: [PATCH 09/13] Add to library from result list --- dist/index.html | 6 ++++-- src/app.js | 6 +++++- src/views/movie_view.js | 7 +++++++ src/views/result_list_view.js | 4 +++- src/views/result_view.js | 15 --------------- 5 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 src/views/result_view.js diff --git a/dist/index.html b/dist/index.html index 9bceae014..a7b15b416 100644 --- a/dist/index.html +++ b/dist/index.html @@ -26,11 +26,13 @@

RENTAL LIBRARY

- - diff --git a/src/app.js b/src/app.js index a943b6d31..c27f9d47e 100644 --- a/src/app.js +++ b/src/app.js @@ -1,3 +1,4 @@ +import Backbone from 'backbone'; // Import jQuery & Underscore import $ from 'jquery'; import _ from 'underscore'; @@ -16,6 +17,7 @@ import ResultListView from './views/result_list_view'; const library = new Library(); const resultList = new ResultList(); +const bus = _.extend({}, Backbone.Events); // ready to go $(document).ready(function() { @@ -24,6 +26,7 @@ $(document).ready(function() { const libraryView = new LibraryView({ model: library, template: _.template($('#library-template').html()), + bus: bus, el: '#library', }); @@ -32,7 +35,8 @@ $(document).ready(function() { const resultListView = new ResultListView({ model: resultList, template: _.template($('#result-list-template').html()), - el: '#search' + el: '#search', + library: library, }) //resultList.set('query', 'psycho'); diff --git a/src/views/movie_view.js b/src/views/movie_view.js index 06ee7b640..0adff9173 100644 --- a/src/views/movie_view.js +++ b/src/views/movie_view.js @@ -4,12 +4,19 @@ const MovieView = Backbone.View.extend({ initialize(params) { this.template = params.template; this.model = params.model; + this.library = params.library; + }, + events: { + 'click #add-btn': 'addToLibrary', }, render() { const compiledTemplate = this.template(this.model.toJSON()); this.$el.html(compiledTemplate); return this; }, + addToLibrary() { + this.library.add(this.model); + } }); export default MovieView; diff --git a/src/views/result_list_view.js b/src/views/result_list_view.js index cd1d876b1..099b6066d 100644 --- a/src/views/result_list_view.js +++ b/src/views/result_list_view.js @@ -5,6 +5,7 @@ const ResultListView = Backbone.View.extend({ initialize(params) { this.template = params.template; this.model = params.model; + this.library = params.library; this.listenTo(this.model, 'update', this.render); }, events: { @@ -18,6 +19,7 @@ const ResultListView = Backbone.View.extend({ template: this.template, tagName: 'li', className: 'movie', + library: this.library, }); console.log(movie) this.$('#results-list').append(movieView.render().$el); @@ -29,7 +31,7 @@ const ResultListView = Backbone.View.extend({ const searchTerm = this.$('[name="search"]').val(); this.model.query = searchTerm this.model.fetch() - } + }, }); export default ResultListView; diff --git a/src/views/result_view.js b/src/views/result_view.js deleted file mode 100644 index 932630466..000000000 --- a/src/views/result_view.js +++ /dev/null @@ -1,15 +0,0 @@ -import Backbone from 'backbone'; - -const ResultView = Backbone.View.extend({ - initialize(params) { - this.template = params.template; - this.model = params.model; - }, - render() { - const compiledTemplate = this.template(this.model.toJSON()); - this.$el.html(compiledTemplate); - return this; - }, -}); - -export default ResultView; From 45cbd1303d4bdb203fad1ee7e69af170efd87c4c Mon Sep 17 00:00:00 2001 From: Gale Harrington Date: Tue, 19 Dec 2017 13:37:47 -0800 Subject: [PATCH 10/13] Remove comments --- src/models/movie.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/movie.js b/src/models/movie.js index aa772a74a..c1bbdc422 100644 --- a/src/models/movie.js +++ b/src/models/movie.js @@ -1,7 +1,7 @@ import Backbone from 'backbone'; const Movie = Backbone.Model.extend({ - // urlRoot: 'http://localhost:3000/movies', + }) From b701a4c9ed5d680eeac0aa664bff8debc879cf0a Mon Sep 17 00:00:00 2001 From: Jessica Owens Date: Wed, 20 Dec 2017 09:40:49 -0800 Subject: [PATCH 11/13] added release dates --- dist/index.html | 22 ++++++++++++++-------- src/css/styles.css | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/dist/index.html b/dist/index.html index a7b15b416..99b7b59cc 100644 --- a/dist/index.html +++ b/dist/index.html @@ -4,36 +4,42 @@ Backbone Baseline - + +
+

BACKBONE BASELINE RENTAL LIBRARY

+

RENTAL LIBRARY

-
+
diff --git a/src/css/styles.css b/src/css/styles.css index 68a79a569..510c4d20e 100644 --- a/src/css/styles.css +++ b/src/css/styles.css @@ -1,5 +1,17 @@ @include foundation-everything; +body#foundation-override { + /* font-family: 'Trirong', serif; */ + /* font-weight: 400; */ + /* background-image: url(https://source.unsplash.com/HC6Gkb9x4Ro/2144×1424); */ + /* background-blend-mode: color; */ + /* background-size: cover; */ + height: 100vh; + width: 100%; + /* background-color: rgba(0, 0, 0, 0.1); */ + +} + main { background: lightblue; } @@ -37,6 +49,10 @@ aside label { div { display: inline; } + +ul, li { + list-style-type: none; +} /* * { border-style: solid; From 339c7072804d111f659277428f2ada4842e65811 Mon Sep 17 00:00:00 2001 From: Gale Harrington Date: Wed, 20 Dec 2017 13:03:06 -0800 Subject: [PATCH 12/13] Configure rack.cors gem --- src/models/movie.js | 7 ++++++- src/views/movie_view.js | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/models/movie.js b/src/models/movie.js index c1bbdc422..6e4c96843 100644 --- a/src/models/movie.js +++ b/src/models/movie.js @@ -1,7 +1,12 @@ import Backbone from 'backbone'; const Movie = Backbone.Model.extend({ - + urlRoot: 'http://localhost:3000/movies' + // sync: function(method, model, options) { + // options.url = 'http://localhost:3000/movies'; + // //Backbone.emulateHTTP = true; + // return Backbone.sync('create', model, options); + // } }) diff --git a/src/views/movie_view.js b/src/views/movie_view.js index 0adff9173..04f2a807b 100644 --- a/src/views/movie_view.js +++ b/src/views/movie_view.js @@ -15,7 +15,9 @@ const MovieView = Backbone.View.extend({ return this; }, addToLibrary() { + console.log(this.model); this.library.add(this.model); + this.model.save(); } }); From 8af77093420e01c2875f981e762fd61c204aebd6 Mon Sep 17 00:00:00 2001 From: Gale Harrington Date: Wed, 20 Dec 2017 13:24:54 -0800 Subject: [PATCH 13/13] Remove comments and console.logs --- dist/index.html | 2 +- src/app.js | 7 ------- src/collections/result_list.js | 11 ----------- src/css/styles.css | 11 ----------- src/models/movie.js | 5 ----- src/views/movie_view.js | 1 - src/views/result_list_view.js | 1 - 7 files changed, 1 insertion(+), 37 deletions(-) diff --git a/dist/index.html b/dist/index.html index 99b7b59cc..f74adcc60 100644 --- a/dist/index.html +++ b/dist/index.html @@ -4,7 +4,7 @@ Backbone Baseline - +

BACKBONE BASELINE RENTAL LIBRARY

diff --git a/src/app.js b/src/app.js index c27f9d47e..bfddad095 100644 --- a/src/app.js +++ b/src/app.js @@ -38,11 +38,4 @@ $(document).ready(function() { el: '#search', library: library, }) - - //resultList.set('query', 'psycho'); - //const resultList = new ResultList({query: 'Psycho'}); - //console.log(resultList); - - //resultList.fetch() - }); diff --git a/src/collections/result_list.js b/src/collections/result_list.js index 548fa11b0..0fe19b3cf 100644 --- a/src/collections/result_list.js +++ b/src/collections/result_list.js @@ -2,18 +2,7 @@ import Backbone from 'backbone'; import Movie from '../models/movie'; const ResultList = Backbone.Collection.extend({ - // initialize: function(options) { - // //this.query = options.query; - // }, - // query: this.query, model: Movie, - // sync: function(method, model, options) { - // switch(method) { - // case 'read': - // options.url = 'http://localhost:3000/movies/search?query=' + this.query; - // return Backbone.sync('read', model, options); - // } - // } sync: function(method, model, options) { options.url = 'http://localhost:3000/movies/search?query=' + this.query; return Backbone.sync('read', model, options); diff --git a/src/css/styles.css b/src/css/styles.css index 510c4d20e..92ed076c3 100644 --- a/src/css/styles.css +++ b/src/css/styles.css @@ -1,16 +1,5 @@ @include foundation-everything; -body#foundation-override { - /* font-family: 'Trirong', serif; */ - /* font-weight: 400; */ - /* background-image: url(https://source.unsplash.com/HC6Gkb9x4Ro/2144×1424); */ - /* background-blend-mode: color; */ - /* background-size: cover; */ - height: 100vh; - width: 100%; - /* background-color: rgba(0, 0, 0, 0.1); */ - -} main { background: lightblue; diff --git a/src/models/movie.js b/src/models/movie.js index 6e4c96843..f4eb208b8 100644 --- a/src/models/movie.js +++ b/src/models/movie.js @@ -2,11 +2,6 @@ import Backbone from 'backbone'; const Movie = Backbone.Model.extend({ urlRoot: 'http://localhost:3000/movies' - // sync: function(method, model, options) { - // options.url = 'http://localhost:3000/movies'; - // //Backbone.emulateHTTP = true; - // return Backbone.sync('create', model, options); - // } }) diff --git a/src/views/movie_view.js b/src/views/movie_view.js index 04f2a807b..18ef93d95 100644 --- a/src/views/movie_view.js +++ b/src/views/movie_view.js @@ -15,7 +15,6 @@ const MovieView = Backbone.View.extend({ return this; }, addToLibrary() { - console.log(this.model); this.library.add(this.model); this.model.save(); } diff --git a/src/views/result_list_view.js b/src/views/result_list_view.js index 099b6066d..97e5e3aa7 100644 --- a/src/views/result_list_view.js +++ b/src/views/result_list_view.js @@ -21,7 +21,6 @@ const ResultListView = Backbone.View.extend({ className: 'movie', library: this.library, }); - console.log(movie) this.$('#results-list').append(movieView.render().$el); }); return this;