read formats from json

This commit is contained in:
rolux 2011-01-06 06:11:02 +00:00
commit eb9afe70a9
2 changed files with 22 additions and 26 deletions

View file

@ -1131,11 +1131,6 @@ var pandora = new Ox.App({
columnsRemovable: true,
columnsResizable: true,
columnsVisible: true,
format: {
releasedate: {type: 'date', args: ['%a, %b %e, %Y']},
runtime: {type: 'duration', args: [0, 'medium']},
votes: {type: 'percent', args: [403824, 2]}
},
id: 'list',
request: function(data, callback) {
Ox.print('data, Query.toObject', data, Query.toObject())
@ -2153,13 +2148,25 @@ var pandora = new Ox.App({
},
{
align: 'left',
id: 'icon',
format: function(value) {
return $('<img>').attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbol' +
(value ? 'Find' : 'None') + '.png'
});
},
id: 'query',
operator: '+',
visible: true,
width: 16
},
{
align: 'left',
format: function(value) {
return $('<img>').attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbol' +
(value ? 'Publish' : 'None') + '.png'
});
},
id: 'public',
operator: '+',
visible: true,
@ -2174,19 +2181,8 @@ var pandora = new Ox.App({
} else {
callback({data: {items: $.map(app.user.lists[id], function(v, i) {
return $.extend(v, {
edit: $('<img>').attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbolNone.png'
}).mouseover(function() { $(this).attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbolEdit.png'
})}).mouseout(function() { $(this).attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbolNone.png'
})}),
icon: $('<img>').attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbol' + (v.items ? 'None' : 'Find') + '.png'
}),
public: $('<img>').attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbol' + (v.items && v.public ? 'Publish' : 'None') + '.png'
}),
query: v.query,
public: v.public,
items: v.items ? v.items.length.toString() : (v.title == '1960s' || v.title == 'All Movies' ? '?' : '100')
});
})}});