add timelines view (draft)

This commit is contained in:
rolux 2011-08-19 06:40:19 +00:00
parent e7320cb890
commit a2d46c7b8b
4 changed files with 37 additions and 11 deletions

View file

@ -544,6 +544,7 @@
"videoScale": "fit",
"videoMuted": false,
"videoSize": "small",
"videoView": "player",
"videoVolume": 1
},
"username": ""

View file

@ -123,16 +123,29 @@ pandora.ui.list = function() { // fixme: remove view argument
item: function(data, sort, size) {
var icons = pandora.user.ui.icons,
ratio = icons == 'posters' ? data.poster.width / data.poster.height : 1;
size = size || 128;
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
icon: {
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
},
info: {
css: {
margin: '-4px 0 0 -4px'
},
element: Ox.BlockVideoTimeline,
id: data.id,
options: {
duration: data.duration,
getImageURL: '/' + data.id + '/timeline16p.png'
}
}
};
},
items: function(data, callback) {
@ -189,6 +202,9 @@ pandora.ui.list = function() { // fixme: remove view argument
sort: pandora.user.ui.lists[pandora.user.ui.list].sort,
unique: 'id'
}).bindEvent({
init: function(data) {
pandora.$ui.total.html(pandora.ui.status('total', data));
},
open: function(data) {
var id = data.ids[0],
item = that.value(id, 'item'),

View file

@ -79,13 +79,18 @@ pandora.ui.mainMenu = function() {
}) }
] },
{},
{ id: 'openmovie', title: ['Open ' + pandora.site.itemName.singular, 'Open ' + pandora.site.itemName.plural], disabled: true, items: [
{ id: 'openmovie', title: ['Open ' + pandora.site.itemName.singular, 'Open ' + pandora.site.itemName.plural], items: [
{ group: 'movieview', min: 1, max: 1, items: $.map(pandora.site.itemViews, function(view, i) {
return Ox.extend({
checked: pandora.user.ui.itemView == view.id,
}, view);
}) },
]},
{ id: 'openvideo', title: 'Open Video Links', items: [
{ group: 'videoview', min: 1, max: 1, items: ['player', 'editor'].map(function(view) {
return {id: view, title: Ox.toTitleCase(view), checked: pandora.user.ui.videoView == view};
}) }
] },
{},
{ id: 'lists', title: 'Hide Lists', keyboard: 'shift l' },
{ id: 'info', title: 'Hide Info', keyboard: 'shift i' },

View file

@ -39,7 +39,11 @@ pandora.ui.rightPanel = function() {
if (!pandora.user.ui.item) {
pandora.resizeGroups(data);
pandora.$ui.list.size();
if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'map') {
if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'timelines') {
pandora.$ui.list.options({
width: data
});
} else if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'map') {
pandora.$ui.map.resizeMap();
}
} else {