From 6e49032602311aa45ab23bf9f4d53b54f9cdcbb6 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 26 Dec 2013 08:35:41 +0000 Subject: [PATCH] add links to indiancine.ma info page --- pandora/config.indiancinema.jsonc | 7 +++++++ static/js/infoView.indiancinema.js | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pandora/config.indiancinema.jsonc b/pandora/config.indiancinema.jsonc index f4b3bf03..5fc30381 100644 --- a/pandora/config.indiancinema.jsonc +++ b/pandora/config.indiancinema.jsonc @@ -373,6 +373,13 @@ "secondaryId": true, "sort": true }, + { + "id": "links", + "title": "Links", + "type": ["string"], + "columnWidth": 180, + "find": true + }, { "id": "comments", "title": "Comments", diff --git a/static/js/infoView.indiancinema.js b/static/js/infoView.indiancinema.js index 2dc63a11..a84b9dee 100644 --- a/static/js/infoView.indiancinema.js +++ b/static/js/infoView.indiancinema.js @@ -26,7 +26,7 @@ pandora.ui.infoView = function(data) { 'editor', 'composer', 'lyricist', 'actor' ], listKeys = nameKeys.concat([ - 'country', 'language', 'color', 'sound', 'genre', 'keyword' + 'country', 'language', 'color', 'sound', 'genre', 'keyword', 'links' ]), // these may contain commas, and are thus separated by semicolons specialListKeys = ['alternativeTitles', 'productionCompany'], @@ -302,7 +302,7 @@ pandora.ui.infoView = function(data) { renderGroup(canSeeAllMetadata ? ['genre', 'keyword'] : ['genre']); - renderGroup(['imdbId']); + renderGroup(['imdbId', 'links']); if (canEdit) { updateIMDb(); @@ -583,6 +583,11 @@ pandora.ui.infoView = function(data) { var ret; if (key == 'year') { ret = formatLink(value, 'year'); + } else if (key == 'links') { + ret = value.split(', ').map(function(link) { + return '' + Ox.parseURL(link).host + ''; + }).join(', '); + } else if (nameKeys.indexOf(key) > -1) { ret = formatLink(value.split(', '), 'name'); } else if (listKeys.indexOf(key) > -1) {