cleanup files, round 1

This commit is contained in:
j 2011-02-01 18:49:34 +05:30
commit 5001e9a808
4 changed files with 70 additions and 105 deletions

View file

@ -636,99 +636,6 @@
})
return that;
},
files: function() {
var that = new Ox.TextList({
columns: [
{
align: "left",
id: "name",
operator: "+",
title: "Name",
unique: true,
visible: true,
width: 400
},
{
align: "left",
id: "oshash",
operator: "+",
title: "oshash",
visible: true,
width: 120
},
{
align: "left",
id: "instances",
operator: "+",
title: "Instances",
visible: true,
width: 60
},
{
align: "left",
id: "width",
operator: "+",
title: "Width",
visible: true,
width: 60
},
{
align: "left",
id: "height",
operator: "+",
title: "Height",
visible: true,
width: 60
},
{
align: "left",
id: "duration",
operator: "+",
title: "Duration",
visible: true,
width: 80,
format: {type: "duration", args: [0, "medium"]}
},
{
align: "left",
id: "size",
operator: "+",
title: "Size",
visible: true,
width: 80,
format: {type: "value", args: ["B"]}
},
{
align: "left",
id: "is_main",
operator: "+",
title: "Main",
visible: true,
width: 140
}
],
columnsMovable: true,
columnsRemovable: true,
columnsResizable: true,
columnsVisible: true,
id: 'files',
request: function(data, callback) {
//Ox.print('data, Query.toObject', data, Query.toObject())
pandora.api.findFiles($.extend(data, {
query: {
conditions: [{
key: 'id',
value: app.user.ui.item,
operator: '='
}]
}
}), callback);
},
scrollbarVisible: true,
sort: [{key: 'name', operator:'+'}]
});
return that;
},
filter: function() {
var that = new Ox.Filter({
findKeys: $.map(app.config.itemKeys, function(key) {
@ -1936,7 +1843,11 @@
});
*/
} else if (app.user.ui.itemView == 'files') {
app.$ui.contentPanel.replace(1, app.$ui.files = ui.files());
app.$ui.contentPanel.replace(1,
app.$ui.item = new Ox.FilesView({
id: result.data.item.id
})
);
}
app.$ui.total.html(result.data.item.title + ' (' + result.data.item.director.join(', ') + ')')
});