This commit is contained in:
j 2011-01-11 15:48:48 +05:30
commit 30eef8fcb5
2 changed files with 31 additions and 41 deletions

View file

@ -78,7 +78,7 @@
{"id": "country", "title": "Country", "width": 120, "type": "string"}, {"id": "country", "title": "Country", "width": 120, "type": "string"},
{"id": "year", "title": "Year", "width": 60, "type": "year"}, {"id": "year", "title": "Year", "width": 60, "type": "year"},
{"id": "language", "title": "Language", "width": 120, "type": "string"}, {"id": "language", "title": "Language", "width": 120, "type": "string"},
{"id": "runtime", "title": "Runtime", "width": 60, "type": "integer", "format": "duration"}, {"id": "runtime", "title": "Runtime", "width": 60, "type": "integer", "format": {"type": "duration", "args": [0, "medium"]}},
{"id": "writer", "title": "Writer", "width": 180, "type": "person"}, {"id": "writer", "title": "Writer", "width": 180, "type": "person"},
{"id": "producer", "title": "Producer", "width": 180, "type": "person"}, {"id": "producer", "title": "Producer", "width": 180, "type": "person"},
{"id": "cinematographer", "title": "Cinematographer", "width": 180, "type": "person"}, {"id": "cinematographer", "title": "Cinematographer", "width": 180, "type": "person"},
@ -88,12 +88,12 @@
{"id": "numberofkeywords", "title": "Number of Keywords", "width": 60, "key": "keyword", "type": "length"}, {"id": "numberofkeywords", "title": "Number of Keywords", "width": 60, "key": "keyword", "type": "length"},
{"id": "wordsinsummary", "title": "Words in Summary", "width": 60, "key": "summary", "type": "words"}, {"id": "wordsinsummary", "title": "Words in Summary", "width": 60, "key": "summary", "type": "words"},
{"id": "wordsintrivia", "title": "Words in Trivia", "width": 60, "key": "trivia", "type": "words"}, {"id": "wordsintrivia", "title": "Words in Trivia", "width": 60, "key": "trivia", "type": "words"},
{"id": "releasedate", "title": "Release Date", "width": 120, "type": "date"}, {"id": "releasedate", "title": "Release Date", "width": 120, "type": "date", "format": {"type": "date", "args": ["%a, %b %e, %Y"]}},
{"id": "budget", "title": "Budget", "width": 90, "type": "integer", "format": "currency"}, {"id": "budget", "title": "Budget", "width": 90, "type": "integer", "format": {"type": "currency", "args": ["$", 0]}},
{"id": "gross", "title": "Gross", "width": 90, "type": "integer", "format": "currency"}, {"id": "gross", "title": "Gross", "width": 90, "type": "integer", "format": {"type": "currency", "args": ["$", 0]}},
{"id": "profit", "title": "Profit", "width": 90, "type": "integer", "format": "currency"}, {"id": "profit", "title": "Profit", "width": 90, "type": "integer", "format": {"type": "currency", "args": ["$", 0]}},
{"id": "rating", "title": "Rating", "width": 60, "type": "float"}, {"id": "rating", "title": "Rating", "width": 60, "type": "float", "format": {"type": "percent", "args": [10, 2]}},
{"id": "votes", "title": "Votes", "width": 60, "type": "integer"}, {"id": "votes", "title": "Votes", "width": 60, "type": "integer", "format": {"type": "percent", "args": [403824, 2]}},
{"id": "id", "title": "ID", "width": 90, "type": "string"}, {"id": "id", "title": "ID", "width": 90, "type": "string"},
{"id": "aspectratio", "title": "Aspect Ratio", "width": 90, "type": "float"}, {"id": "aspectratio", "title": "Aspect Ratio", "width": 90, "type": "float"},
{"id": "duration", "title": "Duration", "width": 90, "type": "float"}, {"id": "duration", "title": "Duration", "width": 90, "type": "float"},

View file

@ -1131,11 +1131,6 @@ var pandora = new Ox.App({
columnsRemovable: true, columnsRemovable: true,
columnsResizable: true, columnsResizable: true,
columnsVisible: 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', id: 'list',
request: function(data, callback) { request: function(data, callback) {
Ox.print('data, Query.toObject', data, Query.toObject()) Ox.print('data, Query.toObject', data, Query.toObject())
@ -2108,6 +2103,7 @@ var pandora = new Ox.App({
sections: function() { sections: function() {
var that = new Ox.Element(); var that = new Ox.Element();
var $sections = []; var $sections = [];
app.$ui.sectionLists = [];
$.each(app.user.ui.sections, function(i, id) { $.each(app.user.ui.sections, function(i, id) {
var menu = []; var menu = [];
if (id == 'my') { if (id == 'my') {
@ -2134,7 +2130,7 @@ var pandora = new Ox.App({
$section.$content.css({ $section.$content.css({
height: app.user.lists[id].length * 16 + 'px' height: app.user.lists[id].length * 16 + 'px'
}); });
var $list = new Ox.TextList({ app.$ui.sectionLists[i] = new Ox.TextList({
columns: [ columns: [
{ {
align: 'left', align: 'left',
@ -2153,13 +2149,25 @@ var pandora = new Ox.App({
}, },
{ {
align: 'left', 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: '+', operator: '+',
visible: true, visible: true,
width: 16 width: 16
}, },
{ {
align: 'left', align: 'left',
format: function(value) {
return $('<img>').attr({
src: 'static/oxjs/build/png/ox.ui.modern/symbol' +
(value ? 'Publish' : 'None') + '.png'
});
},
id: 'public', id: 'public',
operator: '+', operator: '+',
visible: true, visible: true,
@ -2174,19 +2182,8 @@ var pandora = new Ox.App({
} else { } else {
callback({data: {items: $.map(app.user.lists[id], function(v, i) { callback({data: {items: $.map(app.user.lists[id], function(v, i) {
return $.extend(v, { return $.extend(v, {
edit: $('<img>').attr({ query: v.query,
src: 'static/oxjs/build/png/ox.ui.modern/symbolNone.png' public: v.public,
}).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'
}),
items: v.items ? v.items.length.toString() : (v.title == '1960s' || v.title == 'All Movies' ? '?' : '100') items: v.items ? v.items.length.toString() : (v.title == '1960s' || v.title == 'All Movies' ? '?' : '100')
}); });
})}}); })}});
@ -2202,21 +2199,14 @@ var pandora = new Ox.App({
width: app.user.ui.sidebarSize + 'px', width: app.user.ui.sidebarSize + 'px',
height: app.user.lists[id].length * 16 + 'px' height: app.user.lists[id].length * 16 + 'px'
}) })
.bindEvent('select', function(event, data) {
app.$ui.sectionLists.forEach(function($list, i_) {
if (i != i_) {
$list.options('selected', []);
}
});
})
.appendTo($section.$content); .appendTo($section.$content);
/*
} else {
$section.$content.append(
$('<div>').css({ height: '20px' }).append(
$('<div>').css({ float: 'left', width: '16px', height: '16px', margin: '1px'}).append(
$('<img>').attr({ src: 'static/oxjs/build/png/ox.ui.modern/iconFind.png' }).css({ width: '16px', height: '16px', border: 0, background: 'rgb(64, 64, 64)', WebkitBorderRadius: '2px' })
)
).append(
$('<div>').css({ float: 'left', width: '122px', height: '14px', margin: '2px' }).html('Foo')
).append(
$('<div>').css({ float: 'left', width: '40px', height: '14px', margin: '2px', textAlign: 'right' }).html('23')
)
);
} */
}); });
$.each($sections, function(i, $section) { $.each($sections, function(i, $section) {
that.append($section); that.append($section);