| 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.OperatorFlag] = new VRS.RenderPropertyHandler({
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |                     property:               VRS.RenderProperty.OperatorFlag,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |                     surfaces:               VRS.RenderSurface.List + VRS.RenderSurface.DetailHead + VRS.RenderSurface.InfoWindow,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |                     headingKey:             'ListOperatorFlag',
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |                     labelKey:               'OperatorFlag',
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |                     sortableField:          VRS.AircraftListSortableField.OperatorIcao,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |                     headingAlignment:       VRS.Alignment.Centre,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |                     suppressLabelCallback:  function() { return true; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |                     fixedWidth:             function() { return VRS.globalOptions.aircraftOperatorFlagSize.width.toString() + 'px'; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |                     hasChangedCallback:     function(aircraft) { return aircraft.operatorIcao.chg || aircraft.icao.chg || aircraft.registration.chg || aircraft.manufacturer.chg; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |                     renderCallback:         function(aircraft) { return customFormatOperatorIcaoImageHtmlAircraft(aircraft); },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |                     tooltipChangedCallback: function(aircraft) { return aircraft.operatorIcao.chg || aircraft.operator.chg; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |                     tooltipCallback:        function(aircraft) { return aircraft.formatOperatorIcaoAndName(); }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |                 });
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | 
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | 
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |                 VRS.renderPropertyHandlers[VRS.RenderProperty.SilhouetteAndOpFlag] = new VRS.RenderPropertyHandler({
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |                     property:               VRS.RenderProperty.SilhouetteAndOpFlag,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |                     surfaces:               VRS.RenderSurface.List,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |                     headingKey:             'ListModelSilhouetteAndOpFlag',
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |                     labelKey:               'SilhouetteAndOpFlag',
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |                     headingAlignment:       VRS.Alignment.Centre,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |                     sortableField:          VRS.AircraftListSortableField.OperatorIcao,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |                     fixedWidth:             function() { return Math.max(VRS.globalOptions.aircraftSilhouetteSize.width, VRS.globalOptions.aircraftOperatorFlagSize.width).toString() + 'px'; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |                     // Changed the following line to include manufacturer
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |                     hasChangedCallback:     function(aircraft) { return aircraft.modelIcao.chg || aircraft.operatorIcao.chg || aircraft.registration.chg || aircraft.manufacturer.chg; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |                     // And this line to include a call to the custom HTML
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |                     renderCallback:         function(aircraft) { return aircraft.formatModelIcaoImageHtml() + customFormatOperatorIcaoImageHtmlAircraft(aircraft); },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |                     tooltipChangedCallback: function(aircraft) { return aircraft.model.chg || aircraft.modelIcao.chg || aircraft.countEngines.chg || aircraft.engineType.chg || aircraft.species.chg || aircraft.wakeTurbulenceCat.chg || aircraft.operatorIcao.chg || aircraft.operator.chg; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |                     tooltipCallback:        function(aircraft) {
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |                         var silhouetteTooltip = aircraft.formatModelIcaoNameAndDetail();
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |                         var opFlagTooltip = aircraft.formatOperatorIcaoAndName();
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |                         return silhouetteTooltip && opFlagTooltip ? silhouetteTooltip + '. ' + opFlagTooltip : silhouetteTooltip ? silhouetteTooltip : opFlagTooltip;
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |                     }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |                 });
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |             }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |             
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |             if(VRS.reportPropertyHandlers) {
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |                 VRS.reportPropertyHandlers[VRS.ReportAircraftProperty.OperatorFlag] = new VRS.ReportPropertyHandler({
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |                     property:           VRS.ReportAircraftProperty.OperatorFlag,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |                     surfaces:           VRS.ReportSurface.List + VRS.ReportSurface.DetailHead,
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |                     headingKey:         'ListOperatorFlag',
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |                     labelKey:           'OperatorFlag',
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |                     headingAlignment:   VRS.Alignment.Centre,
 | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 49 |  |  |                     fixedWidth:         function() { return VRS.globalOptions.aircraftOperatorFlagSize.width.toString() + 'px'; },
 | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |                     hasValue:           function(/** VRS_JSON_REPORT_AIRCRAFT */ json) { return !!json.opFlag || !!json.icao || !!json.reg || !!json.manufacturer; },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |                     renderCallback:     function(/** VRS_JSON_REPORT_AIRCRAFT */ json) { return customFormatOperatorIcaoImageHtml(json.manufacturer, json.opFlag, json.reg, json.icao); },
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |                     tooltipCallback:    function(/** VRS_JSON_REPORT_AIRCRAFT */ json) { return VRS.format.operatorIcaoAndName(json.owner, json.opFlag); }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |                 });
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |             }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |         });
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |     }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |     
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |     function customFormatOperatorIcaoImageHtmlAircraft(aircraft)
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |     {
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |         return customFormatOperatorIcaoImageHtml(aircraft.manufacturer.val, aircraft.operatorIcao.val, aircraft.registration.val, aircraft.icao.val);
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |     }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |     
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |     function customFormatOperatorIcaoImageHtml(manufacturer, operatorIcao, registration, icao)
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |     {
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |         var codeToUse = '';
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |         codeToUse = customPipeSeparatedCode(codeToUse, registration);        
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |         codeToUse = customPipeSeparatedCode(codeToUse, operatorIcao);
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |         codeToUse = customPipeSeparatedCode(codeToUse, icao);
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  | 	codeToUse = customPipeSeparatedCode(codeToUse, manufacturer);
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  | 
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |         var size = VRS.globalOptions.aircraftOperatorFlagSize;
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |         var result = '<img src="images/File-' + encodeURIComponent(codeToUse);
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |         if(VRS.browserHelper.isHighDpi()) result += '/HiDpi';
 | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |         result += '/OpFlag.png"' +
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |             ' width="' + size.width.toString() + 'px"' +
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |             ' height="' + size.height.toString() + 'px"' +
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |             ' />';
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  | 
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |         return result;
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |     }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  | 
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  | ////////
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |     
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |     function customPipeSeparatedCode(text, code)
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |     {
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |         var result = text;        
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |         if(code && code.length) {
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |             if(result.length) result += '|';
 | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |             result += code;
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |         }
 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |         return result;
 | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 92 |  |  |     }
 | 
            
                                                        
            
                                    
            
            
                | 93 |  |  |  | 
            
                        
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.