text key clip lists

This commit is contained in:
j 2011-12-30 13:30:38 +05:30
commit c8b59c34c6
4 changed files with 22 additions and 13 deletions

View file

@ -7,7 +7,9 @@ pandora.ui.clipList = function(videoRatio) {
var ui = pandora.user.ui,
fixedRatio = !ui.item ? 16/9 : videoRatio,
isClipView = !ui.item ? ui.listView == 'clip' : ui.itemView == 'clips',
textKey = Ox.getObjectById(pandora.site.layers, 'subtitles')
? 'subtitles'
: 'annotations',
that = Ox.IconList({
fixedRatio: fixedRatio,
item: function(data, sort, size) {
@ -22,7 +24,7 @@ pandora.ui.clipList = function(videoRatio) {
width = fixedRatio > 1 ? size : Math.round(size * fixedRatio);
height = fixedRatio > 1 ? Math.round(size / fixedRatio) : size;
}
title = data.subtitles ? data.subtitles[0].value : ''; //fixme: could be other layer
title = data[textKey] ? data[textKey][0].value : '';
url = '/' + data.id.split('/')[0] + '/' + height + 'p' + data['in'] + '.jpg';
sortKey = sort[0].key;
if (['text', 'position', 'duration'].indexOf(sortKey) > -1) {
@ -79,7 +81,7 @@ pandora.ui.clipList = function(videoRatio) {
}, data), callback);
},
keys: Ox.merge(
['id', 'in', 'out', 'subtitles'], //fixme: could be other layer
['id', 'in', 'out', textKey],
!ui.item ? ['videoRatio'] : []
),
max: 1,

View file

@ -308,7 +308,7 @@ pandora.ui.posterInfo = function(data) {
})
.html(
data.title + (
data.director ? ' (' + data.director.join(', ') + ')' : ''
Ox.len(data.director) ? ' (' + data.director.join(', ') + ')' : ''
)
),
that = Ox.SplitPanel({

View file

@ -32,7 +32,7 @@ pandora.ui.item = function() {
pandora.$ui.itemTitle
.options({
title: '<b>' + result.data.title
+ (result.data.director && result.data.director.length
+ (Ox.len(result.data.director)
? ' (' + result.data.director.join(', ') + ')'
: '')
+ (result.data.year ? ' ' + result.data.year : '') + '</b>'