jfm
The problem with your code is that you didn't remove
selected.aircraft from the prototype url you used, and VRS doesn't have that...
which would have shown up if you had looked at the javascript console.
This function works:
Code: Select all
VRS.LinkSite["FlightRadar24DotCom"] = "flightradar24.com";
VRS.linkRenderHandlers.push(
new VRS.LinkRenderHandler({
linkSite: VRS.LinkSite.FlightRadar24DotCom,
displayOrder: 400,
canLinkAircraft: function(/** VRS.Aircraft */ aircraft) { return aircraft && (aircraft.registration.val || aircraft.callsign.val); },
hasChanged: function(/** VRS.Aircraft */ aircraft) { return aircraft.registration.chg || aircraft.callsign.chg; },
title: 'www.flightradar24.com',
buildUrl: function(/** VRS.Aircraft */ aircraft) { return 'https://www.flightradar24.com/' +
( aircraft.callsign.val ?
((!isNaN(aircraft.callsign.val) && aircraft.operatorIcao.val) ?
VRS.stringUtility.htmlEscape(aircraft.formatOperatorIcao() + aircraft.formatCallsign())
: VRS.stringUtility.htmlEscape(aircraft.formatCallsign()))
: VRS.stringUtility.htmlEscape(aircraft.formatRegistration(true)) ); },
target: 'flightradar24'
})
);
Although, honestly, I've never SEEN an aircraft in VRS that has an all-number callsign. But if that's what you want, the above code works.