support urls like '0xdb.org/Inception/1::'
This commit is contained in:
parent
f4d99bdcb3
commit
7f426d42c1
2 changed files with 21 additions and 6 deletions
|
@ -90,12 +90,13 @@ pandora.URL = (function() {
|
|||
view = view ? view[0]
|
||||
: position ? pandora.user.ui.videoView
|
||||
: pandora.user.ui.itemView;
|
||||
pandora.UI.set({
|
||||
pandora.UI.set(Ox.extend({
|
||||
section: 'items',
|
||||
item: item,
|
||||
itemView: view
|
||||
});
|
||||
Ox.print('POSITION', position)
|
||||
}, ['player', 'timeline'].indexOf(view) > -1 ? {
|
||||
videoView: view
|
||||
} : {}));
|
||||
if (position) {
|
||||
split[length - 1] = position[0].split('-').map(function(point, i) {
|
||||
// fixme: this is duplicated, see Ox.VideoPlayer() parsePositionInput()
|
||||
|
|
|
@ -6,9 +6,23 @@ pandora.ui.item = function() {
|
|||
keys: []
|
||||
}, pandora.user.level == 'admin' && pandora.user.ui.itemView == 'info' ? 0 : -1, function(result) {
|
||||
if (result.status.code != 200) {
|
||||
pandora.$ui.contentPanel.replaceElement(1,
|
||||
Ox.Element().html(
|
||||
'The '+pandora.site.itemName.singular+' you are looking for does not exist.'));
|
||||
// fixme: this is quite a hack
|
||||
pandora.api.find({
|
||||
query: {
|
||||
conditions: [{key: 'title', value: decodeURI(pandora.user.ui.item), operator: '='}],
|
||||
operator: ''
|
||||
},
|
||||
keys: ['id']
|
||||
}, function(result) {
|
||||
if (result.data.items.length) {
|
||||
pandora.user.ui.item = '';
|
||||
pandora.URL.set(result.data.items[0].id);
|
||||
} else {
|
||||
pandora.$ui.contentPanel.replaceElement(1,
|
||||
Ox.Element().html(
|
||||
'Sorry, we can\'t find the ' + pandora.site.itemName.singular + ' you\'re looking for.' + '<br/>' + JSON.stringify(result.data)));
|
||||
}
|
||||
});
|
||||
} else if (!result.data.rendered &&
|
||||
['clips', 'map',
|
||||
'player', 'timeline'].indexOf(pandora.user.ui.itemView)>-1) {
|
||||
|
|
Loading…
Reference in a new issue