From 2d0e49183a5c49badb96a0168dab575f7db70b21 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 21 Dec 2014 22:47:26 +0100 Subject: simpliefied caching --- imdb-lookup/js/app.js | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'imdb-lookup/js') diff --git a/imdb-lookup/js/app.js b/imdb-lookup/js/app.js index 03819e6..8cd5e76 100644 --- a/imdb-lookup/js/app.js +++ b/imdb-lookup/js/app.js @@ -28,12 +28,9 @@ App.Movie = DS.Model.extend({ omdbUserTomato: DS.attr('int'), omdbTomatoRating: DS.attr(), omdbTomatoUserRating: DS.attr(), - omdbTomatoFresh: DS.attr('int'), - tmdbId: DS.attr('int') -}) - -App.MovieController = Ember.ObjectController.extend({ + tmdbId: DS.attr('int'), + linkTmdb: function() { return "http://www.themoviedb.org/movie/" + this.get('tmdbId'); }.property('tmdbId'), @@ -45,24 +42,13 @@ App.MovieController = Ember.ObjectController.extend({ }.property('tmdbId'), linkOfdb: function() { return "http://www.ofdb.de/view.php?page=suchergebnis&Kat=IMDb&SText=" + this.get('id'); - }.property('id') + }.property('id'), + linkRotten: function() { + return "http://www.rottentomatoes.com/search/?search=" + encodeURIComponent(this.get('title')); + }.property('title') }); App.IndexController = Ember.ArrayController.extend({ - itemController: 'movie', - filter: '', - filteredContent: function(){ - var filter = this.get('filter'); - var content = this.get('arrangedContent'); - if (filter.length > 2) { - var rx = new RegExp(filter, 'gi'); - return content.filter(function(movie) { - return movie && movie.get('title').match(rx); - }); - } else { - return content; - } - }.property('arrangedContent', 'filter'), actions: { sortBy: function(property) { this.set('sortProperties', [property]); -- cgit v1.2.1