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", "videoScale": "fit",
"videoMuted": false, "videoMuted": false,
"videoSize": "small", "videoSize": "small",
"videoView": "player",
"videoVolume": 1 "videoVolume": 1
}, },
"username": "" "username": ""

View file

@ -123,16 +123,29 @@ pandora.ui.list = function() { // fixme: remove view argument
item: function(data, sort, size) { item: function(data, sort, size) {
var icons = pandora.user.ui.icons, var icons = pandora.user.ui.icons,
ratio = icons == 'posters' ? data.poster.width / data.poster.height : 1; ratio = icons == 'posters' ? data.poster.width / data.poster.height : 1;
size = size || 128; size = 128;
return { return {
height: ratio <= 1 ? size : size / ratio, icon: {
id: data.id, height: ratio <= 1 ? size : size / ratio,
info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key], id: data.id,
title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''), info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key],
url: icons == 'posters' title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''),
? '/' + data.id + '/poster' + size + '.jpg' url: icons == 'posters'
: '/' + data.id + '/icon' + size + '.jpg', ? '/' + data.id + '/poster' + size + '.jpg'
width: ratio >= 1 ? size : size * ratio : '/' + 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) { 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, sort: pandora.user.ui.lists[pandora.user.ui.list].sort,
unique: 'id' unique: 'id'
}).bindEvent({ }).bindEvent({
init: function(data) {
pandora.$ui.total.html(pandora.ui.status('total', data));
},
open: function(data) { open: function(data) {
var id = data.ids[0], var id = data.ids[0],
item = that.value(id, 'item'), 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) { { group: 'movieview', min: 1, max: 1, items: $.map(pandora.site.itemViews, function(view, i) {
return Ox.extend({ return Ox.extend({
checked: pandora.user.ui.itemView == view.id, checked: pandora.user.ui.itemView == view.id,
}, view); }, 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: 'lists', title: 'Hide Lists', keyboard: 'shift l' },
{ id: 'info', title: 'Hide Info', keyboard: 'shift i' }, { id: 'info', title: 'Hide Info', keyboard: 'shift i' },

View file

@ -39,7 +39,11 @@ pandora.ui.rightPanel = function() {
if (!pandora.user.ui.item) { if (!pandora.user.ui.item) {
pandora.resizeGroups(data); pandora.resizeGroups(data);
pandora.$ui.list.size(); 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(); pandora.$ui.map.resizeMap();
} }
} else { } else {