diff --git a/static/js/infoView.t_for_time.js b/static/js/infoView.t_for_time.js index 5624f6a..ea2d542 100644 --- a/static/js/infoView.t_for_time.js +++ b/static/js/infoView.t_for_time.js @@ -252,6 +252,8 @@ pandora.ui.infoView = function(data, isMixed) { renderRemainingKeys(); + renderCluster(); + // Summary ----------------------------------------------------------------- if (canEdit || data.summary) { @@ -552,6 +554,32 @@ pandora.ui.infoView = function(data, isMixed) { } } + function renderCluster() { + var $element = $('
').addClass('OxSelectable').html("Related Videos:"); + var title = data.title.replace('_bg', '').replace('_fg', '') + var request = { + query: { + conditions: [ + {key: 'title', value: title} + ], + operator: '&' + }, + keys: ['title', 'type', 'id'], + range: [0, 10] + }; + $element.appendTo($text); + pandora.api.find(request, function(response) { + response.data.items.forEach(item => { + if (item.id != data.id) { + $element.append( + ` ${item.type[0]}` + ) + } + }) + pandora.createLinks($element) + }) + } + function toggleIconSize() { iconSize = iconSize == 256 ? 512 : 256; iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio);