diff --git a/pywb/static/wb.js b/pywb/static/wb.js index 84588324..81d40f42 100644 --- a/pywb/static/wb.js +++ b/pywb/static/wb.js @@ -19,6 +19,12 @@ This file is part of pywb. _wb_js = (function() { + +var labels = {LOADING_MSG: "Loading...", + REPLAY_MSG: "This is an archived page from ", + LIVE_MSG: "This is a live page just fetched on "}; + + function init_banner() { var PLAIN_BANNER_ID = "_wb_plain_banner"; var FRAME_BANNER_ID = "_wb_frame_top_banner"; @@ -40,19 +46,33 @@ function init_banner() { var banner = document.getElementById(bid); - if (!banner) { - banner = document.createElement("wb_div"); - banner.setAttribute("id", bid); - banner.setAttribute("lang", "en"); - - text = "This is an archived page "; - if (wbinfo && wbinfo.capture_str) { - text += " from " + wbinfo.capture_str + ""; - } - banner.innerHTML = text; - - document.body.insertBefore(banner, document.body.firstChild); + if (banner) { + return; } + + banner = document.createElement("wb_div"); + banner.setAttribute("id", bid); + banner.setAttribute("lang", "en"); + + var text; + + if (wbinfo.is_frame) { + text = labels.LOADING_MSG; + } else if (wbinfo.is_live) { + text = labels.LIVE_MSG; + } else { + text = labels.REPLAY_MSG; + } + + text = "" + text + ""; + + var capture_str = (wbinfo ? wbinfo.capture_str : ""); + + text += "" + capture_str + ""; + + banner.innerHTML = text; + + document.body.insertBefore(banner, document.body.firstChild); } function add_event(name, func, object) { @@ -105,7 +125,10 @@ function notify_top(event) { } if (window.top.update_wb_url) { - window.top.update_wb_url(window.WB_wombat_location.href, wbinfo.timestamp, wbinfo.capture_str); + window.top.update_wb_url(window.WB_wombat_location.href, + wbinfo.timestamp, + wbinfo.capture_str, + wbinfo.is_live); } } @@ -126,4 +149,6 @@ if (wbinfo.is_frame_mp && wbinfo.canon_url && window.location.replace(wbinfo.canon_url); } +return {'labels': labels}; + })(); diff --git a/pywb/ui/frame_insert.html b/pywb/ui/frame_insert.html index d8e7b6d9..19426c40 100644 --- a/pywb/ui/frame_insert.html +++ b/pywb/ui/frame_insert.html @@ -3,7 +3,6 @@ diff --git a/pywb/ui/index.html b/pywb/ui/index.html index 3bbabbe2..3a8ff0c9 100644 --- a/pywb/ui/index.html +++ b/pywb/ui/index.html @@ -9,3 +9,14 @@ The following archive collections are available: {% endif %} {% endfor %} + +Other endpoints in this deployment: + + +