[missions] open mission from permalink

This commit is contained in:
fkloft 2015-04-13 20:56:15 +02:00
parent 90eb283f78
commit d25b7c5dd7

View File

@ -251,7 +251,8 @@ window.plugin.missions = {
callback(mission); callback(mission);
}, function() { }, function() {
console.log('Error loading mission data', guid, arguments); console.error('Error loading mission data: ' + guid + ", " + Array.prototype.slice.call(arguments));
if (errorcallback) { if (errorcallback) {
errorcallback(error); errorcallback(error);
} }
@ -421,7 +422,7 @@ window.plugin.missions = {
title.href = perma; title.href = perma;
title.addEventListener('click', function(ev) { title.addEventListener('click', function(ev) {
renderPortalDetails(waypoint.portal.guid); selectPortalByLatLng(lat, lng);
ev.preventDefault(); ev.preventDefault();
return false; return false;
}, false); }, false);
@ -735,6 +736,12 @@ window.plugin.missions = {
window.pluginCreateHook('portalMissionsLoaded'); window.pluginCreateHook('portalMissionsLoaded');
window.pluginCreateHook('missionFinished'); window.pluginCreateHook('missionFinished');
window.pluginCreateHook('waypointFinished'); window.pluginCreateHook('waypointFinished');
var match = location.pathname.match(/\/mission\/([0-9a-z.]+)/);
if(match && match[1]) {
var mid = match[1];
this.openMission(mid);
}
} }
}; };