some improvements to handling of @foo map urls

This commit is contained in:
rolux 2011-10-08 09:57:02 +00:00
parent 551be76c8b
commit a4d0ae4067
4 changed files with 22 additions and 6 deletions

View file

@ -26,6 +26,18 @@ pandora.URL = (function() {
state.view = pandora.user.ui.itemView; state.view = pandora.user.ui.itemView;
} }
} }
if (!keys || keys.indexOf('mapSelection') > -1) {
state.item = pandora.user.ui.item;
state.view = 'map';
state.span = pandora.user.ui.mapSelection
? '@' + pandora.user.ui.mapSelection : '';
}
if (!keys || keys.indexOf('mapFind') > -1) {
state.item = pandora.user.ui.item;
state.view = 'map';
state.span = pandora.user.ui.mapFind
? '@' + pandora.user.ui.mapFind : '';
}
if (!keys || keys.filter(function(key) { if (!keys || keys.filter(function(key) {
return /^videoPoints/.test(key); return /^videoPoints/.test(key);
}).length) { }).length) {
@ -156,13 +168,13 @@ pandora.URL = (function() {
} else if (state.view == 'map') { } else if (state.view == 'map') {
// fixme: this doesn't handle map coordinates // fixme: this doesn't handle map coordinates
if (state.span[0] != '@') { if (state.span[0] != '@') {
pandora.user.ui.mapSelection = state.span; //pandora.user.ui.mapSelection = state.span;
//set['mapSelection'] = state.span; set['mapSelection'] = state.span;
//set['mapFind'] = ''; set['mapFind'] = '';
} else { } else {
pandora.user.ui.mapFind = state.span.substr(1); //pandora.user.ui.mapFind = state.span.substr(1);
//set['mapFind'] = state.span.substr(1); set['mapFind'] = state.span.substr(1);
//set['mapSelection'] = ''; set['mapSelection'] = '';
} }
} }
} }

View file

@ -1,5 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript // vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.ui.clipPlayer = function() { pandora.ui.clipPlayer = function() {
// FIXME: is clipPlayer the best name for this?
var that = Ox.VideoPlayer({ var that = Ox.VideoPlayer({
controlsBottom: ['play', 'previous', 'next', 'volume'], controlsBottom: ['play', 'previous', 'next', 'volume'],
controlsTop: ['fullscreen', 'scale'], controlsTop: ['fullscreen', 'scale'],

View file

@ -249,6 +249,8 @@ pandora.ui.navigationView = function(type, videoRatio) {
} }
}); });
} }
Ox.print('MAP SELECTION', id, data)
pandora.UI.set({mapSelection: id ? data.name : ''});
} }
function updateStatusbar(items) { function updateStatusbar(items) {

View file

@ -519,6 +519,7 @@ pandora.getMetadataByIdOrName = function(item, view, str, callback) {
} else { } else {
getId(canBePlace ? 'place' : '', function(id) { getId(canBePlace ? 'place' : '', function(id) {
if (id) { if (id) {
Ox.print('found place id', id)
callback(id, 'map'); callback(id, 'map');
} else { } else {
getId(canBeEvent ? 'event' : '', function(id) { getId(canBeEvent ? 'event' : '', function(id) {