Using JS to replace photo

Want to post something that doesn't quite fit into the other forums? This is the place for that.
Post Reply
GregoryGHarding
Posts: 96
Joined: Mon Jan 26, 2015 9:01 am
Location: CYYT

Using JS to replace photo

Post by GregoryGHarding » Thu Apr 09, 2015 6:51 pm

Code: Select all

	function changeSourceAll() {
    		var images = document.getElementsByTagName('img');
    		for (var i = 0; i < images.length; i++) {
        	 	if (images[i].src.indexOf('example1.png') !== -1) {
            			images[i].src = images[i].src.replace("example1.png", "example2.png");
        		}
    		}
	}

i would like to use something like this to change a photo on the details screen to one of my own photos. can you help?

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

Re: Using JS to replace photo

Post by agw » Sun Apr 26, 2015 5:03 pm

Sorry for the delay in replying - if you set the Photos folder in Tools | Options | Data Sources to the folder that holds your aircraft pictures then VRS will always use your photographs instead of the ones on airport-data.com. The pictures can be in PNG or JPEG format, they just need to have either the registration or the ICAO-24 code of the aircraft as the filename. If the pictures are organised into separate folders then enter the root folder and tell VRS to search all sub-folders for the picture.

Post Reply