update.xhtml 2.62 KB
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" xmlns:shop="http://java.sun.com/jsf/composite/cditools/shop" xmlns:tools="http://java.sun.com/jsf/composite/cditools">
<h:body>
	<ui:composition template="/resources/templates/#{sessionHandler.adduserfullscreen}/template.xhtml">
		<ui:param name="thispage" value="page.user.create" />
		<f:metadata>
			<f:viewParam name="userid" value="#{userView.userid}" />
			<f:event type="preRenderView" listener="#{userView.initView}" />
			<f:event type="preRenderView" listener="#{userView.setCaptureForwardUrl('/admin/adduser/capturesuccess')}" />
		</f:metadata>

		<ui:define name="topbar">
			<h:form>
				<h:commandLink styleClass="userbackbutton" action="#{userView.incomingPhotoReady}" value="Valmis">
					<div>#{i18n['adduser.back']}</div>
				</h:commandLink>
			</h:form>

		</ui:define>

		<ui:define name="content">
			<div style="text-align: center;">
				<h:form styleClass="captureForm">
					<h:panelGrid columns="2">

						<h:panelGroup>
							<h1>#{i18n["adduser.update"]}</h1>
							<br />
							<br />
							<a class="touchItem" href="javascript:dophoto(PF('pc'));">
								<div>#{i18n["adduser.takePhoto"]}</div>
							</a>
						</h:panelGroup>

						<h:panelGroup>
							<div id="webcamcontainer">

								<div id="count" />
								<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
								<!--  <p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
								 -->
							</div>
						</h:panelGroup>
					</h:panelGrid>
				</h:form>
			</div>
			<div style="">
				<h:form>
					<h:commandLink style="margin: 0 auto; font-size: 3em;" action="#{userView.incomingPhotoReady}" value="Valmis" />
				</h:form>
			</div>

			<script>
				function dophoto(pc) {
					docount(5, pc);
				}

				function docount(count, pc) {
					$('#count').html(count);
					$('#count').css("opacity", 1);
					$('#count').css("font-size", "28pt");

					$('#count').animate({
						opacity : 0,
						fontSize : 0
					}, 1500, function() {
						if (count > 1)
							docount(count - 1, pc);
						if (count == 1) {
							pc.capture();
						}

					});
				}
			</script>
			<style>
#count {
	font-size: 25pt;
	text-align: center;
	width: 30px;
	postition: relative;
	top: -5em;
	background: none;
}
</style>
		</ui:define>

	</ui:composition>
</h:body>
</html>