link cluster

This commit is contained in:
j 2023-10-06 14:26:13 +02:00
parent 0a549ffddc
commit c48f227dfc

View file

@ -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 = $('<div>').addClass('OxSelectable').html("<b>Related Videos:</b>");
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(
` <a href="/${item.id}/info">${item.type[0]}</a>`
)
}
})
pandora.createLinks($element)
})
}
function toggleIconSize() {
iconSize = iconSize == 256 ? 512 : 256;
iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio);