-
Notifications
You must be signed in to change notification settings - Fork 0
/
minus_tr_ar_ru_ladder.html
198 lines (162 loc) · 7.17 KB
/
minus_tr_ar_ru_ladder.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>RRGC Ladder</title>
<meta name="description" content="RRGC Ladder">
<meta property="og:type" content="website">
<meta property="og:title" content="malikremgcregion.github.io">
<meta property="og:description" content="Showing you the RRGC Ladder">
<meta property="og:url" content="https://malikremgcregion.github.io/ladder.html">
<meta property="og:image" content="https://malikremgcregion.github.io/assets/colored_body_top2.png">
<meta name="twitter:site" content="@RRGC Ladder">
<meta name="twitter:image" content="https://malikremgcregion.github.io/assets/colored_body_top2.png">
<meta name="twitter:card" content="summary_large_image">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.css">
<script src="./js/sortable.min.js"></script>
</head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-GMKFV61CZ9"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-GMKFV61CZ9');
</script>
<body>
<!-- put into a nav file -->
<nav class="navbar navbar-expand-sm bg-dark navbar-dark" id="myNavbar"></nav>
<div class="container">
<table class="table sortable text-light">
<thead class="thead-dark">
<tr>
<th scope="col">id</th>
<th scope="col">region</th>
<th scope="col">games count</th>
<th scope="col">time</th>
</tr>
</thead>
<tbody id="rrgc">
</tbody>
</table>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const url_p_cc = urlParams.get('cc')
if (url_p_cc) {
if(/^[A-Z]{2}$/.test(url_p_cc)){
document.title = url_p_cc + " | RRGC Ladder";
jQuery.extend({
getValues: function(url) {
var result = null;
$.ajax({
url: url,
type: 'get',
dataType: 'text',
async: false,
success: function(data) {
result = data;
}
});
return result;
}
});
var j_db = $.getValues("./db/db.json");
var j_getownedgames = $.getValues("./db/getownedgames.json");
//console.log(j_db);
//console.log(j_getownedgames);
j_db = JSON.parse(j_db);
j_getownedgames = JSON.parse(j_getownedgames);
var profile_id, profile_time_stamp, profile_region;
var tr = '';
for (let j = 0; j < j_db.length; j++) {
profile_id = j_db[j].id;
profile_game_count = j_db[j].game_count;
profile_time_stamp = j_db[j].time_stamp;
profile_region = j_db[j].region;
for (let k = 0; k < j_getownedgames.length; k++) {
if(profile_id === j_getownedgames[k].id) {
profile_game_count = j_getownedgames[k].game_count;
//console.log("this id: " + j_getownedgames[k].id + ", has had their games count altered > " + j_getownedgames[k].game_count);
let cc = url_p_cc;
if(profile_region.length === 2 && profile_region[0] == "ZZ" )
{
profile_region.shift();
}
if(profile_region.length <= 1 && profile_region[0] !== "ZZ" && profile_region[0] !== "TR" && profile_region[0] !== "AR" && profile_region[0] !== "RU" && profile_region.includes(cc)){
tr += '<tr><td><a href="https://malikremgcregion.github.io/?id='+profile_id+'">' + profile_id +'</a></td><td>' + '<a href="' + window.location.href + '?cc=' + profile_region[profile_region.length - 1] +'"><img class="card-img-top" src="./assets/cc_flags/png_16px/'+profile_region[profile_region.length - 1].toLowerCase()+'.png" alt="'+profile_region[profile_region.length - 1]+'" title="'+profile_region[profile_region.length - 1]+'" style="width:16px;height:16px;"></a>' /* profile_region*/ /*profile_region[profile_region.length - 1]*/ + '</td><td>'+profile_game_count/*profile_game_count[profile_game_count.length - 1]*/ + '</td><td>' + profile_time_stamp[profile_time_stamp.length - 1] + '</td></tr>';
}
break;
}
}
}
$('#rrgc').append(tr);
$("th:nth-child(3)").click(); //sortable wont default sort the column by games count.
}
else{
console.log(url_p_cc);
no_cc_ladder()
}
}else{
no_cc_ladder()
}
function no_cc_ladder(){
jQuery.extend({
getValues: function(url) {
var result = null;
$.ajax({
url: url,
type: 'get',
dataType: 'text',
async: false,
success: function(data) {
result = data;
}
});
return result;
}
});
var j_db = $.getValues("./db/db.json");
var j_getownedgames = $.getValues("./db/getownedgames.json");
//console.log(j_db);
//console.log(j_getownedgames);
j_db = JSON.parse(j_db);
j_getownedgames = JSON.parse(j_getownedgames);
var profile_id, profile_time_stamp, profile_region;
var tr = '';
for (let j = 0; j < j_db.length; j++) {
profile_id = j_db[j].id;
profile_game_count = j_db[j].game_count;
profile_time_stamp = j_db[j].time_stamp;
profile_region = j_db[j].region;
for (let k = 0; k < j_getownedgames.length; k++) {
if(profile_id === j_getownedgames[k].id) {
profile_game_count = j_getownedgames[k].game_count;
//console.log("this id: " + j_getownedgames[k].id + ", has had their games count altered > " + j_getownedgames[k].game_count);
let cc = url_p_cc;
if(profile_region.length === 2 && profile_region[0] == "ZZ" )
{
profile_region.shift();
}
if(profile_region.length <= 1 && profile_region[0] !== "ZZ" && profile_region[0] !== "TR" && profile_region[0] !== "AR" && profile_region[0] !== "RU"){
tr += '<tr><td><a href="https://malikremgcregion.github.io/?id='+profile_id+'">' + profile_id +'</a></td><td>' + '<a href="' + window.location.href + '?cc=' + profile_region[profile_region.length - 1] +'"><img class="card-img-top" src="./assets/cc_flags/png_16px/'+profile_region[profile_region.length - 1].toLowerCase()+'.png" alt="'+profile_region[profile_region.length - 1]+'" title="'+profile_region[profile_region.length - 1]+'" style="width:16px;height:16px;"></a>' /* profile_region*/ /*profile_region[profile_region.length - 1]*/ + '</td><td>'+profile_game_count/*profile_game_count[profile_game_count.length - 1]*/ + '</td><td>' + profile_time_stamp[profile_time_stamp.length - 1] + '</td></tr>';
}
break;
}
}
}
$('#rrgc').append(tr);
$("th:nth-child(3)").click(); //sortable wont default sort the column by games count.
}
</script>
<script>$('body').css('background-image', 'url("./assets/colored_body_top2.png")');</script>
<script src="./js/nav.js"></script>
</body>
</html>