aa-intel-tool 0.0.1a8__py3-none-any.whl → 0.0.1a10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aa_intel_tool/app_settings.py +7 -0
- aa_intel_tool/constants.py +40 -13
- aa_intel_tool/helper/data_structure.py +22 -0
- aa_intel_tool/locale/es/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/es/LC_MESSAGES/django.po +19 -17
- aa_intel_tool/locale/ru/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/ru/LC_MESSAGES/django.po +22 -20
- aa_intel_tool/migrations/0006_alter_scandata_unique_together.py +17 -0
- aa_intel_tool/models.py +2 -0
- aa_intel_tool/parser/module/chatlist.py +4 -22
- aa_intel_tool/parser/module/dscan.py +194 -102
- aa_intel_tool/static/aa_intel_tool/javascript/{aa-intel-tool-highlight.js → aa-intel-tool-chatscan-highlight.js} +23 -23
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan-highlight.min.js +1 -0
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.js +3 -3
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-clipboard.js +3 -4
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-clipboard.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan-highlight.js +40 -0
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan-highlight.min.js +1 -0
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.js +43 -45
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.min.js +1 -1
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-chatscan-js.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-dscan-js.html +1 -1
- aa_intel_tool/tests/test-data/dscan-german-client.txt +176 -0
- aa_intel_tool/tests/test-data/dscan-russian-client.txt +13 -0
- aa_intel_tool/tests/test-data/dscan.txt +1 -1
- aa_intel_tool/tests/test_app_settings.py +27 -0
- aa_intel_tool/tests/test_parser.py +16 -17
- aa_intel_tool/views/ajax.py +4 -9
- {aa_intel_tool-0.0.1a8.dist-info → aa_intel_tool-0.0.1a10.dist-info}/METADATA +13 -11
- {aa_intel_tool-0.0.1a8.dist-info → aa_intel_tool-0.0.1a10.dist-info}/RECORD +33 -25
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-highlight.min.js +0 -1
- {aa_intel_tool-0.0.1a8.dist-info → aa_intel_tool-0.0.1a10.dist-info}/WHEEL +0 -0
- {aa_intel_tool-0.0.1a8.dist-info → aa_intel_tool-0.0.1a10.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,7 +7,6 @@ import re
|
|
|
7
7
|
|
|
8
8
|
# Django
|
|
9
9
|
from django.db.models import QuerySet
|
|
10
|
-
from django.utils.text import slugify
|
|
11
10
|
from django.utils.translation import gettext_lazy as _
|
|
12
11
|
|
|
13
12
|
# Alliance Auth
|
|
@@ -23,105 +22,172 @@ from eveuniverse.models import EveType
|
|
|
23
22
|
from aa_intel_tool import __title__
|
|
24
23
|
from aa_intel_tool.app_settings import AppSettings
|
|
25
24
|
from aa_intel_tool.exceptions import ParserError
|
|
25
|
+
from aa_intel_tool.helper.data_structure import dict_to_list
|
|
26
26
|
from aa_intel_tool.models import Scan, ScanData
|
|
27
27
|
from aa_intel_tool.parser.helper.db import safe_scan_to_db
|
|
28
28
|
|
|
29
29
|
logger = LoggerAddTag(my_logger=get_extension_logger(name=__name__), prefix=__title__)
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
def
|
|
32
|
+
def _is_on_grid(distance: str) -> bool:
|
|
33
|
+
"""
|
|
34
|
+
Determine if something is "on grid" or not
|
|
35
|
+
|
|
36
|
+
:param distance:
|
|
37
|
+
:type distance:
|
|
38
|
+
:return:
|
|
39
|
+
:rtype:
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
# AA Intel Tool
|
|
43
|
+
from aa_intel_tool.constants import ( # pylint: disable=import-outside-toplevel
|
|
44
|
+
REGEX_PATTERN,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
if re.search(pattern=REGEX_PATTERN["localised_on_grid"], string=distance):
|
|
48
|
+
# line = re.split(pattern=r" ", string=distance)
|
|
49
|
+
distance_sanitised = int(re.sub(r"[^0-9]", "", distance))
|
|
50
|
+
|
|
51
|
+
if distance_sanitised <= AppSettings.INTELTOOL_DSCAN_GRID_SIZE:
|
|
52
|
+
return True
|
|
53
|
+
|
|
54
|
+
return False
|
|
55
|
+
|
|
56
|
+
return False
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _get_type_info_dict(eve_type: tuple) -> dict:
|
|
60
|
+
"""
|
|
61
|
+
Get the eve_type info dict
|
|
62
|
+
|
|
63
|
+
eve_type[0] = ID
|
|
64
|
+
eve_type[1] = Name
|
|
65
|
+
eve_type[2] = Group ID
|
|
66
|
+
eve_type[3] = Group Name
|
|
67
|
+
|
|
68
|
+
:param eve_type:
|
|
69
|
+
:type eve_type:
|
|
70
|
+
:return:
|
|
71
|
+
:rtype:
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
"id": eve_type[0],
|
|
76
|
+
"name": eve_type[1],
|
|
77
|
+
"type_id": eve_type[2],
|
|
78
|
+
"type_name": eve_type[3],
|
|
79
|
+
"image": eveimageserver.type_icon_url(type_id=eve_type[0], size=32),
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _get_ships(eve_types: QuerySet, counter: dict) -> dict:
|
|
84
|
+
"""
|
|
85
|
+
Get the ships
|
|
86
|
+
This will be the content of the following tables in the D-Scan view:
|
|
87
|
+
» All Ships
|
|
88
|
+
» On Grid
|
|
89
|
+
» Off Grid
|
|
90
|
+
» Ship Types
|
|
91
|
+
|
|
92
|
+
:param eve_types:
|
|
93
|
+
:type eve_types:
|
|
94
|
+
:param counter:
|
|
95
|
+
:type counter:
|
|
96
|
+
:return:
|
|
97
|
+
:rtype:
|
|
98
|
+
"""
|
|
99
|
+
|
|
33
100
|
ships = {"all": {}, "ongrid": {}, "offgrid": {}, "types": {}}
|
|
34
101
|
|
|
35
102
|
eve_types_ships = eve_types.filter(
|
|
36
103
|
eve_group__eve_category_id__exact=EveCategoryId.SHIP
|
|
37
104
|
)
|
|
38
105
|
|
|
39
|
-
for
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
106
|
+
for eve_type in eve_types_ships:
|
|
107
|
+
# Info for "All Ships" table
|
|
108
|
+
if eve_type[0] in counter["all"]:
|
|
109
|
+
if eve_type[1] not in ships["all"]:
|
|
110
|
+
ships["all"][eve_type[1]] = _get_type_info_dict(eve_type=eve_type)
|
|
111
|
+
ships["all"][eve_type[1]]["count"] = counter["all"][eve_type[0]]
|
|
112
|
+
|
|
113
|
+
# Info for "On Grid" table
|
|
114
|
+
if eve_type[0] in counter["ongrid"]:
|
|
115
|
+
if eve_type[1] not in ships["ongrid"]:
|
|
116
|
+
ships["ongrid"][eve_type[1]] = _get_type_info_dict(eve_type=eve_type)
|
|
117
|
+
ships["ongrid"][eve_type[1]]["count"] = counter["ongrid"][eve_type[0]]
|
|
118
|
+
|
|
119
|
+
# Info for "Off Grid" table
|
|
120
|
+
if eve_type[0] in counter["offgrid"]:
|
|
121
|
+
if eve_type[1] not in ships["offgrid"]:
|
|
122
|
+
ships["offgrid"][eve_type[1]] = _get_type_info_dict(eve_type=eve_type)
|
|
123
|
+
ships["offgrid"][eve_type[1]]["count"] = counter["offgrid"][eve_type[0]]
|
|
124
|
+
|
|
125
|
+
# Info for "Ship Types" table
|
|
126
|
+
if eve_type[3] not in ships["types"]:
|
|
127
|
+
ships["types"][eve_type[3]] = {
|
|
128
|
+
"id": eve_type[2],
|
|
129
|
+
"name": eve_type[3],
|
|
130
|
+
"count": 0,
|
|
49
131
|
}
|
|
50
132
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
133
|
+
# Add the count to the ship types
|
|
134
|
+
ships["types"][eve_type[3]]["count"] += counter["all"][eve_type[0]]
|
|
135
|
+
|
|
136
|
+
# Leaving this here just in case the method in the first loop turns out to be faulty
|
|
137
|
+
# for ship_name, ship_info in ships["all"].items(): # pylint: disable=unused-variable
|
|
138
|
+
# if ship_info["type_name"] not in counter["type"]:
|
|
139
|
+
# counter["type"][ship_info["type_name"]] = 0
|
|
140
|
+
#
|
|
141
|
+
# counter["type"][ship_info["type_name"]] += ship_info["count"]
|
|
142
|
+
#
|
|
143
|
+
# if ship_info["type_name"] not in ships["types"]:
|
|
144
|
+
# ships["types"][ship_info["type_name"]] = {
|
|
145
|
+
# "name": ship_info["type_name"],
|
|
146
|
+
# "name_sanitised": slugify(ship_info["type_name"]),
|
|
147
|
+
# }
|
|
148
|
+
#
|
|
149
|
+
# ships["types"][ship_info["type_name"]]["count"] = counter["type"][
|
|
150
|
+
# ship_info["type_name"]
|
|
151
|
+
# ]
|
|
61
152
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"type_name_sanitised": slugify(ship_type_name),
|
|
69
|
-
"count": counter["offgrid"][ship_id],
|
|
70
|
-
"image": eveimageserver.type_icon_url(type_id=ship_id, size=32),
|
|
71
|
-
}
|
|
153
|
+
return {
|
|
154
|
+
"all": dict_to_list(input_dict=ships["all"]),
|
|
155
|
+
"ongrid": dict_to_list(input_dict=ships["ongrid"]),
|
|
156
|
+
"offgrid": dict_to_list(input_dict=ships["offgrid"]),
|
|
157
|
+
"types": dict_to_list(input_dict=ships["types"]),
|
|
158
|
+
}
|
|
72
159
|
|
|
73
|
-
for ship_name, ship_info in ships["all"].items():
|
|
74
|
-
if ship_info["type_name"] not in counter["type"]:
|
|
75
|
-
counter["type"][ship_info["type_name"]] = 0
|
|
76
160
|
|
|
77
|
-
|
|
161
|
+
def _get_upwell_structures_on_grid(eve_types: QuerySet, dscan_list: list) -> list:
|
|
162
|
+
"""
|
|
163
|
+
Get all Upwell structures that are on grid
|
|
78
164
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
165
|
+
:param eve_types:
|
|
166
|
+
:type eve_types:
|
|
167
|
+
:param counter:
|
|
168
|
+
:type counter:
|
|
169
|
+
:return:
|
|
170
|
+
:rtype:
|
|
171
|
+
"""
|
|
84
172
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
# Sort and clean up the dicts
|
|
90
|
-
cleaned_ships_all = [
|
|
91
|
-
ship
|
|
92
|
-
for (
|
|
93
|
-
ship_name, # pylint: disable=unused-variable
|
|
94
|
-
ship,
|
|
95
|
-
) in sorted(ships["all"].items())
|
|
96
|
-
]
|
|
97
|
-
cleaned_ships_ongrid = [
|
|
98
|
-
ship
|
|
99
|
-
for (
|
|
100
|
-
ship_name, # pylint: disable=unused-variable
|
|
101
|
-
ship,
|
|
102
|
-
) in sorted(ships["ongrid"].items())
|
|
103
|
-
]
|
|
104
|
-
cleaned_ships_offgrid = [
|
|
105
|
-
ship
|
|
106
|
-
for (
|
|
107
|
-
ship_name, # pylint: disable=unused-variable
|
|
108
|
-
ship,
|
|
109
|
-
) in sorted(ships["offgrid"].items())
|
|
110
|
-
]
|
|
111
|
-
cleaned_ships_types = [
|
|
112
|
-
ship
|
|
113
|
-
for (
|
|
114
|
-
ship_name, # pylint: disable=unused-variable
|
|
115
|
-
ship,
|
|
116
|
-
) in sorted(ships["types"].items())
|
|
117
|
-
]
|
|
173
|
+
eve_types_structures = eve_types.filter(
|
|
174
|
+
eve_group__eve_category_id__exact=EveCategoryId.STRUCTURE
|
|
175
|
+
)
|
|
118
176
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
177
|
+
structures_on_grid = {}
|
|
178
|
+
|
|
179
|
+
for item in dscan_list:
|
|
180
|
+
if eve_types_structures.filter(id=item[0]).exists() and _is_on_grid(item[3]):
|
|
181
|
+
if item[0] not in structures_on_grid:
|
|
182
|
+
structures_on_grid[item[0]] = {
|
|
183
|
+
"id": item[0],
|
|
184
|
+
"type": item[2],
|
|
185
|
+
"count": 0,
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
structures_on_grid[item[0]]["count"] += 1
|
|
189
|
+
|
|
190
|
+
return dict_to_list(structures_on_grid)
|
|
125
191
|
|
|
126
192
|
|
|
127
193
|
def parse(scan_data: list) -> Scan:
|
|
@@ -137,14 +203,21 @@ def parse(scan_data: list) -> Scan:
|
|
|
137
203
|
message = _("The D-Scan module is currently disabled.")
|
|
138
204
|
|
|
139
205
|
if AppSettings.INTELTOOL_ENABLE_MODULE_DSCAN is True:
|
|
206
|
+
# AA Intel Tool
|
|
207
|
+
from aa_intel_tool.constants import ( # pylint: disable=import-outside-toplevel
|
|
208
|
+
REGEX_PATTERN,
|
|
209
|
+
)
|
|
210
|
+
|
|
140
211
|
counter = {"all": {}, "ongrid": {}, "offgrid": {}, "type": {}}
|
|
141
212
|
eve_ids = {"all": [], "ongrid": [], "offgrid": []}
|
|
213
|
+
dscan_lines = []
|
|
214
|
+
parsed_data = {}
|
|
142
215
|
|
|
143
216
|
# Let's split this list up
|
|
144
217
|
#
|
|
145
218
|
# [0] => Item ID
|
|
146
219
|
# [1] => Name
|
|
147
|
-
# [2] => Ship Class
|
|
220
|
+
# [2] => Ship Class / Structure Type
|
|
148
221
|
# [3] => Distance
|
|
149
222
|
for entry in scan_data:
|
|
150
223
|
line = re.split(pattern=r"\t+", string=entry.rstrip("\t"))
|
|
@@ -153,48 +226,67 @@ def parse(scan_data: list) -> Scan:
|
|
|
153
226
|
if entry_id not in counter["all"]:
|
|
154
227
|
counter["all"][entry_id] = 0
|
|
155
228
|
|
|
156
|
-
if line[3]
|
|
157
|
-
if entry_id not in counter["offgrid"]:
|
|
158
|
-
counter["offgrid"][entry_id] = 0
|
|
159
|
-
|
|
160
|
-
counter["offgrid"][entry_id] += 1
|
|
161
|
-
eve_ids["offgrid"].append(entry_id)
|
|
162
|
-
else:
|
|
229
|
+
if re.search(pattern=REGEX_PATTERN["localised_on_grid"], string=line[3]):
|
|
163
230
|
if entry_id not in counter["ongrid"]:
|
|
164
231
|
counter["ongrid"][entry_id] = 0
|
|
165
232
|
|
|
166
233
|
counter["ongrid"][entry_id] += 1
|
|
167
234
|
eve_ids["ongrid"].append(entry_id)
|
|
235
|
+
else:
|
|
236
|
+
if entry_id not in counter["offgrid"]:
|
|
237
|
+
counter["offgrid"][entry_id] = 0
|
|
168
238
|
|
|
169
|
-
|
|
239
|
+
counter["offgrid"][entry_id] += 1
|
|
240
|
+
eve_ids["offgrid"].append(entry_id)
|
|
170
241
|
|
|
242
|
+
counter["all"][entry_id] += 1
|
|
171
243
|
eve_ids["all"].append(entry_id)
|
|
244
|
+
dscan_lines.append([entry_id, line[1], line[2], line[3]])
|
|
172
245
|
|
|
173
246
|
eve_types = EveType.objects.bulk_get_or_create_esi(
|
|
174
247
|
ids=set(eve_ids["all"]), include_children=True
|
|
175
|
-
).values_list("id", "name", "eve_group__id", "eve_group__name")
|
|
248
|
+
).values_list("id", "name", "eve_group__id", "eve_group__name", named=True)
|
|
176
249
|
|
|
177
250
|
# Parse the data
|
|
178
|
-
ships =
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
251
|
+
ships = _get_ships(eve_types=eve_types, counter=counter)
|
|
252
|
+
upwell_structures = _get_upwell_structures_on_grid(
|
|
253
|
+
eve_types=eve_types, dscan_list=dscan_lines
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
# Add "ship types" to parsed data when available
|
|
257
|
+
if len(ships["types"]):
|
|
258
|
+
parsed_data["shiptypes"] = {
|
|
182
259
|
"section": ScanData.Section.SHIPTYPES,
|
|
183
260
|
"data": ships["types"],
|
|
184
|
-
}
|
|
185
|
-
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
# Add "ships all" to parsed data when available
|
|
264
|
+
if len(ships["all"]):
|
|
265
|
+
parsed_data["all"] = {
|
|
186
266
|
"section": ScanData.Section.SHIPLIST,
|
|
187
267
|
"data": ships["all"],
|
|
188
|
-
}
|
|
189
|
-
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
# Add "ships on grid" to parsed data when available
|
|
271
|
+
if len(ships["ongrid"]):
|
|
272
|
+
parsed_data["ongrid"] = {
|
|
190
273
|
"section": ScanData.Section.SHIPLIST_ON_GRID,
|
|
191
274
|
"data": ships["ongrid"],
|
|
192
|
-
}
|
|
193
|
-
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
# Add "ships off grid" to parsed data when available
|
|
278
|
+
if len(ships["offgrid"]):
|
|
279
|
+
parsed_data["offgrid"] = {
|
|
194
280
|
"section": ScanData.Section.SHIPLIST_OFF_GRID,
|
|
195
281
|
"data": ships["offgrid"],
|
|
196
|
-
}
|
|
197
|
-
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
# Add "Upwell structures on grid" to parsed data when available
|
|
285
|
+
if len(upwell_structures):
|
|
286
|
+
parsed_data["sructures_on_grid"] = {
|
|
287
|
+
"section": ScanData.Section.STRUCTURES_ON_GRID,
|
|
288
|
+
"data": upwell_structures,
|
|
289
|
+
}
|
|
198
290
|
|
|
199
291
|
return safe_scan_to_db(scan_type=Scan.Type.DSCAN, parsed_data=parsed_data)
|
|
200
292
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
/* Highlighting similar table rows on mouse over and click
|
|
3
|
+
/* Highlighting similar table rows on mouse over and click for chat scans
|
|
4
4
|
--------------------------------------------------------------------------------- */
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const removeCorporationStickyComplete = (element) => {
|
|
13
13
|
let removeCorporationSticky = true;
|
|
14
14
|
|
|
15
|
-
$(
|
|
15
|
+
$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`).each((i, el) => {
|
|
16
16
|
if ($(el).hasClass('aa-intel-highlight-sticky')) {
|
|
17
17
|
removeCorporationSticky = false;
|
|
18
18
|
}
|
|
@@ -31,7 +31,7 @@ const removeCorporationStickyComplete = (element) => {
|
|
|
31
31
|
const removeAllianceStickyComplete = (element) => {
|
|
32
32
|
let removeAllianceSticky = true;
|
|
33
33
|
|
|
34
|
-
$(
|
|
34
|
+
$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`).each((i, el) => {
|
|
35
35
|
if ($(el).hasClass('aa-intel-highlight-sticky')) {
|
|
36
36
|
removeAllianceSticky = false;
|
|
37
37
|
}
|
|
@@ -47,7 +47,7 @@ const removeAllianceStickyComplete = (element) => {
|
|
|
47
47
|
* @param element
|
|
48
48
|
*/
|
|
49
49
|
const allianceTableAddStickyByAllianceId = (element) => {
|
|
50
|
-
$(
|
|
50
|
+
$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
51
51
|
.addClass('aa-intel-highlight-sticky');
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -58,7 +58,7 @@ const allianceTableAddStickyByAllianceId = (element) => {
|
|
|
58
58
|
* @param element
|
|
59
59
|
*/
|
|
60
60
|
const allianceTableAddHighlightByAllianceId = (element) => {
|
|
61
|
-
$(
|
|
61
|
+
$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
62
62
|
.addClass('aa-intel-highlight');
|
|
63
63
|
};
|
|
64
64
|
|
|
@@ -69,7 +69,7 @@ const allianceTableAddHighlightByAllianceId = (element) => {
|
|
|
69
69
|
* @param element
|
|
70
70
|
*/
|
|
71
71
|
const allianceTableRemoveStickyByAllianceId = (element) => {
|
|
72
|
-
$(
|
|
72
|
+
$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
73
73
|
.removeClass('aa-intel-highlight-sticky');
|
|
74
74
|
};
|
|
75
75
|
|
|
@@ -80,7 +80,7 @@ const allianceTableRemoveStickyByAllianceId = (element) => {
|
|
|
80
80
|
* @param element
|
|
81
81
|
*/
|
|
82
82
|
const allianceTableRemoveHighlightByAllianceId = (element) => {
|
|
83
|
-
$(
|
|
83
|
+
$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
84
84
|
.removeClass('aa-intel-highlight');
|
|
85
85
|
};
|
|
86
86
|
|
|
@@ -91,7 +91,7 @@ const allianceTableRemoveHighlightByAllianceId = (element) => {
|
|
|
91
91
|
* @param element
|
|
92
92
|
*/
|
|
93
93
|
const corporationTableAddStickyByCorporationId = (element) => {
|
|
94
|
-
$(
|
|
94
|
+
$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
95
95
|
.addClass('aa-intel-highlight-sticky');
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -102,7 +102,7 @@ const corporationTableAddStickyByCorporationId = (element) => {
|
|
|
102
102
|
* @param element
|
|
103
103
|
*/
|
|
104
104
|
const corporationTableAddHighlightByCorporationId = (element) => {
|
|
105
|
-
$(
|
|
105
|
+
$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
106
106
|
.addClass('aa-intel-highlight');
|
|
107
107
|
};
|
|
108
108
|
|
|
@@ -113,7 +113,7 @@ const corporationTableAddHighlightByCorporationId = (element) => {
|
|
|
113
113
|
* @param element
|
|
114
114
|
*/
|
|
115
115
|
const corporationTableAddStickyByAllianceId = (element) => {
|
|
116
|
-
$(
|
|
116
|
+
$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
117
117
|
.addClass('aa-intel-highlight-sticky');
|
|
118
118
|
};
|
|
119
119
|
|
|
@@ -124,7 +124,7 @@ const corporationTableAddStickyByAllianceId = (element) => {
|
|
|
124
124
|
* @param element
|
|
125
125
|
*/
|
|
126
126
|
const corporationTableAddHighlightByAllianceId = (element) => {
|
|
127
|
-
$(
|
|
127
|
+
$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
128
128
|
.addClass('aa-intel-highlight');
|
|
129
129
|
};
|
|
130
130
|
|
|
@@ -135,7 +135,7 @@ const corporationTableAddHighlightByAllianceId = (element) => {
|
|
|
135
135
|
* @param element
|
|
136
136
|
*/
|
|
137
137
|
const corporationTableRemoveStickyByCorporationId = (element) => {
|
|
138
|
-
$(
|
|
138
|
+
$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
139
139
|
.removeClass('aa-intel-highlight-sticky');
|
|
140
140
|
};
|
|
141
141
|
|
|
@@ -146,7 +146,7 @@ const corporationTableRemoveStickyByCorporationId = (element) => {
|
|
|
146
146
|
* @param element
|
|
147
147
|
*/
|
|
148
148
|
const corporationTableRemoveHighlightByCorporationId = (element) => {
|
|
149
|
-
$(
|
|
149
|
+
$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
150
150
|
.removeClass('aa-intel-highlight');
|
|
151
151
|
};
|
|
152
152
|
|
|
@@ -157,7 +157,7 @@ const corporationTableRemoveHighlightByCorporationId = (element) => {
|
|
|
157
157
|
* @param element
|
|
158
158
|
*/
|
|
159
159
|
const corporationTableRemoveStickyByAllianceId = (element) => {
|
|
160
|
-
$(
|
|
160
|
+
$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
161
161
|
.removeClass('aa-intel-highlight-sticky');
|
|
162
162
|
};
|
|
163
163
|
|
|
@@ -168,7 +168,7 @@ const corporationTableRemoveStickyByAllianceId = (element) => {
|
|
|
168
168
|
* @param element
|
|
169
169
|
*/
|
|
170
170
|
const corporationTableRemoveHighlightByAllianceId = (element) => {
|
|
171
|
-
$(
|
|
171
|
+
$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
172
172
|
.removeClass('aa-intel-highlight');
|
|
173
173
|
};
|
|
174
174
|
|
|
@@ -179,7 +179,7 @@ const corporationTableRemoveHighlightByAllianceId = (element) => {
|
|
|
179
179
|
* @param element
|
|
180
180
|
*/
|
|
181
181
|
const pilotTableAddStickyByCorporationId = (element) => {
|
|
182
|
-
$(
|
|
182
|
+
$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
183
183
|
.addClass('aa-intel-highlight-sticky');
|
|
184
184
|
};
|
|
185
185
|
|
|
@@ -190,7 +190,7 @@ const pilotTableAddStickyByCorporationId = (element) => {
|
|
|
190
190
|
* @param element
|
|
191
191
|
*/
|
|
192
192
|
const pilotTableAddHighlightByCorporationId = (element) => {
|
|
193
|
-
$(
|
|
193
|
+
$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
194
194
|
.addClass('aa-intel-highlight');
|
|
195
195
|
};
|
|
196
196
|
|
|
@@ -201,7 +201,7 @@ const pilotTableAddHighlightByCorporationId = (element) => {
|
|
|
201
201
|
* @param element
|
|
202
202
|
*/
|
|
203
203
|
const pilotTableAddStickyByAllianceId = (element) => {
|
|
204
|
-
$(
|
|
204
|
+
$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
205
205
|
.addClass('aa-intel-highlight-sticky');
|
|
206
206
|
};
|
|
207
207
|
|
|
@@ -212,7 +212,7 @@ const pilotTableAddStickyByAllianceId = (element) => {
|
|
|
212
212
|
* @param element
|
|
213
213
|
*/
|
|
214
214
|
const pilotTableAddHighlightByAllianceId = (element) => {
|
|
215
|
-
$(
|
|
215
|
+
$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
216
216
|
.addClass('aa-intel-highlight');
|
|
217
217
|
};
|
|
218
218
|
|
|
@@ -223,7 +223,7 @@ const pilotTableAddHighlightByAllianceId = (element) => {
|
|
|
223
223
|
* @param element
|
|
224
224
|
*/
|
|
225
225
|
const pilotTableRemoveStickyByCorporationId = (element) => {
|
|
226
|
-
$(
|
|
226
|
+
$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
227
227
|
.removeClass('aa-intel-highlight-sticky');
|
|
228
228
|
};
|
|
229
229
|
|
|
@@ -234,7 +234,7 @@ const pilotTableRemoveStickyByCorporationId = (element) => {
|
|
|
234
234
|
* @param element
|
|
235
235
|
*/
|
|
236
236
|
const pilotTableRemoveHighlightByCorporationId = (element) => {
|
|
237
|
-
$(
|
|
237
|
+
$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data('corporationId')}"]`)
|
|
238
238
|
.removeClass('aa-intel-highlight');
|
|
239
239
|
};
|
|
240
240
|
|
|
@@ -245,7 +245,7 @@ const pilotTableRemoveHighlightByCorporationId = (element) => {
|
|
|
245
245
|
* @param element
|
|
246
246
|
*/
|
|
247
247
|
const pilotTableRemoveStickyByAllianceId = (element) => {
|
|
248
|
-
$(
|
|
248
|
+
$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
249
249
|
.removeClass('aa-intel-highlight-sticky');
|
|
250
250
|
};
|
|
251
251
|
|
|
@@ -256,7 +256,7 @@ const pilotTableRemoveStickyByAllianceId = (element) => {
|
|
|
256
256
|
* @param element
|
|
257
257
|
*/
|
|
258
258
|
const pilotTableRemoveHighlightByAllianceId = (element) => {
|
|
259
|
-
$(
|
|
259
|
+
$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data('allianceId')}"]`)
|
|
260
260
|
.removeClass('aa-intel-highlight');
|
|
261
261
|
};
|
|
262
262
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const removeCorporationStickyComplete=element=>{let removeCorporationSticky=true;$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).each((i,el)=>{if($(el).hasClass("aa-intel-highlight-sticky")){removeCorporationSticky=false}});return removeCorporationSticky};const removeAllianceStickyComplete=element=>{let removeAllianceSticky=true;$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).each((i,el)=>{if($(el).hasClass("aa-intel-highlight-sticky")){removeAllianceSticky=false}});return removeAllianceSticky};const allianceTableAddStickyByAllianceId=element=>{$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).addClass("aa-intel-highlight-sticky")};const allianceTableAddHighlightByAllianceId=element=>{$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).addClass("aa-intel-highlight")};const allianceTableRemoveStickyByAllianceId=element=>{$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).removeClass("aa-intel-highlight-sticky")};const allianceTableRemoveHighlightByAllianceId=element=>{$(`table.aa-intel-alliance-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).removeClass("aa-intel-highlight")};const corporationTableAddStickyByCorporationId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).addClass("aa-intel-highlight-sticky")};const corporationTableAddHighlightByCorporationId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).addClass("aa-intel-highlight")};const corporationTableAddStickyByAllianceId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).addClass("aa-intel-highlight-sticky")};const corporationTableAddHighlightByAllianceId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).addClass("aa-intel-highlight")};const corporationTableRemoveStickyByCorporationId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).removeClass("aa-intel-highlight-sticky")};const corporationTableRemoveHighlightByCorporationId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).removeClass("aa-intel-highlight")};const corporationTableRemoveStickyByAllianceId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).removeClass("aa-intel-highlight-sticky")};const corporationTableRemoveHighlightByAllianceId=element=>{$(`table.aa-intel-corporation-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).removeClass("aa-intel-highlight")};const pilotTableAddStickyByCorporationId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).addClass("aa-intel-highlight-sticky")};const pilotTableAddHighlightByCorporationId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).addClass("aa-intel-highlight")};const pilotTableAddStickyByAllianceId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).addClass("aa-intel-highlight-sticky")};const pilotTableAddHighlightByAllianceId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).addClass("aa-intel-highlight")};const pilotTableRemoveStickyByCorporationId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).removeClass("aa-intel-highlight-sticky")};const pilotTableRemoveHighlightByCorporationId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-corporation-id="${element.data("corporationId")}"]`).removeClass("aa-intel-highlight")};const pilotTableRemoveStickyByAllianceId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).removeClass("aa-intel-highlight-sticky")};const pilotTableRemoveHighlightByAllianceId=element=>{$(`table.aa-intel-pilot-participation-list tr[data-alliance-id="${element.data("allianceId")}"]`).removeClass("aa-intel-highlight")};const addHightlight=(by_table,table_row)=>{table_row.addClass("aa-intel-highlight");if(by_table==="alliance"){corporationTableAddHighlightByAllianceId(table_row);pilotTableAddHighlightByAllianceId(table_row)}if(by_table==="corporation"){allianceTableAddHighlightByAllianceId(table_row);pilotTableAddHighlightByCorporationId(table_row)}if(by_table==="pilot"){allianceTableAddHighlightByAllianceId(table_row);corporationTableAddHighlightByCorporationId(table_row)}};const addSticky=(by_table,table_row)=>{table_row.addClass("aa-intel-highlight-sticky");if(by_table==="alliance"){corporationTableAddStickyByAllianceId(table_row);pilotTableAddStickyByAllianceId(table_row)}if(by_table==="corporation"){allianceTableAddStickyByAllianceId(table_row);pilotTableAddStickyByCorporationId(table_row)}if(by_table==="pilot"){allianceTableAddStickyByAllianceId(table_row);corporationTableAddStickyByCorporationId(table_row)}};const removeHightlight=(by_table,table_row)=>{table_row.removeClass("aa-intel-highlight");if(by_table==="alliance"){corporationTableRemoveHighlightByAllianceId(table_row);pilotTableRemoveHighlightByAllianceId(table_row)}if(by_table==="corporation"){allianceTableRemoveHighlightByAllianceId(table_row);pilotTableRemoveHighlightByCorporationId(table_row)}if(by_table==="pilot"){allianceTableRemoveHighlightByAllianceId(table_row);corporationTableRemoveHighlightByCorporationId(table_row)}};const removeSticky=(by_table,table_row)=>{table_row.removeClass("aa-intel-highlight-sticky");if(by_table==="alliance"){corporationTableRemoveStickyByAllianceId(table_row);pilotTableRemoveStickyByAllianceId(table_row)}if(by_table==="corporation"){pilotTableRemoveStickyByCorporationId(table_row);if(removeAllianceStickyComplete(table_row)===true){allianceTableRemoveStickyByAllianceId(table_row)}}if(by_table==="pilot"){if(removeCorporationStickyComplete(table_row)===true){corporationTableRemoveStickyByCorporationId(table_row)}if(removeAllianceStickyComplete(table_row)===true){allianceTableRemoveStickyByAllianceId(table_row)}}};const changeStickyHighlight=(by_table,table_row)=>{if(table_row.hasClass("aa-intel-highlight-sticky")){removeSticky(by_table,table_row)}else{addSticky(by_table,table_row)}};
|
|
@@ -267,7 +267,7 @@ jQuery(document).ready(($) => {
|
|
|
267
267
|
elementAlliancesTotalCount.html(newTotal);
|
|
268
268
|
|
|
269
269
|
$(row)
|
|
270
|
-
.addClass(
|
|
270
|
+
.addClass(`aa-intel-alliance-participation-item aa-intel-alliance-id-${data['id']}`)
|
|
271
271
|
.attr('data-alliance-id', data['id']);
|
|
272
272
|
|
|
273
273
|
// Highlight
|
|
@@ -352,7 +352,7 @@ jQuery(document).ready(($) => {
|
|
|
352
352
|
elementCorporationsTotalCount.html(newTotal);
|
|
353
353
|
|
|
354
354
|
$(row)
|
|
355
|
-
.addClass(
|
|
355
|
+
.addClass(`aa-intel-corporation-participation-item aa-intel-corporation-id-${data['id']}`)
|
|
356
356
|
.attr('data-corporation-id', data['id'])
|
|
357
357
|
.attr('data-alliance-id', data['alliance']['id']);
|
|
358
358
|
|
|
@@ -443,7 +443,7 @@ jQuery(document).ready(($) => {
|
|
|
443
443
|
elementPilotsTotalCount.html(newTotal);
|
|
444
444
|
|
|
445
445
|
$(row)
|
|
446
|
-
.addClass(
|
|
446
|
+
.addClass(`aa-intel-corporation-participation-item aa-intel-corporation-id-${data['id']}`)
|
|
447
447
|
.attr('data-character-id', data['id'])
|
|
448
448
|
.attr('data-corporation-id', data['corporation']['id'])
|
|
449
449
|
.attr('data-alliance-id', data['alliance']['id']);
|