linking to Eurocontrol Aircraft performance DB

Are you having problems with using or developing a plugin? Let me know here.
Post Reply
dimbel
Posts: 20
Joined: Mon Nov 11, 2013 12:57 pm

linking to Eurocontrol Aircraft performance DB

Post by dimbel » Fri Jan 16, 2015 2:01 pm

Hi,

I stumbled over this website https://contentzone.eurocontrol.int/air ... ault.aspx?. After some searching in the forum, I found this post (http://forum.virtualradarserver.co.uk/v ... om+content and decided to give it a try to add this custom link.

Installed the CustomeContent plugin, created a file customlink.html and added this:

Code: Select all

<script type="text/javascript">
VRS.LinkSite["ICAO_info"] = "https://contentzone.eurocontrol.int/";

VRS.linkRenderHandlers.push(
   new VRS.LinkRenderHandler({
      linkSite:           VRS.LinkSite.ICAO_info,
      displayOrder:       400,
      canLinkAircraft:    function(/** VRS.Aircraft */ aircraft) { return aircraft && (aircraft.modelIcao.val); },
      hasChanged:         function(/** VRS.Aircraft */ aircraft) { return aircraft.modelIcao.chg; },
      title:              'eurcontrol.int',
      buildUrl:           function(/** VRS.Aircraft */ aircraft) { return 'https://contentzone.eurocontrol.int/aircraftperformance/details.aspx?ICAO=' + ( aircraft.modelIcao.val  ); },
      target:             'Eurocontrol'
   })
);

</script>
Added a line to add the content of the file at the end of HEAD in desktop.html, reloaded the webpage and it worked :) . It is not perfect, so feel free to post corrections/extensions.
Just wanted to share the website and my attempt at CustomContent plugin to the community here.

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

Re: linking to Eurocontrol Aircraft performance DB

Post by agw » Sun Jan 18, 2015 3:57 pm

I hadn't seen that site before. The detail pages are very interesting, thanks for that.

The script looks fine to me (although you missed out an "o" in "eurocontrol.int" :))

lindamor
Posts: 12
Joined: Sat Apr 04, 2015 11:10 pm

Re: linking to Eurocontrol Aircraft performance DB

Post by lindamor » Mon Apr 06, 2015 5:42 pm

Thank You!

Thank you for the script. I use it, and it works fine!

Because i am not familar to Java-script, let me ask, is there any fundus for various scripts to try out on my server?

In fact i am not able to just change the global Units from miles to kilometres....thats me (very rooky),so what can i do....
(maybe you can help me)

still wish you a good time...

Linda

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

Re: linking to Eurocontrol Aircraft performance DB

Post by agw » Sun Apr 26, 2015 6:15 pm

Sorry for the delay in replying! I'm afraid that there isn't any repository of scripts anywhere, at least none that I know of. I think the closest is probably just the set of example scripts in the documentation :)

lindamor
Posts: 12
Joined: Sat Apr 04, 2015 11:10 pm

Re: linking to Eurocontrol Aircraft performance DB

Post by lindamor » Tue May 12, 2015 3:10 pm

Hi

As i say my knowledge of Java-script is almost (entirely) zero, but anyway way i try to do somethings for find out various Solutions. :-)
So i was poach the script from "dimbel" and change it to work also for "planeplotters.net"
I do this without ANY knowledge of what i am doing, but it seems to work, so i put it out to the
forum community.

Code: Select all


<script type="text/javascript">
VRS.LinkSite["PlaneSpotters_net"] = "http://planespotters.net/";

VRS.linkRenderHandlers.push(
   new VRS.LinkRenderHandler({
      linkSite:           VRS.LinkSite.PlaneSpotters_net,
      displayOrder:       200,
      canLinkAircraft:    function(/** VRS.Aircraft */ aircraft) { return aircraft && (aircraft.registration.val); },
      hasChanged:         function(/** VRS.Aircraft */ aircraft) { return aircraft.registration.chg; },
      title:              'planespotters.net',
      buildUrl:           function(/** VRS.Aircraft */ aircraft) { return 'http://www.planespotters.net/search.php?q=' + ( aircraft.registration.val  ); },
      target:             'Planespotters'
   })
);

</script>

Please dont angry me, because i was not use my own brain, but without any knowledge of scripting, there is only
one way left, namely to steal the script and just change the values in it.

best regards
lindamor
Last edited by lindamor on Fri May 15, 2015 11:01 pm, edited 2 times in total.

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

Re: linking to Eurocontrol Aircraft performance DB

Post by agw » Fri May 15, 2015 7:03 pm

lindamor wrote:there is only one way left, namely to steal the script and just change the values in it.
No worries, it's how everything gets done :) The only thing I would say is that you might want to change the identifiers slightly so that your script can co-exist with the original. The identifier "ICAO_info" appears in these two lines:

Code: Select all

VRS.LinkSite["ICAO_info"] = "http://planespotters.net/";
      linkSite:           VRS.LinkSite.ICAO_info,
If you change that to something else, say PlaneSpotters_net, then you can use dimbel's original script and your script together and get both links:

Code: Select all

VRS.LinkSite["PlaneSpotters_net"] = "http://planespotters.net/";
      linkSite:           VRS.LinkSite.PlaneSpotters_net,

lindamor
Posts: 12
Joined: Sat Apr 04, 2015 11:10 pm

Re: linking to Eurocontrol Aircraft performance DB

Post by lindamor » Fri May 15, 2015 11:04 pm

Hello and a very nice day to all!
If you change that to something else, say PlaneSpotters_net, then you can use dimbel's original script and your script together and get both links:
It´s done right now :D

Post Reply