Merge git://github.com/jonatkins/ingress-intel-total-conversion into dev

This commit is contained in:
Morgan Jones 2013-05-06 13:13:33 -06:00
commit 38b1034830
3 changed files with 13 additions and 10 deletions

View File

@ -359,16 +359,21 @@ window.updateDisplayedLayerGroup = function(name, display) {
// Read layerGroup status from window.overlayStatus if it was added to map, // Read layerGroup status from window.overlayStatus if it was added to map,
// read from cookie if it has not added to map yet. // read from cookie if it has not added to map yet.
// return true if both overlayStatus and cookie didn't have the record // return 'defaultDisplay' if both overlayStatus and cookie didn't have the record
window.isLayerGroupDisplayed = function(name) { window.isLayerGroupDisplayed = function(name, defaultDisplay) {
if(typeof(overlayStatus[name]) !== 'undefined') return overlayStatus[name]; if(typeof(overlayStatus[name]) !== 'undefined') return overlayStatus[name];
var layersJSON = readCookie('ingress.intelmap.layergroupdisplayed'); var layersJSON = readCookie('ingress.intelmap.layergroupdisplayed');
if(!layersJSON) return true; if(!layersJSON) return defaultDisplay;
var layers = JSON.parse(layersJSON); var layers = JSON.parse(layersJSON);
// keep latest overlayStatus // keep latest overlayStatus
overlayStatus = $.extend(layers, overlayStatus); overlayStatus = $.extend(layers, overlayStatus);
if(typeof(overlayStatus[name]) === 'undefined') return true; if(typeof(overlayStatus[name]) === 'undefined') return defaultDisplay;
return overlayStatus[name]; return overlayStatus[name];
} }
window.addLayerGroup = function(name, layerGroup, defaultDisplay) {
if(isLayerGroupDisplayed(name, defaultDisplay)) map.addLayer(layerGroup);
layerChooser.addOverlay(layerGroup, name);
}

View File

@ -106,9 +106,7 @@ window.plugin.keysOnMap.setupCSS = function() {
} }
window.plugin.keysOnMap.setupLayer = function() { window.plugin.keysOnMap.setupLayer = function() {
window.layerChooser.addOverlay(window.plugin.keysOnMap.keyLayerGroup, 'Keys'); window.addLayerGroup('Keys', window.plugin.keysOnMap.keyLayerGroup, false);
if(isLayerGroupDisplayed('Keys'))
map.addLayer(window.plugin.keysOnMap.keyLayerGroup);
} }
var setup = function() { var setup = function() {

View File

@ -45,7 +45,7 @@ body {
margin-top: -31px; /* -(toggle height / 2) */ margin-top: -31px; /* -(toggle height / 2) */
line-height: 10px; line-height: 10px;
position: absolute; position: absolute;
top: 325px; /* (sidebar height / 2) */ top: 108px;
z-index: 3001; z-index: 3001;
background-color: rgba(8, 48, 78, 0.9); background-color: rgba(8, 48, 78, 0.9);
color: #FFCE00; color: #FFCE00;
@ -53,7 +53,7 @@ body {
border-right: none; border-right: none;
border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px;
text-decoration: none; text-decoration: none;
right: 301px; /* overwritten later by the script with SIDEBAR_WIDTH */ right: -50px; /* overwritten later by the script with SIDEBAR_WIDTH */
} }
.enl { .enl {
@ -652,7 +652,7 @@ h3 {
* content when first selecting a portal) */ * content when first selecting a portal) */
#portaldetails { #portaldetails {
min-height: 485px; min-height: 63px;
position: relative; /* so the below '#portaldetails .close' is relative to this */ position: relative; /* so the below '#portaldetails .close' is relative to this */
} }