-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbvg_turnier.js
53 lines (47 loc) · 2.3 KB
/
bvg_turnier.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
console.log( 'bvg_turnier.js included...' );
/*
jQuery('.admin_block_label').on( 'click', function(){
jQuery('.admin_block').hide();
jQuery( this ).next().slideDown();
});
*/
jQuery('.table_row').on( 'click', function(){
player_name_tosearch = jQuery( this ).find( '.pl_name').html();
if( jQuery( '#block_spiele' ).length > 0 ){
jQuery( '#block_spiele .match_pl1_name').each( function(){
var text = jQuery(this).html();
jQuery(this).html(text.replace( '<span style="color: #ff0; background-color: rgba( 0, 0, 0, 0.4); padding-right: 4px; padding-left: 4px;">(.*)</span>' , '$1'));
text = jQuery(this).text();
jQuery(this).html(text.replace( player_name_tosearch , '<span style="color: #ff0; background-color: rgba( 0, 0, 0, 0.4); padding-right: 4px; padding-left: 4px;">'+player_name_tosearch+'</span>'));
});
jQuery( '#block_spiele .match_pl2_name').each( function(){
var text = jQuery(this).html();
jQuery(this).html(text.replace( '<span style="color: #ff0; background-color: rgba( 0, 0, 0, 0.4); padding-right: 4px; padding-left: 4px;">(.*)</span>' , '$1'));
text = jQuery(this).text();
jQuery(this).html(text.replace( player_name_tosearch , '<span style="color: #ff0; background-color: rgba( 0, 0, 0, 0.4); padding-right: 4px; padding-left: 4px;">'+player_name_tosearch+'</span>'));
});
}
});
jQuery('#round_select').on( 'change', function(){
console.log('Change round...');
round_display = jQuery( this ).val();
if( round_display == 0 ){
jQuery('.match_round_header').fadeIn();
jQuery('.match_row').fadeIn();
}else{
jQuery('.match_round_header').each(function(){
jQuery( this ).fadeOut();
jQuery( '.match_row' ).fadeOut();
});
jQuery('.match_round_header').each(function(){
if( jQuery( this).attr( 'data-round' ) == round_display ){
jQuery( this ).slideDown();
jQuery('.match_row').each(function(){
if( jQuery( this).attr( 'data-round' ) == round_display ){
jQuery( this ).slideDown( 'slow' );
}
});
}
});
}
});