java/nekurak.net-web/web/WEB-INF/casti/chat.jsp
changeset 156 5f14ce03f518
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/nekurak.net-web/web/WEB-INF/casti/chat.jsp	Sun Jan 09 01:05:59 2011 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
     1.6 +		  xmlns:c="http://java.sun.com/jsp/jstl/core"
     1.7 +		  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
     1.8 +		  xmlns:fn="http://java.sun.com/jsp/jstl/functions"
     1.9 +		  xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak"
    1.10 +		  version="2.0">
    1.11 +
    1.12 +	<c:choose>
    1.13 +		<c:when test="${param.akceChat == 'odesli'}">
    1.14 +			<!-- TODO: servlet -->
    1.15 +			<jsp:useBean id="odesilac" class="cz.frantovo.nekurak.web.chat.OdesilacZprav" scope="request"/>
    1.16 +			<jsp:setProperty name="odesilac" property="mistnost" value="${param.mistnost}"/>
    1.17 +			<jsp:setProperty name="odesilac" property="od" value="${param.od}"/>
    1.18 +			<jsp:setProperty name="odesilac" property="zprava" value="${param.zprava}"/>
    1.19 +
    1.20 +			<c:if test="${odesilac.odeslano}">
    1.21 +				<p>Zpráva byla odeslána.</p>
    1.22 +			</c:if>
    1.23 +		</c:when>
    1.24 +		<c:when test="${param.akceChat == 'vypis'}">
    1.25 +			<!-- TODO: servlet + JSP -->
    1.26 +			<jsp:useBean id="vypis" class="cz.frantovo.nekurak.web.chat.VypisZprav" scope="request"/>
    1.27 +			<jsp:setProperty name="vypis" property="mistnost" value="${param.mistnost}"/>
    1.28 +			<jsp:setProperty name="vypis" property="poradoveCislo" value="${param.poradoveCislo}"/>
    1.29 +			<!-- Náš vlastní XML formát -->
    1.30 +			<zpravy>
    1.31 +				<c:forEach var="z" items="${vypis.zpravy}">
    1.32 +					<zprava>
    1.33 +						<poradoveCislo><c:out value="${z.poradoveCislo}"/></poradoveCislo>
    1.34 +						<od><c:out value="${z.od}"/></od>
    1.35 +						<text><c:out value="${z.text}"/></text>
    1.36 +						<kdy><fmt:formatDate value="${z.kdy}" pattern="yyyy-MM-dd HH:mm:ss"/></kdy>
    1.37 +						<overeny><c:out value="${z.overenyUzivatel}"/></overeny>
    1.38 +					</zprava>
    1.39 +				</c:forEach>
    1.40 +			</zpravy>
    1.41 +		</c:when>
    1.42 +		<c:otherwise>
    1.43 +			<fmt:message key="chat.nadpis" var="titulekStranky"/>
    1.44 +			<nk:stranka titulek="${titulekStranky}">
    1.45 +
    1.46 +				<h1><c:out value="${titulekStranky}"/></h1>
    1.47 +				<script type="text/javascript" src="js/chat.js"></script>
    1.48 +
    1.49 +				<div id="chat">
    1.50 +					<form action="javascript:ajaxOdesli();" id="odesilaciFormular">
    1.51 +						<fieldset>
    1.52 +							<!-- TODO: jméno místnosti konfigurovat na jednom místě -->
    1.53 +							<input type="hidden" name="mistnost" value="nekurak@konference.frantovo.cz"/>
    1.54 +							<fmt:message key="chat.anonym" var="chatAnonym"/>
    1.55 +							<input title="vaše přezdívka" type="text" name="od" class="chatOd" value="${chatAnonym}"/>
    1.56 +							<input title="text zprávy" type="text" name="text" class="chatText" value="…"/>
    1.57 +							<button type="submit" class="chatOdeslat"><fmt:message key="chat.tlacitkoOdeslat"/></button>
    1.58 +						</fieldset>
    1.59 +					</form>
    1.60 +					<div id="vypisZprav">…</div>
    1.61 +				</div>
    1.62 +
    1.63 +				<script type="text/javascript">
    1.64 +					spustCasovac();
    1.65 +				</script>
    1.66 +			</nk:stranka>
    1.67 +		</c:otherwise>
    1.68 +	</c:choose>
    1.69 +
    1.70 +</jsp:root>