small bugfixes

This commit is contained in:
rolux 2011-08-18 11:32:47 +00:00
parent 784c6fdba7
commit d897cb13bd
4 changed files with 47 additions and 13 deletions

View file

@ -1,7 +1,7 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.ui.contentPanel = function() {
var that = Ox.SplitPanel({
elements: pandora.user.ui.item == '' ? [
elements: !pandora.user.ui.item ? [
{
collapsed: !pandora.user.ui.showGroups,
collapsible: true,

View file

@ -34,13 +34,16 @@ pandora.ui.group = function(id, query) {
columnsVisible: true,
id: 'group_' + id,
items: function(data, callback) {
//Ox.print('sending request', data)
//if (pandora.user.ui.showGroups) {
delete data.keys;
//alert(id + " pandora.Query.toObject " + JSON.stringify(pandora.Query.toObject(id)) + ' ' + JSON.stringify(data))
return pandora.api.find($.extend(data, {
group: id,
query: pandora.Query.toObject(id)
}), callback);
//} else {
// callback({data: {items: data.keys ? [] : 0}});
//}
},
scrollbarVisible: true,
selected: query ? $.map(query.conditions, function(v) {

View file

@ -293,7 +293,7 @@ pandora.ui.item = function() {
streams = {};
video.height = video.resolutions[0];
video.width = parseInt(video.height * video.aspectRatio / 2) * 2;
video.resolutions.forEach(function(profile) {
video.resolutions.forEach(function(resolution) {
streams[resolution] = video.baseUrl + '/' + resolution + 'p.' + format;
});
$.each(pandora.site.layers, function(i, layer) {

View file

@ -112,7 +112,38 @@ pandora.ui.list = function() { // fixme: remove view argument
unique: 'id'
});
} else if (view == 'info') {
that = Ox.Element().css({margin: '16px'}).html(view + ' results view still missing.');
that = Ox.IconList({
borderRadius: pandora.user.ui.icons == 'posters' ? 0 : 16,
defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1,
id: 'list',
item: function(data, sort, size) {
var icons = pandora.user.ui.icons,
ratio = icons == 'posters' ? data.poster.width / data.poster.height : 1;
size = size || 128;
return {
height: ratio <= 1 ? size : size / ratio,
id: data.id,
info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key],
title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''),
url: icons == 'posters'
? '/' + data.id + '/poster' + size + '.jpg'
: '/' + data.id + '/icon' + size + '.jpg',
width: ratio >= 1 ? size : size * ratio
};
},
items: function(data, callback) {
//Ox.print('data, pandora.Query.toObject', data, pandora.Query.toObject())
pandora.api.find($.extend(data, {
query: pandora.Query.toObject()
}), callback);
},
keys: ['director', 'id', 'poster', 'title', 'year'],
orientation: 'vertical',
selected: pandora.user.ui.lists[pandora.user.ui.list].selected,
size: 128,
sort: pandora.user.ui.lists[pandora.user.ui.list].sort,
unique: 'id'
});
} else if (view == 'clips') {
that = Ox.Element().css({margin: '16px'}).html(view + ' results view still missing.');
} else if (view == 'timelines') {
@ -218,7 +249,7 @@ pandora.ui.list = function() { // fixme: remove view argument
size = size || 128;
var width = data.aspectRatio < fixedRatio ? size : size * data.aspectRatio / fixedRatio,
height = width / data.aspectRatio,
url = '/' + data.item + '/' + width + '/' + data['in'] + '.jpg';
url = '/' + data.item + '/' + height + 'p' + data['in'] + '.jpg';
return {
height: height,
id: data.id,
@ -300,12 +331,12 @@ pandora.ui.list = function() { // fixme: remove view argument
['list', 'icons'].indexOf(view) > -1 && that.bind({
dragstart: function(e) {
pandora.$ui.folderList.forEach(function($list, i) {
Ox.forEach(pandora.$ui.folderList, function($list, i) {
$list.addClass('OxDrop');
});
},
dragend: function(e) {
pandora.$ui.folderList.forEach(function($list, i) {
Ox.forEach(pandora.$ui.folderList, function($list, i) {
$list.removeClass('OxDrop');
});
}