guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patches: Trivial (add div), Progressive Enhancement, Externalise CSS/JS


From: alex sassmannshausen
Subject: Patches: Trivial (add div), Progressive Enhancement, Externalise CSS/JS
Date: Sun, 18 Aug 2013 14:55:28 +0200

Hello,

Right, thanks for your feedback — and Cyril, for finding an HTML5 validator
that works. The NU validator seems to be well hidden if your starting
point is validator.w3.org.

Please find attached 3 patches. First is trivial, continuing Cyril's
work to make the package-list validate. It simply adds a missing closing
div, just after the footer.

The second patch re-introduces changes to the SXML and _javascript_ to
fulfill the criteria of Progressive Enhancement:
- All content is shown when _javascript_ is not enabled on GUI browsers.
In addition the patch implements JS that carries out the changes to the
HTML document successively rather than all at the end, which, with the
current size of the page, would cause a 'flicker'.

I have improved the changelog, as well as, I believe, made the functions
that these changes require, clearer.
Ludo, I appreciate set! being evil (maybe not the true extent yet
though…), but I believe it to be necessary on this occasion:
show_hide-grouper collects package description IDs in the local lid list
variable. This is achieved through repeated set!-ing. That list needs to
be cleared after each occasion that show_hide-grouper generates an sxml
_javascript_ call to bulk_show_hide, with the collected package-IDs as
formals, to be inserted in the final HTML. bulk_show_hide initially
hides the package descriptions and creates the <a> element that allows
for the package description to be 'expanded' or 'collapsed'.

Currently show_hide-grouper inserts roughly 31 _javascript_ calls to
bulk_show hide (1 every 15 package descriptions + 1 at the end to
collect the remaining package descriptions) in the final HTML
document. Hope this makes sense; if you can think of a better way of
doing it please let me know.

The third patch finally moves the CSS and JS into separate files, as
suggested by Ludo. I have implemented this so that by default, the page
simply links to those external files (this allows browsers to cache the
JS and CSS independently from the HTML). This does mean that those 2
additional files (package-list.js and package-list.css) need to be
pushed to the Guix site whenever changes are carried out to the CSS/JS.
The alternative, inlining the CSS and JS in the resulting HTML, which is
I think what was proposed, has been implemented as suggested, but I'm
running into an error — and I'm having difficulty locating it. It seems
to be happenning either during the (cute) evaluation, or the (dump-port)
evaluation. This functionality is currently disabled, and can be enabled
by calling insert-css or insert-js with an optional additional formal
parameter if you want to have a go at testing.

I'd be happy with the latter functionality removed or fixed — in terms
of HTML practice, I think the default, that is linking to external
files, is generally the done thing.

Best Wishes,

Alex

Attachment: 0001-list-packages-Add-missing-closing-div-after-footer-i.patch
Description: Binary data

Attachment: 0002-list-packages-Progressive-Enhancement-approach-to-JS.patch
Description: Binary data

Attachment: 0003-list-packages-Externalise-CSS-and-JavaScript.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]