mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-28 00:25:21 +01:00
split replay view into BaseContentView and ReplayView refactor RewriteLiveHandler into RewriteLiveView add additional tests for framed and non-framed mode default to framed replay!
79 lines
1.8 KiB
HTML
79 lines
1.8 KiB
HTML
<html>
|
|
<head>
|
|
<!-- Start WB Insert -->
|
|
<script>
|
|
wbinfo = {}
|
|
// wbinfo.capture_str = "{{ timestamp | format_ts }}";
|
|
wbinfo.capture_str = " ";
|
|
wbinfo.is_embed = false;
|
|
wbinfo.prefix = "{{ wbrequest.wb_prefix }}";
|
|
wbinfo.capture_url = "{{ url }}";
|
|
wbinfo.is_frame = true;
|
|
</script>
|
|
<script src='{{ wbrequest.host_prefix }}/{{ static_path }}/wb.js'> </script>
|
|
<script>
|
|
|
|
var update_wb_url = push_state;
|
|
|
|
function make_outer_url(url, ts)
|
|
{
|
|
if (ts) {
|
|
return wbinfo.prefix + ts + "/" + url;
|
|
} else {
|
|
return wbinfo.prefix + url;
|
|
}
|
|
}
|
|
|
|
function make_inner_url(url, ts)
|
|
{
|
|
if (ts) {
|
|
return wbinfo.prefix + ts + "mp_/" + url;
|
|
} else {
|
|
return wbinfo.prefix + "mp_/" + url;
|
|
}
|
|
}
|
|
|
|
function push_state(url, timestamp, capture_str) {
|
|
var state = {}
|
|
state.outer_url = make_outer_url(url, timestamp);
|
|
state.inner_url = make_inner_url(url, timestamp);
|
|
state.capture_str = capture_str;
|
|
|
|
//if (url == wbinfo.capture_url) {
|
|
// return;
|
|
//}
|
|
|
|
window.history.replaceState(state, "", state.outer_url);
|
|
update_status(state.capture_str);
|
|
}
|
|
|
|
function pop_state(state) {
|
|
update_status(state.capture_str);
|
|
window.frames[0].src = state.outer_url;
|
|
}
|
|
|
|
function update_status(str) {
|
|
var elem = document.getElementById("_wb_capture_info");
|
|
if (elem) {
|
|
elem.innerHTML = str;
|
|
}
|
|
}
|
|
|
|
window.onpopstate = function(event) {
|
|
var curr_state = event.state;
|
|
|
|
if (curr_state) {
|
|
pop_state(curr_state);
|
|
}
|
|
}
|
|
|
|
</script>
|
|
<link rel='stylesheet' href='{{ wbrequest.host_prefix }}/{{ static_path }}/wb.css'/>
|
|
<!-- End WB Insert -->
|
|
<body style="margin: 0px; padding: 0px;">
|
|
<div class="wb_iframe_div">
|
|
<iframe src="{{ wbrequest.wb_prefix + embed_url }}" seamless="seamless" frameborder="0" scrolling="yes" class="wb_iframe"/>
|
|
</div>
|
|
</body>
|
|
</html>
|