From 810c117ca9df310c483726093da1c44451f68fe6 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 27 Feb 2013 21:24:13 +0530 Subject: [PATCH] update indiancinema info view --- static/js/pandora/infoView.indiancinema.js | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/static/js/pandora/infoView.indiancinema.js b/static/js/pandora/infoView.indiancinema.js index ab3f96d2..3942685d 100644 --- a/static/js/pandora/infoView.indiancinema.js +++ b/static/js/pandora/infoView.indiancinema.js @@ -131,6 +131,8 @@ pandora.ui.infoView = function(data) { $minutes, + $imdb, + $descriptions, $statistics = $('
') @@ -235,6 +237,10 @@ pandora.ui.infoView = function(data) { renderGroup(['imdbId']); + if (canEdit) { + updateIMDb(); + } + if (data.summary || canEdit) { Ox.EditableContent({ clickLink: pandora.clickLink, @@ -454,6 +460,8 @@ pandora.ui.infoView = function(data) { if (Ox.contains(nameKeys, key)) { names = getNames(); renderDescriptions(); + } else if (key == 'imdbId') { + updateIMDb(); } }); } @@ -737,6 +745,9 @@ pandora.ui.infoView = function(data) { .html(' min') [data.runtime ? 'show' : 'hide']() .appendTo($element); + } else if (key == 'imdbId') { + $imdb = $('') + .appendTo($element); } } }); @@ -933,6 +944,27 @@ pandora.ui.infoView = function(data) { pandora.UI.set({infoIconSize: iconSize}); } + function updateIMDb() { + if (data.imdbId) { + pandora.api.find({ + query: { + conditions: [{key: 'imdbId', operator: '=', value: data.imdbId}] + } + }, function(result) { + if (result.data.items == 1) { + $imdb.empty(); + } else { + $imdb.html( + ' (' + + result.data.items + ' duplicates)' + ); + } + }); + } else { + $imdb.empty(); + } + } + that.reload = function() { var src = src = '/' + data.id + '/' + ( ui.icons == 'posters'