update sequences dialog

This commit is contained in:
rolux 2012-06-16 14:21:32 +00:00
parent 982cafe1fb
commit c540f61f3d

View file

@ -209,77 +209,83 @@ pandora.ui.sequencesDialog = function() {
position: item.position position: item.position
}, function(result) { }, function(result) {
// result.data: {hash, id, in, out} // result.data: {hash, id, in, out}
Ox.print('RD:::', result.data) if (Ox.isEmpty(result.data)) {
result.data['in'] = item.position;
result.data.out = item.position + 1 / fps;
result.data.id = item.id + '/'
+ Ox.formatNumber(result.data['in'], 3) + '-'
+ Ox.formatNumber(result.data.out, 3)
}
sequence = Ox.extend({}, item, result.data); sequence = Ox.extend({}, item, result.data);
$clipButtons[sequence['in'] > 0 ? 'enableButton' : 'disableButton']('previous'); $clipButtons[sequence['in'] > 0 ? 'enableButton' : 'disableButton']('previous');
$clipButtons[sequence.out < item.duration ? 'enableButton' : 'disableButton']('next'); $clipButtons[sequence.out < item.duration ? 'enableButton' : 'disableButton']('next');
if (!$item) { if (!$item) {
$item = Ox.IconList({ $item = Ox.IconList({
fixedRatio: fixedRatio,
item: getItem,
/*
items: [item],
*/
///*
items: function(data, callback) {
setTimeout(function() {
callback({
data: {items: data.keys ? [sequence] : 1},
status: {code: 200, text: 'ok'}
});
}, 250);
},
//*/
max: 0,
orientation: 'both',
size: 128,
sort: [{key: 'id', operator: '+'}],
unique: 'id'
});
$innerPanel.replaceElement(0, $item);
}
$list = Ox.IconList({
fixedRatio: fixedRatio, fixedRatio: fixedRatio,
item: getItem, item: getItem,
/*
items: [item],
*/
///*
items: function(data, callback) { items: function(data, callback) {
pandora.api.findSequences(Ox.extend(data, { setTimeout(function() {
query: { callback({
conditions: [ data: {items: data.keys ? [sequence] : 1},
{key: 'id', value: sequence.id, operator: '!='}, status: {code: 200, text: 'ok'}
{key: 'mode', value: pandora.user.ui.sequenceMode, operator: '=='}, });
{key: 'hash', value: sequence.hash, operator: '=='} }, 250);
],
operator: '&'
}
}), callback);
}, },
keys: ['director', 'id', 'title', 'videoRatio'], //*/
max: 1, max: 0,
orientation: 'both', orientation: 'both',
size: 128, size: 128,
sort: Ox.clone(pandora.user.ui.sequenceSort), sort: [{key: 'id', operator: '+'}],
unique: 'id' unique: 'id'
})
.bindEvent({
init: function(data) {
$status.html(
Ox.formatNumber(data.items) + ' Clip'
+ (data.items == 1 ? '' : 's')
);
},
open: changeClip,
select: function(data) {
$dialog[
data.ids.length ? 'enableButton' : 'disableButton'
]('open');
},
pandora_sequencesort: function(data) {
Ox.print('SEQUENCESORT:', data)
$list.options({sort: data.value});
}
}); });
$innerPanel.replaceElement(0, $item);
}
if (sequence.hash) {
$list = Ox.IconList({
fixedRatio: fixedRatio,
item: getItem,
items: function(data, callback) {
pandora.api.findSequences(Ox.extend(data, {
query: {
conditions: [
{key: 'id', value: sequence.id, operator: '!='},
{key: 'mode', value: pandora.user.ui.sequenceMode, operator: '=='},
{key: 'hash', value: sequence.hash, operator: '=='}
],
operator: '&'
}
}), callback);
},
keys: ['director', 'id', 'title', 'videoRatio'],
max: 1,
orientation: 'both',
size: 128,
sort: Ox.clone(pandora.user.ui.sequenceSort),
unique: 'id'
})
.bindEvent({
init: function(data) {
$status.html(
Ox.formatNumber(data.items) + ' Clip'
+ (data.items == 1 ? '' : 's')
);
},
open: changeClip,
select: function(data) {
$dialog[
data.ids.length ? 'enableButton' : 'disableButton'
]('open');
}
});
} else {
$list = Ox.Element();
$status.html('0 Clips');
}
$innerPanel.replaceElement(1, $list); $innerPanel.replaceElement(1, $list);
Ox.print('SEQUENCE::', sequence)
$image.attr({src: getImageURL(sequence.hash)}); $image.attr({src: getImageURL(sequence.hash)});
}); });
}); });