|
1
|
|
|
/** global: VRS */
|
|
2
|
|
|
if(VRS && VRS.globalDispatch && VRS.serverConfig) {
|
|
3
|
|
|
VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {
|
|
|
|
|
|
|
4
|
|
|
if(VRS.renderPropertyHandlers) {
|
|
5
|
|
|
VRS.renderPropertyHandlers[VRS.RenderProperty.Country] = new VRS.RenderPropertyHandler({
|
|
6
|
|
|
property: VRS.RenderProperty.Country,
|
|
7
|
|
|
surfaces: VRS.RenderSurface.List + VRS.RenderSurface.DetailHead + VRS.RenderSurface.InfoWindow,
|
|
8
|
|
|
headingKey: 'ListCountry',
|
|
9
|
|
|
labelKey: 'Country',
|
|
10
|
|
|
sortableField: VRS.AircraftListSortableField.Country,
|
|
11
|
|
|
suppressLabelCallback: function() { return true; },
|
|
12
|
|
|
fixedWidth: function() { return '27px'; },
|
|
13
|
|
|
hasChangedCallback: function(aircraft) { return aircraft.country.chg; },
|
|
14
|
|
|
renderCallback: function(aircraft) { return customFormatCountryFlagImageHtml(aircraft); },
|
|
15
|
|
|
tooltipChangedCallback: function(aircraft) { return aircraft.country.chg; },
|
|
16
|
|
|
tooltipCallback: function(aircraft) { return aircraft.country.val; }
|
|
17
|
|
|
});
|
|
18
|
|
|
}
|
|
19
|
|
|
});
|
|
20
|
|
|
}
|
|
21
|
|
|
|
|
22
|
|
|
function customFormatCountryFlagImageHtml(aircraft)
|
|
23
|
|
|
{
|
|
24
|
|
|
var result = '';
|
|
25
|
|
|
if(aircraft.country.val) {
|
|
26
|
|
|
var codeToUse = '';
|
|
27
|
|
|
var codeToUse = aircraft.country.val;
|
|
|
|
|
|
|
28
|
|
|
//Place images on 'country' folder
|
|
29
|
|
|
result = '<img src="images/web-country/Wdth-27/Hght-20';
|
|
30
|
|
|
if(VRS.browserHelper.isHighDpi()) result += '/HiDpi';
|
|
|
|
|
|
|
31
|
|
|
result += '/' + encodeURIComponent(codeToUse) +'.bmp" width="27px" height="20px" />';
|
|
32
|
|
|
}
|
|
33
|
|
|
return result;
|
|
34
|
|
|
}
|
|
35
|
|
|
|
|
36
|
|
|
function customPipeSeparatedCode(text, code)
|
|
37
|
|
|
{
|
|
38
|
|
|
var result = text;
|
|
39
|
|
|
if(code && code.length) {
|
|
40
|
|
|
if(result.length) result += '|';
|
|
|
|
|
|
|
41
|
|
|
result += code;
|
|
42
|
|
|
}
|
|
43
|
|
|
return result;
|
|
44
|
|
|
}
|
|
45
|
|
|
|
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.