View & Share Remote Image - crnormand/gurps GitHub Wiki

Type: Script

Contributor: Buzzard

Description: Provides a modal to specify a URL to a remotely hosted image and then displays that image inside of a Foundry image modal without having to host that image inside Foundry. Displayed images can then be shared with Players. This is very helpful for quickly sharing visual references in-game without having to download and upload images into Foundry.

new Dialog({
	title: "Remote Image",
	content: `<div class="form-group"><label for="url">Image URL</label><input type="text" name="url"/><br /><br /><label for="head">Title (optional)</label><input type="text" name="head"/></div><br />`,
	buttons: {
		ok: {
			label: "OK",
			icon: `<i class="fas fa-check"></i>`,
			callback: html => {
			const url = html.find("[name=url]").val();
			const head = html.find("[name=head]").val();
			const ip = new ImagePopout(url, {
				title: head
			});

			// Display Image Popout
			ip.render(true);

			}
		}
	}
}).render(true);
⚠️ **GitHub.com Fallback** ⚠️