merge #86, with some tweaks in the case AT_PLAYER area so it's cleaner
This commit is contained in:
parent
4a44111414
commit
4b3e84ce51
17
code/chat.js
17
code/chat.js
@ -256,6 +256,7 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
|
|||||||
if(json[0] in storageHash) return true;
|
if(json[0] in storageHash) return true;
|
||||||
|
|
||||||
var skipThisEntry = false;
|
var skipThisEntry = false;
|
||||||
|
var msgToPlayer = false;
|
||||||
|
|
||||||
var time = json[1];
|
var time = json[1];
|
||||||
var team = json[2].plext.team === 'ALIENS' ? TEAM_ENL : TEAM_RES;
|
var team = json[2].plext.team === 'ALIENS' ? TEAM_ENL : TEAM_RES;
|
||||||
@ -276,13 +277,13 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'TEXT':
|
case 'TEXT':
|
||||||
var tmp = $('<div/>').text(markup[1].plain).html().autoLink();
|
msg += $('<div/>').text(markup[1].plain).html().autoLink();
|
||||||
msg += tmp.replace(window.PLAYER['nickMatcher'], '<em>$1</em>');
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'AT_PLAYER':
|
case 'AT_PLAYER':
|
||||||
var tmp = $('<div/>').text(markup[1].plain).html().autoLink();
|
msgToPlayer = (markup[1].plain == ('@'+window.PLAYER.nickname));
|
||||||
msg += tmp.replace(window.PLAYER['nickMatcher'], '<em>$1</em>');
|
var spanClass = msgToPlayer ? "pl_nudge_me" : (markup[1].team + " pl_nudge_player");
|
||||||
|
msg += $('<div/>').html($('<span/>').attr('class', spanClass).text(markup[1].plain)).html();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'PORTAL':
|
case 'PORTAL':
|
||||||
@ -307,7 +308,7 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
|
|||||||
if(skipThisEntry) return true;
|
if(skipThisEntry) return true;
|
||||||
|
|
||||||
// format: timestamp, autogenerated, HTML message, player guid
|
// format: timestamp, autogenerated, HTML message, player guid
|
||||||
storageHash[json[0]] = [json[1], auto, chat.renderMsg(msg, nick, time, team), pguid];
|
storageHash[json[0]] = [json[1], auto, chat.renderMsg(msg, nick, time, team, msgToPlayer), pguid];
|
||||||
|
|
||||||
window.setPlayerName(pguid, nick); // free nick name resolves
|
window.setPlayerName(pguid, nick); // free nick name resolves
|
||||||
});
|
});
|
||||||
@ -357,11 +358,15 @@ window.chat.renderDivider = function(text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.chat.renderMsg = function(msg, nick, time, team) {
|
window.chat.renderMsg = function(msg, nick, time, team, msgToPlayer) {
|
||||||
var ta = unixTimeToHHmm(time);
|
var ta = unixTimeToHHmm(time);
|
||||||
var tb = unixTimeToString(time, true);
|
var tb = unixTimeToString(time, true);
|
||||||
// help cursor via “#chat time”
|
// help cursor via “#chat time”
|
||||||
var t = '<time title="'+tb+'" data-timestamp="'+time+'">'+ta+'</time>';
|
var t = '<time title="'+tb+'" data-timestamp="'+time+'">'+ta+'</time>';
|
||||||
|
if ( msgToPlayer )
|
||||||
|
{
|
||||||
|
t = '<div class="pl_nudge_date">' + t + '</div><div class="pl_nudge_pointy_spacer"></div>';
|
||||||
|
}
|
||||||
var s = 'style="cursor:pointer; color:'+COLORS[team]+'"';
|
var s = 'style="cursor:pointer; color:'+COLORS[team]+'"';
|
||||||
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';
|
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';
|
||||||
var i = ['<span class="invisep"><</span>', '<span class="invisep">></span>'];
|
var i = ['<span class="invisep"><</span>', '<span class="invisep">></span>'];
|
||||||
|
38
style.css
38
style.css
@ -777,3 +777,41 @@ td + td {
|
|||||||
width: 50px;
|
width: 50px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pl_nudge_date {
|
||||||
|
background-color: #724510;
|
||||||
|
border-left: 1px solid #ffd652;
|
||||||
|
border-bottom: 1px solid #ffd652;
|
||||||
|
border-top: 1px solid #ffd652;
|
||||||
|
color: #ffd652;
|
||||||
|
display: inline-block;
|
||||||
|
float: left;
|
||||||
|
font-size: 12px;
|
||||||
|
height: 18px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl_nudge_pointy_spacer {
|
||||||
|
background: no-repeat url(//commondatastorage.googleapis.com/ingress.com/img/nudge_pointy.png);
|
||||||
|
display: inline-block;
|
||||||
|
float: left;
|
||||||
|
height: 20px;
|
||||||
|
left: 47px;
|
||||||
|
width: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl_nudge_player {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl_nudge_me {
|
||||||
|
color: #ffd652;
|
||||||
|
}
|
||||||
|
|
||||||
|
.RESISTANCE {
|
||||||
|
color: #00c2ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ALIENS {
|
||||||
|
color: #28f428;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user