')
.css({marginBottom: '4px'})
- .append(formatKey(itemKey.title, 'statistics'))
+ .append(formatKey('cuts per minute', 'statistics'))
.append(
Ox.Theme.formatColor(null, 'gradient')
.css({textAlign: 'right'})
- .html(
- Ox['format' + Ox.toTitleCase(itemKey.format.type)]
- .apply(null, [value].concat(itemKey.format.args))
- )
+ .html(Ox.formatNumber(data['cutsperminute'] || 0, 3))
)
.appendTo($statistics);
- });
-
- // Hue, Saturation, Lightness, Volume --------------------------------------
-
- ['hue', 'saturation', 'lightness', 'volume'].forEach(function(key) {
- $('
')
- .css({marginBottom: '4px'})
- .append(formatKey(key, 'statistics'))
- .append(
- Ox.Theme.formatColor(
- data[key] || 0, key == 'volume' ? 'lightness' : key
- ).css({textAlign: 'right'})
- )
- .appendTo($statistics);
- });
-
- // Cuts per Minute ---------------------------------------------------------
-
- $('
')
- .css({marginBottom: '4px'})
- .append(formatKey('cuts per minute', 'statistics'))
- .append(
- Ox.Theme.formatColor(null, 'gradient')
- .css({textAlign: 'right'})
- .html(Ox.formatNumber(data['cutsperminute'] || 0, 3))
- )
- .appendTo($statistics);
+ }
// Rights Level ------------------------------------------------------------
@@ -479,7 +485,7 @@ pandora.ui.infoView = function(data) {
.append(
Ox.EditableContent({
height: 128,
- placeholder: formatLight(Ox._('No notes')),
+ placeholder: formatLight(Ox._(isMixed ? 'Mixed notes' : 'No notes')),
tooltip: pandora.getEditTooltip(),
type: 'textarea',
value: data.notes || '',
@@ -498,7 +504,7 @@ pandora.ui.infoView = function(data) {
function editMetadata(key, value) {
if (value != data[key]) {
- var edit = {id: data.id};
+ var edit = {id: isMultiple ? ui.listSelection : data.id};
if (key == 'title') {
edit[key] = value;
} else if (listKeys.indexOf(key) >= 0) {
@@ -507,26 +513,28 @@ pandora.ui.infoView = function(data) {
edit[key] = value ? value : null;
}
pandora.api.edit(edit, function(result) {
- data[key] = result.data[key];
- descriptions[key] && descriptions[key].options({
- value: result.data[key + 'description']
- });
- Ox.Request.clearCache(); // fixme: too much? can change filter/list etc
- if (result.data.id != data.id) {
- pandora.UI.set({item: 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: '' + result.data.title
- + (Ox.len(result.data.director)
- ? ' (' + result.data.director.join(', ') + ')'
- : '')
- + (result.data.year ? ' ' + result.data.year : '') + ''
+ if (!isMultiple) {
+ data[key] = result.data[key];
+ descriptions[key] && descriptions[key].options({
+ value: result.data[key + 'description']
});
- //pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser());
+ Ox.Request.clearCache(); // fixme: too much? can change filter/list etc
+ if (result.data.id != data.id) {
+ pandora.UI.set({item: 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: '' + 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());
+ }
});
}
}
@@ -687,7 +695,7 @@ pandora.ui.infoView = function(data) {
format: function(value) {
return formatValue(key, value);
},
- placeholder: formatLight(Ox._('unknown')),
+ placeholder: formatLight(Ox._( isMixed[key] ? 'mixed' : 'unknown')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
value: getValue(key, data[key])
})
@@ -729,8 +737,12 @@ pandora.ui.infoView = function(data) {
.css({background: $rightsLevelElement.css('background')})
.data({OxColor: $rightsLevelElement.data('OxColor')})
renderCapabilities(rightsLevel);
- pandora.api.edit({id: data.id, rightslevel: rightsLevel}, function(result) {
- // ...
+ var edit = {
+ id: isMultiple ? ui.listSelection : data.id,
+ rightslevel: rightsLevel
+ };
+ pandora.api.edit(edit, function(result) {
+ that.triggerEvent('change', Ox.extend({}, 'rightslevel', rightsLevel));
});
}
})