author | František Kučera <franta-hg@frantovo.cz> |
Sun, 09 Jan 2011 16:33:29 +0100 | |
changeset 159 | 1ebf1bc25d8e |
parent 149 | 8238cdb4113a |
permissions | -rw-r--r-- |
franta-hg@149 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
franta-hg@149 | 2 |
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" |
franta-hg@149 | 3 |
xmlns:c="http://java.sun.com/jsp/jstl/core" |
franta-hg@149 | 4 |
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" |
franta-hg@149 | 5 |
xmlns:fn="http://java.sun.com/jsp/jstl/functions" |
franta-hg@149 | 6 |
xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak" |
franta-hg@149 | 7 |
version="2.0"> |
franta-hg@149 | 8 |
|
franta-hg@149 | 9 |
<c:choose> |
franta-hg@149 | 10 |
<c:when test="${param.akceChat == 'odesli'}"> |
franta-hg@149 | 11 |
<!-- TODO: servlet --> |
franta-hg@149 | 12 |
<jsp:useBean id="odesilac" class="cz.frantovo.nekurak.web.chat.OdesilacZprav" scope="request"/> |
franta-hg@149 | 13 |
<jsp:setProperty name="odesilac" property="mistnost" value="${param.mistnost}"/> |
franta-hg@149 | 14 |
<jsp:setProperty name="odesilac" property="od" value="${param.od}"/> |
franta-hg@149 | 15 |
<jsp:setProperty name="odesilac" property="zprava" value="${param.zprava}"/> |
franta-hg@149 | 16 |
|
franta-hg@149 | 17 |
<c:if test="${odesilac.odeslano}"> |
franta-hg@149 | 18 |
<p>Zpráva byla odeslána.</p> |
franta-hg@149 | 19 |
</c:if> |
franta-hg@149 | 20 |
</c:when> |
franta-hg@149 | 21 |
<c:when test="${param.akceChat == 'vypis'}"> |
franta-hg@149 | 22 |
<!-- TODO: servlet + JSP --> |
franta-hg@149 | 23 |
<jsp:useBean id="vypis" class="cz.frantovo.nekurak.web.chat.VypisZprav" scope="request"/> |
franta-hg@149 | 24 |
<jsp:setProperty name="vypis" property="mistnost" value="${param.mistnost}"/> |
franta-hg@149 | 25 |
<jsp:setProperty name="vypis" property="poradoveCislo" value="${param.poradoveCislo}"/> |
franta-hg@149 | 26 |
<!-- Náš vlastní XML formát --> |
franta-hg@149 | 27 |
<zpravy> |
franta-hg@149 | 28 |
<c:forEach var="z" items="${vypis.zpravy}"> |
franta-hg@149 | 29 |
<zprava> |
franta-hg@149 | 30 |
<poradoveCislo><c:out value="${z.poradoveCislo}"/></poradoveCislo> |
franta-hg@149 | 31 |
<od><c:out value="${z.od}"/></od> |
franta-hg@149 | 32 |
<text><c:out value="${z.text}"/></text> |
franta-hg@149 | 33 |
<kdy><fmt:formatDate value="${z.kdy}" pattern="yyyy-MM-dd HH:mm:ss"/></kdy> |
franta-hg@149 | 34 |
<overeny><c:out value="${z.overenyUzivatel}"/></overeny> |
franta-hg@149 | 35 |
</zprava> |
franta-hg@149 | 36 |
</c:forEach> |
franta-hg@149 | 37 |
</zpravy> |
franta-hg@149 | 38 |
</c:when> |
franta-hg@149 | 39 |
<c:otherwise> |
franta-hg@149 | 40 |
<fmt:message key="chat.nadpis" var="titulekStranky"/> |
franta-hg@149 | 41 |
<nk:stranka titulek="${titulekStranky}"> |
franta-hg@149 | 42 |
|
franta-hg@149 | 43 |
<h1><c:out value="${titulekStranky}"/></h1> |
franta-hg@149 | 44 |
<script type="text/javascript" src="js/chat.js"></script> |
franta-hg@149 | 45 |
|
franta-hg@149 | 46 |
<div id="chat"> |
franta-hg@149 | 47 |
<form action="javascript:ajaxOdesli();" id="odesilaciFormular"> |
franta-hg@149 | 48 |
<fieldset> |
franta-hg@149 | 49 |
<!-- TODO: jméno místnosti konfigurovat na jednom místě --> |
franta-hg@149 | 50 |
<input type="hidden" name="mistnost" value="nekurak@konference.frantovo.cz"/> |
franta-hg@149 | 51 |
<fmt:message key="chat.anonym" var="chatAnonym"/> |
franta-hg@149 | 52 |
<input title="vaše přezdívka" type="text" name="od" class="chatOd" value="${chatAnonym}"/> |
franta-hg@149 | 53 |
<input title="text zprávy" type="text" name="text" class="chatText" value="…"/> |
franta-hg@149 | 54 |
<button type="submit" class="chatOdeslat"><fmt:message key="chat.tlacitkoOdeslat"/></button> |
franta-hg@149 | 55 |
</fieldset> |
franta-hg@149 | 56 |
</form> |
franta-hg@149 | 57 |
<div id="vypisZprav">…</div> |
franta-hg@149 | 58 |
</div> |
franta-hg@149 | 59 |
|
franta-hg@149 | 60 |
<script type="text/javascript"> |
franta-hg@149 | 61 |
spustCasovac(); |
franta-hg@149 | 62 |
</script> |
franta-hg@149 | 63 |
</nk:stranka> |
franta-hg@149 | 64 |
</c:otherwise> |
franta-hg@149 | 65 |
</c:choose> |
franta-hg@149 | 66 |
|
franta-hg@149 | 67 |
</jsp:root> |