mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
frame ui: pass timestamp to frame banner, fix typo in html
banner: allow overriding of banner id by returning custom id
This commit is contained in:
parent
29c6a36dac
commit
734ee4471b
@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
#_wb_plain_banner, #_wb_frame_top_banner
|
#_wb_plain_banner, #_wb_frame_top_banner
|
||||||
{
|
{
|
||||||
display: block !important;
|
display: block !important;
|
||||||
top: 0px !important;
|
top: 0px !important;
|
||||||
left: 0px !important;
|
left: 0px !important;
|
||||||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
|
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
font-size: 24px !important;
|
font-size: 24px !important;
|
||||||
background-color: lightYellow !important;
|
background-color: lightYellow !important;
|
||||||
color: black !important;
|
color: black !important;
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
z-index: 2147483643 !important;
|
z-index: 2147483643 !important;
|
||||||
|
@ -19,20 +19,23 @@ This file is part of pywb, https://github.com/ikreymer/pywb
|
|||||||
|
|
||||||
function __WbJsInit() {
|
function __WbJsInit() {
|
||||||
|
|
||||||
|
var bid = undefined;
|
||||||
|
|
||||||
|
|
||||||
function init_banner() {
|
function init_banner() {
|
||||||
var PLAIN_BANNER_ID = "_wb_plain_banner";
|
var PLAIN_BANNER_ID = "_wb_plain_banner";
|
||||||
var FRAME_BANNER_ID = "_wb_frame_top_banner";
|
var FRAME_BANNER_ID = "_wb_frame_top_banner";
|
||||||
var bid;
|
|
||||||
|
|
||||||
if (window.top != window.self) {
|
if (window.top != window.self) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wbinfo.is_frame) {
|
if (!bid) {
|
||||||
bid = FRAME_BANNER_ID;
|
if (wbinfo.is_frame) {
|
||||||
} else {
|
bid = FRAME_BANNER_ID;
|
||||||
bid = PLAIN_BANNER_ID;
|
} else {
|
||||||
|
bid = PLAIN_BANNER_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!document || !document.body) {
|
if (!document || !document.body) {
|
||||||
@ -43,7 +46,10 @@ function init_banner() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_wb_js.create_banner_element(bid);
|
var res = _wb_js.create_banner_element(bid);
|
||||||
|
if (res) {
|
||||||
|
bid = res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.banner_labels = {LOADING_MSG: "Loading...",
|
this.banner_labels = {LOADING_MSG: "Loading...",
|
||||||
|
@ -44,7 +44,7 @@ function make_inner_url(url, ts)
|
|||||||
|
|
||||||
function push_state(url, timestamp, capture_str, is_live) {
|
function push_state(url, timestamp, capture_str, is_live) {
|
||||||
if (window.frames[0].WB_wombat_location) {
|
if (window.frames[0].WB_wombat_location) {
|
||||||
curr_href = window.frames[0].WB_wombat_location.href;
|
var curr_href = window.frames[0].WB_wombat_location.href;
|
||||||
|
|
||||||
// If not current url, don't update
|
// If not current url, don't update
|
||||||
if (url != curr_href) {
|
if (url != curr_href) {
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<!-- Start WB Insert -->
|
|
||||||
<script>
|
<script>
|
||||||
wbinfo = {}
|
wbinfo = {}
|
||||||
wbinfo.prefix = "{{ wbrequest.wb_prefix }}";
|
wbinfo.prefix = "{{ wbrequest.wb_prefix }}";
|
||||||
wbinfo.capture_url = "{{ url }}";
|
wbinfo.capture_url = "{{ url }}";
|
||||||
|
wbinfo.timestamp = "{{ wbrequest.wb_url.timestamp }}";
|
||||||
wbinfo.is_frame = true;
|
wbinfo.is_frame = true;
|
||||||
</script>
|
</script>
|
||||||
<script src='{{ wbrequest.host_prefix }}/{{ static_path }}/wb.js'> </script>
|
<script src='{{ wbrequest.host_prefix }}/{{ static_path }}/wb.js'> </script>
|
||||||
|
<link rel='stylesheet' href='{{ wbrequest.host_prefix }}/{{ static_path }}/wb.css'/>
|
||||||
|
|
||||||
{% include banner_html ignore missing %}
|
{% include banner_html ignore missing %}
|
||||||
|
|
||||||
<script src='{{ wbrequest.host_prefix }}/{{ static_path }}/wb_frame.js'> </script>
|
<script src='{{ wbrequest.host_prefix }}/{{ static_path }}/wb_frame.js'> </script>
|
||||||
<link rel='stylesheet' href='{{ wbrequest.host_prefix }}/{{ static_path }}/wb.css'/>
|
</head>
|
||||||
<!-- End WB Insert -->
|
|
||||||
<body style="margin: 0px; padding: 0px;">
|
<body style="margin: 0px; padding: 0px;">
|
||||||
<div class="wb_iframe_div">
|
<div class="wb_iframe_div">
|
||||||
<iframe src="{{ wbrequest.wb_prefix + embed_url }}" onload="iframe_loaded(event);" seamless="seamless" frameborder="0" scrolling="yes" class="wb_iframe"/>
|
<iframe src="{{ wbrequest.wb_prefix + embed_url }}" onload="iframe_loaded(event);" seamless="seamless" frameborder="0" scrolling="yes" class="wb_iframe"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user