Skip to content

Commit 74022b5

Browse files
committed
fix: missing inactivity and stats
adds inactivity counter and links (Player and Alliance name) for island view when sorted by player name
1 parent b576388 commit 74022b5

File tree

1 file changed

+16
-49
lines changed

1 file changed

+16
-49
lines changed

modules/RepConvGRC.js

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,9 @@ function _RepConvGRC() {
337337
}
338338
}
339339
function islandBBCode(RCGP){ // info o graczach na wyspie - dodanie listy miast w BBCode
340-
var
341-
WndName = (RCGP).getName(),
342-
WndId = '#' + WndName;
343-
if ((RCGP.getJQElement()).find($(WndId + 'RepConvTownButton')).length == 0) {
344-
// nazwy graczy jako linki
345-
var _towns = JSON.parse(RepConv.requests[RCGP.getController()].responseText).json.json.town_list;
346-
if ((RCGP.getJQElement()).find($('#island_info_towns_left_sorted_by_name li span.player_name a.gp_player_link')).length == 0) {
347-
$.each((RCGP.getJQElement()).find($('#island_info_towns_left_sorted_by_name li span.player_name')), function(ind,elem){
340+
function addDetails(RCGP, itemId){
341+
if ((RCGP.getJQElement()).find($('#'+itemId+' li span.player_name a.gp_player_link')).length == 0) {
342+
$.each((RCGP.getJQElement()).find($('#'+itemId+' li span.player_name')), function(ind,elem){
348343
$.each(_towns,function(itown,etown){
349344
if(etown.player == $(elem).html()){
350345
$(elem).html(
@@ -380,44 +375,16 @@ function _RepConvGRC() {
380375
})
381376
})
382377
}
383-
if ((RCGP.getJQElement()).find($('#island_info_towns_left_sorted_by_score li span.player_name a.gp_player_link')).length == 0) {
384-
$.each((RCGP.getJQElement()).find($('#island_info_towns_left_sorted_by_score li span.player_name')), function(ind,elem){
385-
$.each(_towns,function(itown,etown){
386-
if(etown.player == $(elem).html()){
387-
$(elem)
388-
.html(
389-
hCommon.player(
390-
btoa(
391-
JSON.stringify({"name":etown.player,"id":etown.pid})
392-
.replace(/[\u007f-\uffff]/g,
393-
function(c) {
394-
return '\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4);
395-
}
396-
)
397-
),
398-
etown.player,
399-
etown.pid
400-
)
401-
)
402-
// alliance
403-
if (etown.player_alliance != null){
404-
$(elem)
405-
.parent()
406-
.append(
407-
$('<span/>',{'class':'small alliance_name grcrt_brackets'})
408-
.html(
409-
hCommon.alliance(
410-
'n',
411-
RepConvTool.getAllianceData(RepConvTool.getPlayerData(etown.pid).alliance_id).name,
412-
RepConvTool.getPlayerData(etown.pid).alliance_id
413-
)
414-
)
415-
)
416-
}
417-
}
418-
})
419-
})
420-
}
378+
}
379+
var
380+
WndName = (RCGP).getName(),
381+
WndId = '#' + WndName;
382+
if ((RCGP.getJQElement()).find($(WndId + 'RepConvTownButton')).length == 0) {
383+
// nazwy graczy jako linki
384+
var _towns = JSON.parse(RepConv.requests[RCGP.getController()].responseText).json.json.town_list;
385+
addDetails(RCGP, 'island_info_towns_left_sorted_by_name');
386+
addDetails(RCGP, 'island_info_towns_left_sorted_by_score');
387+
addDetails(RCGP, 'island_info_towns_left_sorted_by_player');
421388
// /nazwy graczy jako linki
422389
// new bbcode
423390
if ((RCGP.getJQElement()).find($('#BTNVIEWBB' + WndName)).length == 0) {
@@ -2585,7 +2552,7 @@ function _RepConvGRC() {
25852552
}
25862553

25872554
function colorizeMessageList(RCGP){
2588-
var __ally = {};
2555+
var __ally = {}, what;
25892556
if(RepConv.settings[RepConv.Cookie+'_mcol']){
25902557
__ally[Game.alliance_id]='OWN_ALLIANCE';
25912558
$.each(MM.getOnlyCollectionByName("AlliancePact").models, function(ii,ee){
@@ -2630,7 +2597,7 @@ function _RepConvGRC() {
26302597
}
26312598

26322599
function colorizeMessageView(RCGP){
2633-
var __ally = {};
2600+
var __ally = {}, what;
26342601
if(RepConv.settings[RepConv.Cookie+'_mcol']){
26352602
__ally[Game.alliance_id]='OWN_ALLIANCE';
26362603
$.each(MM.getOnlyCollectionByName("AlliancePact").models, function(ii,ee){
@@ -2771,7 +2738,7 @@ function _RepConvGRC() {
27712738
.attr('id','BTNCOMPARE')
27722739
.css({'margin': '0px', 'position': 'absolute', 'top': '0px', 'right': '1px'})
27732740
.click(function() {
2774-
var __ally = {leftAlly:[Game.alliance_id],rightAlly:[]}
2741+
var __ally = {leftAlly:[Game.alliance_id],rightAlly:[]}, what;
27752742
$.each(MM.getOnlyCollectionByName("AlliancePact").models, function(ii,ee){
27762743
if(!ee.getInvitationPending()){
27772744
switch (ee.getRelation()){

0 commit comments

Comments
 (0)