1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

Improve replay banner's accessibility (#742)

* Puts banner in header and nav landmark regions
* Adds landmark role of banner to header
This commit is contained in:
Laura Wrubel 2022-08-09 15:25:38 -07:00 committed by GitHub
parent a97ad7ebbe
commit 49393ce16a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,6 +148,10 @@ This file is part of pywb, https://github.com/webrecorder/pywb
* @param {string} bid - The id for the banner
*/
DefaultBanner.prototype.createBanner = function(bid) {
this.header = document.createElement('header');
this.header.setAttribute('role', 'banner');
this.nav = document.createElement('nav');
this.banner = document.createElement('wb_div', true);
this.banner.setAttribute('id', bid);
this.banner.setAttribute('lang', 'en');
@ -208,8 +212,9 @@ This file is part of pywb, https://github.com/webrecorder/pywb
}
this.banner.appendChild(ancillaryLinks);
document.body.insertBefore(this.banner, document.body.firstChild);
this.nav.appendChild(this.banner);
this.header.appendChild(this.nav);
document.body.insertBefore(this.header, document.body.firstChild);
};
/**