From c48f227dfc1c0f4221622c175082da87d436e222 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 6 Oct 2023 14:26:13 +0200 Subject: [PATCH] link cluster --- static/js/infoView.t_for_time.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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);