@@ -337,14 +337,9 @@ function _RepConvGRC() {
337
337
}
338
338
}
339
339
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 ) {
348
343
$ . each ( _towns , function ( itown , etown ) {
349
344
if ( etown . player == $ ( elem ) . html ( ) ) {
350
345
$ ( elem ) . html (
@@ -380,44 +375,16 @@ function _RepConvGRC() {
380
375
} )
381
376
} )
382
377
}
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' ) ;
421
388
// /nazwy graczy jako linki
422
389
// new bbcode
423
390
if ( ( RCGP . getJQElement ( ) ) . find ( $ ( '#BTNVIEWBB' + WndName ) ) . length == 0 ) {
@@ -2585,7 +2552,7 @@ function _RepConvGRC() {
2585
2552
}
2586
2553
2587
2554
function colorizeMessageList ( RCGP ) {
2588
- var __ally = { } ;
2555
+ var __ally = { } , what ;
2589
2556
if ( RepConv . settings [ RepConv . Cookie + '_mcol' ] ) {
2590
2557
__ally [ Game . alliance_id ] = 'OWN_ALLIANCE' ;
2591
2558
$ . each ( MM . getOnlyCollectionByName ( "AlliancePact" ) . models , function ( ii , ee ) {
@@ -2630,7 +2597,7 @@ function _RepConvGRC() {
2630
2597
}
2631
2598
2632
2599
function colorizeMessageView ( RCGP ) {
2633
- var __ally = { } ;
2600
+ var __ally = { } , what ;
2634
2601
if ( RepConv . settings [ RepConv . Cookie + '_mcol' ] ) {
2635
2602
__ally [ Game . alliance_id ] = 'OWN_ALLIANCE' ;
2636
2603
$ . each ( MM . getOnlyCollectionByName ( "AlliancePact" ) . models , function ( ii , ee ) {
@@ -2771,7 +2738,7 @@ function _RepConvGRC() {
2771
2738
. attr ( 'id' , 'BTNCOMPARE' )
2772
2739
. css ( { 'margin' : '0px' , 'position' : 'absolute' , 'top' : '0px' , 'right' : '1px' } )
2773
2740
. click ( function ( ) {
2774
- var __ally = { leftAlly :[ Game . alliance_id ] , rightAlly :[ ] }
2741
+ var __ally = { leftAlly :[ Game . alliance_id ] , rightAlly :[ ] } , what ;
2775
2742
$ . each ( MM . getOnlyCollectionByName ( "AlliancePact" ) . models , function ( ii , ee ) {
2776
2743
if ( ! ee . getInvitationPending ( ) ) {
2777
2744
switch ( ee . getRelation ( ) ) {
0 commit comments