updating map/calendar item views

This commit is contained in:
rolux 2011-10-30 21:05:57 +00:00
parent ae28b99ae8
commit 908e468f46
6 changed files with 47 additions and 26 deletions

View file

@ -13,6 +13,7 @@
for items of a rights level up to and including x
*/
"capabilities": {
// "canClickMap": {"friend": true, "staff": true, "admin": true},
"canDeleteItems": {"admin": true},
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4},
"canEditMetadata": {"staff": true, "admin": true},

View file

@ -226,7 +226,7 @@ pandora.URL = (function() {
});
if (!pandora.$ui.appPanel && state.item && find) {
// on page load, if item is set and there is or was a query,
// on page load, if item is set and there was a query,
// we have to check if the item actually matches the query,
// and otherwise reset find
pandora.api.find({

View file

@ -6,9 +6,9 @@ pandora.ui.item = function() {
pandora.api.get({
id: pandora.user.ui.item,
keys: ['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1 ?
[ 'cuts', 'duration', 'layers', 'parts', 'rendered', 'rightslevel', 'size', 'title', 'videoRatio'] : []
}, pandora.user.level == 'admin' && pandora.user.ui.itemView == 'info' ? 0 : -1, function(result) {
keys: ['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1
? [ 'cuts', 'director', 'duration', 'layers', 'parts', 'rendered', 'rightslevel', 'size', 'title', 'videoRatio', 'year'] : []
}, pandora.user.ui.itemView == 'info' && pandora.site.capabilities.canEditMetadata[pandora.user.level] ? 0 : -1, function(result) {
if (result.status.code == 200) {
// fixme: can the history state title get updated too?
@ -27,6 +27,14 @@ pandora.ui.item = function() {
);
}*/
pandora.$ui.itemTitle
.options({
title: '<b>' + result.data.title
+ (result.data.director ? ' (' + result.data.director.join(', ') + ')' : '')
+ (result.data.year ? ' ' + result.data.year : '') + '</b>'
})
.show();
if (['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1) {
// fixme: layers have value, subtitles has text?
var subtitles = result.data.layers.subtitles

View file

@ -15,21 +15,25 @@ pandora.ui.navigationView = function(type, videoRatio) {
$element = Ox.Element(),
$itemIcon = $('<img>')
$itemIcon = type == 'map' ? $('<img>')
.addClass('OxFlag')
.attr({
src: type == 'map'
? Ox.getImageByGeoname('icon', 16, '')
: '/static/png/icon16.png'
src: Ox.getImageByGeoname('icon', 16, '')
})
.css({float: 'left', margin: '4px'}),
.css({float: 'left', margin: '2px'}) : '',
$itemLabel = Ox.Label({
textAlign: 'center',
title: '',
width: 96 + Ox.UI.SCROLLBAR_SIZE
width: 0 // 76 + Ox.UI.SCROLLBAR_SIZE
})
.css({
position: 'absolute',
left: 4 + !!ui.item * 20 + (type == 'map') * 20 + 'px',
top: '4px',
right: '24px',
width: 'auto'
})
.css({float: 'left', margin: '4px 0 4px 0'})
.bindEvent({
singleclick: function() {
$element[type == 'map' ? 'panToPlace' : 'panToEvent']();
@ -43,7 +47,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
title: 'close',
type: 'image'
})
.css({float: 'left', margin: '4px'})
.css({float: 'right', margin: '2px'})
.bindEvent({
click: function() {
$element.options({selected: null});
@ -52,6 +56,8 @@ pandora.ui.navigationView = function(type, videoRatio) {
}),
$item = $('<div>')
.css({padding: '2px'})
.append(ui.item ? pandora.$ui.sortMenu = pandora.ui.sortMenu() : '')
.append($itemIcon)
.append($itemLabel)
.append($itemButton),
@ -94,9 +100,8 @@ pandora.ui.navigationView = function(type, videoRatio) {
orientation: 'vertical'
})
.bindEvent({
resize: function(data) {
resizeToolbar(data.size);
$list.size();
resize: function() {
$list.size()
},
resizeend: function(data) {
var size = data.size;
@ -113,7 +118,6 @@ pandora.ui.navigationView = function(type, videoRatio) {
// finished, causing the list size to be off by one
setTimeout(function() {
$element['resize' + Ox.toTitleCase(type)]();
resizeToolbar(size);
$list.size();
}, 0);
});
@ -142,6 +146,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
that.replaceElement(0,
$element = Ox.Map({
// clickable: pandora.site.capabilities.canClickMap[pandora.user.level],
find: ui.mapFind,
// 20 menu + 24 toolbar + 1 resizebar + 16 statusbar
height: window.innerHeight - ui.showGroups * ui.groupsSize - 61,
@ -218,14 +223,9 @@ pandora.ui.navigationView = function(type, videoRatio) {
}
resizeToolbar(listSize);
updateToolbar();
updateStatusbar();
function resizeToolbar(width) {
$itemLabel.options({width: width - 48});
}
function selectItem(data) {
var id = data.id || '';
updateToolbar(id ? data : null);

View file

@ -48,13 +48,12 @@ pandora.ui.rightPanel = function() {
pandora.$ui.player.options({width: data.size});
} else if (pandora.user.ui.itemView == 'timeline') {
pandora.$ui.editor.options({width: data.size});
} else if (pandora.user.ui.listView == 'map') {
pandora.$ui.map.resizeMap();
} else if (pandora.user.ui.listView == 'calendar') {
pandora.$ui.calendar.resizeCalendar();
}
}
},
pandora_itemview: function(data) {
if (pandora.isClipView() != pandora.isClipView(data.previousValue)) {
that.replaceElement(0, pandora.$ui.toolbar = pandora.ui.toolbar());
}
}
});
}

View file

@ -18,6 +18,19 @@ pandora.ui.toolbar = function() {
).append(
pandora.$ui.orderButton = pandora.ui.orderButton()
);
ui.item && that.append(
pandora.$ui.itemTitle = Ox.Label({
textAlign: 'center'
})
.css({
position: 'absolute',
left: '236px',
top: '4px',
right: (ui._list ? 324 : 310) + 'px',
width: 'auto'
})
.hide()
);
that.append(
pandora.$ui.findElement = pandora.ui.findElement()
);