diff --git a/pywb/static/default_banner.css b/pywb/static/default_banner.css index 3a9565f1..1f9b03d7 100644 --- a/pywb/static/default_banner.css +++ b/pywb/static/default_banner.css @@ -11,19 +11,7 @@ color: white !important; z-index: 2147483643 !important; line-height: normal !important; -} -#title_or_url -{ - display: block !important; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; -} - -#_wb_frame_top_banner -{ position: absolute !important; border: 0px; height: 44px !important; @@ -44,6 +32,17 @@ -ms-flex-align: center; } +#title_or_url +{ + display: block !important; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100%; +} + + + #_wb_frame_top_banner ._wb_linked_logo { display: block; @@ -110,11 +109,14 @@ { font-size: 12px; color: #FFF; - margin-right: 15px; text-align: right; - flex-shrink: 1 0; - -webkit-flex-shrink: 1 0; - -moz-flex-shrink: 1 0; + margin: 0px 15px 0px 0px; + padding: inherit; + background-color: inherit; + width: initial; + flex-shrink: 1; + -webkit-flex-shrink: 1; + -moz-flex-shrink: 1; -ms-flex: 0 0 115px; } #_wb_frame_top_banner #_wb_ancillary_links a:link, diff --git a/pywb/static/default_banner.js b/pywb/static/default_banner.js index 5fd71e01..34fca130 100644 --- a/pywb/static/default_banner.js +++ b/pywb/static/default_banner.js @@ -45,16 +45,15 @@ This file is part of pywb, https://github.com/webrecorder/pywb * @desc Initialize (display) the banner */ DefaultBanner.prototype.init = function() { + this.createBanner('_wb_frame_top_banner'); + if (window.wbinfo) { - this.createBanner('_wb_plain_banner'); this.set_banner( window.wbinfo.url, window.wbinfo.timestamp, window.wbinfo.is_live, window.wbinfo.is_framed ? '' : document.title ); - } else { - this.createBanner('_wb_frame_top_banner'); } }; @@ -306,4 +305,16 @@ This file is part of pywb, https://github.com/webrecorder/pywb // all banners will expose themselves by adding themselves as WBBanner on window window.WBBanner = new DefaultBanner(); + + // if in replay frame, init immediately + if (window.wbinfo) { + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", function() { + window.WBBanner.init(); + }); + } else { + window.WBBanner.init(); + } + } + })(); diff --git a/pywb/templates/banner.html b/pywb/templates/banner.html index f458db79..d629dd2b 100644 --- a/pywb/templates/banner.html +++ b/pywb/templates/banner.html @@ -1,8 +1,4 @@ {% if not env.pywb_proxy_magic or config.proxy.enable_banner | default(true) %} - - - - + + + + + {% endif %} diff --git a/pywb/version.py b/pywb/version.py index cce7cd75..23a4653c 100644 --- a/pywb/version.py +++ b/pywb/version.py @@ -1,4 +1,4 @@ -__version__ = '2.4.0rc3' +__version__ = '2.4.0rc4' if __name__ == '__main__': print(__version__)