//- UNCLASSIFIED

block layout_parms
	- prep = true 

if type == "help"
	:markdown
		# layout options:

			- prep = prepare brower (!{prep}) 
			- socketio = socketio path (!{socketio})
			- client = client name (!{client})
			- table = endpoint name (!{table})
			- type = render type (!{type})
			- query = query options (!{JSON.stringify(query)})
			- path = source path (!{path})

	block layout_help

else
	html(lang="en")
		head
			meta(http-equiv="Content-Type",content="text/html; charset=utf-8;")

			//- Tell IE to use the latest, best version (or Chrome Frame if pre-IE11).
			meta(http-equiv="X-UA-Compatible", content="IE=Edge,chrome=1")

			//- Make the application on mobile take up the full browser screen and disable user scaling.
			meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no")
			//link(rel="stylesheet", type="text/css", href="/clients/css/w3.w3css.css")

			//-	Check browser compatibility. Requires javascript and JSON. Invalid browsers will crash or ignore startup scripts.
			if prep
				title #{nick}-#{table}
				// Flag javascript-disabled browsers
				noscript
					p Please enable Javascript and Cookies to access #{nick}.

				// Add JSON to json-disabled browsers
				if ! JSON.parse
					script(type="text/javascript",src="/clients/json/json2.js")

				//- Add global ajax method to navigator.ajax
				// script(type="text/javascript",src="/uis/ajax.js")

				//- Add global link follower method to navigator.follow
				// script(type="text/javascript",src="/uis/follow.js")

			//-
				The socketio path is "/socket.io/socket.io-client.js" || "/socketio/socketio-client.js" to enable buggy||working 
				client-to-client communications.  The socketio interface is established when the server does a 
				require( "socketio" || "socket.io" ) to create its endpoints at "/socketio" || "/socket.io", and when the 
				client imports its socketio via a <script src=socketio> tag.  When sockets are not being supported, 
				the server provides socketio = "/socketio/nosockets.js". 

			if socketio
				script(type="text/javascript",src=socketio)
				script.
					var 
						ioClient = "#{client}";
						// alert("socketio=#{socketio} client=#{client}")

			//- reserved for cardreader support
				script.
				navigator.mediaDevices.enumerateDevices().then( devs => console.log("devices", devs) );

			block layout_head

		body
			block layout_body

//- UNCLASSIFIED