')
.css(css)
+ .css({marginTop: '8px'})
+ .bindEvent({
+ submit: function(event) {
+ editMetadata('summary', event.value);
+ }
+ })
.appendTo($text);
- html = [];
- ['budget', 'gross', 'profit'].forEach(function(key) {
- data[key] && html.push(
- formatKey(key == 'profit' && data[key] < 0 ? 'loss' : key)
- + Ox.formatCurrency(Math.abs(data[key]), '$')
- );
- });
- $div.html(html.join('; '));
}
- if (data.connections) {
+ if (data.imdbId || canEdit) {
$div = $('
')
.css(css)
+ .css({clear: 'both', marginTop: '16px'})
+ .html(formatKey('IMDb ID'))
.appendTo($text);
- html = [];
- [
- 'Edited from', 'Edited into',
- 'Features', 'Featured in',
- 'Follows', 'Followed by',
- 'References', 'Referenced in',
- 'Remake of', 'Remade as',
- 'Spin off from', 'Spin off',
- 'Spoofs', 'Spoofed in'
- ].forEach(function(key) {
- data.connections[key] && html.push(
- formatKey(key) + data.connections[key].map(function(connection) {
- return (
- connection.item
- ? '
' + connection.title + ''
- : connection.title
- ) + (
- connection.description
- ? ' ' + formatLight('(' + connection.description + ')')
- : ''
- );
- }).join(', ')
- );
- });
- $div.html(html.join('; '));
+ Ox.Editable({
+ clickLink: pandora.clickLink,
+ editable: canEdit,
+ format: function(value) {
+ return '
' + value + ''
+ },
+ placeholder: formatLight('unknown'),
+ tooltip: 'Doubleclick to edit',
+ value: data.imdbId || ''
+ })
+ .bindEvent({
+ submit: function(event) {
+ editMetadata('imdbId', event.value);
+ }
+ })
+ .appendTo($div);
}
- ['reviews', 'links'].forEach(function(key) {
- data[key] && $('
')
- .css(css)
- .html(
- formatKey(key) + data[key].map(function(value) {
- return '
' + value.source + ''
- }).join(', ')
- )
- .appendTo($text);
- });
-
$('
').css({height: '16px'}).appendTo($text);
if (canEdit) {
@@ -555,7 +494,7 @@ pandora.ui.infoView = function(data) {
}
- if (pandora.site.capabilities.canRemoveItems[pandora.user.ui.level]) {
+ if (pandora.site.capabilities.canRemoveItems[pandora.user.level]) {
$deleteButton = Ox.Button({
title: 'Delete ' + pandora.site.itemName.singular + '...',
width: 128
@@ -595,12 +534,16 @@ pandora.ui.infoView = function(data) {
var edit = {id: data.id};
if (key == 'title') {
Ox.extend(edit, parseTitle(value));
- } else if (['director', 'country'].indexOf(key) > -1) {
+ } else if ([
+ 'director', 'country', 'language'
+ ].indexOf(key) > -1) {
edit[key] = value ? value.split(', ') : [];
} else {
edit[key] = value;
}
pandora.api.edit(edit, function(result) {
+ var src;
+ data[key] == result.data[key];
if (result.data.id != data.id) {
Ox.Request.clearCache(); // fixme: too much
pandora.UI.set({item: result.data.id});
@@ -608,6 +551,27 @@ pandora.ui.infoView = function(data) {
}
pandora.updateItemContext();
pandora.$ui.browser.value(result.data.id, key, result.data[key]);
+ if (Ox.contains(['title', 'director', 'year'], key)) {
+ pandora.clearIconCache(data.id);
+ if (ui.icons == 'posters') {
+ if ($browserImages.length == 0) {
+ $browserImages = pandora.$ui.browser.find('img[src*="/' + data.id + '/"]');
+ }
+ $browserImages.each(function() {
+ $(this).attr({
+ src: '/' + data.id + '/poster128.jpg?' + Ox.uid()
+ });
+ });
+ $list.find('img[src*="siteposter.jpg"]').each(function() {
+ $(this).attr({
+ src: '/' + data.id + '/siteposter.jpg?' + Ox.uid()
+ });
+ });
+ src = '/' + data.id + '/poster512.jpg?' + Ox.uid()
+ $icon.attr({src: src});
+ $reflectionIcon.attr({src: src});
+ }
+ }
});
}
}
@@ -620,7 +584,7 @@ pandora.ui.infoView = function(data) {
}
function formatLight(str) {
- return '' + str + '';
+ return '' + str + '';
}
function formatTitle(title) {
@@ -861,6 +825,9 @@ pandora.ui.infoView = function(data) {
$rightsLevelSelect = Ox.Select({
items: pandora.site.rightsLevels.map(function(rightsLevel, i) {
return {id: i, title: rightsLevel.name};
+ }).filter(function(rightsLevel) {
+ return (!copyright && rightsLevel.title != 'Under Copyright')
+ || (copyright && rightsLevel.title != 'Out of Copyright');
}),
width: 128,
value: data.rightslevel
@@ -958,4 +925,4 @@ pandora.ui.infoView = function(data) {
return that;
-}
+};