1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 16:14:48 +01:00
pywb/static/wb.js
Ilya Kreymer 57fe9515db - support for running uwsgi with virtualenv
- text changes in banner
- some info about testing in README
2014-01-29 17:23:19 -08:00

48 lines
1.1 KiB
JavaScript

// Rewritten location and domain obj setup
window.WB_wombat_location = window.location
if (window.top != window) {
window.top.WB_wombat_location = window.top.location
}
if (window.opener) {
window.opener.WB_wombat_location = window.opener.location
}
document.WB_wombat_domain = document.domain
function initBanner()
{
var BANNER_ID = "_wayback_banner";
var banner = document.getElementById(BANNER_ID);
if (!banner) {
banner = document.createElement("wb_div");
banner.setAttribute("id", BANNER_ID);
banner.setAttribute("lang", "en");
text = "This is an archived page ";
if (wbinfo && wbinfo.capture_str) {
text += " from <b>" + wbinfo.capture_str + "</b>";
}
banner.innerHTML = text;
document.body.insertBefore(banner, document.body.firstChild);
}
}
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "interactive" || document.readyState === "complete") {
initBanner();
clearInterval(readyStateCheckInterval);
}
}, 10);