If you're using raw files, I looks like you just need to add whatever extension they have to this line:
if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i))
So if your using a Nikon, it would be:
if (theFile.name.match(/\.(jpg|tif|psd|pdf|nef|)$/i))