diff --git a/README.md b/README.md deleted file mode 100644 index 4731e91..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# flicklist -Class project for students in the front-end web track - diff --git a/css/styles.css b/css/styles.css deleted file mode 100644 index e69de29..0000000 diff --git a/index.html b/index.html index f07d92e..90693fa 100644 --- a/index.html +++ b/index.html @@ -1,47 +1,47 @@ - + - + - FlickList + FlickList -
+

FlickList

Keep a list of all the movies you've been meaning to watch.

-
+
-
+
-

My Watchlist

-
+

My Watchlist

+
-
- - - - - - - - - - - - \ No newline at end of file +
+ + + +
+
+

Browse Movies

+
+
+ + +
+ + + + + + diff --git a/js/flicklist.js b/js/flicklist.js index 9e50acd..53c8639 100644 --- a/js/flicklist.js +++ b/js/flicklist.js @@ -1,14 +1,14 @@ var model = { - watchlistItems: [], - browseItems: [] + watchlistItems: [], + browseItems: [] } var api = { - root: "https://api.themoviedb.org/3", - token: "8e888fa39ec243e662e1fb738c42ae99" + root: "https://api.themoviedb.org/3", + token: "a5236e0bfac6c2e98564690ff04e45fe" // TODO 0 put your api key here } @@ -18,8 +18,25 @@ var api = { * the callback function that was passed in */ function discoverMovies(callback) { - // TODO - + $.ajax({ + url: api.root + "/discover/movie", + data: { + api_key: api.token, + }, + success: function(response) { + console.log("We got a response from The Movie DB!"); + //console.log(response); + + // TODO 2 (DONE) + // update the model, setting its .browseItems property equal to the movies we recieved in the response + // update the model variable, filling its .browseItems property with the newly received list of movies + model.browseItems = response.results; + //console.log(model.browseItems); + // invoke the callback function that was passed in. + callback(); + } + }); + } @@ -27,7 +44,51 @@ function discoverMovies(callback) { * re-renders the page with new content, based on the current state of the model */ function render() { - // TODO - + // TODO 7 + // clear everything from both lists + $('#section-watchlist ul').empty(); + + // TODO 6 + // for each movie on the user's watchlist, insert a list item into the