Added sign out link when hovering over name (fixes #352)

This commit is contained in:
Cameron Moon 2013-03-01 13:31:13 +11:00
parent 62c6f0e397
commit 32ca78b1d7
2 changed files with 25 additions and 3 deletions

View File

@ -186,13 +186,22 @@ window.setupPlayerStat = function() {
$('#playerstat').html('' $('#playerstat').html(''
+ '<h2 title="'+t+'">'+level+'&nbsp;' + '<h2 title="'+t+'">'+level+'&nbsp;'
+ '<div id="name">'
+ '<span class="'+cls+'">'+PLAYER.nickname+'</span>' + '<span class="'+cls+'">'+PLAYER.nickname+'</span>'
+ '<div>' + '<a href="https://www.ingress.com/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253Dhttps://www.ingress.com/intel%26service%3Dah" id="signout">sign out</a>'
+ '</div>'
+ '<div id="stats">'
+ '<sup>XM: '+xmRatio+'%</sup>' + '<sup>XM: '+xmRatio+'%</sup>'
+ '<sub>' + (level < 8 ? 'level: '+lvlApProg+'%' : 'max level') + '</sub>' + '<sub>' + (level < 8 ? 'level: '+lvlApProg+'%' : 'max level') + '</sub>'
+ '</div>' + '</div>'
+ '</h2>' + '</h2>'
); );
$('#name').mouseenter(function() {
$('#signout').show();
}).mouseleave(function() {
$('#signout').hide();
});
} }
window.setupSidebarToggle = function() { window.setupSidebarToggle = function() {

View File

@ -329,21 +329,34 @@ h2 {
width: 100%; width: 100%;
} }
h2 span { h2 #name {
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
text-overflow: "~"; text-overflow: "~";
vertical-align: top; vertical-align: top;
white-space: nowrap; white-space: nowrap;
width: 205px; width: 205px;
position: relative;
} }
h2 div { h2 #stats {
float: right; float: right;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
h2 #signout {
font-size: 12px;
font-weight: normal;
line-height: 29px;
padding: 0 4px;
position: absolute;
top: 0;
right: 0;
background-color: rgba(8, 48, 78, 0.5);
display: none; /* starts hidden */
}
h2 sup, h2 sub { h2 sup, h2 sub {
display: block; display: block;
font-size: 11px; font-size: 11px;