<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
	Created by Michael Schuijff &lt;michael@reglobe.nl&gt;
	Copyright Lost Images, The Netherlands
	
	For more information, visit www.michaelschuijff.nl
*/

(function () {
	let input = createElement('input', 'hidden');
	input.type = 'file', document.body.append(input);

	window.gallery = function (success, multiple, accept) {
		accept = accept || 'image/*';
		
		if (multiple) {
			input.setAttribute('multiple', true)
		} else {
			input.removeAttribute('multiple')
		}
		
		input.setAttribute('accept', accept);
		
		input.onchange = () =&gt; {
			if (!success || !input.files.length) {
				return;
			}
			
			if (multiple) {
				success(Array.from(input.files));
			} else {
				success(input.files[0]);
			}
		}
		
		input.value = '';
		
		input.click();
	}
})();
</pre></body></html>