pandora_leftovers/static/js/documentInfoView.leftovers.js

877 lines
32 KiB
JavaScript
Raw Normal View History

2019-04-18 09:42:23 +00:00
'use strict';
pandora.ui.documentInfoView = function(data, isMixed) {
isMixed = isMixed || {};
var ui = pandora.user.ui,
isMultiple = arguments.length == 2,
canEdit = pandora.hasCapability('canEditMetadata') || isMultiple || data.editable,
canRemove = pandora.hasCapability('canRemoveItems'),
css = {
marginTop: '4px',
textAlign: 'justify'
},
html,
iconRatio = data.ratio,
iconSize = isMultiple ? 0 : ui.infoIconSize,
iconWidth = isMultiple ? 0 : iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio),
iconHeight = iconRatio < 1 ? iconSize : Math.round(iconSize / iconRatio),
iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0,
margin = 16,
nameKeys = pandora.site.documentKeys.filter(function(key) {
return key.sortType == 'person';
}).map(function(key) {
return key.id;
}),
listKeys = pandora.site.documentKeys.filter(function(key) {
return Ox.isArray(key.type);
}).map(function(key){
return key.id;
}),
statisticsWidth = 128,
$bar = Ox.Bar({size: 16})
.bindEvent({
doubleclick: function(e) {
if ($(e.target).is('.OxBar')) {
$info.animate({scrollTop: 0}, 250);
}
}
}),
$options = Ox.MenuButton({
items: [
{
id: 'delete',
title: Ox._('Delete {0}...', [Ox._('Document')]),
disabled: !canRemove
}
],
style: 'square',
title: 'set',
tooltip: Ox._('Options'),
type: 'image',
})
.css({
float: 'left',
borderColor: 'rgba(0, 0, 0, 0)',
background: 'rgba(0, 0, 0, 0)'
})
.bindEvent({
click: function(data_) {
if (data_.id == 'delete') {
pandora.ui.deleteDocumentDialog(
[data],
function() {
Ox.Request.clearCache();
if (ui.document) {
pandora.UI.set({document: ''});
} else {
pandora.$ui.list.reloadList()
}
}
).open();
}
}
})
.appendTo($bar),
$edit = Ox.MenuButton({
items: [
{
id: 'insert',
title: Ox._('Insert HTML...'),
disabled: true
}
],
style: 'square',
title: 'edit',
tooltip: Ox._('Edit'),
type: 'image',
})
.css({
float: 'right',
borderColor: 'rgba(0, 0, 0, 0)',
background: 'rgba(0, 0, 0, 0)'
})
.bindEvent({
click: function(data) {
// ...
}
})
.appendTo($bar),
$info = Ox.Element().css({overflowY: 'auto'}),
that = Ox.SplitPanel({
elements: [
{element: $bar, size: isMultiple ? 0 : 16},
{element: $info}
],
orientation: 'vertical'
});
if (!isMultiple) {
var $left = Ox.Element()
.css({
position: 'absolute'
})
.appendTo($info);
2019-04-18 09:42:23 +00:00
var $icon = Ox.Element({
element: '<img>',
})
.attr({
2020-05-09 16:41:21 +00:00
src: pandora.site.site.mediaprefix + '/documents/' + data.id + '/512p.jpg?' + data.modified
2019-04-18 09:42:23 +00:00
})
.css({
position: 'absolute',
left: margin + iconLeft + 'px',
top: margin + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px'
})
.bindEvent({
2019-12-05 15:51:51 +00:00
singleclick: toggleIconSize
2019-04-18 09:42:23 +00:00
})
.appendTo($left),
2019-04-18 09:42:23 +00:00
$reflection = $('<div>')
.addClass('OxReflection')
.css({
position: 'absolute',
left: margin + 'px',
top: margin + iconHeight + 'px',
width: iconSize + 'px',
height: iconSize / 2 + 'px',
overflow: 'hidden'
})
.appendTo($left),
2019-04-18 09:42:23 +00:00
$reflectionIcon = $('<img>')
.attr({
src: '/documents/' + data.id + '/512p.jpg?' + data.modified
})
.css({
position: 'absolute',
left: iconLeft + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px',
})
.appendTo($reflection),
$reflectionGradient = $('<div>')
.css({
position: 'absolute',
width: iconSize + 'px',
height: iconSize / 2 + 'px'
})
.appendTo($reflection);
}
var $data = $('<div>')
.addClass('OxTextPage')
.css({
position: 'absolute',
left: margin + 'px',
top: margin + iconHeight + margin + 'px',
2021-02-18 16:58:01 +00:00
width: (iconSize == 256 ? iconSize : iconWidth) + 'px',
})
.appendTo($left);
2019-04-18 09:42:23 +00:00
var $text = Ox.Element()
.addClass('OxTextPage')
.css({
position: 'absolute',
left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px',
top: margin + 'px',
right: margin + statisticsWidth + margin + 'px',
})
.appendTo($info),
$statistics = $('<div>')
.css({
position: 'absolute',
width: statisticsWidth + 'px',
top: margin + 'px',
right: margin + 'px'
})
.appendTo($info),
$capabilities;
[$options, $edit].forEach(function($element) {
$element.find('input').css({
borderWidth: 0,
borderRadius: 0,
padding: '3px'
});
});
listKeys.forEach(function(key) {
if (Ox.isString(data[key])) {
data[key] = [data[key]];
}
});
if (!canEdit) {
pandora.createLinks($info);
}
// Group & Publication description -----------------------------------------------------
if (!isMultiple) {
;['group', 'publication'].forEach(key => {
var $box = $('<div>').appendTo($data);
(data[key] ? pandora.api.findEntities : Ox.noop)({
query: {
conditions: [{
2021-09-15 11:42:03 +00:00
key: 'type', operator: '==', value: Ox.decodeHTMLEntities(key)
}, {
2021-09-15 12:12:13 +00:00
key: 'name', operator: '==', value: Ox.decodeHTMLEntities(data[key] || '')
}],
operator: '&'
},
keys: ['id', 'name', 'description']
}, function(result) {
2021-02-07 10:48:35 +00:00
if (data[key] && ((result && result.data.items.length == 1) || canEdit)) {
var entity = {}
if (result && result.data.items.length) {
entity = result.data.items[0]
}
$('<div>')
.html(Ox._('About {0}:', [data[key]]))
.css({
'padding-top': '4px',
'font-weight': 'bold'
})
.appendTo($box);
$('<div>')
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: false,
format: function(value) {
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: entity.description || ''
})
.css(css)
2021-02-18 17:03:40 +00:00
.css({
'text-align': ''
})
.bindEvent({
doubleclick: function(event) {
if (!canEdit) {
return
}
if (entity.id) {
var set = {}
set['entitiesType'] = key
set['entitiesSelection.' + key] = [entity.id];
pandora.UI.set(set);
pandora.$ui.entitiesDialog = pandora.ui.entitiesDialog().open();
} else {
pandora.api.addEntity({
type: key,
name: data[key]
}, function(result) {
var set = {}
set['entitiesType'] = key
set['entitiesSelection.' + key] = [result.data.id];
pandora.UI.set(set);
pandora.$ui.entitiesDialog = pandora.ui.entitiesDialog().open();
})
}
}
})
).css({
margin: '12px 0',
})
.appendTo($box);
}
})
});
}
2019-04-18 09:42:23 +00:00
// Title -------------------------------------------------------------------
$('<div>')
.css({
marginTop: '-2px',
})
.append(
Ox.EditableContent({
editable: canEdit,
tooltip: canEdit ? pandora.getEditTooltip() : '',
2021-04-29 19:57:09 +00:00
placeholder: formatLight(Ox._( isMixed.title ? 'Mixed title' : 'Untitled')),
2019-04-18 09:42:23 +00:00
value: data.title || ''
})
.css({
marginBottom: '-3px',
fontWeight: 'bold',
fontSize: '13px'
})
.bindEvent({
submit: function(event) {
editMetadata('title', event.value);
}
})
)
.appendTo($text);
// Director, Year and Country ----------------------------------------------
2020-05-09 16:39:54 +00:00
renderGroup(['group', 'author']);
renderGroup(['publication']);
2020-06-28 14:52:01 +00:00
renderGroup(['date', 'format', 'language']);
2020-06-28 14:50:03 +00:00
renderGroup(['publisher', 'series', 'volume', 'issue']);
2019-06-06 15:28:19 +00:00
renderGroup(['source', 'links']);
2020-06-28 14:52:01 +00:00
renderGroup(['place', 'space']);
2020-05-09 16:44:24 +00:00
renderGroup(['movement', 'event']);
2020-05-09 16:39:54 +00:00
renderGroup(['associatedgroups', 'relatedpeople']);
2020-05-22 12:42:58 +00:00
renderGroup(['antagonisms']);
2019-12-04 23:51:44 +00:00
renderGroup(['tactics']);
2019-04-18 09:42:23 +00:00
renderGroup(['tags']);
// Description -------------------------------------------------------------
if (canEdit || data.description) {
$('<div>')
.html('Description:')
.css({
'padding-top': '4px',
'font-weight': 'bold'
})
.appendTo($text);
2019-04-18 09:42:23 +00:00
$('<div>')
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: canEdit,
format: function(value) {
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
maxHeight: Infinity,
placeholder: formatLight(Ox._('No Description')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: data.description || ''
})
.css(css)
.css({
marginTop: '12px',
overflow: 'hidden'
})
.bindEvent({
submit: function(event) {
editMetadata('description', event.value);
}
})
)
.appendTo($text);
}
if (canEdit || data.content) {
$('<div>')
.html('Content:')
.css({
'padding-top': '4px',
'font-weight': 'bold'
})
.appendTo($text);
$('<div>')
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: canEdit,
format: function(value) {
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
maxHeight: Infinity,
placeholder: formatLight(Ox._('No Content')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: data.content || ''
})
.css(css)
.css({
marginTop: '12px',
overflow: 'hidden'
})
.bindEvent({
submit: function(event) {
editMetadata('content', event.value);
}
})
)
.appendTo($text);
}
2019-06-06 17:13:16 +00:00
// Preview
2019-12-05 14:38:52 +00:00
if (!isMultiple && data.extension != 'html') {
2019-06-06 17:13:16 +00:00
var $div = $('<div>').css({
marginTop: '12px',
}).html(
2019-12-05 14:38:52 +00:00
data.extension == 'pdf'
? Ox.range(1, data.dimensions + 1).map(function(page) {
2019-06-06 17:13:16 +00:00
return '<a href="/document/'
+ data.id + '/' + page
+ '"><img src="/documents/'+ data.id + '/128p'+ page + '.jpg"></a>'
2019-12-05 14:38:52 +00:00
}).join('\n')
2019-12-05 14:41:46 +00:00
: ('<a href="/document/' + data.id + '"><img src="/documents/' + data.id + '/128p.jpg"></a>')
2019-06-06 17:13:16 +00:00
)
pandora.createLinks($div);
$div.appendTo($text)
}
2019-04-18 09:42:23 +00:00
// Referenced --------------------------------------------------------------
if (
!isMultiple && (
data.referenced.items.length
|| data.referenced.annotations.length
|| data.referenced.documents.length
|| data.referenced.entities.length
)) {
var itemsById = {}
data.referenced.items.forEach(function(item) {
itemsById[item.id] = Ox.extend(item, {annotations: [], referenced: true});
});
data.referenced.annotations.forEach(function(annotation) {
var itemId = annotation.id.split('/')[0];
if (!itemsById[itemId]) {
itemsById[itemId] = {
id: itemId,
title: annotation.title,
annotations: []
};
}
itemsById[itemId].annotations = itemsById[itemId].annotations.concat(annotation);
});
var html = Ox.sortBy(Object.values(itemsById), 'title').map(function(item) {
return (item.referenced ? '<a href="/' + item.id + '/documents">' : '')
+ item.title //Ox.encodeHTMLEntities(item.title)
+ (item.referenced ? '</a>' : '')
+ (item.annotations.length
? ' (' + Ox.sortBy(item.annotations, 'in').map(function(annotation) {
return '<a href="/' + annotation.id + '">'
+ Ox.formatDuration(annotation.in) + '</a>'
}).join(', ')
+ ')'
: '')
}).join(', ');
html += data.referenced.documents.map(function(document) {
return ', <a href="/documents/' + document.id + '/info">' + document.title + '</a>';
}).join('');
html += data.referenced.entities.map(function(entity) {
return ', <a href="/entities/' + entity.id + '">' + entity.name + '</a>';
}).join('');
var $div = $('<div>')
.css({marginTop: '12px'})
.html(formatKey('Referenced', 'text') + html)
.appendTo($text);
pandora.createLinks($div);
}
// Extension, Dimensions, Size ---------------------------------------------
['extension', 'dimensions', 'size'].forEach(function(key) {
$('<div>')
.css({marginBottom: '4px'})
.append(formatKey(key, 'statistics'))
.append(
Ox.Theme.formatColor(null, 'gradient')
.css({textAlign: 'right'})
.html(formatValue(key, data[key]))
)
.appendTo($statistics);
});
/*
['created', 'modified'].forEach(function(key) {
$('<div>')
.css({marginBottom: '4px'})
.append(formatKey(key, 'statistics'))
.append(
$('<div>').html(Ox.formatDate(data[key], '%B %e, %Y'))
)
.appendTo($statistics);
});
$('<div>')
.css({marginBottom: '4px'})
.append(formatKey('timesaccessed', 'statistics'))
.append(
$('<div>').html(data.timesaccessed)
)
.appendTo($statistics);
*/
// Rights Level ------------------------------------------------------------
var $rightsLevel = $('<div>');
$('<div>')
.css({marginBottom: '4px'})
.append(formatKey('Rights Level', 'statistics'))
.append($rightsLevel)
.appendTo($statistics);
renderRightsLevel();
2020-09-11 09:31:38 +00:00
// Links
2020-11-26 19:29:52 +00:00
if (!isMultiple) {
$('<div>')
.css({marginTop: '16px', marginBottom: '16px', pointer: 'cursor'})
.append('')
.append(
Ox.Theme.formatColor(null, 'gradient')
.html('View Document')
.css({poiner: 'cursor'})
.on({
click: function() {
pandora.UI.set({documentView: 'view'})
}
})
)
.appendTo($statistics);
}
2020-09-11 09:31:38 +00:00
2019-04-18 09:42:23 +00:00
function editMetadata(key, value) {
if (value != data[key]) {
var edit = {
id: isMultiple ? ui.collectionSelection : data.id,
};
if (key == 'title') {
edit[key] = value;
} else if (listKeys.indexOf(key) >= 0) {
edit[key] = value ? value.split(', ') : [];
} else {
edit[key] = value ? value : null;
}
pandora.api.editDocument(edit, function(result) {
if (!isMultiple) {
var src;
data[key] = result.data[key];
Ox.Request.clearCache(); // fixme: too much? can change filter/list etc
if (result.data.id != data.id) {
pandora.UI.set({document: result.data.id});
pandora.$ui.browser.value(data.id, 'id', result.data.id);
}
//pandora.updateItemContext();
//pandora.$ui.browser.value(result.data.id, key, result.data[key]);
pandora.$ui.itemTitle
.options({title: '<b>' + (pandora.getDocumentTitle(result.data)) + '</b>'});
}
that.triggerEvent('change', Ox.extend({}, key, value));
});
}
}
function formatKey(key, mode) {
var item = Ox.getObjectById(pandora.site.documentKeys, key);
key = Ox._(item ? item.title : key);
mode = mode || 'text';
return mode == 'text'
? '<span style="font-weight: bold">' + Ox.toTitleCase(key) + ':</span> '
: mode == 'description'
? Ox.toTitleCase(key)
: Ox.Element()
.css({marginBottom: '4px', fontWeight: 'bold'})
.html(Ox.toTitleCase(key)
.replace(' Per ', ' per '));
}
function formatLight(str) {
return '<span class="OxLight">' + str + '</span>';
}
function formatLink(value, key) {
return (Ox.isArray(value) ? value : [value]).map(function(value) {
2020-05-09 17:06:05 +00:00
var documentKey = Ox.getObjectById(pandora.site.documentKeys, key),
op = documentKey && documentKey.filter ? '==' : '=';
2019-04-18 09:42:23 +00:00
return key
2021-09-15 12:07:56 +00:00
? '<a href="/documents/' + key + op + pandora.escapeQueryValue(Ox.decodeHTMLEntities(value)) + '">' + value + '</a>'
2019-04-18 09:42:23 +00:00
: value;
}).join(', ');
}
function formatValue(key, value) {
var ret;
if (key == 'date' && (!value || value.split('-').length < 4)) {
ret = pandora.formatDate(value);
} else if (nameKeys.indexOf(key) > -1) {
ret = formatLink(value.split(', '), key);
2019-06-06 15:28:19 +00:00
} else if (key == 'links') {
ret = value.split(', ').map(function(link) {
return '<a href="' + link + '">' + Ox.parseURL(link).host + '</a>';
}).join(', ');
2019-06-06 15:34:11 +00:00
} else if (listKeys.indexOf(key) > -1) {
ret = formatLink(value.split(', '), key);
2020-05-09 16:58:14 +00:00
} else if ([
'format',
'group',
'publication',
'publisher',
'source',
'type'
].indexOf(key) > -1) {
2019-06-06 15:34:11 +00:00
ret = formatLink(value, key);
2019-04-18 09:42:23 +00:00
} else {
if (isMixed[key]) {
ret = 'Mixed'
} else {
ret = pandora.formatDocumentKey(Ox.getObjectById(pandora.site.documentKeys, key), data);
}
}
return ret;
}
function getRightsLevelElement(rightsLevel) {
return Ox.Theme.formatColorLevel(
rightsLevel,
pandora.site.documentRightsLevels.map(function(rightsLevel) {
return rightsLevel.name;
})
);
}
function getValue(key, value) {
return !value ? ''
: Ox.contains(listKeys, key) ? value.join(', ')
: value;
}
function renderCapabilities(rightsLevel) {
var capabilities = [].concat(
canEdit ? [{name: 'canSeeItem', symbol: 'Find'}] : [],
[
{name: 'canPlayClips', symbol: 'PlayInToOut'},
{name: 'canPlayVideo', symbol: 'Play'},
{name: 'canDownloadVideo', symbol: 'Download'}
]
),
userLevels = canEdit ? pandora.site.userLevels : [pandora.user.level];
$capabilities.empty();
userLevels.forEach(function(userLevel, i) {
var $element,
$line = $('<div>')
.css({
height: '16px',
marginBottom: '4px'
})
.appendTo($capabilities);
if (canEdit) {
$element = Ox.Theme.formatColorLevel(i, userLevels.map(function(userLevel) {
return Ox.toTitleCase(userLevel);
}), [0, 240]);
Ox.Label({
textAlign: 'center',
title: Ox.toTitleCase(userLevel),
width: 60
})
.addClass('OxColor OxColorGradient')
.css({
float: 'left',
height: '12px',
paddingTop: '2px',
background: $element.css('background'),
fontSize: '8px',
color: $element.css('color')
})
.data({OxColor: $element.data('OxColor')})
.appendTo($line);
}
capabilities.forEach(function(capability) {
var hasCapability = pandora.hasCapability(capability.name, userLevel) >= rightsLevel,
$element = Ox.Theme.formatColorLevel(hasCapability, ['', '']);
Ox.Button({
tooltip: (canEdit ? Ox.toTitleCase(userLevel) : 'You') + ' '
+ (hasCapability ? 'can' : 'can\'t') + ' '
+ Ox.toSlashes(capability.name)
.split('/').slice(1).join(' ')
.toLowerCase(),
title: capability.symbol,
type: 'image'
})
.addClass('OxColor OxColorGradient')
.css({background: $element.css('background')})
.css('margin' + (canEdit ? 'Left' : 'Right'), '4px')
.data({OxColor: $element.data('OxColor')})
.appendTo($line);
});
if (!canEdit) {
Ox.Button({
title: Ox._('Help'),
tooltip: Ox._('About Rights'),
type: 'image'
})
.css({marginLeft: '52px'})
.bindEvent({
click: function() {
pandora.UI.set({page: 'rights'});
}
})
.appendTo($line);
}
});
}
function renderGroup(keys) {
var $element;
if (canEdit || keys.filter(function(key) {
return data[key];
}).length) {
$element = $('<div>').addClass('OxSelectable').css(css);
keys.forEach(function(key, i) {
if (canEdit || data[key]) {
if ($element.children().length) {
$('<span>').html('; ').appendTo($element);
}
$('<span>').html(formatKey(key)).appendTo($element);
Ox.EditableContent({
clickLink: pandora.clickLink,
format: function(value) {
return formatValue(key, value);
},
placeholder: formatLight(Ox._(isMixed[key] ? 'mixed' : 'unknown')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
value: getValue(key, data[key])
})
.bindEvent({
submit: function(data) {
editMetadata(key, data.value);
}
})
.appendTo($element);
2020-11-26 19:25:57 +00:00
if (isMixed[key] && Ox.contains(listKeys, key)) {
pandora.ui.addRemoveKeyDialog({
ids: ui.collectionSelection,
key: key,
section: ui.section
}).appendTo($element)
}
2019-04-18 09:42:23 +00:00
}
});
$element.appendTo($text);
}
return $element;
}
function renderRightsLevel() {
var $rightsLevelElement = getRightsLevelElement(data.rightslevel),
$rightsLevelSelect;
$rightsLevel.empty();
if (canEdit) {
$rightsLevelSelect = Ox.Select({
items: pandora.site.documentRightsLevels.map(function(rightsLevel, i) {
return {id: i, title: rightsLevel.name};
}),
width: 128,
value: data.rightslevel
})
.addClass('OxColor OxColorGradient')
.css({
marginBottom: '4px',
background: $rightsLevelElement.css('background')
})
.data({OxColor: $rightsLevelElement.data('OxColor')})
.bindEvent({
change: function(event) {
var rightsLevel = event.value;
$rightsLevelElement = getRightsLevelElement(rightsLevel);
$rightsLevelSelect
.css({background: $rightsLevelElement.css('background')})
.data({OxColor: $rightsLevelElement.data('OxColor')})
//renderCapabilities(rightsLevel);
var edit = {
id: isMultiple ? ui.collectionSelection : data.id,
rightslevel: rightsLevel
};
pandora.api.editDocument(edit, function(result) {
that.triggerEvent('change', Ox.extend({}, 'rightslevel', rightsLevel));
});
}
})
.appendTo($rightsLevel);
} else {
$rightsLevelElement
.css({
marginBottom: '4px'
})
.appendTo($rightsLevel);
}
$capabilities = $('<div>').appendTo($rightsLevel);
//renderCapabilities(data.rightslevel);
}
2019-12-05 15:51:51 +00:00
function toggleIconSize() {
iconSize = iconSize == 256 ? 512 : 256;
iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio);
iconHeight = iconRatio < 1 ? iconSize : Math.round(iconSize / iconRatio);
iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0,
$icon.animate({
left: margin + iconLeft + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px',
}, 250);
$reflection.animate({
top: margin + iconHeight + 'px',
width: iconSize + 'px',
height: iconSize / 2 + 'px'
}, 250);
$reflectionIcon.animate({
left: iconLeft + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px',
}, 250);
$reflectionGradient.animate({
width: iconSize + 'px',
height: iconSize / 2 + 'px'
}, 250);
$text.animate({
left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px'
}, 250);
2021-02-18 16:54:07 +00:00
$data.animate({
2021-02-18 16:56:38 +00:00
top: margin + iconHeight + margin + 'px',
width: (iconSize == 256 ? iconSize : iconWidth) + 'px'
2021-02-18 16:54:07 +00:00
}, 250);
2019-12-05 15:51:51 +00:00
pandora.UI.set({infoIconSize: iconSize});
}
2019-04-18 09:42:23 +00:00
that.reload = function() {
/*
var src = '/documents/' + data.id + '/512p.jpg?' + data.modified;
$icon.attr({src: src});
$reflectionIcon.attr({src: src});
iconSize = iconSize == 256 ? 512 : 256;
iconRatio = ui.icons == 'posters'
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1;
toggleIconSize();
*/
};
that.bindEvent({
mousedown: function() {
setTimeout(function() {
!Ox.Focus.focusedElementIsInput() && that.gainFocus();
});
}
});
return that;
};