Commit f7f04f68 by Juho Salli

Merge branch 'keepalivetime' into 'master'

Conversation keepalive prettifying

on javascript keepalive error give javascript alert() message instead of just reloading the page. When updating the server reload goes to glassfish on nginx 404 page, which is not nice.

See merge request !279
2 parents 21ce7f4b d4fbb11c
......@@ -20,7 +20,7 @@
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/primelayout/css/skinning.css" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/primelayout/css/structual.css" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/custom_components.css" />
<script type="text/javascript" src="#{request.contextPath}/resources/script/prime_calendar.js" ></script>
<script type="text/javascript" src="#{request.contextPath}/resources/script/prime_calendar.js"></script>
<ui:insert name="headerdata" />
......@@ -41,9 +41,8 @@
<h:body>
<!-- Javascript-lokalisaatiolippupuljausta -->
<h:form id="conversationKeepaliver">
<p:remoteCommand name="cdiKeepalive" onerror="location.reload();" update=":cdiloop" actionListener="#{conversationKeepaliveView.ping()}" />
<p:remoteCommand name="cdiKeepalive" onerror="alert('#{i18n['template.keepaliveError']}'); location.reload();" update=":cdiloop" actionListener="#{conversationKeepaliveView.ping()}" />
</h:form>
<h:outputText id="cdiloop" value="#{conversationKeepaliveView.value}" />
<script type="text/javascript">
$(document)
......@@ -93,9 +92,7 @@
<c:otherwise>
<p:graphicImage id="eventlogo" rendered="#{layoutView.headerIsImage}" value="#{layoutView.headerimage}" />
<ui:fragment rendered="#{!layoutView.headerIsImage}">
<h1>
<h:outputText value="#{layoutView.headertext}" />
</h1>
<h1><h:outputText value="#{layoutView.headertext}" /></h1>
</ui:fragment>
</c:otherwise>
</c:choose>
......@@ -213,10 +210,15 @@
<f:param name="pagename" value="#{layoutView.pagepath}:bottom" />
</h:link>
<footer class="bgColor1"> </footer>
</p:layoutUnit>
<p:layoutUnit position="south" size="30">
<footer class="bgColor1">
<h:outputText id="cdiloop" value="#{conversationKeepaliveView.date}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</footer>
</p:layoutUnit>
</p:layout>
......@@ -252,8 +254,6 @@
}
});
</script>
<c:if test="#{sessionHandler.isInDevelopmentMode()}">
......
......@@ -19,6 +19,7 @@
package fi.codecrew.moya.web;
import java.io.Serializable;
import java.util.Date;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
......@@ -35,12 +36,10 @@ public class ConversationKeepaliveView implements Serializable {
*/
private static final long serialVersionUID = -3393159401702699270L;
private int value = 0;
private static final Logger logger = LoggerFactory.getLogger(ConversationKeepaliveView.class);
public int ping() {
return ++value;
}
......@@ -52,6 +51,9 @@ public class ConversationKeepaliveView implements Serializable {
public void setValue(int value) {
this.value = value;
}
public Date getDate() {
return new Date();
}
}
\ No newline at end of file
......@@ -1406,7 +1406,8 @@ svm.pending.successMessage = Payment pending. You will receive email after payme
svm.success.errorMessage = Payment could not be verified!
svm.success.successMessage = Payment was successfull.
template.loggedInAs = Logged in as
template.keepaliveError = Page has expired. Please refresh the page.
template.loggedInAs = Logged in as
topmenu.admin = Admin View
topmenu.helpdesk = Helpdesk
......
......@@ -1391,7 +1391,8 @@ svm.pending.successMessage = Maksukuittausta odotetaan. Kuittauksesta l\u00E4het
svm.success.errorMessage = Verkkomaksua ei voitu verifioida! Virheest\u00E4 on raportoitu eteenp\u00E4in.
svm.success.successMessage = Verkkomaksu onnistui.
template.loggedInAs = Kirjautunut tunnuksella
template.keepaliveError = Sivu on vanhentunut. Ole hyv\u00E4 ja p\u00E4ivit\u00E4 sivu.
template.loggedInAs = Kirjautunut tunnuksella
topmenu.admin = Yll\u00E4piton\u00E4kym\u00E4
topmenu.helpdesk = Helpdesk
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!