update.xhtml
3.67 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!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/update')}"/>
</f:metadata>
<ui:define name="topbar">
<h:form id="readyform">
<h:commandLink id="pictureReady" 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; margin-top: 10em;">
<div style="display: none; font-size:5em;" id="pictureTakenConfirm">Kuva otettu</div>
<h:form styleClass="captureForm">
<h:panelGrid columns="2">
<h:panelGroup style="vertical-align:top">
<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 style="vertical-align:top">
<div id="webcamcontainer">
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}"/>
<!--p:commandButton type="button" value="Capture" onclick="PF('pc').capture()" -->
<div id="borderstuff" style="border-style:solid; border-width: 2px; border-color:red; position:relative; height: 205px; width:150px; top: -225px; right:-85px"> </div>
<div id="count" style="padding: 95px 0 0 150px; top: -400px; position:relative;"/>
<!-- <p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
-->
</div>
</h:panelGroup>
</h:panelGrid>
</h:form>
</div>
<div style="display: none;">
<h:form id="incomingpictureform">
<p:fragment rendered="#{!empty userView.selectedUser.currentImage}">
<p:graphicImage value="/dydata/userimage/#{userView.selectedUser.currentImage.id}.img" alt="image"/>
</p:fragment>
<h:commandLink rendered="#{!empty userView.selectedUser.currentImage}" style="margin: 0 auto; font-size: 3em;" action="#{userView.incomingPhotoReady}" value="Valmis"/>
<br/>
</h:form>
</div>
<script type="text/javascript">
function dophoto(pc) {
docount(3, 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();
$('#pictureTakenConfirm').show();
window.setTimeout(function () {
$('#readyform\\:pictureReady').trigger('click');
}, 1500);
}
});
}
</script>
<style type="text/css">
#count {
font-size: 25pt;
text-align: center;
width: 30px;
postition: relative;
top: -5em;
background: none;
}
td {
vertical-align: top;
}
</style>
</ui:define>
</ui:composition>
</h:body>
</html>