From: Keith Marshall Date: Fri, 9 Oct 2020 14:12:25 +0000 (+0100) Subject: Add generic page overlay to report missing content. X-Git-Url: http://git.osdn.net/view?p=mingw%2Fwebsite.git;a=commitdiff_plain;h=24c7b59d9252f75b9b90a7a9bd4f27bfd34bcc60 Add generic page overlay to report missing content. * missing.html: New file. * site.js (load_content) [status 404]: Use it. (load_page_content): Initially, clear previous content. * header.html (Downloads, Documentation, Contact Us): Add "onclick" tab references; defer provision of content, raising 404 status. --- diff --git a/header.html b/header.html index 666d78f..7d0c8ac 100644 --- a/header.html +++ b/header.html @@ -39,20 +39,41 @@ * OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * + * + * Note: this page assumes browser support for the following numeric + * HTML entity codes: + * + * ‑ non-breaking hyphen + * ’ typographic apostrophe + * -->

Minimalist GNU for Windows

diff --git a/missing.html b/missing.html new file mode 100644 index 0000000..49a11fd --- /dev/null +++ b/missing.html @@ -0,0 +1,62 @@ + +

Page Not Found

+

The MinGW.org web‑site is undergoing an overhaul, +whilst in the process of transferring to a new hosting provider. +During this transitional phase, +some pages may be temporarily unavailable. +

+

If you see this page, +it is likely that the content you are trying to access +has not yet been transferred; +please check back later. +

+ + diff --git a/site.js b/site.js index f2da66d..c625c21 100644 --- a/site.js +++ b/site.js @@ -47,8 +47,14 @@ function load_content( container, src ) */ var request_handler = new XMLHttpRequest(); request_handler.onreadystatechange = function() - { if( (this.readyState == this.DONE) && (this.status == 200) ) - set_content( container, this.responseText ); + { if( this.readyState == this.DONE ) + switch( this.status ) + { case 200: + set_content( container, this.responseText ); + break; + case 404: + load_content( container, "missing.html" ); + } } request_handler.open( "GET", src, true ); request_handler.send(); @@ -59,6 +65,7 @@ function load_page_content( src, subtitle ) * update the displayed page subtitle, (which may be null), and * load the page content from the specified "src" file. */ + set_content( "page-content", null ); set_content( "page-title", document.title ); set_content( "page-subtitle", subtitle ); load_content( "page-content", src );