forked from NightHackzz/player-tracker-nhz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player-tracker-ja-nhz.user.js
706 lines (603 loc) · 50 KB
/
player-tracker-ja-nhz.user.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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
// ==UserScript==
// @id iitc-plugin-player-tracker-nhz@ja
// @name IITC-ja Plugin: Player Tracker(nhz)
// @category Layer
// @version 0.11.1.20170211.ja.nhz.0001
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL https://github.com/NightHackzz/player-tracker-nhz/raw/master/player-tracker-ja-nhz.user.js
// @downloadURL https://github.com/NightHackzz/player-tracker-nhz/raw/master/player-tracker-ja-nhz.user.js
// @description [2017-02-11.0001] PlayerTracker(nhz) トレース色、追跡、履歴時間指定版.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @include https://www.ingress.com/mission/*
// @include http://www.ingress.com/mission/*
// @match https://www.ingress.com/mission/*
// @match http://www.ingress.com/mission/*
// @grant none
// ==/UserScript==
function wrapper(plugin_info) {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
//PLUGIN AUTHORS: writing a plugin outside of the IITC build environment? if so, delete these lines!!
//(leaving them in place might break the 'About IITC' page or break update checks)
plugin_info.buildName = 'iitc-ja-nhz';
plugin_info.dateTimeVersion = '20170211.0001';
plugin_info.pluginId = 'player-tracker-ja-nhz';
//END PLUGIN AUTHORS NOTE
// PLUGIN START ////////////////////////////////////////////////////////
window.PLAYER_TRACKER_MAX_TIME = 60*60*1000; // in milliseconds
window.PLAYER_TRACKER_MIN_ZOOM = 9;
window.PLAYER_TRACKER_MIN_OPACITY = 0.3;
window.PLAYER_TRACKER_LINE_COLOUR_ENL = '#ff0080';
window.PLAYER_TRACKER_LINE_COLOUR_RES = '#0000ff';
var PLAYER_TRACKER_NHZ_STORAGE_KEY = 'player-tracer-nhz-option';
// オプション値
var OptionData = { };
// use own namespace for plugin
window.plugin.playerTracker = function() {};
window.plugin.playerTracker.setup = function() {
$('<style>').prop('type', 'text/css').html('.plugin-player-tracker-popup a {\n color: inherit;\n text-decoration: underline;\n text-decoration-style: dashed;\n -moz-text-decoration-style: dashed;\n -webkit-text-decoration-style: dashed;\n}\n').appendTo('head');
var iconEnlImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAo1SURBVHjanJR5UJNnHscfp7ud7mxnt7u2M+3O9pruzPZ9k5CTHCQByRtCwpWDkIQr5BDU1a7Fiq0V3ogXiCBauVGQQ0AOkUMIoVLvWl1t3e1qW+tVtdt2tVKsMqXW7/4R1OqI2n1nPvPMvL/n9/vM87zzfckL8unkT8I/EPmcV4i1XkLMVSJiqhQRY6WAuJoY4ns3i8RV8mhztchirhFlm6qEBaYq4cKk+lBrepuab64SEUutmCRUCIh7WySxN8pJwgYBMZYJiaVWTCw1YkKmkpgqhcRRFybJbI0pSKjmf2jdFPq9vVF2I6VVAUeT/KekOuk1y0bxcVOlsMRcIw77fyQvGSuENZaNoh/S25WYO2zAwn0WLN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6+K9cW1iivEX+D42+fskarNZrzRAWWiFkvPKS6k9T9XkTDOURRSUBRaIkur5GW7K93ZaQZGo+TdCRV4nVCRk67oEr7y0pge/TR1fL6/pgbyA9YY0bTfvjUuyt/U/+16PXfgkaFMJFQlRUj3k+RYoCilMyjTjxZSecTUp0wxFIQV5vhmiJAM/iid97+dHZG/rf0aoyMuEioRkzW7ICyj45tvw25Qe/Ga1p36b0gPffBvkBRQka3by3jj3SqLmX34QJ3qIRDKJXT4yQJ5ngrzAhokZJvxm9TEPTco0Q15gg1+uCUSinusb2rd/MEeTXknU/AuhIs+xXtkJv3wbZHlWvLj6GH6dzOrF1ccgy7PCL98Gccp23hufhanVL+CHdMbKJ5H8CxvveshyeuGbb8OEDDN+lXwMv0o+hokZZvjm2yDN6eFeC5AgEnVLf3CHxcLU6hdEKvJTQkVClLINsjwbpLk2oX9Ic22Q5dkgSunkvXF8/vznd2DsuZ5480kkF3MtDYmaNX5CuhkT0s2Q5togUfeAUOm4UZxc8IM9vscuteqchIqEaHUHazwnaa4NRHIHP02n+f26P9hziKJE3TxuOg5x1lFIcmyQ5NggzjrqthCtnfWDP1DJPRJbCBUJInkLJDlWSHKsIJI38yC9P4qToQC8iL/rYvnWF2UcgShjZOnTO0EX9aMB4bxyhFCRIFZuZMWCHPzRnNV1mxmHur2cYUfxBF3Ijw6EW83fL0CodPt+VKenPe9gpFzoK4mk/EcLwvWVHYSK3PGjO88+5nhsok40NVEn+rbr+b8BANIDJqc+VKDfAAAAAElFTkSuQmCC';
plugin.playerTracker.iconEnl = L.Icon.Default.extend({options: {
iconUrl: iconEnlImage,
iconRetinaUrl: iconEnlRetImage
}});
plugin.playerTracker.iconRes = L.Icon.Default.extend({options: {
iconUrl: iconResImage,
iconRetinaUrl: iconResRetImage
}});
plugin.playerTracker.drawnTracesEnl = new L.LayerGroup();
plugin.playerTracker.drawnTracesRes = new L.LayerGroup();
// to avoid any favouritism, we'll put the player's own faction layer first
if (PLAYER.team == 'RESISTANCE') {
window.addLayerGroup('Player Tracker Resistance', plugin.playerTracker.drawnTracesRes, true);
window.addLayerGroup('Player Tracker Enlightened', plugin.playerTracker.drawnTracesEnl, true);
} else {
window.addLayerGroup('Player Tracker Enlightened', plugin.playerTracker.drawnTracesEnl, true);
window.addLayerGroup('Player Tracker Resistance', plugin.playerTracker.drawnTracesRes, true);
}
map.on('layeradd',function(obj) {
if(obj.layer === plugin.playerTracker.drawnTracesEnl || obj.layer === plugin.playerTracker.drawnTracesRes) {
obj.layer.eachLayer(function(marker) {
if(marker._icon) window.setupTooltips($(marker._icon));
});
}
});
plugin.playerTracker.playerPopup = new L.Popup({offset: L.point([1,-34])});
// オプション値読み込み
window.plugin.playerTracker.loadOption();
//---- PANEL
//if (window.useAndroidPanes()) {
// android.addPane('plugin-player-tracker-nhz', 'Player足跡', 'ic_action_user');
// addHook('paneChanged', window.plugin.playerTracker.onPaneChanged);
//} else {
$('#toolbox').append('<a onclick="window.plugin.playerTracker.playerTrackerDialog();return false;">Player足跡</a>');
//}
addHook('publicChatDataAvailable', window.plugin.playerTracker.handleData);
window.map.on('zoomend', function() {
window.plugin.playerTracker.zoomListener();
});
window.plugin.playerTracker.zoomListener();
plugin.playerTracker.setupUserSearch();
//cssData = "#playerTrackerDialog.mobile {background: transparent; border: 0 none !important; height: 100% !important; width: 100% !important; left: 0 !important; top: 0 !important; position: absolute; overflow: auto; z-index: 9000 !important; }";
//$('<style>') .prop('type', 'text/css') .html(cssData).appendTo('head');
};
// Android Panel
window.plugin.playerTracker.onPaneChanged = function(pane) {
if(pane == 'plugin-player-tracker-nhz') {
window.plugin.playerTracker.playerTrackerDialog();
} else {
$("#playerTrackerDialog").remove();
}
};
// Option Dialog
window.plugin.playerTracker.playerTrackerDialog = function() {
var html = $('<div>');
html.append($('<label>' , {
class : 'info-text',
text : '時間範囲:',
for : 'player-tracker-nhz-opt-priod'
}));
var select_priod = $($('<select>', {
value : 3 ,
id : 'player-tracker-nhz-opt-priod'
}))
.append($('<option>').val(3).text("3時間"))
.append($('<option>').val(6).text("6時間"))
.append($('<option>').val(12).text("12時間"))
.append($('<option>').val(24).text("24時間"));
html.append(select_priod);
html.append('<br>');
html.append($('<label>' , {
class : 'info-text',
text : '位置履歴数:',
for : 'player-tracker-nhz-opt-history'
}));
var select_history = $($('<select>', {
value : 6 ,
id : 'player-tracker-nhz-opt-history'
}))
.append($('<option>').val(10).text("10履歴"))
.append($('<option>').val(20).text("20履歴"));
html.append(select_history);
html.append($('<p>').text('※COMMのAllを過去にさかのぼって表示すると、過去追跡が可能です'));
//if (window.useAndroidPanes()) {
// $('<div>' , {
// id : 'playerTrackerDialog',
// class : 'mobile'
// }).append(html).appendTo(document.body);
// $('#player-tracker-nhz-opt-priod').val(OptionData.priod);
// $('#player-tracker-nhz-opt-history').val(OptionData.history);
//}
//else {
dialog({
html: html,
id: 'playerTracker-options',
title: 'Player足跡設定',
focusCallback: function() {
$('#player-tracker-nhz-opt-priod').val(OptionData.priod);
$('#player-tracker-nhz-opt-history').val(OptionData.history);
},
closeCallback:function() {
OptionData.priod =$('#player-tracker-nhz-opt-priod').val();
OptionData.history =$('#player-tracker-nhz-opt-history').val();
window.plugin.playerTracker.saveOption();
return true;
}
});
//}
};
// オプション値をロード
window.plugin.playerTracker.loadOption = function () {
var stream = localStorage.getItem(PLAYER_TRACKER_NHZ_STORAGE_KEY);
var _data = (stream === null) ? {} : JSON.parse(stream);
if (!!!_data.priod) {
_data.priod = 3;
}
if (!!!_data.history) {
_data.history = 10;
}
OptionData.priod = parseInt(_data.priod,10);
OptionData.history = parseInt(_data.history,10);
};
// オプション値を保存
window.plugin.playerTracker.saveOption = function () {
var stream = JSON.stringify(OptionData);
localStorage.setItem(PLAYER_TRACKER_NHZ_STORAGE_KEY,stream);
};
window.plugin.playerTracker.stored = {};
plugin.playerTracker.onClickListener = function(event) {
var marker = event.target;
if (marker.options.desc) {
plugin.playerTracker.playerPopup.setContent(marker.options.desc);
plugin.playerTracker.playerPopup.setLatLng(marker.getLatLng());
map.openPopup(plugin.playerTracker.playerPopup);
}
};
// force close all open tooltips before markers are cleared
window.plugin.playerTracker.closeIconTooltips = function() {
plugin.playerTracker.drawnTracesRes.eachLayer(function(layer) {
if ($(layer._icon)) { $(layer._icon).tooltip('close');}
});
plugin.playerTracker.drawnTracesEnl.eachLayer(function(layer) {
if ($(layer._icon)) { $(layer._icon).tooltip('close');}
});
};
window.plugin.playerTracker.zoomListener = function() {
var ctrl = $('.leaflet-control-layers-selector + span:contains("Player Tracker")').parent();
if(window.map.getZoom() < window.PLAYER_TRACKER_MIN_ZOOM) {
if (!window.isTouchDevice()) plugin.playerTracker.closeIconTooltips();
plugin.playerTracker.drawnTracesEnl.clearLayers();
plugin.playerTracker.drawnTracesRes.clearLayers();
ctrl.addClass('disabled').attr('title', 'Zoom in to show those.');
//note: zoomListener is also called at init time to set up things, so we only need to do this in here
window.chat.backgroundChannelData('plugin.playerTracker', 'all', false); //disable this plugin's interest in 'all' COMM
} else {
ctrl.removeClass('disabled').attr('title', '');
//note: zoomListener is also called at init time to set up things, so we only need to do this in here
window.chat.backgroundChannelData('plugin.playerTracker', 'all', true); //enable this plugin's interest in 'all' COMM
}
};
window.plugin.playerTracker.getLimit = function() {
return new Date().getTime() - window.PLAYER_TRACKER_MAX_TIME * OptionData.priod;
};
window.plugin.playerTracker.discardOldData = function() {
var limit = plugin.playerTracker.getLimit();
$.each(plugin.playerTracker.stored, function(plrname, player) {
var i;
var ev = player.events;
for(i = 0; i < ev.length; i++) {
if(ev[i].time >= limit) break;
}
if(i === 0) return true;
if(i === ev.length) return delete plugin.playerTracker.stored[plrname];
plugin.playerTracker.stored[plrname].events.splice(0, i);
});
};
window.plugin.playerTracker.eventHasLatLng = function(ev, lat, lng) {
var hasLatLng = false;
$.each(ev.latlngs, function(ind, ll) {
if(ll[0] === lat && ll[1] === lng) {
hasLatLng = true;
return false;
}
});
return hasLatLng;
};
window.plugin.playerTracker.processNewData = function(data) {
var limit = plugin.playerTracker.getLimit();
$.each(data.result, function(ind, json) {
// skip old data
if(json[1] < limit) return true;
// find player and portal information
var plrname, lat, lng, id=null, name, address;
var skipThisMessage = false;
$.each(json[2].plext.markup, function(ind, markup) {
switch(markup[0]) {
case 'TEXT':
// Destroy link and field messages depend on where the link or
// field was originally created. Therefore it’s not clear which
// portal the player is at, so ignore it.
if(markup[1].plain.indexOf('destroyed the Link') !== -1 ||
markup[1].plain.indexOf('destroyed a Control Field') !== -1 ||
markup[1].plain.indexOf('Your Link') !== -1) {
skipThisMessage = true;
return false;
}
break;
case 'PLAYER':
plrname = markup[1].plain;
break;
case 'PORTAL':
// link messages are “player linked X to Y” and the player is at
// X.
lat = lat ? lat : markup[1].latE6/1E6;
lng = lng ? lng : markup[1].lngE6/1E6;
// no GUID in the data any more - but we need some unique string. use the latE6,lngE6
id = markup[1].latE6+","+markup[1].lngE6;
name = name ? name : markup[1].name;
address = address ? address : markup[1].address;
break;
}
});
// skip unusable events
if(!plrname || !lat || !lng || !id || skipThisMessage) return true;
var newEvent = {
latlngs: [[lat, lng]],
ids: [id],
time: json[1],
name: name,
address: address
};
var playerData = window.plugin.playerTracker.stored[plrname];
// short-path if this is a new player
if(!playerData || playerData.events.length === 0) {
plugin.playerTracker.stored[plrname] = {
nick: plrname,
team: json[2].plext.team,
events: [newEvent]
};
return true;
}
var evts = playerData.events;
// there’s some data already. Need to find correct place to insert.
var i;
for(i = 0; i < evts.length; i++) {
if(evts[i].time > json[1]) break;
}
var cmp = Math.max(i-1, 0);
// so we have an event that happened at the same time. Most likely
// this is multiple resos destroyed at the same time.
if(evts[cmp].time === json[1]) {
evts[cmp].latlngs.push([lat, lng]);
evts[cmp].ids.push(id);
plugin.playerTracker.stored[plrname].events = evts;
return true;
}
// the time changed. Is the player still at the same location?
// assume this is an older event at the same location. Then we need
// to look at the next item in the event list. If this event is the
// newest one, there may not be a newer event so check for that. If
// it really is an older event at the same location, then skip it.
if(evts[cmp+1] && plugin.playerTracker.eventHasLatLng(evts[cmp+1], lat, lng))
return true;
// if this event is newer, need to look at the previous one
var sameLocation = plugin.playerTracker.eventHasLatLng(evts[cmp], lat, lng);
// if it’s the same location, just update the timestamp. Otherwise
// push as new event.
if(sameLocation) {
evts[cmp].time = json[1];
} else {
evts.splice(i, 0, newEvent);
}
// update player data
plugin.playerTracker.stored[plrname].events = evts;
});
};
window.plugin.playerTracker.getLatLngFromEvent = function(ev) {
//TODO? add weight to certain events, or otherwise prefer them, to give better locations?
var lats = 0;
var lngs = 0;
$.each(ev.latlngs, function(i, latlng) {
lats += latlng[0];
lngs += latlng[1];
});
return L.latLng(lats / ev.latlngs.length, lngs / ev.latlngs.length);
};
window.plugin.playerTracker.ago = function(time, now) {
var s = (now-time) / 1000;
var h = Math.floor(s / 3600);
var m = Math.floor((s % 3600) / 60);
var returnVal = m + '分';
if(h > 0) {
returnVal = h + '時間' + returnVal;
}
return returnVal;
};
function getLevel(lvl) {
return $('<span>')
.css({
padding: '4px',
color: 'white',
backgroundColor: COLORS_LVL[lvl],
})
.text(lvl);
}
window.plugin.playerTracker.drawData = function() {
var isTouchDev = window.isTouchDevice();
var gllfe = plugin.playerTracker.getLatLngFromEvent;
var polyLineByAgeEnl = [[], [], [], []];
var polyLineByAgeRes = [[], [], [], []];
var split = (PLAYER_TRACKER_MAX_TIME * OptionData.priod) / 4;
var now = new Date().getTime();
$.each(plugin.playerTracker.stored, function(plrname, playerData) {
if(!playerData || playerData.events.length === 0) {
console.warn('broken player data for plrname=' + plrname);
return true;
}
// gather line data and put them in buckets so we can color them by
// their age
var i;
var playerLine = [];
for(i = 1; i < playerData.events.length; i++) {
var p = playerData.events[i];
var ageBucket = Math.min(parseInt((now - p.time) / split), 4-1);
var line = [gllfe(p), gllfe(playerData.events[i-1])];
if(playerData.team === 'RESISTANCE')
polyLineByAgeRes[ageBucket].push(line);
else
polyLineByAgeEnl[ageBucket].push(line);
}
var evtsLength = playerData.events.length;
var last = playerData.events[evtsLength-1];
var ago = plugin.playerTracker.ago;
// tooltip for marker - no HTML - and not shown on touchscreen devices
var tooltip = isTouchDev ? '' : (playerData.nick+', '+ago(last.time, now)+'前');
// popup for marker
var popup = $('<div>')
.addClass('plugin-player-tracker-popup');
$('<span>')
.addClass('nickname ' + (playerData.team === 'RESISTANCE' ? 'res' : 'enl'))
.css('font-weight', 'bold')
.text(playerData.nick)
.appendTo(popup);
if(window.plugin.guessPlayerLevels !== undefined &&
window.plugin.guessPlayerLevels.fetchLevelDetailsByPlayer !== undefined) {
var level = $('<span>')
.css({'font-weight': 'bold', 'margin-left': '10px'})
.appendTo(popup);
var playerLevelDetails = window.plugin.guessPlayerLevels.fetchLevelDetailsByPlayer(plrname);
level
.text('Min level ')
.append(getLevel(playerLevelDetails.min));
if(playerLevelDetails.min != playerLevelDetails.guessed)
level
.append(document.createTextNode(', guessed level: '))
.append(getLevel(playerLevelDetails.guessed));
}
popup
.append('<br>')
.append(document.createTextNode(ago(last.time, now) + '前'))
.append('<br>')
.append(plugin.playerTracker.getPortalLink(last));
// show previous data in popup
if(evtsLength >= 2) {
popup
.append('<br>')
.append('<br>')
.append(document.createTextNode('位置履歴:'))
.append('<br>');
var table = $('<table>')
.appendTo(popup)
.css('border-spacing', '0');
//履歴数分
for(i = evtsLength - 2; i >= 0 && i >= evtsLength - OptionData.history ; i--) {
var ev = playerData.events[i];
$('<tr>')
.append($('<td>')
.text(ago(ev.time, now) + '前'))
.append($('<td>')
.append(plugin.playerTracker.getPortalLink(ev)))
.appendTo(table);
}
}
// calculate the closest portal to the player
var eventPortal = [];
var closestPortal;
var mostPortals = 0;
$.each(last.ids, function(i, id) {
if(eventPortal[id]) {
eventPortal[id]++;
} else {
eventPortal[id] = 1;
}
if(eventPortal[id] > mostPortals) {
mostPortals = eventPortal[id];
closestPortal = id;
}
});
// marker opacity
var relOpacity = 1 - (now - last.time) / (window.PLAYER_TRACKER_MAX_TIME * OptionData.priod);
var absOpacity = window.PLAYER_TRACKER_MIN_OPACITY + (1 - window.PLAYER_TRACKER_MIN_OPACITY) * relOpacity;
// marker itself
var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl();
// as per OverlappingMarkerSpiderfier docs, click events (popups, etc) must be handled via it rather than the standard
// marker click events. so store the popup text in the options, then display it in the oms click handler
var m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity, desc: popup[0], title: tooltip});
m.addEventListener('spiderfiedclick', plugin.playerTracker.onClickListener);
// m.bindPopup(title);
if (tooltip) {
// ensure tooltips are closed, sometimes they linger
m.on('mouseout', function() { $(this._icon).tooltip('close'); });
}
playerData.marker = m;
m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl);
window.registerMarkerForOMS(m);
// jQueryUI doesn’t automatically notice the new markers
if (!isTouchDev) {
window.setupTooltips($(m._icon));
}
});
// draw the poly lines to the map
$.each(polyLineByAgeEnl, function(i, polyLine) {
if(polyLine.length === 0) return true;
var opts = {
weight: 2-0.25*i,
color: PLAYER_TRACKER_LINE_COLOUR_ENL,
clickable: false,
opacity: 1-0.2*i,
dashArray: "5,8"
};
$.each(polyLine,function(ind,poly) {
L.polyline(poly, opts).addTo(plugin.playerTracker.drawnTracesEnl);
});
});
$.each(polyLineByAgeRes, function(i, polyLine) {
if(polyLine.length === 0) return true;
var opts = {
weight: 2-0.25*i,
color: PLAYER_TRACKER_LINE_COLOUR_RES,
clickable: false,
opacity: 1-0.2*i,
dashArray: "5,8"
};
$.each(polyLine, function(ind,poly) {
L.polyline(poly, opts).addTo(plugin.playerTracker.drawnTracesRes);
});
});
};
window.plugin.playerTracker.getPortalLink = function(data) {
var position = data.latlngs[0];
var ll = position.join(',');
return $('<a>')
.addClass('text-overflow-ellipsis')
.css('max-width', '15em')
.text(window.chat.getChatPortalName(data))
.prop({
title: window.chat.getChatPortalName(data),
href: '/intel?ll=' + ll + '&pll=' + ll,
})
.click(function(event) {
window.selectPortalByLatLng(position);
event.preventDefault();
return false;
})
.dblclick(function(event) {
map.setView(position, 17);
window.selectPortalByLatLng(position);
event.preventDefault();
return false;
});
};
window.plugin.playerTracker.handleData = function(data) {
if(window.map.getZoom() < window.PLAYER_TRACKER_MIN_ZOOM) return;
plugin.playerTracker.discardOldData();
plugin.playerTracker.processNewData(data);
if (!window.isTouchDevice()) plugin.playerTracker.closeIconTooltips();
plugin.playerTracker.drawnTracesEnl.clearLayers();
plugin.playerTracker.drawnTracesRes.clearLayers();
plugin.playerTracker.drawData();
};
window.plugin.playerTracker.findUser = function(nick) {
nick = nick.toLowerCase();
var foundPlayerData = false;
$.each(plugin.playerTracker.stored, function(plrname, playerData) {
if (playerData.nick.toLowerCase() === nick) {
foundPlayerData = playerData;
return false;
}
});
return foundPlayerData;
};
window.plugin.playerTracker.findUserPosition = function(nick) {
var data = window.plugin.playerTracker.findUser(nick);
if (!data) return false;
var last = data.events[data.events.length - 1];
return plugin.playerTracker.getLatLngFromEvent(last);
};
window.plugin.playerTracker.centerMapOnUser = function(nick) {
var data = plugin.playerTracker.findUser(nick);
if(!data) return false;
var last = data.events[data.events.length - 1];
var position = plugin.playerTracker.getLatLngFromEvent(last);
if(window.isSmartphone()) window.show('map');
window.map.setView(position, map.getZoom());
if(data.marker) {
window.plugin.playerTracker.onClickListener({target: data.marker});
}
return true;
};
window.plugin.playerTracker.onNicknameClicked = function(info) {
if (info.event.ctrlKey || info.event.metaKey) {
return !plugin.playerTracker.centerMapOnUser(info.nickname);
}
return true; // don't interrupt hook
};
window.plugin.playerTracker.onSearchResultSelected = function(result, event) {
event.stopPropagation(); // prevent chat from handling the click
if(window.isSmartphone()) window.show('map');
// if the user moved since the search was started, check if we have a new set of data
if(false === window.plugin.playerTracker.centerMapOnUser(result.nickname))
map.setView(result.position);
if(event.type == 'dblclick')
map.setZoom(17);
return true;
};
window.plugin.playerTracker.onSearch = function(query) {
var term = query.term.toLowerCase();
if (term.length && term[0] == '@') term = term.substr(1);
$.each(plugin.playerTracker.stored, function(nick, data) {
if(nick.toLowerCase().indexOf(term) === -1) return;
var event = data.events[data.events.length - 1];
query.addResult({
title: '<mark class="nickname help '+TEAM_TO_CSS[getTeam(data)]+'">' + nick + '</mark>',
nickname: nick,
description: data.team.substr(0,3) + ', last seen ' + unixTimeToDateTimeString(event.time),
position: plugin.playerTracker.getLatLngFromEvent(event),
onSelected: window.plugin.playerTracker.onSearchResultSelected,
});
});
};
window.plugin.playerTracker.setupUserSearch = function() {
addHook('nicknameClicked', window.plugin.playerTracker.onNicknameClicked);
addHook('search', window.plugin.playerTracker.onSearch);
};
var setup = plugin.playerTracker.setup;
// PLUGIN END //////////////////////////////////////////////////////////
setup.info = plugin_info; //add the script info data to the function as a property
if(!window.bootPlugins) window.bootPlugins = [];
window.bootPlugins.push(setup);
// if IITC has already booted, immediately run the 'setup' function
if(window.iitcLoaded && typeof setup === 'function') setup();
} // wrapper end
// inject code into site context
var script = document.createElement('script');
var info = {};
if (typeof GM_info !== 'undefined' && GM_info && GM_info.script) info.script = { version: GM_info.script.version, name: GM_info.script.name, description: GM_info.script.description };
script.appendChild(document.createTextNode('('+ wrapper +')('+JSON.stringify(info)+');'));
(document.body || document.head || document.documentElement).appendChild(script);