2011-12-27 06:54:49 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
pandora.ui.infoView = function(data) {
|
|
|
|
|
|
|
|
var ui = pandora.user.ui,
|
2012-01-15 15:05:37 +00:00
|
|
|
canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level] || data.editable,
|
2014-02-13 11:54:30 +00:00
|
|
|
canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level] || data.editable,
|
2011-12-27 06:54:49 +00:00
|
|
|
css = {
|
|
|
|
marginTop: '4px',
|
2013-07-19 09:34:01 +00:00
|
|
|
textAlign: 'justify'
|
2011-12-27 06:54:49 +00:00
|
|
|
},
|
2013-05-09 12:03:26 +00:00
|
|
|
descriptions = [],
|
2012-02-11 12:27:58 +00:00
|
|
|
html,
|
2012-01-20 18:10:25 +00:00
|
|
|
iconRatio = ui.icons == 'posters' ? data.posterRatio : 1,
|
2011-12-27 06:54:49 +00:00
|
|
|
iconSize = ui.infoIconSize,
|
|
|
|
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,
|
|
|
|
borderRadius = ui.icons == 'posters' ? 0 : iconSize / 8,
|
|
|
|
margin = 16,
|
2015-10-20 17:13:38 +00:00
|
|
|
nameKeys = pandora.site.itemKeys.filter(function(key) {
|
|
|
|
return key.sortType == 'person';
|
|
|
|
}).map(function(key) {
|
|
|
|
return key.id;
|
|
|
|
}),
|
|
|
|
listKeys = pandora.site.itemKeys.filter(function(key) {
|
|
|
|
return Ox.isArray(key.type);
|
|
|
|
}).map(function(key){
|
|
|
|
return key.id;
|
|
|
|
}),
|
2015-09-21 17:31:44 +00:00
|
|
|
posterKeys = ['title', 'date'],
|
2011-12-27 06:54:49 +00:00
|
|
|
statisticsWidth = 128,
|
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
$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}...', [pandora.site.itemName.singular]),
|
|
|
|
disabled: !canRemove
|
|
|
|
}
|
|
|
|
],
|
|
|
|
style: 'square',
|
|
|
|
title: 'set',
|
|
|
|
tooltip: Ox._('Options'),
|
|
|
|
type: 'image',
|
|
|
|
})
|
2011-12-27 06:54:49 +00:00
|
|
|
.css({
|
2013-07-11 12:38:19 +00:00
|
|
|
float: 'left',
|
|
|
|
borderColor: 'rgba(0, 0, 0, 0)',
|
|
|
|
background: 'rgba(0, 0, 0, 0)'
|
|
|
|
})
|
|
|
|
.bindEvent({
|
|
|
|
click: function(data_) {
|
|
|
|
if (data_.id == 'delete') {
|
|
|
|
pandora.$ui.deleteItemDialog = pandora.ui.deleteItemDialog(data).open();
|
|
|
|
}
|
|
|
|
}
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
2013-07-11 12:38:19 +00:00
|
|
|
.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: 16},
|
|
|
|
{element: $info}
|
|
|
|
],
|
|
|
|
orientation: 'vertical'
|
|
|
|
}),
|
2011-12-27 06:54:49 +00:00
|
|
|
|
2012-01-20 18:10:25 +00:00
|
|
|
$left = Ox.Element()
|
2013-05-09 12:03:26 +00:00
|
|
|
.css({
|
|
|
|
position: 'absolute'
|
|
|
|
})
|
2011-12-27 06:54:49 +00:00
|
|
|
.appendTo($info),
|
|
|
|
|
|
|
|
$icon = Ox.Element({
|
|
|
|
element: '<img>',
|
2013-02-09 10:05:15 +00:00
|
|
|
tooltip: 'Switch to ' + Ox.getObjectById(
|
2013-02-09 10:03:14 +00:00
|
|
|
pandora.site.itemViews,
|
|
|
|
ui.videoView
|
2013-02-11 07:30:52 +00:00
|
|
|
).title + ' View'
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
|
|
|
.attr({
|
2014-02-02 11:30:25 +00:00
|
|
|
src: pandora.getMediaURL('/' + data.id + '/' + (
|
2012-01-20 18:10:25 +00:00
|
|
|
ui.icons == 'posters' ? 'poster' : 'icon'
|
2014-02-02 11:30:25 +00:00
|
|
|
) + '512.jpg?' + data.modified)
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
|
|
|
.css({
|
|
|
|
position: 'absolute',
|
|
|
|
left: margin + iconLeft + 'px',
|
|
|
|
top: margin + 'px',
|
|
|
|
width: iconWidth + 'px',
|
|
|
|
height: iconHeight + 'px',
|
2013-02-09 10:03:48 +00:00
|
|
|
borderRadius: borderRadius + 'px',
|
|
|
|
cursor: 'pointer'
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
2013-02-09 10:03:14 +00:00
|
|
|
.bindEvent({
|
|
|
|
anyclick: function() {
|
|
|
|
pandora.UI.set({itemView: ui.videoView});
|
|
|
|
}
|
|
|
|
})
|
2012-01-20 18:10:25 +00:00
|
|
|
.appendTo($left),
|
2013-02-09 09:14:54 +00:00
|
|
|
|
2011-12-27 06:54:49 +00:00
|
|
|
$reflection = $('<div>')
|
|
|
|
.addClass('OxReflection')
|
|
|
|
.css({
|
|
|
|
position: 'absolute',
|
|
|
|
left: margin + 'px',
|
|
|
|
top: margin + iconHeight + 'px',
|
|
|
|
width: iconSize + 'px',
|
2013-05-09 12:03:26 +00:00
|
|
|
height: Math.round(iconSize / 2) + 'px',
|
2011-12-27 06:54:49 +00:00
|
|
|
overflow: 'hidden'
|
|
|
|
})
|
2012-01-20 18:10:25 +00:00
|
|
|
.appendTo($left),
|
2011-12-27 06:54:49 +00:00
|
|
|
|
|
|
|
$reflectionIcon = $('<img>')
|
|
|
|
.attr({
|
2014-02-02 11:30:25 +00:00
|
|
|
src: pandora.getMediaURL('/' + data.id + '/' + (
|
2011-12-27 06:54:49 +00:00
|
|
|
ui.icons == 'posters' ? 'poster' : 'icon'
|
2014-02-02 11:30:25 +00:00
|
|
|
) + '512.jpg?' + data.modified)
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
|
|
|
.css({
|
|
|
|
position: 'absolute',
|
|
|
|
left: iconLeft + 'px',
|
|
|
|
width: iconWidth + 'px',
|
|
|
|
height: iconHeight + 'px',
|
|
|
|
borderRadius: borderRadius + 'px'
|
|
|
|
})
|
|
|
|
.appendTo($reflection),
|
|
|
|
|
|
|
|
$reflectionGradient = $('<div>')
|
|
|
|
.css({
|
|
|
|
position: 'absolute',
|
|
|
|
width: iconSize + 'px',
|
2013-05-09 12:03:26 +00:00
|
|
|
height: Math.round(iconSize / 2) + 'px'
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
|
|
|
.appendTo($reflection),
|
|
|
|
|
2012-01-20 18:10:25 +00:00
|
|
|
$data = $('<div>')
|
2013-03-08 03:49:55 +00:00
|
|
|
.addClass('OxTextPage')
|
2012-01-20 18:10:25 +00:00
|
|
|
.css({
|
|
|
|
position: 'absolute',
|
|
|
|
left: margin + 'px',
|
2012-02-14 06:21:01 +00:00
|
|
|
top: margin + iconHeight + margin + 'px',
|
|
|
|
width: iconSize + 'px',
|
2012-01-20 18:10:25 +00:00
|
|
|
})
|
|
|
|
.appendTo($left),
|
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
$text = Ox.Element()
|
2013-03-08 03:49:55 +00:00
|
|
|
.addClass('OxTextPage')
|
2011-12-27 06:54:49 +00:00
|
|
|
.css({
|
|
|
|
position: 'absolute',
|
|
|
|
left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px',
|
|
|
|
top: margin + 'px',
|
|
|
|
right: margin + statisticsWidth + margin + 'px',
|
|
|
|
})
|
2012-01-20 18:10:25 +00:00
|
|
|
.appendTo($info),
|
2011-12-27 06:54:49 +00:00
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
$statistics = $('<div>')
|
2011-12-27 06:54:49 +00:00
|
|
|
.css({
|
|
|
|
position: 'absolute',
|
|
|
|
width: statisticsWidth + 'px',
|
|
|
|
top: margin + 'px',
|
|
|
|
right: margin + 'px'
|
|
|
|
})
|
2012-01-20 18:10:25 +00:00
|
|
|
.appendTo($info),
|
|
|
|
|
|
|
|
$capabilities;
|
2011-12-27 06:54:49 +00:00
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
[$options, $edit].forEach(function($element) {
|
|
|
|
$element.find('input').css({
|
|
|
|
borderWidth: 0,
|
|
|
|
borderRadius: 0,
|
|
|
|
padding: '3px'
|
|
|
|
});
|
|
|
|
});
|
2015-10-20 17:21:18 +00:00
|
|
|
|
|
|
|
listKeys.forEach(function(key) {
|
|
|
|
if (Ox.isString(data[key])) {
|
|
|
|
data[key] = [data[key]];
|
|
|
|
}
|
|
|
|
});
|
2013-07-11 12:38:19 +00:00
|
|
|
|
2012-01-20 18:10:25 +00:00
|
|
|
if (!canEdit) {
|
2015-10-20 17:13:38 +00:00
|
|
|
pandora.createLinks($info);
|
2012-01-20 18:10:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Source & Project --------------------------------------------------------
|
2011-12-27 06:54:49 +00:00
|
|
|
|
2012-01-20 18:10:25 +00:00
|
|
|
['source', 'project'].forEach(function(key) {
|
2012-01-20 19:04:48 +00:00
|
|
|
if (canEdit || data[key]) {
|
2013-07-19 09:34:01 +00:00
|
|
|
var $div = $('<div>')
|
|
|
|
.addClass('OxSelectable')
|
|
|
|
.css(css)
|
|
|
|
.css({margin: 0})
|
|
|
|
.appendTo($data);
|
2013-05-09 12:03:26 +00:00
|
|
|
$('<span>')
|
2012-01-20 18:10:25 +00:00
|
|
|
.html(
|
|
|
|
formatKey({
|
|
|
|
category: 'categories',
|
|
|
|
}[key] || key).replace('</span>', ' </span>')
|
|
|
|
)
|
|
|
|
.appendTo($div);
|
2013-05-09 12:03:26 +00:00
|
|
|
Ox.EditableContent({
|
2012-01-20 18:10:25 +00:00
|
|
|
clickLink: pandora.clickLink,
|
|
|
|
format: function(value) {
|
2013-07-11 12:38:19 +00:00
|
|
|
return formatValue(key, value);
|
2012-01-20 18:10:25 +00:00
|
|
|
},
|
2013-05-09 12:03:26 +00:00
|
|
|
placeholder: formatLight(Ox._('unknown')),
|
2012-01-20 18:10:25 +00:00
|
|
|
editable: canEdit,
|
2013-03-01 03:51:39 +00:00
|
|
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
2012-01-20 18:10:25 +00:00
|
|
|
value: listKeys.indexOf(key) >= 0
|
|
|
|
? (data[key] || []).join(', ')
|
|
|
|
: data[key] || ''
|
|
|
|
})
|
|
|
|
.bindEvent({
|
|
|
|
submit: function(event) {
|
|
|
|
editMetadata(key, event.value);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.appendTo($div);
|
|
|
|
if (canEdit || data[key + 'description']) {
|
|
|
|
$('<div>')
|
|
|
|
.append(
|
2013-05-09 12:03:26 +00:00
|
|
|
descriptions[key] = Ox.EditableContent({
|
2012-01-20 18:10:25 +00:00
|
|
|
clickLink: pandora.clickLink,
|
|
|
|
editable: canEdit,
|
2013-05-09 12:03:26 +00:00
|
|
|
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='
|
|
|
|
);
|
|
|
|
},
|
2013-05-09 10:13:58 +00:00
|
|
|
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
|
2013-03-01 03:51:39 +00:00
|
|
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
2012-01-20 18:10:25 +00:00
|
|
|
type: 'textarea',
|
|
|
|
value: data[key + 'description'] || ''
|
|
|
|
})
|
2013-02-09 09:31:05 +00:00
|
|
|
.css(css)
|
2012-01-20 18:10:25 +00:00
|
|
|
.bindEvent({
|
|
|
|
submit: function(event) {
|
|
|
|
editMetadata(key + 'description', event.value);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
).css({
|
2013-05-09 12:03:26 +00:00
|
|
|
margin: '12px 0',
|
2012-01-20 18:10:25 +00:00
|
|
|
})
|
|
|
|
.appendTo($div);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2011-12-27 06:54:49 +00:00
|
|
|
|
|
|
|
// Title -------------------------------------------------------------------
|
|
|
|
|
|
|
|
$('<div>')
|
|
|
|
.css({
|
2013-07-11 12:38:19 +00:00
|
|
|
marginTop: '-2px',
|
|
|
|
marginBottom: '12px'
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
|
|
|
.append(
|
2013-05-09 12:03:26 +00:00
|
|
|
Ox.EditableContent({
|
2012-01-20 18:10:25 +00:00
|
|
|
editable: canEdit,
|
2013-10-17 15:03:47 +00:00
|
|
|
placeholder: formatLight(Ox._('No Title')),
|
2013-03-01 03:51:39 +00:00
|
|
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
2011-12-27 06:54:49 +00:00
|
|
|
value: data.title
|
|
|
|
})
|
|
|
|
.css({
|
|
|
|
fontWeight: 'bold',
|
2013-07-19 09:34:01 +00:00
|
|
|
fontSize: '13px'
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
|
|
|
.bindEvent({
|
|
|
|
submit: function(event) {
|
|
|
|
editMetadata('title', event.value);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($text);
|
2011-12-27 06:54:49 +00:00
|
|
|
|
2013-05-09 12:03:26 +00:00
|
|
|
// Groups ------------------------------------------------------------------
|
2012-01-20 18:10:25 +00:00
|
|
|
|
2013-05-09 12:03:26 +00:00
|
|
|
renderGroup(['location', 'date', 'language']);
|
2011-12-29 12:42:19 +00:00
|
|
|
|
2013-05-09 12:03:26 +00:00
|
|
|
renderGroup(['director', 'cinematographer', 'featuring']);
|
2012-01-20 18:10:25 +00:00
|
|
|
|
2013-09-15 11:42:18 +00:00
|
|
|
renderGroup(['topic']);
|
2012-01-20 18:10:25 +00:00
|
|
|
|
2012-02-16 10:30:52 +00:00
|
|
|
// Summary -------------------------------------------------------------
|
2012-01-20 18:10:25 +00:00
|
|
|
|
2013-05-09 12:03:26 +00:00
|
|
|
if (canEdit || data.summary) {
|
2012-01-20 18:10:25 +00:00
|
|
|
$('<div>')
|
2013-07-11 12:38:19 +00:00
|
|
|
.css({
|
|
|
|
marginTop: '12px',
|
|
|
|
marginBottom: '12px'
|
|
|
|
})
|
2012-01-20 18:10:25 +00:00
|
|
|
.append(
|
2013-05-09 12:03:26 +00:00
|
|
|
Ox.EditableContent({
|
2012-01-20 18:10:25 +00:00
|
|
|
clickLink: pandora.clickLink,
|
2013-09-30 09:44:12 +00:00
|
|
|
collapseToEnd: false,
|
2012-01-20 18:10:25 +00:00
|
|
|
editable: canEdit,
|
2013-05-09 12:03:26 +00:00
|
|
|
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='
|
|
|
|
);
|
|
|
|
},
|
2012-01-20 18:10:25 +00:00
|
|
|
maxHeight: Infinity,
|
2013-05-09 12:03:26 +00:00
|
|
|
placeholder: formatLight(Ox._('No Summary')),
|
2013-03-01 03:51:39 +00:00
|
|
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
2012-01-20 18:10:25 +00:00
|
|
|
type: 'textarea',
|
2013-02-09 09:43:55 +00:00
|
|
|
value: data.summary || ''
|
2012-01-20 18:10:25 +00:00
|
|
|
})
|
2013-02-09 09:31:05 +00:00
|
|
|
.css(css)
|
2013-07-11 12:38:19 +00:00
|
|
|
.css({
|
|
|
|
overflow: 'hidden'
|
|
|
|
})
|
2012-01-20 18:10:25 +00:00
|
|
|
.bindEvent({
|
|
|
|
submit: function(event) {
|
2012-02-16 10:30:52 +00:00
|
|
|
editMetadata('summary', event.value);
|
2012-01-20 18:10:25 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($text);
|
|
|
|
$('<div>').css({width: '1px', height: 0, clear: 'both'}).appendTo($text);
|
2012-01-20 18:10:25 +00:00
|
|
|
}
|
|
|
|
|
2012-02-15 19:35:53 +00:00
|
|
|
// License -----------------------------------------------------------------
|
|
|
|
|
2013-05-09 12:03:26 +00:00
|
|
|
renderGroup(['license']);
|
2011-12-27 09:40:11 +00:00
|
|
|
|
2013-07-19 09:34:01 +00:00
|
|
|
$('<div>')
|
|
|
|
.addClass('OxSelectable')
|
|
|
|
.css(css)
|
|
|
|
.css({height: '16px'})
|
|
|
|
.appendTo($text);
|
2013-02-09 09:52:54 +00:00
|
|
|
|
2013-01-02 12:59:58 +00:00
|
|
|
// Duration, Aspect Ratio --------------------------------------------------
|
|
|
|
|
|
|
|
['duration', 'aspectratio'].forEach(function(key) {
|
|
|
|
var itemKey = Ox.getObjectById(pandora.site.itemKeys, key),
|
|
|
|
value = data[key] || 0;
|
|
|
|
$('<div>')
|
|
|
|
.css({marginBottom: '4px'})
|
2013-07-11 12:38:19 +00:00
|
|
|
.append(formatKey(itemKey.title, 'statistics'))
|
2013-01-02 12:59:58 +00:00
|
|
|
.append(
|
|
|
|
Ox.Theme.formatColor(null, 'gradient')
|
|
|
|
.css({textAlign: 'right'})
|
|
|
|
.html(
|
|
|
|
Ox['format' + Ox.toTitleCase(itemKey.format.type)]
|
|
|
|
.apply(null, [value].concat(itemKey.format.args))
|
|
|
|
)
|
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($statistics);
|
2013-01-02 12:59:58 +00:00
|
|
|
});
|
|
|
|
|
2011-12-27 06:54:49 +00:00
|
|
|
// Hue, Saturation, Lightness, Volume --------------------------------------
|
|
|
|
|
|
|
|
['hue', 'saturation', 'lightness', 'volume'].forEach(function(key) {
|
|
|
|
$('<div>')
|
|
|
|
.css({marginBottom: '4px'})
|
2013-07-11 12:38:19 +00:00
|
|
|
.append(formatKey(key, 'statistics'))
|
2011-12-27 06:54:49 +00:00
|
|
|
.append(
|
|
|
|
Ox.Theme.formatColor(
|
|
|
|
data[key] || 0, key == 'volume' ? 'lightness' : key
|
|
|
|
).css({textAlign: 'right'})
|
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($statistics);
|
2011-12-27 06:54:49 +00:00
|
|
|
});
|
|
|
|
|
2013-01-02 12:59:58 +00:00
|
|
|
// Cuts per Minute ---------------------------------------------------------
|
|
|
|
|
|
|
|
$('<div>')
|
|
|
|
.css({marginBottom: '4px'})
|
2013-07-11 12:38:19 +00:00
|
|
|
.append(formatKey('cuts per minute', 'statistics'))
|
2013-01-02 12:59:58 +00:00
|
|
|
.append(
|
|
|
|
Ox.Theme.formatColor(null, 'gradient')
|
|
|
|
.css({textAlign: 'right'})
|
|
|
|
.html(Ox.formatNumber(data['cutsperminute'] || 0, 3))
|
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($statistics);
|
|
|
|
|
|
|
|
// Rights Level ------------------------------------------------------------
|
|
|
|
|
|
|
|
var $rightsLevel = $('<div>');
|
|
|
|
$('<div>')
|
|
|
|
.css({marginBottom: '4px'})
|
|
|
|
.append(formatKey(Ox._('Rights Level'), 'statistics'))
|
|
|
|
.append($rightsLevel)
|
|
|
|
.appendTo($statistics);
|
|
|
|
renderRightsLevel();
|
2013-01-02 12:59:58 +00:00
|
|
|
|
2012-02-15 19:35:53 +00:00
|
|
|
// User and Groups ---------------------------------------------------------
|
|
|
|
|
|
|
|
['user', 'groups'].forEach(function(key) {
|
2014-10-01 14:50:42 +00:00
|
|
|
var $input;
|
2012-02-23 20:57:34 +00:00
|
|
|
(canEdit || data[key] && data[key].length) && $('<div>')
|
2012-02-15 19:35:53 +00:00
|
|
|
.css({marginBottom: '4px'})
|
2013-07-11 12:38:19 +00:00
|
|
|
.append(formatKey(key, 'statistics'))
|
2012-02-15 19:35:53 +00:00
|
|
|
.append(
|
|
|
|
$('<div>')
|
|
|
|
.css({margin: '2px 0 0 -1px'}) // fixme: weird
|
|
|
|
.append(
|
2014-10-01 14:50:42 +00:00
|
|
|
$input = Ox.Editable({
|
2013-05-09 12:03:26 +00:00
|
|
|
placeholder: key == 'groups' ? formatLight(Ox._('No Groups')) : '',
|
2014-10-01 14:50:42 +00:00
|
|
|
editable: key == 'user' && canEdit,
|
2013-03-01 03:51:39 +00:00
|
|
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
2012-02-15 19:35:53 +00:00
|
|
|
value: key == 'user' ? data[key] : data[key].join(', ')
|
|
|
|
})
|
2014-10-01 14:50:42 +00:00
|
|
|
.bindEvent(Ox.extend({
|
2012-02-15 19:35:53 +00:00
|
|
|
submit: function(event) {
|
|
|
|
editMetadata(key, event.value);
|
|
|
|
}
|
2014-10-01 14:50:42 +00:00
|
|
|
}, key == 'groups' ? {
|
2014-10-15 09:34:27 +00:00
|
|
|
doubleclick: canEdit ? function() {
|
2014-10-01 15:12:23 +00:00
|
|
|
setTimeout(function() {
|
|
|
|
if (window.getSelection) {
|
|
|
|
window.getSelection().removeAllRanges();
|
|
|
|
} else if (document.selection) {
|
|
|
|
document.selection.empty();
|
|
|
|
}
|
|
|
|
});
|
2014-10-01 14:50:42 +00:00
|
|
|
pandora.$ui.groupsDialog = pandora.ui.groupsDialog({
|
|
|
|
id: data.id,
|
|
|
|
name: data.title,
|
|
|
|
type: 'item'
|
|
|
|
})
|
|
|
|
.bindEvent({
|
|
|
|
groups: function(data) {
|
|
|
|
$input.options({
|
|
|
|
value: data.groups.join(', ')
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.open();
|
2014-10-15 09:34:27 +00:00
|
|
|
} : function() {}
|
2014-10-01 14:50:42 +00:00
|
|
|
} : {}))
|
2012-02-15 19:35:53 +00:00
|
|
|
)
|
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($statistics);
|
2012-02-15 19:35:53 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Created and Modified ----------------------------------------------------
|
|
|
|
|
|
|
|
['created', 'modified'].forEach(function(key) {
|
|
|
|
$('<div>')
|
|
|
|
.css({marginBottom: '4px'})
|
2013-07-11 12:38:19 +00:00
|
|
|
.append(formatKey(key, 'statistics'))
|
2012-02-15 19:35:53 +00:00
|
|
|
.append(
|
2012-02-16 07:25:07 +00:00
|
|
|
$('<div>').html(Ox.formatDate(data[key], '%B %e, %Y'))
|
2012-02-15 19:35:53 +00:00
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($statistics);
|
2012-02-15 19:35:53 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Notes --------------------------------------------------------------------
|
2011-12-27 06:54:49 +00:00
|
|
|
|
|
|
|
if (canEdit) {
|
|
|
|
$('<div>')
|
|
|
|
.css({marginBottom: '4px'})
|
2013-07-11 12:38:19 +00:00
|
|
|
.append(
|
|
|
|
formatKey('Notes', 'statistics').options({
|
|
|
|
tooltip: Ox._('Only {0} can see and edit these comments', [
|
|
|
|
Object.keys(pandora.site.capabilities.canEditMetadata).map(function(level, i) {
|
|
|
|
return (
|
|
|
|
i == 0 ? ''
|
|
|
|
: i < Ox.len(pandora.site.capabilities.canEditMetadata) - 1 ? ', '
|
|
|
|
: ' ' + Ox._('and') + ' '
|
|
|
|
) + Ox.toTitleCase(level)
|
|
|
|
}).join('')])
|
|
|
|
})
|
|
|
|
)
|
2011-12-27 06:54:49 +00:00
|
|
|
.append(
|
2013-05-09 12:03:26 +00:00
|
|
|
Ox.EditableContent({
|
2011-12-27 06:54:49 +00:00
|
|
|
height: 128,
|
2013-05-09 12:03:26 +00:00
|
|
|
placeholder: formatLight(Ox._('No notes')),
|
2013-03-01 03:51:39 +00:00
|
|
|
tooltip: pandora.getEditTooltip(),
|
2011-12-27 06:54:49 +00:00
|
|
|
type: 'textarea',
|
2013-03-09 08:23:47 +00:00
|
|
|
value: data.notes || '',
|
2011-12-27 06:54:49 +00:00
|
|
|
width: 128
|
|
|
|
})
|
|
|
|
.bindEvent({
|
|
|
|
submit: function(event) {
|
2012-01-13 09:47:18 +00:00
|
|
|
editMetadata('notes', event.value);
|
2011-12-27 06:54:49 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
)
|
2013-07-11 12:38:19 +00:00
|
|
|
.appendTo($statistics);
|
2011-12-27 06:54:49 +00:00
|
|
|
}
|
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
$('<div>').css({height: '16px'}).appendTo($statistics);
|
2011-12-27 06:54:49 +00:00
|
|
|
|
|
|
|
function editMetadata(key, value) {
|
|
|
|
if (value != data[key]) {
|
|
|
|
var edit = {id: data.id};
|
|
|
|
if (key == 'title') {
|
2012-01-09 09:06:35 +00:00
|
|
|
edit[key] = value;
|
2012-02-17 09:29:21 +00:00
|
|
|
} else if (listKeys.indexOf(key) >= 0) {
|
2011-12-27 13:52:16 +00:00
|
|
|
edit[key] = value ? value.split(', ') : [];
|
2011-12-27 06:54:49 +00:00
|
|
|
} else {
|
2012-02-13 11:33:32 +00:00
|
|
|
edit[key] = value ? value : null;
|
2011-12-27 06:54:49 +00:00
|
|
|
}
|
|
|
|
pandora.api.edit(edit, function(result) {
|
2015-09-22 09:32:02 +00:00
|
|
|
var src;
|
2013-07-11 12:38:19 +00:00
|
|
|
data[key] = result.data[key];
|
2012-01-15 15:05:37 +00:00
|
|
|
descriptions[key] && descriptions[key].options({
|
2012-01-20 18:10:25 +00:00
|
|
|
value: result.data[key + 'description']
|
2012-01-15 15:05:37 +00:00
|
|
|
});
|
2012-01-09 09:55:52 +00:00
|
|
|
Ox.Request.clearCache(); // fixme: too much? can change filter/list etc
|
2011-12-27 06:54:49 +00:00
|
|
|
if (result.data.id != data.id) {
|
|
|
|
pandora.UI.set({item: result.data.id});
|
|
|
|
pandora.$ui.browser.value(data.id, 'id', result.data.id);
|
|
|
|
}
|
2013-02-11 12:14:15 +00:00
|
|
|
pandora.updateItemContext();
|
2013-07-11 12:38:19 +00:00
|
|
|
pandora.$ui.browser.value(result.data.id, key, result.data[key]);
|
2015-09-21 17:31:44 +00:00
|
|
|
if (Ox.contains(posterKeys, key) && ui.icons == 'posters') {
|
|
|
|
src = pandora.getMediaURL('/' + data.id + '/poster512.jpg?' + Ox.uid());
|
|
|
|
$icon.attr({src: src});
|
|
|
|
$reflectionIcon.attr({src: src});
|
|
|
|
}
|
2012-01-18 16:12:26 +00:00
|
|
|
pandora.$ui.itemTitle
|
|
|
|
.options({
|
|
|
|
title: '<b>' + result.data.title
|
|
|
|
+ (Ox.len(result.data.director)
|
|
|
|
? ' (' + result.data.director.join(', ') + ')'
|
|
|
|
: '')
|
|
|
|
+ (result.data.year ? ' ' + result.data.year : '') + '</b>'
|
|
|
|
});
|
2011-12-27 06:54:49 +00:00
|
|
|
//pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
function formatKey(key, mode) {
|
2013-04-30 17:18:05 +00:00
|
|
|
var item = Ox.getObjectById(pandora.site.itemKeys, key);
|
2013-05-09 12:03:26 +00:00
|
|
|
key = Ox._(item ? item.title : key);
|
2013-07-11 12:38:19 +00:00
|
|
|
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 '));
|
2011-12-27 06:54:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function formatLight(str) {
|
2013-07-11 12:38:19 +00:00
|
|
|
return '<span class="OxLight">' + str + '</span>';
|
2011-12-27 06:54:49 +00:00
|
|
|
}
|
|
|
|
|
2014-04-19 20:46:29 +00:00
|
|
|
function formatLink(key, value, linkValue) {
|
2011-12-27 06:54:49 +00:00
|
|
|
return (Ox.isArray(value) ? value : [value]).map(function(value) {
|
2013-07-11 12:38:19 +00:00
|
|
|
return key
|
2014-11-18 14:25:24 +00:00
|
|
|
? '<a href="/' + key + '=' + (linkValue ? linkValue : value) + '">' + value + '</a>'
|
2011-12-27 06:54:49 +00:00
|
|
|
: value;
|
|
|
|
}).join(', ');
|
|
|
|
}
|
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
function formatValue(key, value) {
|
2013-05-09 12:03:26 +00:00
|
|
|
var ret;
|
|
|
|
if (key == 'date') {
|
|
|
|
ret = value ? Ox.formatDate(value,
|
|
|
|
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length]
|
|
|
|
) : '';
|
2013-06-25 12:14:44 +00:00
|
|
|
} else if (listKeys.indexOf(key) > -1) {
|
|
|
|
ret = value.split(', ');
|
2013-05-09 12:03:26 +00:00
|
|
|
} else {
|
|
|
|
ret = value;
|
|
|
|
}
|
2013-06-25 12:14:44 +00:00
|
|
|
if (nameKeys.indexOf(key) > -1) {
|
|
|
|
key = 'name';
|
|
|
|
}
|
2014-04-19 20:46:29 +00:00
|
|
|
return formatLink(key, ret, key == 'date' && value);
|
2013-05-09 12:03:26 +00:00
|
|
|
}
|
|
|
|
|
2011-12-27 06:54:49 +00:00
|
|
|
function getRightsLevelElement(rightsLevel) {
|
|
|
|
return Ox.Theme.formatColorLevel(
|
|
|
|
rightsLevel,
|
|
|
|
pandora.site.rightsLevels.map(function(rightsLevel) {
|
|
|
|
return rightsLevel.name;
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2013-05-09 12:03:26 +00:00
|
|
|
function getValue(key, value) {
|
|
|
|
return !value ? ''
|
|
|
|
: Ox.contains(listKeys, key) ? value.join(', ')
|
|
|
|
: value;
|
|
|
|
}
|
|
|
|
|
2011-12-27 06:54:49 +00:00
|
|
|
function renderCapabilities(rightsLevel) {
|
2012-05-24 08:22:56 +00:00
|
|
|
var capabilities = [].concat(
|
2011-12-27 06:54:49 +00:00
|
|
|
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',
|
2014-02-15 10:44:00 +00:00
|
|
|
title: Ox._(Ox.toTitleCase(userLevel)),
|
2011-12-27 06:54:49 +00:00
|
|
|
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.site.capabilities[capability.name][userLevel] >= rightsLevel,
|
|
|
|
$element = Ox.Theme.formatColorLevel(hasCapability, ['', '']);
|
|
|
|
Ox.Button({
|
2014-02-15 10:44:00 +00:00
|
|
|
tooltip: Ox._('{0} '
|
2011-12-27 06:54:49 +00:00
|
|
|
+ (hasCapability ? 'can' : 'can\'t') + ' '
|
2012-05-22 15:07:34 +00:00
|
|
|
+ Ox.toSlashes(capability.name)
|
|
|
|
.split('/').slice(1).join(' ')
|
2014-02-15 10:44:00 +00:00
|
|
|
.toLowerCase()
|
|
|
|
.replace('see item', 'see the item')
|
|
|
|
.replace('play video', 'play the full video')
|
|
|
|
.replace('download video', 'download the video'),
|
2014-02-17 14:40:15 +00:00
|
|
|
[canEdit ? Ox._(Ox.toTitleCase(userLevel)) : Ox._('You')]),
|
2011-12-27 06:54:49 +00:00
|
|
|
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({
|
2013-05-09 12:03:26 +00:00
|
|
|
title: Ox._('Help'),
|
|
|
|
tooltip: Ox._('About Rights'),
|
2011-12-27 06:54:49 +00:00
|
|
|
type: 'image'
|
|
|
|
})
|
|
|
|
.css({marginLeft: '52px'})
|
|
|
|
.bindEvent({
|
|
|
|
click: function() {
|
|
|
|
pandora.UI.set({page: 'rights'});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.appendTo($line);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2013-05-09 12:03:26 +00:00
|
|
|
function renderGroup(keys) {
|
|
|
|
var $element;
|
|
|
|
if (canEdit || keys.filter(function(key) {
|
|
|
|
return data[key];
|
|
|
|
}).length) {
|
2013-07-19 09:34:01 +00:00
|
|
|
$element = $('<div>')
|
|
|
|
.addClass('OxSelectable')
|
|
|
|
.css(css);
|
2013-05-09 12:03:26 +00:00
|
|
|
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) {
|
2013-07-11 12:38:19 +00:00
|
|
|
return formatValue(key, value);
|
2013-05-09 12:03:26 +00:00
|
|
|
},
|
2014-02-15 10:44:00 +00:00
|
|
|
placeholder: formatLight(Ox._('unknown')),
|
2013-05-09 12:03:26 +00:00
|
|
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
|
|
|
value: getValue(key, data[key])
|
|
|
|
})
|
|
|
|
.bindEvent({
|
|
|
|
submit: function(data) {
|
|
|
|
editMetadata(key, data.value);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.appendTo($element);
|
|
|
|
}
|
|
|
|
});
|
2013-07-11 12:38:19 +00:00
|
|
|
$element.appendTo($text);
|
2013-05-09 12:03:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-27 06:54:49 +00:00
|
|
|
function renderRightsLevel() {
|
|
|
|
var $rightsLevelElement = getRightsLevelElement(data.rightslevel),
|
|
|
|
$rightsLevelSelect;
|
|
|
|
$rightsLevel.empty();
|
|
|
|
if (canEdit) {
|
|
|
|
$rightsLevelSelect = Ox.Select({
|
|
|
|
items: pandora.site.rightsLevels.map(function(rightsLevel, i) {
|
2013-05-09 12:03:26 +00:00
|
|
|
return {id: i, title: Ox._(rightsLevel.name)};
|
2011-12-27 06:54:49 +00:00
|
|
|
}),
|
2012-01-20 20:56:49 +00:00
|
|
|
width: 128,
|
|
|
|
value: data.rightslevel
|
2011-12-27 06:54:49 +00:00
|
|
|
})
|
|
|
|
.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);
|
|
|
|
pandora.api.edit({id: data.id, rightslevel: rightsLevel}, function(result) {
|
|
|
|
// ...
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.appendTo($rightsLevel);
|
|
|
|
} else {
|
|
|
|
$rightsLevelElement
|
|
|
|
.css({
|
|
|
|
marginBottom: '4px'
|
|
|
|
})
|
|
|
|
.appendTo($rightsLevel);
|
|
|
|
}
|
|
|
|
$capabilities = $('<div>').appendTo($rightsLevel);
|
|
|
|
renderCapabilities(data.rightslevel);
|
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
|
|
|
borderRadius = ui.icons == 'posters' ? 0 : iconSize / 8;
|
|
|
|
$icon.animate({
|
|
|
|
left: margin + iconLeft + 'px',
|
|
|
|
width: iconWidth + 'px',
|
|
|
|
height: iconHeight + 'px',
|
|
|
|
borderRadius: borderRadius + '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',
|
|
|
|
borderRadius: borderRadius + 'px'
|
|
|
|
}, 250);
|
|
|
|
$reflectionGradient.animate({
|
|
|
|
width: iconSize + 'px',
|
|
|
|
height: iconSize / 2 + 'px'
|
|
|
|
}, 250);
|
2012-01-20 18:10:25 +00:00
|
|
|
$data.animate({
|
2012-02-14 06:21:01 +00:00
|
|
|
top: margin + iconHeight + margin + 'px',
|
|
|
|
width: iconSize + 'px',
|
2012-01-20 18:10:25 +00:00
|
|
|
}, 250);
|
2013-07-11 12:38:19 +00:00
|
|
|
$text.animate({
|
2011-12-27 06:54:49 +00:00
|
|
|
left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px',
|
|
|
|
}, 250);
|
|
|
|
pandora.UI.set({infoIconSize: iconSize});
|
|
|
|
}
|
|
|
|
|
|
|
|
that.reload = function() {
|
2014-02-02 11:30:25 +00:00
|
|
|
var src = pandora.getMediaURL('/' + data.id + '/' + (
|
2013-05-09 12:03:26 +00:00
|
|
|
ui.icons == 'posters' ? 'poster' : 'icon'
|
2014-02-02 11:30:25 +00:00
|
|
|
) + '512.jpg?' + Ox.uid());
|
2011-12-27 06:54:49 +00:00
|
|
|
$icon.attr({src: src});
|
|
|
|
$reflectionIcon.attr({src: src});
|
|
|
|
iconSize = iconSize == 256 ? 512 : 256;
|
|
|
|
iconRatio = ui.icons == 'posters'
|
2013-07-08 12:40:23 +00:00
|
|
|
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1;
|
2011-12-27 06:54:49 +00:00
|
|
|
toggleIconSize();
|
|
|
|
};
|
|
|
|
|
2014-10-07 10:29:41 +00:00
|
|
|
that.resizeElement = function() {
|
|
|
|
// overwrite splitpanel resize
|
|
|
|
};
|
|
|
|
|
2011-12-27 06:54:49 +00:00
|
|
|
that.bindEvent({
|
2014-09-24 20:54:45 +00:00
|
|
|
mousedown: function() {
|
2014-10-20 15:54:34 +00:00
|
|
|
setTimeout(function() {
|
|
|
|
!Ox.Focus.focusedElementIsInput() && that.gainFocus();
|
|
|
|
});
|
2014-09-24 20:54:45 +00:00
|
|
|
},
|
2011-12-27 06:54:49 +00:00
|
|
|
pandora_icons: that.reload,
|
2012-03-20 12:01:26 +00:00
|
|
|
pandora_showsiteposters: function() {
|
2011-12-27 06:54:49 +00:00
|
|
|
ui.icons == 'posters' && that.reload();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return that;
|
|
|
|
|
2013-07-11 12:38:19 +00:00
|
|
|
};
|