1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +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:
Ilya Kreymer 2015-02-02 09:41:49 -08:00
parent 29c6a36dac
commit 734ee4471b
4 changed files with 18 additions and 12 deletions

View File

@ -1,13 +1,13 @@
#_wb_plain_banner, #_wb_frame_top_banner
{
{
display: block !important;
top: 0px !important;
left: 0px !important;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
width: 100% !important;
font-size: 24px !important;
background-color: lightYellow !important;
background-color: lightYellow !important;
color: black !important;
text-align: center !important;
z-index: 2147483643 !important;

View File

@ -19,20 +19,23 @@ This file is part of pywb, https://github.com/ikreymer/pywb
function __WbJsInit() {
var bid = undefined;
function init_banner() {
var PLAIN_BANNER_ID = "_wb_plain_banner";
var FRAME_BANNER_ID = "_wb_frame_top_banner";
var bid;
if (window.top != window.self) {
return;
}
if (wbinfo.is_frame) {
bid = FRAME_BANNER_ID;
} else {
bid = PLAIN_BANNER_ID;
if (!bid) {
if (wbinfo.is_frame) {
bid = FRAME_BANNER_ID;
} else {
bid = PLAIN_BANNER_ID;
}
}
if (!document || !document.body) {
@ -43,7 +46,10 @@ function init_banner() {
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...",

View File

@ -44,7 +44,7 @@ function make_inner_url(url, ts)
function push_state(url, timestamp, capture_str, is_live) {
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 (url != curr_href) {

View File

@ -1,19 +1,19 @@
<html>
<head>
<!-- Start WB Insert -->
<script>
wbinfo = {}
wbinfo.prefix = "{{ wbrequest.wb_prefix }}";
wbinfo.capture_url = "{{ url }}";
wbinfo.timestamp = "{{ wbrequest.wb_url.timestamp }}";
wbinfo.is_frame = true;
</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 %}
<script src='{{ wbrequest.host_prefix }}/{{ static_path }}/wb_frame.js'> </script>
<link rel='stylesheet' href='{{ wbrequest.host_prefix }}/{{ static_path }}/wb.css'/>
<!-- End WB Insert -->
</head>
<body style="margin: 0px; padding: 0px;">
<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"/>