From 0ef9742d0ea41c028356692d8d0bc0502e5edbc2 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 8 Mar 2013 08:12:10 +0000 Subject: [PATCH] fix special (semicolon-separated) values --- static/js/pandora/infoView.indiancinema.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/static/js/pandora/infoView.indiancinema.js b/static/js/pandora/infoView.indiancinema.js index c5c6213e..a208ff18 100644 --- a/static/js/pandora/infoView.indiancinema.js +++ b/static/js/pandora/infoView.indiancinema.js @@ -26,9 +26,10 @@ pandora.ui.infoView = function(data) { 'editor', 'composer', 'lyricist', 'actor' ], listKeys = nameKeys.concat([ - 'country', 'language', 'color', 'sound', 'productionCompany', - 'genre', 'keyword' + 'country', 'language', 'color', 'sound', 'genre', 'keyword' ]), + // these may contain commas, and are thus separated by semicolons + specialListKeys = ['alternativeTitles', 'productionCompany'], descriptions = { names: getNames(), studios: getStudios() @@ -458,6 +459,8 @@ pandora.ui.infoView = function(data) { $minutes[value ? 'show' : 'hide'](); } else if (listKeys.indexOf(key) > -1) { edit[key] = value ? value.split(', ') : []; + } else if (specialListKeys.indexOf(key) > -1) { + edit[key] = value ? value.split('; ') : []; } else { edit[key] = value; } @@ -527,7 +530,7 @@ pandora.ui.infoView = function(data) { return key ? '' + value + '' : value; - }).join(', '); + }).join(Ox.contains(specialListKeys, key) ? '; ' : ', '); } function formatTitle(title) { @@ -547,11 +550,10 @@ pandora.ui.infoView = function(data) { var ret; if (nameKeys.indexOf(key) > -1) { ret = formatLink(value.split(', '), 'name'); - } else if ( - listKeys.indexOf(key) > -1 - || Ox.contains(['year', 'color', 'sound'], key) - ) { + } else if (listKeys.indexOf(key) > -1) { ret = formatLink(value.split(', '), key); + } else if (specialListKeys.indexOf(key) > -1) { + ret = formatLink(value.split('; '), key); } else if (key == 'imdbId') { ret = '' + value + ''; @@ -616,6 +618,7 @@ pandora.ui.infoView = function(data) { }).join('; ') : key == 'runtime' ? Math.round(value / 60) : Ox.contains(listKeys, key) ? value.join(', ') + : Ox.contains(specialListKeys, key) ? value.join('; ') : value; }