From 8b2472701a1ed735ef7fcb2465d27a80e0ad6284 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 5 Apr 2013 18:06:40 +0100 Subject: [PATCH 1/2] make double-click on portal title in details panel close the panel TODO: better interface (close button?), but at least there's *some* way of closing it now --- code/portal_detail_display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index 81c3d4b2..c8b6c86f 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -58,7 +58,7 @@ window.renderPortalDetails = function(guid) { $('#portaldetails') .attr('class', TEAM_TO_CSS[getTeam(d)]) .html('' - + '

'+d.portalV2.descriptiveText.TITLE+'

' + + '

'+d.portalV2.descriptiveText.TITLE+'

' // help cursor via “.imgpreview img” + '
' + '' From f48aca886461a9dc080eba2831616115539df572 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 5 Apr 2013 23:58:55 +0100 Subject: [PATCH 2/2] more chat changes - remove public @mentions from the faction chat channel - add default case to chat text handling. if a new message fragment type is added, at least something will be shown in chat instead of being blank (as happened when AT_PLAYER was first introduced) - highlight your own player name in the chat column in yellow for things you said/actions performed - similar to @mentions from other players --- code/chat.js | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/code/chat.js b/code/chat.js index 67c23ed8..f6716a0d 100644 --- a/code/chat.js +++ b/code/chat.js @@ -241,12 +241,12 @@ window.chat.renderFull = function(oldMsgsWereAdded) { // common // -window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) { +window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel) { $.each(newData.result, function(ind, json) { // avoid duplicates if(json[0] in storageHash.data) return true; - var skipThisEntry = false; + var isSecureMessage = false; var msgToPlayer = false; var time = json[1]; @@ -259,10 +259,7 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) { if (storageHash.newestTimestamp === -1 || storageHash.newestTimestamp < time) storageHash.newestTimestamp = time; //remove "Your X on Y was destroyed by Z" from the faction channel - if (systemNarrowcast && !skipSecureMsgs) { - //NOTE: skipSecureMsgs is being used as a "is public channel" flag here - return true; - } + if (systemNarrowcast && !isPublicChannel) return true; var msg = '', nick = '', pguid; $.each(json[2].plext.markup, function(ind, markup) { @@ -306,13 +303,34 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) { break; case 'SECURE': - if(skipSecureMsgs) { - skipThisEntry = true; - return false; // breaks $.each - } + //NOTE: we won't add the '[secure]' string here - it'll be handled below instead + isSecureMessage = true; + break; + + default: + //handle unknown types by outputting the plain text version, marked with it's type + msg += $('
').text(markup[0]+':<'+markup[1].plain+'>').html(); + break; } }); - if(skipThisEntry) return true; + + + //skip secure messages on the public channel + if (isPublicChannel && isSecureMessage) return true; + + //skip public messages (e.g. @player mentions) on the secure channel + if ((!isPublicChannel) && (!isSecureMessage)) return true; + + + //NOTE: these two are currently redundant with the above two tests - but code can change... + //from the server, private channel messages are flagged with a SECURE string '[secure] ', and appear in + //both the public and private channels + //we don't include this '[secure]' text above, as it's redundant in the faction-only channel + //let's add it here though if we have a secure message in the public channel, or the reverse if a non-secure in the faction one + if (isPublicChannel && isSecureMessage) msg = '[secure] ' + msg; + //and, add the reverse - a 'public' marker to messages in the private channel + if ((!isPublicChannel) && (!isSecureMessage)) msg = '[public] ' + msg; + // format: timestamp, autogenerated, HTML message, player guid storageHash.data[json[0]] = [json[1], auto, chat.renderMsg(msg, nick, time, team, msgToPlayer, systemNarrowcast), pguid]; @@ -378,7 +396,9 @@ window.chat.renderMsg = function(msg, nick, time, team, msgToPlayer, systemNarro { msg = '
' + msg + '
'; } - var s = 'style="cursor:pointer; color:'+COLORS[team]+'"'; + var color = COLORS[team]; + if (nick === window.PLAYER.nickname) color = '#fd6'; //highlight things said/done by the player in a unique colour (similar to @player mentions from others in the chat text itself) + var s = 'style="cursor:pointer; color:'+color+'"'; var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : ''; var i = ['<', '>']; return ''+t+''+i[0]+''+ nick+''+i[1]+''+msg+'';