support urls like '0xdb.org/Inception/1::'

This commit is contained in:
rolux 2011-08-24 21:57:07 +00:00
parent 6c3563455f
commit 7e7e2c95df
2 changed files with 21 additions and 6 deletions

View file

@ -90,12 +90,13 @@ pandora.URL = (function() {
view = view ? view[0] view = view ? view[0]
: position ? pandora.user.ui.videoView : position ? pandora.user.ui.videoView
: pandora.user.ui.itemView; : pandora.user.ui.itemView;
pandora.UI.set({ pandora.UI.set(Ox.extend({
section: 'items', section: 'items',
item: item, item: item,
itemView: view itemView: view
}); }, ['player', 'timeline'].indexOf(view) > -1 ? {
Ox.print('POSITION', position) videoView: view
} : {}));
if (position) { if (position) {
split[length - 1] = position[0].split('-').map(function(point, i) { split[length - 1] = position[0].split('-').map(function(point, i) {
// fixme: this is duplicated, see Ox.VideoPlayer() parsePositionInput() // fixme: this is duplicated, see Ox.VideoPlayer() parsePositionInput()

View file

@ -6,9 +6,23 @@ pandora.ui.item = function() {
keys: [] keys: []
}, pandora.user.level == 'admin' && pandora.user.ui.itemView == 'info' ? 0 : -1, function(result) { }, pandora.user.level == 'admin' && pandora.user.ui.itemView == 'info' ? 0 : -1, function(result) {
if (result.status.code != 200) { if (result.status.code != 200) {
// 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, pandora.$ui.contentPanel.replaceElement(1,
Ox.Element().html( Ox.Element().html(
'The '+pandora.site.itemName.singular+' you are looking for does not exist.')); 'Sorry, we can\'t find the ' + pandora.site.itemName.singular + ' you\'re looking for.' + '<br/>' + JSON.stringify(result.data)));
}
});
} else if (!result.data.rendered && } else if (!result.data.rendered &&
['clips', 'map', ['clips', 'map',
'player', 'timeline'].indexOf(pandora.user.ui.itemView)>-1) { 'player', 'timeline'].indexOf(pandora.user.ui.itemView)>-1) {