Merge master

This commit is contained in:
Jeremy Lindgren 2013-05-01 12:53:59 -05:00
commit 55be1dd2af
6 changed files with 717 additions and 695 deletions

View File

@ -202,8 +202,8 @@ def copytree(src, dst, symlinks=False, ignore=None):
# if we're building mobile too # if we're building mobile too
if buildMobile: if buildMobile:
if buildMobile not in ['debug','release']: if buildMobile not in ['debug','release','copyonly']:
raise Exception("Error: buildMobile must be 'debug' or 'release'") raise Exception("Error: buildMobile must be 'debug' or 'release' or 'copyonly'")
# compile the user location script # compile the user location script
fn = "user-location.user.js" fn = "user-location.user.js"
@ -232,13 +232,14 @@ if buildMobile:
copytree(os.path.join(outDir,"plugins"), "mobile/assets/plugins") copytree(os.path.join(outDir,"plugins"), "mobile/assets/plugins")
# now launch 'ant' to build the mobile project if buildMobile != 'copyonly':
retcode = os.system("ant -buildfile mobile/build.xml %s" % buildMobile) # now launch 'ant' to build the mobile project
retcode = os.system("ant -buildfile mobile/build.xml %s" % buildMobile)
if retcode != 0: if retcode != 0:
print ("Error: mobile app failed to build. ant returned %d" % retcode) print ("Error: mobile app failed to build. ant returned %d" % retcode)
else: else:
shutil.copy("mobile/bin/IITC_Mobile-%s.apk" % buildMobile, os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) ) shutil.copy("mobile/bin/IITC_Mobile-%s.apk" % buildMobile, os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) )
# vim: ai si ts=4 sw=4 sts=4 et # vim: ai si ts=4 sw=4 sts=4 et

View File

@ -160,6 +160,7 @@ window.setupMap = function() {
)); ));
var addLayers = {}; var addLayers = {};
var hiddenLayer = [];
portalsLayers = []; portalsLayers = [];
for(var i = 0; i <= 8; i++) { for(var i = 0; i <= 8; i++) {
@ -167,15 +168,21 @@ window.setupMap = function() {
map.addLayer(portalsLayers[i]); map.addLayer(portalsLayers[i]);
var t = (i === 0 ? 'Unclaimed' : 'Level ' + i) + ' Portals'; var t = (i === 0 ? 'Unclaimed' : 'Level ' + i) + ' Portals';
addLayers[t] = portalsLayers[i]; addLayers[t] = portalsLayers[i];
// Store it in hiddenLayer to remove later
if(!isLayerGroupDisplayed(t)) hiddenLayer.push(portalsLayers[i]);
} }
fieldsLayer = L.layerGroup([]); fieldsLayer = L.layerGroup([]);
map.addLayer(fieldsLayer, true); map.addLayer(fieldsLayer, true);
addLayers['Fields'] = fieldsLayer; addLayers['Fields'] = fieldsLayer;
// Store it in hiddenLayer to remove later
if(!isLayerGroupDisplayed('Fields')) hiddenLayer.push(fieldsLayer);
linksLayer = L.layerGroup([]); linksLayer = L.layerGroup([]);
map.addLayer(linksLayer, true); map.addLayer(linksLayer, true);
addLayers['Links'] = linksLayer; addLayers['Links'] = linksLayer;
// Store it in hiddenLayer to remove later
if(!isLayerGroupDisplayed('Links')) hiddenLayer.push(linksLayer);
window.layerChooser = new L.Control.Layers({ window.layerChooser = new L.Control.Layers({
'MapQuest OSM': views[0], 'MapQuest OSM': views[0],
@ -185,6 +192,10 @@ window.setupMap = function() {
'Google Hybrid': views[4], 'Google Hybrid': views[4],
'Google Terrain': views[5] 'Google Terrain': views[5]
}, addLayers); }, addLayers);
// Remove the hidden layer after layerChooser built, to avoid messing up ordering of layers
$.each(hiddenLayer, function(ind, layer){
map.removeLayer(layer);
});
map.addControl(window.layerChooser); map.addControl(window.layerChooser);
@ -396,6 +407,11 @@ function boot() {
window.setupBackButton(); window.setupBackButton();
// read here ONCE, so the URL is only evaluated one time after the // read here ONCE, so the URL is only evaluated one time after the
// necessary data has been loaded. // necessary data has been loaded.
urlPortalLL = getURLParam('pll');
if(urlPortalLL) {
urlPortalLL = urlPortalLL.split(",");
urlPortalLL = [parseFloat(urlPortalLL[0]) || 0.0, parseFloat(urlPortalLL[1]) || 0.0];
}
urlPortal = getURLParam('pguid'); urlPortal = getURLParam('pguid');
// load only once // load only once

File diff suppressed because it is too large Load Diff

View File

@ -99,6 +99,7 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
if(!window.getPaddedBounds().contains(latlng) if(!window.getPaddedBounds().contains(latlng)
&& selectedPortal !== ent[0] && selectedPortal !== ent[0]
&& urlPortal !== ent[0] && urlPortal !== ent[0]
&& !(urlPortalLL && urlPortalLL[0] === latlng[0] && urlPortalLL[1] === latlng[1])
) return; ) return;
if('imageByUrl' in ent[2] && 'imageUrl' in ent[2].imageByUrl) { if('imageByUrl' in ent[2] && 'imageUrl' in ent[2].imageByUrl) {
@ -175,11 +176,15 @@ window.handlePortalsRender = function(portals) {
runHooks('portalDataLoaded', {portals : portals}); runHooks('portalDataLoaded', {portals : portals});
$.each(portals, function(ind, portal) { $.each(portals, function(ind, portal) {
//~ if(selectedPortal === portal[0]) portalUpdateAvailable = true; //~ if(selectedPortal === portal[0]) portalUpdateAvailable = true;
if(urlPortal && portal[0] === urlPortal) portalInUrlAvailable = true; if(urlPortalLL && urlPortalLL[0] === portal[2].locationE6.latE6/1E6 && urlPortalLL[1] === portal[2].locationE6.lngE6/1E6) {
urlPortal = portal[0];
portalInUrlAvailable = true;
urlPortalLL = null;
}
if(window.portals[portal[0]]) { if(window.portals[portal[0]]) {
highlightPortal(window.portals[portal[0]]); highlightPortal(window.portals[portal[0]]);
} }
renderPortal(portal); renderPortal(portal);
}); });
// restore selected portal if still available // restore selected portal if still available

View File

@ -45,11 +45,11 @@ window.renderPortalDetails = function(guid) {
setPortalIndicators(d); setPortalIndicators(d);
var img = d.imageByUrl.imageUrl; var img = d.imageByUrl.imageUrl;
var lat = d.locationE6.latE6; var lat = d.locationE6.latE6/1E6;
var lng = d.locationE6.lngE6; var lng = d.locationE6.lngE6/1E6;
var perma = '/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid; var perma = '/intel?ll='+lat+','+lng+'&z=17&pll='+lat+','+lng;
var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."'; var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."';
var poslinks = 'window.showPortalPosLinks('+lat/1E6+','+lng/1E6+',\'' + d.portalV2.descriptiveText.TITLE + '\')'; var poslinks = 'window.showPortalPosLinks('+lat+','+lng+',\'' + d.portalV2.descriptiveText.TITLE + '\')';
var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 R045\\n69120 Heidelberg\\nGermany'; var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 R045\\n69120 Heidelberg\\nGermany';
$('#portaldetails') $('#portaldetails')

View File

@ -288,9 +288,9 @@ window.prettyEnergy = function(nrg) {
window.setPermaLink = function(elm) { window.setPermaLink = function(elm) {
var c = map.getCenter(); var c = map.getCenter();
var lat = Math.round(c.lat*1E6); var lat = Math.round(c.lat*1E6)/1E6;
var lng = Math.round(c.lng*1E6); var lng = Math.round(c.lng*1E6)/1E6;
var qry = 'latE6='+lat+'&lngE6='+lng+'&z=' + map.getZoom(); var qry = 'll='+lat+','+lng+'&z=' + map.getZoom();
$(elm).attr('href', '/intel?' + qry); $(elm).attr('href', '/intel?' + qry);
} }