summaryrefslogtreecommitdiff
path: root/imdb-lookup/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'imdb-lookup/js/app.js')
-rw-r--r--imdb-lookup/js/app.js26
1 files changed, 6 insertions, 20 deletions
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]);