update.xhtml
2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!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="/layout/#{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:metadata>
<ui:define name="content">
<div style="text-align: center;">
<h:panelGrid columns="2">
<h:panelGroup>
<h1>#{i18n["adduser.update"]}</h1>
<div id="webcamcontainer">
<h:form styleClass="captureForm">
<div id="count" />
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
<p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
</h:form>
</div>
</h:panelGroup>
<h:panelGroup styleClass="top">
<h2>#{i18n['user.thisIsCurrentImage']}</h2>
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<ui:fragment rendered="#{!empty userView.user.currentImage}">
<img width="300" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.img" alt="image" />
</ui:fragment>
</h:panelGroup>
</h:panelGrid>
</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;
}
</style>
</ui:define>
</ui:composition>
</h:body>
</html>