forked from 0x2620/pandora
updating map/calendar item views
This commit is contained in:
parent
ae28b99ae8
commit
908e468f46
6 changed files with 47 additions and 26 deletions
|
@ -13,6 +13,7 @@
|
||||||
for items of a rights level up to and including x
|
for items of a rights level up to and including x
|
||||||
*/
|
*/
|
||||||
"capabilities": {
|
"capabilities": {
|
||||||
|
// "canClickMap": {"friend": true, "staff": true, "admin": true},
|
||||||
"canDeleteItems": {"admin": true},
|
"canDeleteItems": {"admin": true},
|
||||||
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4},
|
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4},
|
||||||
"canEditMetadata": {"staff": true, "admin": true},
|
"canEditMetadata": {"staff": true, "admin": true},
|
||||||
|
|
|
@ -226,7 +226,7 @@ pandora.URL = (function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!pandora.$ui.appPanel && state.item && find) {
|
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,
|
// we have to check if the item actually matches the query,
|
||||||
// and otherwise reset find
|
// and otherwise reset find
|
||||||
pandora.api.find({
|
pandora.api.find({
|
||||||
|
|
|
@ -6,9 +6,9 @@ pandora.ui.item = function() {
|
||||||
|
|
||||||
pandora.api.get({
|
pandora.api.get({
|
||||||
id: pandora.user.ui.item,
|
id: pandora.user.ui.item,
|
||||||
keys: ['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1 ?
|
keys: ['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1
|
||||||
[ 'cuts', 'duration', 'layers', 'parts', 'rendered', 'rightslevel', 'size', 'title', 'videoRatio'] : []
|
? [ 'cuts', 'director', 'duration', 'layers', 'parts', 'rendered', 'rightslevel', 'size', 'title', 'videoRatio', 'year'] : []
|
||||||
}, pandora.user.level == 'admin' && pandora.user.ui.itemView == 'info' ? 0 : -1, function(result) {
|
}, pandora.user.ui.itemView == 'info' && pandora.site.capabilities.canEditMetadata[pandora.user.level] ? 0 : -1, function(result) {
|
||||||
|
|
||||||
if (result.status.code == 200) {
|
if (result.status.code == 200) {
|
||||||
// fixme: can the history state title get updated too?
|
// 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) {
|
if (['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1) {
|
||||||
// fixme: layers have value, subtitles has text?
|
// fixme: layers have value, subtitles has text?
|
||||||
var subtitles = result.data.layers.subtitles
|
var subtitles = result.data.layers.subtitles
|
||||||
|
|
|
@ -15,21 +15,25 @@ pandora.ui.navigationView = function(type, videoRatio) {
|
||||||
|
|
||||||
$element = Ox.Element(),
|
$element = Ox.Element(),
|
||||||
|
|
||||||
$itemIcon = $('<img>')
|
$itemIcon = type == 'map' ? $('<img>')
|
||||||
.addClass('OxFlag')
|
.addClass('OxFlag')
|
||||||
.attr({
|
.attr({
|
||||||
src: type == 'map'
|
src: Ox.getImageByGeoname('icon', 16, '')
|
||||||
? Ox.getImageByGeoname('icon', 16, '')
|
|
||||||
: '/static/png/icon16.png'
|
|
||||||
})
|
})
|
||||||
.css({float: 'left', margin: '4px'}),
|
.css({float: 'left', margin: '2px'}) : '',
|
||||||
|
|
||||||
$itemLabel = Ox.Label({
|
$itemLabel = Ox.Label({
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
title: '',
|
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({
|
.bindEvent({
|
||||||
singleclick: function() {
|
singleclick: function() {
|
||||||
$element[type == 'map' ? 'panToPlace' : 'panToEvent']();
|
$element[type == 'map' ? 'panToPlace' : 'panToEvent']();
|
||||||
|
@ -43,7 +47,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
|
||||||
title: 'close',
|
title: 'close',
|
||||||
type: 'image'
|
type: 'image'
|
||||||
})
|
})
|
||||||
.css({float: 'left', margin: '4px'})
|
.css({float: 'right', margin: '2px'})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
click: function() {
|
click: function() {
|
||||||
$element.options({selected: null});
|
$element.options({selected: null});
|
||||||
|
@ -52,6 +56,8 @@ pandora.ui.navigationView = function(type, videoRatio) {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
$item = $('<div>')
|
$item = $('<div>')
|
||||||
|
.css({padding: '2px'})
|
||||||
|
.append(ui.item ? pandora.$ui.sortMenu = pandora.ui.sortMenu() : '')
|
||||||
.append($itemIcon)
|
.append($itemIcon)
|
||||||
.append($itemLabel)
|
.append($itemLabel)
|
||||||
.append($itemButton),
|
.append($itemButton),
|
||||||
|
@ -94,9 +100,8 @@ pandora.ui.navigationView = function(type, videoRatio) {
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
resize: function(data) {
|
resize: function() {
|
||||||
resizeToolbar(data.size);
|
$list.size()
|
||||||
$list.size();
|
|
||||||
},
|
},
|
||||||
resizeend: function(data) {
|
resizeend: function(data) {
|
||||||
var size = data.size;
|
var size = data.size;
|
||||||
|
@ -113,7 +118,6 @@ pandora.ui.navigationView = function(type, videoRatio) {
|
||||||
// finished, causing the list size to be off by one
|
// finished, causing the list size to be off by one
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$element['resize' + Ox.toTitleCase(type)]();
|
$element['resize' + Ox.toTitleCase(type)]();
|
||||||
resizeToolbar(size);
|
|
||||||
$list.size();
|
$list.size();
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
@ -142,6 +146,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
|
||||||
|
|
||||||
that.replaceElement(0,
|
that.replaceElement(0,
|
||||||
$element = Ox.Map({
|
$element = Ox.Map({
|
||||||
|
// clickable: pandora.site.capabilities.canClickMap[pandora.user.level],
|
||||||
find: ui.mapFind,
|
find: ui.mapFind,
|
||||||
// 20 menu + 24 toolbar + 1 resizebar + 16 statusbar
|
// 20 menu + 24 toolbar + 1 resizebar + 16 statusbar
|
||||||
height: window.innerHeight - ui.showGroups * ui.groupsSize - 61,
|
height: window.innerHeight - ui.showGroups * ui.groupsSize - 61,
|
||||||
|
@ -218,14 +223,9 @@ pandora.ui.navigationView = function(type, videoRatio) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resizeToolbar(listSize);
|
|
||||||
updateToolbar();
|
updateToolbar();
|
||||||
updateStatusbar();
|
updateStatusbar();
|
||||||
|
|
||||||
function resizeToolbar(width) {
|
|
||||||
$itemLabel.options({width: width - 48});
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectItem(data) {
|
function selectItem(data) {
|
||||||
var id = data.id || '';
|
var id = data.id || '';
|
||||||
updateToolbar(id ? data : null);
|
updateToolbar(id ? data : null);
|
||||||
|
|
|
@ -48,13 +48,12 @@ pandora.ui.rightPanel = function() {
|
||||||
pandora.$ui.player.options({width: data.size});
|
pandora.$ui.player.options({width: data.size});
|
||||||
} else if (pandora.user.ui.itemView == 'timeline') {
|
} else if (pandora.user.ui.itemView == 'timeline') {
|
||||||
pandora.$ui.editor.options({width: data.size});
|
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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,19 @@ pandora.ui.toolbar = function() {
|
||||||
).append(
|
).append(
|
||||||
pandora.$ui.orderButton = pandora.ui.orderButton()
|
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(
|
that.append(
|
||||||
pandora.$ui.findElement = pandora.ui.findElement()
|
pandora.$ui.findElement = pandora.ui.findElement()
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue