From: <bra...@us...> - 2008-07-21 23:20:59
|
Revision: 2465 http://archive-access.svn.sourceforge.net/archive-access/?rev=2465&view=rev Author: bradtofel Date: 2008-07-21 23:21:07 +0000 (Mon, 21 Jul 2008) Log Message: ----------- Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ArchiveComment.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/JSLessTimeline.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Redirect.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ResultMeta.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/client-rewrite.js trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/disclaim-element.js Removed Paths: ------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ArchiveComment.jsp (from rev 2447, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ArchiveComment.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ArchiveComment.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ArchiveComment.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,21 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Date" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% +UIResults results = UIResults.extractReplay(request); +StringFormatter fmt = results.getWbRequest().getFormatter(); +Date exactDate = results.getResult().getCaptureDate(); +Date now = new Date(); +String prettyDateFormat = "{0,date,H:mm:ss MMM d, yyyy}"; +String prettyArchiveString = fmt.format(prettyDateFormat,exactDate); +String prettyRequestString = fmt.format(prettyDateFormat,now); +%> +<!-- + FILE ARCHIVED ON <%= prettyArchiveString %> AND RETRIEVED FROM THE + INTERNET ARCHIVE ON <%= prettyRequestString %>. + JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. + + ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. + SECTION 108(a)(3)). +--> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp (from rev 2447, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ClientSideJSInsert.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,19 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Date" %> +<%@ page import="org.archive.wayback.ResultURIConverter" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% +UIResults results = UIResults.extractReplay(request); +String requestDate = results.getResult().getCaptureTimestamp(); +String contextPath = results.getURIConverter().makeReplayURI(requestDate,""); +String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" + + request.getServerPort() + request.getContextPath(); + +String jsUrl = contextRoot + "/replay/client-rewrite.js"; +%> +<script type="text/javascript"> + var sWayBackCGI = "<%= contextPath %>"; +</script> +<script type="text/javascript" src="<%= jsUrl %>" ></script> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp (from rev 2447, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Disclaimer.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,42 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Date" %> +<%@ page import="org.archive.wayback.WaybackConstants" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% +UIResults results = UIResults.extractReplay(request); + +StringFormatter fmt = results.getWbRequest().getFormatter(); +CaptureSearchResult result = results.getResult(); +String dupeMsg = ""; +if(result != null) { + if(result.isDuplicateDigest()) { + Date dupeDate = result.getDuplicateDigestStoredDate(); + String prettyDate = ""; + if(dupeDate != null) { + prettyDate = "(" + + fmt.format("MetaReplay.captureDateDisplay", + dupeDate) + ")"; + } + dupeMsg = " Note that this document was downloaded, and not saved because it was a duplicate of a previously captured version " + + prettyDate + ". HTTP headers presented here are from the original capture."; + } +} + +Date resultDate = result.getCaptureDate(); +String resultUrl = result.getOriginalUrl(); + +String wmNotice = fmt.format("ReplayView.banner", resultUrl, resultDate); +String wmHideNotice = fmt.format("ReplayView.bannerHideLink"); + +String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" ++ request.getServerPort() + request.getContextPath(); +String jsUrl = contextRoot + "/replay/disclaim.js"; +%> +<script type="text/javascript"> + var wmNotice = "<%= wmNotice %><%= dupeMsg %>"; + var wmHideNotice = "<%= wmHideNotice %>"; +</script> +<script type="text/javascript" src="<%= jsUrl %>"></script> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/JSLessTimeline.jsp (from rev 2447, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/JSLessTimeline.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/JSLessTimeline.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/JSLessTimeline.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,295 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.Date" %> +<%@ page import="java.text.ParseException" %> +<%@ page import="org.archive.wayback.WaybackConstants" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResults" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsTimelinePartitionsFactory" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" + + request.getServerPort() + request.getContextPath(); + +UIResults results = UIResults.extractReplay(request); +WaybackRequest wbRequest = results.getWbRequest(); +StringFormatter fmt = wbRequest.getFormatter(); +CaptureSearchResults cResults = results.getCaptureResults(); + +String exactDateStr = wbRequest.getReplayTimestamp(); +Date exactDate = wbRequest.getReplayDate(); +String searchUrl = wbRequest.getRequestUrl(); +String resolution = wbRequest.getTimelineResolution(); + +if(resolution == null) { + resolution = WaybackRequest.REQUEST_RESOLUTION_AUTO; +} +String metaChecked = ""; +if(wbRequest.isMetaMode()) { + metaChecked = "checked"; +} + +CaptureSearchResult first = null; +CaptureSearchResult prev = null; +CaptureSearchResult next = null; +CaptureSearchResult last = null; + +long resultCount = cResults.getReturnedCount(); +int resultIndex = 1; +Iterator<CaptureSearchResult> it = cResults.iterator(); +while(it.hasNext()) { + CaptureSearchResult res = it.next(); + Date resDate = res.getCaptureDate(); + + int compared = resDate.compareTo(exactDate); + if(compared < 0) { + resultIndex++; + prev = res; + if(first == null) { + first = res; + } + } else if(compared > 0) { + last = res; + if(next == null) { + next = res; + } + } +} +// string to indicate which select option is currently active +String yearsOptSelected = ""; +String monthsOptSelected = ""; +String daysOptSelected = ""; +String hoursOptSelected = ""; +String autoOptSelected = ""; + +String minResolution = ResultsTimelinePartitionsFactory.getMinResolution(cResults); + +String optimal = ""; +if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { + optimal = fmt.format("TimelineView.timeRange.hours"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { + optimal = fmt.format("TimelineView.timeRange.days"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { + optimal = fmt.format("TimelineView.timeRange.months"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { + optimal = fmt.format("TimelineView.timeRange.twomonths"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { + optimal = fmt.format("TimelineView.timeRange.years"); +} else { + optimal = fmt.format("TimelineView.timeRange.unknown"); +} +String autoOptString = fmt.format("TimelineView.timeRange.auto",optimal); + +ArrayList<ResultsPartition> partitions; +if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { + hoursOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getHour(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { + daysOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getDay(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { + monthsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { + monthsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getTwoMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { + yearsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getYear(cResults,wbRequest); +} else { + autoOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getAuto(cResults,wbRequest); +} +int numPartitions = partitions.size(); +ResultsPartition firstP = (ResultsPartition) partitions.get(0); +ResultsPartition lastP = (ResultsPartition) partitions.get(numPartitions -1); + +String firstDate = firstP.getTitle(); +String lastDate = lastP.getTitle(); +String titleString = ""; +%> +<!-- + ====================================== + BEGIN Wayback INSERTED TIMELINE BANNER + + The following HTML has been inserted + by the Wayback application to enhance + the viewing experience, and was not + part of the original archived content. + ====================================== +--> +<div id="wm-ipp" style="position:relative;z-index:99999;border:1px solid;color:black;background-color:lightYellow;font-size:10px;font-family:sans-serif;padding:5px" > + +<table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td width="1" nowrap></td> + <td> + <!-- Viewing --> + <table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td> + <span><%= fmt.format("TimelineView.viewingVersion",resultIndex,resultCount) %> </span> + </td> + </tr> + <tr> + <td nowrap><span> <%= fmt.format("TimelineView.viewingVersionDate",exactDate) %> </span> </td> + </tr> + </table> + </td> + <td width="400" align="center"> + <table> + <tr> + <td width="50%"></td> + <td> + <table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td width="48%" nowrap><span><%= firstDate %></span></td> + <td align="center" valign="bottom" nowrap><img wmSpecial="1" src="<%= contextRoot %>/images/mark.jpg"></td> + <td width="48%" nowrap align="right"><span><%= lastDate %></span></td> + </tr> + </table> + </td> + <td width="50%"></td> + </tr> + <tr> + <td nowrap align="right"><% + titleString = ""; + if(first != null) { + titleString = "title=\"" + + fmt.format("TimelineView.firstVersionTitle", + first.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(first) %>"><% + } + %><img <%= titleString %> wmSpecial="1" border=0 width=19 height=20 src="<%= contextRoot %>/images/first.jpg"><% + if(first != null) { + %></a><% + } + titleString = ""; + if(prev != null) { + titleString = "title=\"" + + fmt.format("TimelineView.prevVersionTitle", + prev.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(prev) %>"><% + } + %><img <%= titleString %> wmSpecial="1" border=0 width=13 height=20 src="<%= contextRoot %>/images/prev.jpg"><% + if(first != null) { + %></a><% + } + %></td> + <td nowrap><% + + for(int i = 0; i < numPartitions; i++) { + ResultsPartition partition = (ResultsPartition) partitions.get(i); + ArrayList partitionResults = partition.getMatches(); + int numResults = partitionResults.size(); + String imageUrl = contextRoot + "/images/line.jpg"; + String replayUrl = null; + String prettyDateTime = null; + if(numResults == 1) { + imageUrl = contextRoot + "/images/mark_one.jpg"; + CaptureSearchResult result = (CaptureSearchResult) partitionResults.get(0); + replayUrl = results.resultToReplayUrl(result); + prettyDateTime = fmt.format("TimelineView.markDateTitle",result.getCaptureDate()); + + } else if (numResults > 1) { + imageUrl = contextRoot + "/images/mark_several.jpg"; + CaptureSearchResult result = (CaptureSearchResult) partitionResults.get(numResults - 1); + replayUrl = results.resultToReplayUrl(result); + prettyDateTime = fmt.format("TimelineView.markDateTitle",result.getCaptureDate()); + + } + if((i > 0) && (i < numPartitions)) { + +%><img wmSpecial="1" border=0 width=1 height=16 src="<%= contextRoot %>/images/linemark.jpg"><% + + } + + if(replayUrl == null) { + +%><img wmSpecial="1" border=0 width=7 height=16 src="<%= imageUrl %>"><% + + } else { + +%><a wmSpecial="1" href="<%= replayUrl %>"><img wmSpecial="1" border=0 width=7 height=16 title="<%= prettyDateTime %>" src="<%= imageUrl %>"></a><% + + } + } + +%></td> + <td nowrap><% + titleString = ""; + if(next != null) { + titleString = "title=\"" + + fmt.format("TimelineView.nextVersionTitle", + next.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(next) %>"><% + } + %><img wmSpecial="1" <%= titleString %> border=0 width=13 height=20 src="<%= contextRoot %>/images/next.jpg"><% + if(first != null) { + %></a><% + } + titleString = ""; + if(last != null) { + titleString = "title=\"" + + fmt.format("TimelineView.lastVersionTitle", + last.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(last) %>"><% + } + %><img wmSpecial="1" <%= titleString %> border=0 width=19 height=20 src="<%= contextRoot %>/images/last.jpg"><% + if(first != null) { + %></a><% + } + %></td> + </tr> + </table> + </td> + <td align="right" width="400"> + <!-- Resolution --> + <!-- + need to get cookie data passing set up before this can be re-enabled: + <form wmSpecial="1" name="timeline" method="GET" target="_top" action="<%= contextRoot + "/frameset" %>"> + <input type="hidden" name="url" value="<%= searchUrl %>"> + <input type="hidden" name="exactdate" value="<%= exactDateStr %>"> + <input type="hidden" name="type" value="urlclosestquery"> + <%= fmt.format("TimelineView.timeRange") %> + <select NAME="resolution" SIZE="1" onChange="changeResolution()"> + <option <%= yearsOptSelected %> value="years"> + <%= fmt.format("TimelineView.timeRange.years") %> + </option> + <option <%= monthsOptSelected %> value="months"> + <%= fmt.format("TimelineView.timeRange.months") %> + </option> + <option <%= daysOptSelected %> value="days"> + <%= fmt.format("TimelineView.timeRange.days") %> + </option> + <option <%= hoursOptSelected %> value="hours"> + <%= fmt.format("TimelineView.timeRange.hours") %> + </option> + <option <%= autoOptSelected %> value="auto"><%= autoOptString %></option> + </select> <%= + fmt.format("TimelineView.metaDataCheck") + %><input type="checkbox" name="<%= WaybackRequest.REQUEST_META_MODE%>" value="<%= WaybackRequest.REQUEST_YES %>" <%= + metaChecked + %> onClick="changeMeta()"> + </form> + --> + <a wmSpecial="1" href="<%= contextRoot %>/help.jsp" target="_top"><%= + fmt.format("UIGlobal.helpLink") + %></a> + </td> + <td> + <img wmSpecial="1" alt='' height='1' src='<%= contextRoot %>/images/1px.gif' width='5'> + </td> + </tr> +</table> +</div> +<!-- + ====================================== + END Wayback INSERTED TIMELINE BANNER + ====================================== +--> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Redirect.jsp (from rev 2454, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Redirect.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Redirect.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Redirect.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,15 @@ +<%@ page import="org.archive.wayback.util.bdb.BDBMap" %> + +<% + String url = request.getParameter("url"); + String time = request.getParameter("time"); + + // Put time-mapping for this id, or if no id, the ip-addr. + String id = request.getHeader("Proxy-Id"); + if(id == null) id = request.getRemoteAddr(); + BDBMap.addTimestampForId(request.getContextPath(),id, time); + + // Now redirect to the page the user wanted. + response.sendRedirect(url); +%> +anchored date! Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ResultMeta.jsp (from rev 2447, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ResultMeta.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ResultMeta.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,124 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.Map" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +UIResults uiResults = UIResults.extractReplay(request); +StringFormatter fmt = uiResults.getWbRequest().getFormatter(); +CaptureSearchResult result = uiResults.getResult(); +String origUrl = result.getOriginalUrl(); +String urlKey = result.getUrlKey(); +String archiveID = result.getFile() + "/" + result.getOffset(); +String captureTS = result.getCaptureTimestamp(); +String capturePrettyDateTime = fmt.format("MetaReplay.captureDateDisplay", + result.getCaptureDate()); +String mimeType = result.getMimeType(); +String digest = result.getDigest(); +Map<String,String> headers = uiResults.getResource().getHttpHeaders(); + +%> +<html> + <head> + <title> + <%= fmt.format("MetaReplay.title") + urlKey +" / " + + capturePrettyDateTime %> + </title> + </head> + <body> + <h2> + <%= fmt.format("MetaReplay.title") %> + </h2> + <table> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.originalURL") %> + </td> + <td class="value-cell"> + <b> + <%= origUrl %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.URLKey") %> + </td> + <td class="value-cell"> + <b> + <%= urlKey %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.captureDate") %> + </td> + <td class="value-cell"> + <b> + <%= capturePrettyDateTime %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.archiveID") %> + </td> + <td class="value-cell"> + <b> + <%= archiveID %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.MIMEType") %> + </td> + <td class="value-cell"> + <b> + <%= mimeType %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.digest") %> + </td> + <td class="value-cell"> + <b> + <%= digest %> + </b> + </td> + </tr> + </table> + <p> + <h2> + <%= fmt.format("MetaReplay.HTTPHeaders") %> + </h2> + <table> + <% + Iterator<String> itr = headers.keySet().iterator(); + while(itr.hasNext()) { + String key = itr.next(); + String value = headers.get(key); + %> + <tr> + <td class="field-cell"> + <%= key %> + </td> + <td class="value-cell"> + <b> + <%= value %> + </b> + </td> + </tr> + <% + } + %> + </table> + + </body> +</html> + Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp 2007-10-15 21:28:33 UTC (rev 2055) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -1,326 +0,0 @@ -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="java.util.Date" %> -<%@ page import="java.text.ParseException" %> -<%@ page import="org.archive.wayback.WaybackConstants" %> -<%@ page import="org.archive.wayback.core.SearchResult" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> -<%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.core.WaybackRequest" %> -<%@ page import="org.archive.wayback.query.UIQueryResults" %> -<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsTimelinePartitionsFactory" %> -<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> -<%@ page import="org.archive.wayback.util.StringFormatter" %> -<% - -String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" - + request.getServerPort() + request.getContextPath(); - -UIQueryResults results = (UIQueryResults) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); - -Timestamp searchStartTs = results.getStartTimestamp(); -Timestamp searchEndTs = results.getEndTimestamp(); -Timestamp exactTs = results.getExactRequestedTimestamp(); -String searchUrl = results.getSearchUrl(); -Date exactDate = exactTs.getDate(); - -String exactDateStr = exactTs.getDateStr(); -WaybackRequest wbRequest = results.getWbRequest(); -String resolution = wbRequest.get(WaybackConstants.REQUEST_RESOLUTION); -if(resolution == null) { - resolution = WaybackConstants.REQUEST_RESOLUTION_AUTO; -} -String metaMode = wbRequest.get(WaybackConstants.REQUEST_META_MODE); -String metaChecked = ""; -if(metaMode != null && metaMode.equals("yes")) { - metaChecked = "checked"; -} - -String searchString = results.getSearchUrl(); - -SearchResult first = null; -SearchResult prev = null; -SearchResult next = null; -SearchResult last = null; - -int resultCount = results.getResultsReturned(); -int resultIndex = 1; -Iterator<SearchResult> it = results.resultsIterator(); -while(it.hasNext()) { - SearchResult res = it.next(); - String resDateStr = res.get(WaybackConstants.RESULT_CAPTURE_DATE); - int compared = resDateStr.compareTo(exactDateStr.substring(0,resDateStr.length())); - if(compared < 0) { - resultIndex++; - prev = res; - if(first == null) { - first = res; - } - } else if(compared > 0) { - last = res; - if(next == null) { - next = res; - } - } -} -// string to indicate which select option is currently active -String yearsOptSelected = ""; -String monthsOptSelected = ""; -String daysOptSelected = ""; -String hoursOptSelected = ""; -String autoOptSelected = ""; - -String minResolution = ResultsTimelinePartitionsFactory.getMinResolution( - results.getResults()); - -String optimal = ""; -if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { - optimal = fmt.format("TimelineView.timeRange.hours"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { - optimal = fmt.format("TimelineView.timeRange.days"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { - optimal = fmt.format("TimelineView.timeRange.months"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { - optimal = fmt.format("TimelineView.timeRange.years"); -} else { - optimal = fmt.format("TimelineView.timeRange.unknown"); -} -String autoOptString = fmt.format("TimelineView.timeRange.auto",optimal); - -ArrayList<ResultsPartition> partitions; -if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { - hoursOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getHour(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { - daysOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getDay(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { - monthsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getMonth(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { - yearsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getYear(results.getResults(), - wbRequest); -} else { - autoOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getAuto(results.getResults(), - wbRequest); -} -int numPartitions = partitions.size(); -ResultsPartition firstP = (ResultsPartition) partitions.get(0); -ResultsPartition lastP = (ResultsPartition) partitions.get(numPartitions -1); - -String firstDate = firstP.getTitle(); -String lastDate = lastP.getTitle(); -String titleString = ""; -%> -<script type="text/javascript"> - function changeResolution() { - document.timeline.submit(); - } - function changeMeta() { - document.timeline.submit(); - } - -var open = true; - -function handleDragClick() { - var daDiv = document.getElementById("wm-ipp"); - var daDraggerDiv = document.getElementById("wm-dragger"); - while(daDraggerDiv.hasChildNodes()) { - daDraggerDiv.removeChild(daDraggerDiv.firstChild); - } - var newText; - if(open) { - open = false; - daDiv.style.width = "100px"; - newText = "<"; - } else { - open = true; - daDiv.style.width = "100%"; - newText = ">"; - } - daDraggerDiv.appendChild(document.createTextNode(newText)); -} - - -</script> -<!-- -overflow:hidden; border-width:1; border-style:outset; width:100%; height:80px; right:0; top:0; background-color:#dddddd; - --> -<div id="wm-ipp" style="position:relative;z-index:99999;border:1px solid;color:black;background-color:lightYellow;font-size:10px;font-family:sans-serif;padding:5px" > -<!-- -<div onclick="handleDragClick()" id="wm-dragger" style="height:25px; width:100%; border-width:1; border-style:outset; background-color:#cccccc; text-align:right;"> -< -</div> - --> -<table cellspacing="0" border="0" cellpadding="0" width="100%"> - <tr> - <td width="1" nowrap></td> - <td> - <!-- Viewing --> - <table cellspacing="0" border="0" cellpadding="0" width="100%"> - <tr> - <td> - <span><%= fmt.format("TimelineView.viewingVersion",resultIndex,resultCount) %> </span> - </td> - </tr> - <tr> - <td nowrap><span> <%= fmt.format("TimelineView.viewingVersionDate",exactDate) %> </span> </td> - </tr> - </table> - </td> - <td width="400"> - <table> - <tr> - <td width="50%"></td> - <td> - <table cellspacing="0" border="0" cellpadding="0" width="100%"> - <tr> - <td width="48%" nowrap><span><%= firstDate %></span></td> - <td align="center" valign="bottom" nowrap><img wmSpecial="1" src="<%= contextRoot %>/images/mark.jpg"></td> - <td width="48%" nowrap align="right"><span><%= lastDate %></span></td> - </tr> - </table> - </td> - <td width="50%"></td> - </tr> - <tr> - <td nowrap align="right"><% - titleString = ""; - if(first != null) { - titleString = "title=\"" + - fmt.format("TimelineView.firstVersionTitle", - results.resultToDate(first)) + "\""; - %><a wmSpecial="1" href="<%= results.resultToReplayUrl(first) %>"><% - } - %><img <%= titleString %> wmSpecial="1" border=0 width=19 height=20 src="<%= contextRoot %>/images/first.jpg"><% - if(first != null) { - %></a><% - } - titleString = ""; - if(prev != null) { - titleString = "title=\"" + - fmt.format("TimelineView.prevVersionTitle", - results.resultToDate(prev)) + "\""; - %><a wmSpecial="1" href="<%= results.resultToReplayUrl(prev) %>"><% - } - %><img <%= titleString %> wmSpecial="1" border=0 width=13 height=20 src="<%= contextRoot %>/images/prev.jpg"><% - if(first != null) { - %></a><% - } - %></td> - <td nowrap><% - - for(int i = 0; i < numPartitions; i++) { - ResultsPartition partition = (ResultsPartition) partitions.get(i); - ArrayList partitionResults = partition.getMatches(); - int numResults = partitionResults.size(); - String imageUrl = contextRoot + "/images/line.jpg"; - String replayUrl = null; - String prettyDateTime = null; - if(numResults == 1) { - imageUrl = contextRoot + "/images/mark_one.jpg"; - SearchResult result = (SearchResult) partitionResults.get(0); - replayUrl = results.resultToReplayUrl(result); - prettyDateTime = fmt.format("TimelineView.markDateTitle",results.resultToDate(result)); - - } else if (numResults > 1) { - imageUrl = contextRoot + "/images/mark_several.jpg"; - SearchResult result = (SearchResult) partitionResults.get(numResults - 1); - replayUrl = results.resultToReplayUrl(result); - prettyDateTime = fmt.format("TimelineView.markDateTitle",results.resultToDate(result)); - - } - if((i > 0) && (i < numPartitions)) { - -%><img wmSpecial="1" border=0 width=1 height=16 src="<%= contextRoot %>/images/linemark.jpg"><% - - } - - if(replayUrl == null) { - -%><img wmSpecial="1" border=0 width=7 height=16 src="<%= imageUrl %>"><% - - } else { - -%><a wmSpecial="1" href="<%= replayUrl %>"><img wmSpecial="1" border=0 width=7 height=16 title="<%= prettyDateTime %>" src="<%= imageUrl %>"></a><% - - } - } - -%></td> - <td nowrap><% - titleString = ""; - if(next != null) { - titleString = "title=\"" + - fmt.format("TimelineView.nextVersionTitle", - results.resultToDate(next)) + "\""; - %><a wmSpecial="1" href="<%= results.resultToReplayUrl(next) %>"><% - } - %><img wmSpecial="1" <%= titleString %> border=0 width=13 height=20 src="<%= contextRoot %>/images/next.jpg"><% - if(first != null) { - %></a><% - } - titleString = ""; - if(last != null) { - titleString = "title=\"" + - fmt.format("TimelineView.lastVersionTitle", - results.resultToDate(last)) + "\""; - %><a wmSpecial="1" href="<%= results.resultToReplayUrl(last) %>"><% - } - %><img wmSpecial="1" <%= titleString %> border=0 width=19 height=20 src="<%= contextRoot %>/images/last.jpg"><% - if(first != null) { - %></a><% - } - %></td> - </tr> - </table> - </td> - <td align="right"> - <!-- Resolution --> - <form wmSpecial="1" name="timeline" method="GET" target="_top" action="<%= contextRoot + "/frameset" %>"> - <input type="hidden" name="url" value="<%= searchUrl %>"> - <input type="hidden" name="exactdate" value="<%= exactDateStr %>"> - <input type="hidden" name="type" value="urlclosestquery"> - <%= fmt.format("TimelineView.timeRange") %> - <select NAME="resolution" SIZE="1" onChange="changeResolution()"> - <option <%= yearsOptSelected %> value="years"> - <%= fmt.format("TimelineView.timeRange.years") %> - </option> - <option <%= monthsOptSelected %> value="months"> - <%= fmt.format("TimelineView.timeRange.months") %> - </option> - <option <%= daysOptSelected %> value="days"> - <%= fmt.format("TimelineView.timeRange.days") %> - </option> - <option <%= hoursOptSelected %> value="hours"> - <%= fmt.format("TimelineView.timeRange.hours") %> - </option> - <option <%= autoOptSelected %> value="auto"><%= autoOptString %></option> - </select> <%= - fmt.format("TimelineView.metaDataCheck") - %><input type="checkbox" name="metamode" value="yes" <%= - metaChecked - %> onClick="changeMeta()"> <a href="help.php" target="_top"><%= - fmt.format("UIGlobal.helpLink") - %></a> - </form> - </td> - <td> - <img wmSpecial="1" alt='' height='1' src='<%= contextRoot %>/images/1px.gif' width='5'> - </td> - </tr> -</table> -</div> -<script type="text/javascript"> - var daDiv = document.getElementById("wm-ipp"); - var daParentNode = daDiv.parentNode; - var daBody = document.body; - daParentNode.removeChild(daDiv); - daBody.insertBefore(daDiv,daBody.firstChild); -</script> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp (from rev 2447, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,319 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.Date" %> +<%@ page import="java.text.ParseException" %> +<%@ page import="org.archive.wayback.WaybackConstants" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResults" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsTimelinePartitionsFactory" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" + + request.getServerPort() + request.getContextPath(); + +UIResults results = UIResults.extractReplay(request); +WaybackRequest wbRequest = results.getWbRequest(); +StringFormatter fmt = wbRequest.getFormatter(); +CaptureSearchResults cResults = results.getCaptureResults(); + +String exactDateStr = wbRequest.getReplayTimestamp(); +Date exactDate = wbRequest.getReplayDate(); +String searchUrl = wbRequest.getRequestUrl(); +String resolution = wbRequest.getTimelineResolution(); + + +if(resolution == null) { + resolution = WaybackRequest.REQUEST_RESOLUTION_AUTO; +} +String metaChecked = ""; +if(wbRequest.isMetaMode()) { + metaChecked = "checked"; +} + +CaptureSearchResult first = null; +CaptureSearchResult prev = null; +CaptureSearchResult next = null; +CaptureSearchResult last = null; + +long resultCount = cResults.getReturnedCount(); +int resultIndex = 1; +Iterator<CaptureSearchResult> it = cResults.iterator(); +while(it.hasNext()) { + CaptureSearchResult res = it.next(); + String resDateStr = res.getCaptureTimestamp(); + int compared = resDateStr.compareTo(exactDateStr.substring(0,resDateStr.length())); + if(compared < 0) { + resultIndex++; + prev = res; + if(first == null) { + first = res; + } + } else if(compared > 0) { + last = res; + if(next == null) { + next = res; + } + } +} +// string to indicate which select option is currently active +String yearsOptSelected = ""; +String monthsOptSelected = ""; +String daysOptSelected = ""; +String hoursOptSelected = ""; +String autoOptSelected = ""; + +String minResolution = ResultsTimelinePartitionsFactory.getMinResolution(cResults); + +String optimal = ""; +if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { + optimal = fmt.format("TimelineView.timeRange.hours"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { + optimal = fmt.format("TimelineView.timeRange.days"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { + optimal = fmt.format("TimelineView.timeRange.months"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { + optimal = fmt.format("TimelineView.timeRange.twomonths"); +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { + optimal = fmt.format("TimelineView.timeRange.years"); +} else { + optimal = fmt.format("TimelineView.timeRange.unknown"); +} +String autoOptString = fmt.format("TimelineView.timeRange.auto",optimal); + +ArrayList<ResultsPartition> partitions; +if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { + hoursOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getHour(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { + daysOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getDay(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { + monthsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { + monthsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getTwoMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { + yearsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getYear(cResults,wbRequest); +} else { + autoOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getAuto(cResults,wbRequest); +} +int numPartitions = partitions.size(); +ResultsPartition firstP = (ResultsPartition) partitions.get(0); +ResultsPartition lastP = (ResultsPartition) partitions.get(numPartitions -1); + +String firstDate = firstP.getTitle(); +String lastDate = lastP.getTitle(); +String titleString = ""; +%> +<script type="text/javascript"> + function changeResolution() { + document.timeline.submit(); + } + function changeMeta() { + document.timeline.submit(); + } + +var open = true; + +function handleDragClick() { + var daDiv = document.getElementById("wm-ipp"); + var daDraggerDiv = document.getElementById("wm-dragger"); + while(daDraggerDiv.hasChildNodes()) { + daDraggerDiv.removeChild(daDraggerDiv.firstChild); + } + var newText; + if(open) { + open = false; + daDiv.style.width = "100px"; + newText = "<"; + } else { + open = true; + daDiv.style.width = "100%"; + newText = ">"; + } + daDraggerDiv.appendChild(document.createTextNode(newText)); +} + + +</script> + +<div id="wm-ipp" style="position:relative;z-index:99999;border:1px solid;color:black;background-color:lightYellow;font-size:10px;font-family:sans-serif;padding:5px" > + +<table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td width="1" nowrap></td> + <td> + <!-- Viewing --> + <table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td> + <span><%= fmt.format("TimelineView.viewingVersion",resultIndex,resultCount) %> </span> + </td> + </tr> + <tr> + <td nowrap><span> <%= fmt.format("TimelineView.viewingVersionDate",exactDate) %> </span> </td> + </tr> + </table> + </td> + <td width="400" align="center"> + <table> + <tr> + <td width="50%"></td> + <td> + <table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td width="48%" nowrap><span><%= firstDate %></span></td> + <td align="center" valign="bottom" nowrap><img wmSpecial="1" src="<%= contextRoot %>/images/mark.jpg"></td> + <td width="48%" nowrap align="right"><span><%= lastDate %></span></td> + </tr> + </table> + </td> + <td width="50%"></td> + </tr> + <tr> + <td nowrap align="right"><% + titleString = ""; + if(first != null) { + titleString = "title=\"" + + fmt.format("TimelineView.firstVersionTitle", + first.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(first) %>"><% + } + %><img <%= titleString %> wmSpecial="1" border=0 width=19 height=20 src="<%= contextRoot %>/images/first.jpg"><% + if(first != null) { + %></a><% + } + titleString = ""; + if(prev != null) { + titleString = "title=\"" + + fmt.format("TimelineView.prevVersionTitle", + prev.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(prev) %>"><% + } + %><img <%= titleString %> wmSpecial="1" border=0 width=13 height=20 src="<%= contextRoot %>/images/prev.jpg"><% + if(first != null) { + %></a><% + } + %></td> + <td nowrap><% + + for(int i = 0; i < numPartitions; i++) { + ResultsPartition partition = (ResultsPartition) partitions.get(i); + ArrayList partitionResults = partition.getMatches(); + int numResults = partitionResults.size(); + String imageUrl = contextRoot + "/images/line.jpg"; + String replayUrl = null; + String prettyDateTime = null; + if(numResults == 1) { + imageUrl = contextRoot + "/images/mark_one.jpg"; + CaptureSearchResult result = (CaptureSearchResult) partitionResults.get(0); + replayUrl = results.resultToReplayUrl(result); + prettyDateTime = fmt.format("TimelineView.markDateTitle",result.getCaptureDate()); + + } else if (numResults > 1) { + imageUrl = contextRoot + "/images/mark_several.jpg"; + CaptureSearchResult result = (CaptureSearchResult) partitionResults.get(numResults - 1); + replayUrl = results.resultToReplayUrl(result); + prettyDateTime = fmt.format("TimelineView.markDateTitle",result.getCaptureDate()); + + } + if((i > 0) && (i < numPartitions)) { + +%><img wmSpecial="1" border=0 width=1 height=16 src="<%= contextRoot %>/images/linemark.jpg"><% + + } + + if(replayUrl == null) { + +%><img wmSpecial="1" border=0 width=7 height=16 src="<%= imageUrl %>"><% + + } else { + +%><a wmSpecial="1" href="<%= replayUrl %>"><img wmSpecial="1" border=0 width=7 height=16 title="<%= prettyDateTime %>" src="<%= imageUrl %>"></a><% + + } + } + +%></td> + <td nowrap><% + titleString = ""; + if(next != null) { + titleString = "title=\"" + + fmt.format("TimelineView.nextVersionTitle", + next.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(next) %>"><% + } + %><img wmSpecial="1" <%= titleString %> border=0 width=13 height=20 src="<%= contextRoot %>/images/next.jpg"><% + if(first != null) { + %></a><% + } + titleString = ""; + if(last != null) { + titleString = "title=\"" + + fmt.format("TimelineView.lastVersionTitle", + last.getCaptureDate()) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(last) %>"><% + } + %><img wmSpecial="1" <%= titleString %> border=0 width=19 height=20 src="<%= contextRoot %>/images/last.jpg"><% + if(first != null) { + %></a><% + } + %></td> + </tr> + </table> + </td> + <td align="right" width="400"> + <!-- Resolution --> + <!-- + need to get cookie data passing set up before this can be re-enabled: + <form wmSpecial="1" name="timeline" method="GET" target="_top" action="<%= contextRoot + "/frameset" %>"> + <input type="hidden" name="url" value="<%= searchUrl %>"> + <input type="hidden" name="exactdate" value="<%= exactDateStr %>"> + <input type="hidden" name="type" value="urlclosestquery"> + <%= fmt.format("TimelineView.timeRange") %> + <select NAME="resolution" SIZE="1" onChange="changeResolution()"> + <option <%= yearsOptSelected %> value="years"> + <%= fmt.format("TimelineView.timeRange.years") %> + </option> + <option <%= monthsOptSelected %> value="months"> + <%= fmt.format("TimelineView.timeRange.months") %> + </option> + <option <%= daysOptSelected %> value="days"> + <%= fmt.format("TimelineView.timeRange.days") %> + </option> + <option <%= hoursOptSelected %> value="hours"> + <%= fmt.format("TimelineView.timeRange.hours") %> + </option> + <option <%= autoOptSelected %> value="auto"><%= autoOptString %></option> + </select> <%= + fmt.format("TimelineView.metaDataCheck") + %><input type="checkbox" name="<%= WaybackRequest.REQUEST_META_MODE %>" value="<%= WaybackRequest.REQUEST_YES %>" <%= + metaChecked + %> onClick="changeMeta()">  + </form> + --> + <a wmSpecial="1" href="<%= contextRoot %>/help.jsp" target="_top"><%= + fmt.format("UIGlobal.helpLink") + %></a> + </td> + <td> + <img wmSpecial="1" alt='' height='1' src='<%= contextRoot %>/images/1px.gif' width='5'> + </td> + </tr> +</table> +</div> +<script type="text/javascript"> + var daDiv = document.getElementById("wm-ipp"); + var daParentNode = daDiv.parentNode; + var daBody = document.body; + daParentNode.removeChild(daDiv); + daBody.insertBefore(daDiv,daBody.firstChild); +</script> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/client-rewrite.js (from rev 2161, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/client-rewrite.js) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/client-rewrite.js (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/client-rewrite.js 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,65 @@ + +function xResolveUrl(url) { + var image = new Image(); + image.src = url; + return image.src; +} +function xLateUrl(aCollection, sProp) { + var i = 0; + for(i = 0; i < aCollection.length; i++) { + if(aCollection[i].getAttribute(sProp) && + (aCollection[i].getAttribute(sProp).length > 0) && + (typeof(aCollection[i][sProp]) == "string")) { + + if(aCollection[i][sProp].indexOf("mailto:") == -1 && + aCollection[i][sProp].indexOf("javascript:") == -1) { + + var wmSpecial = aCollection[i].getAttribute("wmSpecial"); + if(wmSpecial && wmSpecial.length > 0) { + } else { + if(aCollection[i][sProp].indexOf(sWayBackCGI) == -1) { + if(aCollection[i][sProp].indexOf("http") == 0) { + aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp]; + } else { + aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]); + } + } + } + } + } + } +} + +xLateUrl(document.getElementsByTagName("IMG"),"src"); +xLateUrl(document.getElementsByTagName("A"),"href"); +xLateUrl(document.getElementsByTagName("AREA"),"href"); +xLateUrl(document.getElementsByTagName("OBJECT"),"codebase"); +xLateUrl(document.getElementsByTagName("OBJECT"),"data"); +xLateUrl(document.getElementsByTagName("APPLET"),"codebase"); +xLateUrl(document.getElementsByTagName("APPLET"),"archive"); +xLateUrl(document.getElementsByTagName("EMBED"),"src"); +xLateUrl(document.getElementsByTagName("IFRAME"),"src"); +xLateUrl(document.getElementsByTagName("INPUT"),"src"); +xLateUrl(document.getElementsByTagName("BODY"),"background"); +var forms = document.getElementsByTagName("FORM"); +if (forms) { + var j = 0; + for (j = 0; j < forms.length; j++) { + f = forms[j]; + if (typeof(f.action) == "string") { + if(typeof(f.method) == "string") { + if(typeof(f.method) != "post") { + var resolved = ""; + var orig = f.action; + if(f.action.indexOf("http") == 0) { + resolved = f.action; + } else { + resolved = xResolveUrl(f.action); + } + // this does not work on firefox... + f.action = sWayBackCGI + resolved; + } + } + } + } +} Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/disclaim-element.js (from rev 2150, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/disclaim-element.js) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/disclaim-element.js (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/disclaim-element.js 2008-07-21 23:21:07 UTC (rev 2465) @@ -0,0 +1,29 @@ +function getFrameArea(frame) { + if(frame.innerWidth) return frame.innerWidth * frame.innerHeight; + if(frame.document.documentElement && frame.document.documentElement.clientHeight) return frame.document.documentElement.clientWidth * frame.document.documentElement.clientHeight; + if(frame.document.body) return frame.document.body.clientWidth * frame.document.body.clientHeight; + return 0; +} + +function disclaimElement(element) { + if(top!=self) { + if(top.document.body.tagName == "BODY") { + return; + } + largestArea = 0; + largestFrame = null; + for(i=0;i<top.frames.length;i++) { + frame = top.frames[i]; + area = getFrameArea(frame); + if(area > largestArea) { + largestFrame = frame; + largestArea = area; + } + } + if(self!=largestFrame) { + return; + } + } + element.style.display="block"; + document.body.insertBefore(element,document.body.firstChild); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |