Diffrent background color for miliary in aircraft list?

Want to post something that doesn't quite fit into the other forums? This is the place for that.
Post Reply
DeWoert
Posts: 40
Joined: Mon Feb 29, 2016 9:36 pm

Diffrent background color for miliary in aircraft list?

Post by DeWoert » Sun Dec 11, 2016 8:23 pm

Is there a way to have the background color in the aircraftlist different for military aircraft ?
(The color can change to red for an emercency squawks flight.)
Would be nice if there was a way to give military aircraft a different background color.

agw
Posts: 1957
Joined: Fri Feb 17, 2012 3:20 am

Re: Diffrent background color for miliary in aircraft list?

Post by agw » Thu Dec 22, 2016 1:19 am

It's not easy to add new conditions to the code that colours in the background on the aircraft list. What you can do is take over one of the existing conditions - for example, you can add a script to automatically flag all military aircraft as interesting which will in turn colour them in differently on the aircraft list.

This script would mark all military aircraft as interesting:

Code: Select all

<script type="text/javascript">
    if(VRS && VRS.globalDispatch && VRS.serverConfig) {
        VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {
            if(bootStrap.hookInitialised) {
                bootStrap.hookInitialised(function(pageSettings) {
                    if(pageSettings.aircraftList) {
                        pageSettings.aircraftList.hookAppliedJson(function() {
                            pageSettings.aircraftList.foreachAircraft(function(aircraft) {
                                if(aircraft.isMilitary.val) {
                                    aircraft.userInterested.val = true;
                                }
                            });
                        });
                    }
                });
            }
        });
    }
</script>

roadfun
Posts: 7
Joined: Mon Feb 06, 2017 6:58 pm

Re: Diffrent background color for miliary in aircraft list?

Post by roadfun » Tue Feb 07, 2017 10:23 pm

I think I'd like this as well. But I'm new to VRS and am not sure how/where to install/enable this script.

Thanks.

agw
Posts: 1957
Joined: Fri Feb 17, 2012 3:20 am

Re: Diffrent background color for miliary in aircraft list?

Post by agw » Mon Feb 13, 2017 2:09 am

You just need to install the custom content plugin. Save the script as a .html file somewhere on your machine and then follow the instructions on this page:

http://www.virtualradarserver.co.uk/Doc ... tings.aspx

to inject the script file at the END of HEAD for address *. The custom content plugin's options screen can be reached via Tools | Plugins and then click the Options button next to the custom content plugin's entry in the list that it shows.

Post Reply