revert last commit, it broke scrolling. also replace expensive CSS rules with differen solution
This commit is contained in:
@ -27,7 +27,7 @@ window.setupLargeImagePreview = function() {
|
||||
|
||||
window.setupStyles = function() {
|
||||
$('head').append('<style>' +
|
||||
[ '#sidebar { margin-right: '+(SIDEBAR_WIDTH+2)+'px } ',
|
||||
[ '#map { margin-right: '+(SIDEBAR_WIDTH+2)+'px } ',
|
||||
'#largepreview.enl img { border:2px solid '+COLORS[TEAM_ENL]+'; } ',
|
||||
'#largepreview.none img { border:2px solid '+COLORS[TEAM_NONE]+'; } ',
|
||||
'#chatcontrols { bottom: '+(CHAT_SHRINKED+24)+'px; }',
|
||||
|
11
code/chat.js
11
code/chat.js
@ -27,7 +27,7 @@ window.chat.clear = function() {
|
||||
window.chat._newFactionTimestamp = -1;
|
||||
window.chat._oldPublicTimestamp = -1;
|
||||
window.chat._newPublicTimestamp = -1;
|
||||
$('#chatfaction, #chatpublic, #chatautomated').data('ignoreNextScroll', true).html('<div></div>');
|
||||
$('#chatfaction, #chatpublic, #chatautomated').data('ignoreNextScroll', true).html('');
|
||||
}
|
||||
|
||||
window.chat.clearIfRequired = function() {
|
||||
@ -296,7 +296,7 @@ window.chat.handlePublicAutomated = function(data) {
|
||||
case 'PORTAL':
|
||||
var latlng = [part[1].latE6/1E6, part[1].lngE6/1E6];
|
||||
var js = 'window.zoomToAndShowPortal(\''+part[1].guid+'\', ['+latlng[0]+', '+latlng[1]+'])';
|
||||
tmpmsg += '<a onclick="'+js+'" title="'+part[1].address+'">'+part[1].name+'</a>';
|
||||
tmpmsg += '<a onclick="'+js+'" title="'+part[1].address+'" class="help">'+part[1].name+'</a>';
|
||||
break;
|
||||
}
|
||||
});
|
||||
@ -332,7 +332,7 @@ window.chat.renderAutomatedMsgsTo = function() {
|
||||
return val;
|
||||
}).join('\n');
|
||||
|
||||
$('#chatautomated').html('<div>'+msgs+'</div>');
|
||||
$('#chatautomated').html(msgs);
|
||||
}
|
||||
|
||||
|
||||
@ -382,7 +382,7 @@ window.chat.renderPlayerMsgsTo = function(isFaction, data, isOldMsgs, dupCheckAr
|
||||
prevTime = nowTime;
|
||||
});
|
||||
|
||||
var addTo = isFaction ? $('#chatfaction > div') : $('#chatpublic > div');
|
||||
var addTo = isFaction ? $('#chatfaction') : $('#chatpublic');
|
||||
|
||||
// if there is a change of day between two requests, handle the
|
||||
// divider insertion here.
|
||||
@ -408,9 +408,10 @@ window.chat.renderDivider = function(text) {
|
||||
window.chat.renderMsg = function(msg, nick, time, team) {
|
||||
var ta = unixTimeToHHmm(time);
|
||||
var tb = unixTimeToString(time, true);
|
||||
// help cursor via “#chat time”
|
||||
var t = '<time title="'+tb+'" data-timestamp="'+time+'">'+ta+'</time>';
|
||||
var s = 'style="color:'+COLORS[team]+'"';
|
||||
var title = nick.length >= 8 ? 'title="'+nick+'"' : '';
|
||||
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';
|
||||
return '<p>'+t+'<mark '+s+'>'+nick+'</mark><span>'+msg+'</span></p>';
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ window.updateGameScore = function(data) {
|
||||
var rs = '<span class="res" style="width:'+rp+'%;">'+Math.round(rp)+'% </span>';
|
||||
var es = '<span class="enl" style="width:'+ep+'%;"> '+Math.round(ep)+'%</span>';
|
||||
$('#gamestat').html(rs+es).one('click', function() { window.updateGameScore() });
|
||||
// help cursor via “#gamestat span”
|
||||
$('#gamestat').attr('title', 'Resistance:\t\t'+r+' MindUnits\nEnlightenment:\t'+e+' MindUnits');
|
||||
|
||||
window.setTimeout('window.updateGameScore', REFRESH_GAME_SCORE*1000);
|
||||
|
@ -59,6 +59,7 @@ window.renderPortalDetails = function(guid) {
|
||||
.attr('class', TEAM_TO_CSS[getTeam(d)])
|
||||
.html(''
|
||||
+ '<h3>'+d.portalV2.descriptiveText.TITLE+'</h3>'
|
||||
// help cursor via “.imgpreview img”
|
||||
+ '<div class="imgpreview"><img src="'+img+'" title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."/></div>'
|
||||
+ '<span id="level">'+Math.floor(getPortalLevel(d))+'</span>'
|
||||
+ '<div class="mods">'+getModDetails(d)+'</div>'
|
||||
|
@ -47,7 +47,7 @@ window.renderUpdateStatus = function() {
|
||||
t += 'Up to date.';
|
||||
|
||||
if(renderLimitReached())
|
||||
t += ' <span style="color:red" title="Can only render so much before it gets unbearably slow. Not all entities are shown. Zoom in or increase the limit (search for MAX_DRAWN_*).">RENDER LIMIT</span> '
|
||||
t += ' <span style="color:red" class="help" title="Can only render so much before it gets unbearably slow. Not all entities are shown. Zoom in or increase the limit (search for MAX_DRAWN_*).">RENDER LIMIT</span> '
|
||||
|
||||
if(window.failedRequestCount > 0)
|
||||
t += ' ' + window.failedRequestCount + ' requests failed.'
|
||||
|
Reference in New Issue
Block a user