USPS Chat Log - Take 5

This commit is contained in:
vita10gy 2013-03-09 01:38:45 -06:00
parent fb2b659efc
commit 9cd15edc54

View File

@ -285,7 +285,7 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
msg += '<a onclick="'+js+'"'
+ ' title="'+markup[1].address+'"'
+ ' href="'+perma+'" class="help">'
+ markup[1].name
+ window.chat.getChatPortalName(markup[1])
+ '</a>';
break;
@ -305,6 +305,16 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
});
}
//Override portal names that are used over and over, such as 'US Post Office'
window.chat.getChatPortalName = function(markup) {
var name = markup.name;
if(name === 'US Post Office') {
var address = markup.address.split(',');
name = 'USPS: ' + address[0];
}
return name;
}
// renders data from the data-hash to the element defined by the given
// ID. Set 3rd argument to true if it is likely that old data has been
// added. Latter is only required for scrolling.