From: Keith Marshall Date: Sat, 11 Sep 2021 23:19:40 +0000 (+0100) Subject: Execute embedded scripts on overlay-page load. X-Git-Url: http://git.osdn.net/view?p=mingw%2Fwebsite.git;a=commitdiff_plain;h=aa687c72a815bb0c10a1f2040e4a53e4395d3605 Execute embedded scripts on overlay-page load. * site.js (no_break, update_page_content_header): Delete them. (set_page): New page-load helper function; it supports page title and subtitle updates, when called from embedded scripts on overlay-pages. (load_page) [status == 200]: Scan for, and execute embedded scripts. * index.html [masthead] (h1, h2): Change identifiers from... (as-page-title, as-page-subtitle): ...these respectively, to... (page-title, page-subtitle): ...these; add hidden placeholder content. * about.html contact.html fdl.html mailing.html missing.html * terms.html [masthead] (dl): Delete hidden element; replace it with script, to assign effective HTML content to each of... (page-title, page-subtitle): ...these. * fdl.html mailing.html (ol, ul): Do not override CSS styles. * site.css [masthead]: Do not assume that final element is... (dl): ...this; define style for immediately following paragraph, on the basis that the final masthead element may be anything. --- diff --git a/about.html b/about.html index 8937505..42566ac 100644 --- a/about.html +++ b/about.html @@ -48,16 +48,15 @@ * ” right (closing) typographic double quote * --> -
- -
Welcome to MinGW.OSDN
-
Home of the MinGW and MSYS Projects
-
+

MinGW, a contraction of “Minimalist GNU for Windows”, is a minimalist development environment diff --git a/contact.html b/contact.html index 3ea29c8..3fcc1d0 100644 --- a/contact.html +++ b/contact.html @@ -48,16 +48,15 @@ * ” right (closing) typographic double quote * --> -

- -
Contacting MinGW.OSDN
-
When a Web-Search Fails to Resolve your Issue
-
+

If you have exhausted all of the web‑site resources, and you have searched all of the -

- -
MinGW.OSDN Licensing
-
The MinGW Free Documentation Licence
-
+

Copyright © 2020, MinGW.OSDN Project

Redistribution and use in source and ‘compiled’ forms (SGML, HTML, PDF, PostScript, RTF, etc.) with or without modification, are permitted provided that the following conditions are met:—

-
    +
    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer as diff --git a/index.html b/index.html index c013fb9..45eb993 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ --> - + Welcome to MinGW.OSDN + + +

      :

      +

      :


      diff --git a/mailing.html b/mailing.html index efbad45..0b4d68e 100644 --- a/mailing.html +++ b/mailing.html @@ -49,16 +49,15 @@ * ” right (closing) typographic double quote * --> -
      - -
      MinGW.OSDN Mailing-Lists
      -
      Mailing-Lists and Mail Archives Operated by MinGW.OSDN
      -
      +

      MinGW.OSDN’s preferred method for communication, between users and the project team, is by way of mailing‑lists. Historically, there were several topic‑specific lists, originally @@ -261,7 +260,7 @@ in your posts being ignored by a number of knowledgeable people, and repeated offenses may even lead to your posts being vetted, and potentially rejected, by the list moderator.

      -
        +
        • The language of the lists is English ; if you post in any other language, you are unlikely to elicit a response.
        • diff --git a/missing.html b/missing.html index 523de03..16ba5b6 100644 --- a/missing.html +++ b/missing.html @@ -48,16 +48,15 @@ * ” right (closing) typographic double quote * --> -
          - -
          MinGW.OSDN Server Error
          -
          HTTP Status 404 — Requested Page Not Found
          -
          +

          The requested URL, “”, cannot be resolved. diff --git a/site.css b/site.css index 713a0d4..9b95aed 100644 --- a/site.css +++ b/site.css @@ -244,7 +244,7 @@ dl.masthead */ display: none; } -dl.masthead+p +.masthead+p { /* The masthead section is separated from the remaining page * content, by a horizontal rule; to keep white space balanced, * above and below this rule, when it is immediately followed diff --git a/site.js b/site.js index 4a5f9ad..17599e4 100644 --- a/site.js +++ b/site.js @@ -37,25 +37,18 @@ function set_content( item, value ) */ var element = document.getElementById( item ); if( element ) element.innerHTML = value; + return element; } -function no_break( text ) -{ /* Helper function to replace all occurrences of ASCII hyphen-minus, - * within "text", by substitution of HTML non-breaking hyphen. +function set_page( title, text ) +{ /* Helper function, for use in overlay page scripts, to update + * the "title" and "subtitle" fields within the page header; note + * that "text" may, and should, use ASCII hyphen-minus where any + * hyphen is to be represented; these will be replaced by HTML + * non-breaking hyphen entities, on header field assignment. */ - return text.replace( /-/g, "‑" ); -} - -function update_page_content_header( tag ) -{ /* Update the "page-title" and "page-subtitle" content-header text, - * by substitution into the "as-page-title" and "as-page-subtitle" - * place-holder elements, respectively. - */ - var element = document.getElementById( "page-".concat( tag )); - if( element ) - { if( tag == "title" ) document.title = element.innerHTML; - set_content( "as-page-".concat( tag ), no_break( element.innerHTML )); - } + if( title == "title" ) document.title = text; + set_content( "page-".concat( title ), text.replace( /-/g, "‑" )); } function load_content( container, src ) @@ -69,10 +62,13 @@ function load_content( container, src ) { if( this.readyState == this.DONE ) switch( this.status ) { case 200: - set_content( container, this.responseText ); - update_page_content_header( "title" ); - update_page_content_header( "subtitle" ); + var element = set_content( container, this.responseText ); + var idx; element = element.getElementsByTagName( "script" ); set_content( "e404-missing-page", document.URL ); + for( idx = 0; idx < element.length; idx++ ) + { var onload_action = Function( element[idx].innerHTML ); + onload_action(); + } if( src.includes("#") ) { src = src.substring( src.indexOf("#") + 1, src.length ); element = document.getElementById( src ); diff --git a/terms.html b/terms.html index 481933d..7863dc9 100644 --- a/terms.html +++ b/terms.html @@ -49,16 +49,15 @@ * ” right (closing) typographic double quote * --> -

          - -
          MinGW.OSDN Licensing
          -
          Terms of Use for MinGW.OSDN Products and Resources
          -
          +

          Each of the various packages, which are distributed by MinGW.OSDN,