From: <bra...@us...> - 2011-02-06 14:56:06
|
Revision: 3411 http://archive-access.svn.sourceforge.net/archive-access/?rev=3411&view=rev Author: bradtofel Date: 2011-02-06 14:56:00 +0000 (Sun, 06 Feb 2011) Log Message: ----------- BUGFIX: was not working before - now uses info that should be set by AccessPoint prior to delegating to this jsp Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp 2011-02-06 14:54:55 UTC (rev 3410) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp 2011-02-06 14:56:00 UTC (rev 3411) @@ -1,5 +1,6 @@ <%@ page import="org.archive.wayback.webapp.AccessPoint" %><%@ page import="org.archive.wayback.util.StringFormatter" +%><%@ page import="java.util.Date" %><% String toUrl = request.getParameter(AccessPoint.INTERSTITIAL_TARGET); if(toUrl == null) { @@ -8,22 +9,38 @@ Bad request. require argument <%= AccessPoint.INTERSTITIAL_TARGET %> <% } else { - String secsS = request.getParameter(AccessPoint.INTERSTITIAL_SECONDS); - int secs = 5; + String secsS = request.getParameter(AccessPoint.INTERSTITIAL_SECONDS); + String dateString = request.getParameter(AccessPoint.INTERSTITIAL_DATE); + String replayUrl = request.getParameter(AccessPoint.INTERSTITIAL_URL); + long dateLong = 0; + int secs = 5; try { secs = Integer.parseInt(secsS); } catch (NumberFormatException e) { - } + try { + dateLong = Long.parseLong(dateString); + } catch (NumberFormatException e) { + } if(secs < 1) { secs = 5; } - StringFormatter f = new StringFormatter(null,null); + StringFormatter f = new StringFormatter(null); + String safeReplayUrl = null; + String prettyReplayDate = null; + if(replayUrl != null) { + safeReplayUrl = f.escapeHtml(replayUrl); + } + if(dateLong > 0) { + Date rd = new Date(dateLong); + prettyReplayDate = + f.format("{0,date,H:mm:ss MMM d, yyyy}",rd); + } String safeTargetUrl = f.escapeHtml(toUrl); String safeTargetUrlJS = f.escapeJavaScript(toUrl); %> <jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> - + <!-- dateLong <%= dateLong %> --> <div id="positionHome"> <section> <div id="logoHome"> @@ -38,11 +55,18 @@ } window.setTimeout("go()",<%= secs * 1000 %>); </script> - <h2 class="blue">Hello.</h2> + <h2 class="blue">Welcome to Wayback.</h2> <p class="code">Loading...</p> - <p class="code shift">[Month 00, 0000]</p> - <p class="code">Loading...</p> - <p class="code shift"><%= safeTargetUrl %></p> + <% + if(safeReplayUrl != null && prettyReplayDate != null) { + %> + <p class="code shift"><%= safeReplayUrl %></p> + <p class="code">as close to the date:</p> + <p class="code shift"><%= prettyReplayDate %></p> + <p class="code">as is available..</p> + <% + } + %> <p class="impatient"><a href="<%= safeTargetUrl %>">Impatient?</a></p> <% } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |