Ignore:
Timestamp:
11/29/11 05:01:28 (9 years ago)
Author:
Jim Ursetto
Message:

chickadee 0.9.11: Improve response time & Firefox rendering with <script> at end; fix TOC flash

Move <script>s to end of HTML, improving responsiveness, avoiding starting mid-page
in Firefox, and correcting flash of unhidden TOC. Introduce js/no-js class into
<html> a la Modernizr, though we do it with a one-line inline script.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/chickadee/trunk/chickadee.scm

    r21731 r25601  
    319319  (sxml->html
    320320   `((lit "<!doctype html>")
    321      (html
     321     (html (@ class "no-js")
    322322      (head ,(charset "utf-8")
    323             ,(map javascript (chickadee-js-files))
    324323            ,(map css-link (chickadee-css-files))
     324            ;; Remove "no-js" class and add "js" class to <HTML> when JS enabled, a la Modernizr.
     325            (script "this.document.documentElement.className = "
     326                    "this.document.documentElement.className.replace(/\\bno-js\\b/, '') + ' js '")
    325327            (title ,(if page-title
    326328                        `(,page-title " | chickadee")
     
    364366       (div (@ (id "body"))
    365367            (div (@ (id "main"))
    366                  ,body)))))))
     368                 ,body)))
     369      ,(map javascript (chickadee-js-files))))))
    367370
    368371(define (node-page title contents body #!key (page-title #f))
Note: See TracChangeset for help on using the changeset viewer.