merge changes from pandora

This commit is contained in:
j 2010-09-13 16:19:21 +02:00
commit 7efd182088

View file

@ -409,12 +409,13 @@ app.constructGroups = function() {
} }
], ],
id: 'group_' + id, id: 'group_' + id,
request: function(options) { request: function(data, callback) {
delete options.keys; Ox.print('sending request', data)
app.api.find($.extend(options, { delete data.keys;
return app.api.find($.extend(data, {
group: id, group: id,
query: app.Query.toObject() query: app.Query.toObject()
}), options.callback); }), callback);
}, },
sort: [ sort: [
{ {
@ -436,21 +437,21 @@ app.constructGroups = function() {
}); });
query = app.Query.toObject(); query = app.Query.toObject();
app.$ui.list.options({ app.$ui.list.options({
request: function(options) { request: function(data, callback) {
return app.api.find($.extend(options, { return app.api.find($.extend(data, {
query: query query: query
}), options.callback); }), callback);
} }
}); });
$.each(app.ui.groups, function(i_, group_) { $.each(app.ui.groups, function(i_, group_) {
if (i_ != i) { if (i_ != i) {
app.$ui.groups[i_].options({ app.$ui.groups[i_].options({
request: function(options) { request: function(data, callback) {
delete options.keys; delete data.keys;
return app.api.find($.extend(options, { return app.api.find($.extend(data, {
group: group_.id, group: group_.id,
query: app.Query.toObject(group_.id) query: app.Query.toObject(group_.id)
}), options.callback); }), callback);
} }
}); });
} }
@ -464,6 +465,7 @@ app.constructGroups = function() {
size: width.list, size: width.list,
title: title title: title
}; };
Ox.print('--OK--');
}); });
return $groups; return $groups;
} }
@ -504,11 +506,11 @@ app.constructList = function(view) {
columnsMovable: true, columnsMovable: true,
columnsRemovable: true, columnsRemovable: true,
id: 'list', id: 'list',
request: function(options) { request: function(data, callback) {
Ox.print('options, Query.toObject', options, app.Query.toObject()) Ox.print('data, Query.toObject', data, app.Query.toObject())
app.api.find($.extend(options, { app.api.find($.extend(data, {
query: app.Query.toObject() query: app.Query.toObject()
}), options.callback); }), callback);
}, },
sort: app.user.ui.sort sort: app.user.ui.sort
}); });
@ -529,16 +531,16 @@ app.constructList = function(view) {
id: data['id'], id: data['id'],
info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key], info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key],
title: data.title + (data.director ? ' (' + data.director + ')' : ''), title: data.title + (data.director ? ' (' + data.director + ')' : ''),
url: 'http://0xdb.org/' + data.id + '/poster.' + size + '.' + 'jpg', url: data.poster.url.replace(/jpg/, size + '.jpg'),
width: width width: width
}; };
}, },
keys: keys, keys: keys,
request: function(options) { request: function(data, callback) {
Ox.print('options, Query.toObject', options, app.Query.toObject()) Ox.print('data, Query.toObject', data, app.Query.toObject())
app.api.find($.extend(options, { app.api.find($.extend(data, {
query: app.Query.toObject() query: app.Query.toObject()
}), options.callback); }), callback);
}, },
size: 128, size: 128,
sort: app.user.ui.sort, sort: app.user.ui.sort,
@ -597,7 +599,7 @@ app.constructList = function(view) {
app.$ui.previewDialog.resize(dialogWidth, dialogHeight, function() { app.$ui.previewDialog.resize(dialogWidth, dialogHeight, function() {
app.$ui.previewImage app.$ui.previewImage
.attr({ .attr({
src: item.poster.url, src: item.poster.url.replace(/jpg/, 'large.jpg'),
}) })
.one('load', function() { .one('load', function() {
app.$ui.previewImage app.$ui.previewImage
@ -616,7 +618,7 @@ app.constructList = function(view) {
} else { } else {
app.$ui.previewImage = $('<img>') app.$ui.previewImage = $('<img>')
.attr({ .attr({
src: item.poster.url src: item.poster.url.replace(/jpg/, 'large.jpg')
}) })
.css({ .css({
position: 'absolute', position: 'absolute',
@ -1460,20 +1462,20 @@ app.constructToolbar = function() {
$.each(groups, function(i, group) { $.each(groups, function(i, group) {
groups[i].query.conditions = []; groups[i].query.conditions = [];
app.$ui.groups[i].options({ app.$ui.groups[i].options({
request: function(options) { request: function(data, callback) {
delete options.keys; delete data.keys;
return app.api.find($.extend(options, { return app.api.find($.extend(data, {
group: group.id, group: group.id,
query: app.Query.toObject(group.id) query: app.Query.toObject(group.id)
}), options.callback); }), callback);
} }
}); });
}); });
app.$ui.list.options({ app.$ui.list.options({
request: function(options) { request: function(data, callback) {
return app.api.find($.extend(options, { return app.api.find($.extend(data, {
query: query = app.Query.toObject() query: query = app.Query.toObject()
}), options.callback); }), callback);
} }
}); });
location.hash = app.Query.toString(query); location.hash = app.Query.toString(query);