')
- .html(
- formatKey({
- categorty: 'categories',
- }[key] || key).replace('', ' ')
- )
- .appendTo($div);
- Ox.Editable({
- clickLink: pandora.clickLink,
- format: function(value) {
- return list_keys.indexOf(key) >= 0
- ? formatValue(value.split(', '), {
- 'director': 'name',
- 'cinematographer': 'name',
- 'features': 'name',
- }[key] || key)
- : value;
- },
- placeholder: formatLight('unknown'),
- editable: isEditable,
- tooltip: isEditable ? 'Doubleclick to edit' : '',
- value: list_keys.indexOf(key) >= 0
- ? (data[key] || []).join(', ')
- : data[key] || ''
- })
- .bindEvent({
- submit: function(event) {
- editMetadata(key, event.value);
- }
- })
- .appendTo($div);
- if(pandora.site.itemKeys.filter(function(item) {
- if (item.id == key)
- return item.description
- }).length > 0) {
+ .appendTo($text),
+ value = list_keys.indexOf(key) >= 0
+ ? (data[key] || []).join(', ')
+ : data[key] || '';
+ if(isEditable || value) {
$('
')
- .append(
- descriptions[key] = Ox.Editable({
- clickLink: pandora.clickLink,
- placeholder: formatLight(Ox.toTitleCase(key) + ' Description'),
- editable: isEditable,
- tooltip: isEditable ? 'Doubleclick to edit' : '',
- type: 'textarea',
- value: data[key + 'description']|| ''
- })
- .bindEvent({
- submit: function(event) {
- editMetadata(key + 'description', event.value);
- }
- })
- ).css({
- 'padding-top': '4px',
- 'padding-bottom': '4px'
- })
+ .html(
+ formatKey({
+ categorty: 'categories',
+ }[key] || key).replace('', ' ')
+ )
.appendTo($div);
+ Ox.Editable({
+ clickLink: pandora.clickLink,
+ format: function(value) {
+ return list_keys.indexOf(key) >= 0
+ ? formatValue(value.split(', '), {
+ 'director': 'name',
+ 'cinematographer': 'name',
+ 'features': 'name',
+ }[key] || key)
+ : value;
+ },
+ placeholder: formatLight('unknown'),
+ editable: isEditable,
+ tooltip: isEditable ? 'Doubleclick to edit' : '',
+ value: list_keys.indexOf(key) >= 0
+ ? (data[key] || []).join(', ')
+ : data[key] || ''
+ })
+ .bindEvent({
+ submit: function(event) {
+ editMetadata(key, event.value);
+ }
+ })
+ .appendTo($div);
+ if(pandora.site.itemKeys.filter(function(item) {
+ if (item.id == key)
+ return item.description
+ }).length > 0
+ && (isEditable || data[key + 'description'])) {
+ $('
')
+ .append(
+ descriptions[key] = Ox.Editable({
+ clickLink: pandora.clickLink,
+ placeholder: formatLight(Ox.toTitleCase(key) + ' Description'),
+ editable: isEditable,
+ tooltip: isEditable ? 'Doubleclick to edit' : '',
+ type: 'textarea',
+ value: data[key + 'description']|| ''
+ })
+ .bindEvent({
+ submit: function(event) {
+ editMetadata(key + 'description', event.value);
+ }
+ })
+ ).css({
+ 'padding-top': '4px',
+ 'padding-bottom': '4px'
+ })
+ .appendTo($div);
+ }
}
});
@@ -447,6 +375,14 @@ pandora.ui.infoView = function(data) {
pandora.$ui.browser.value(result.data.id, 'director', result.data.director);
pandora.$ui.browser.value(result.data.id, 'country', result.data.country);
pandora.$ui.browser.value(result.data.id, 'year', result.data.year);
+ pandora.$ui.itemTitle
+ .options({
+ title: '' + result.data.title
+ + (Ox.len(result.data.director)
+ ? ' (' + result.data.director.join(', ') + ')'
+ : '')
+ + (result.data.year ? ' ' + result.data.year : '') + ''
+ });
//pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser());
});
}