racket/html-properties: add `js-addition'

original commit: 9162fc25042364c128be0b850c730a93ff910679
This commit is contained in:
Matthew Flatt 2012-09-11 17:39:12 -06:00
parent f470e3c3a7
commit 4a512f6a66
3 changed files with 21 additions and 0 deletions

View File

@ -9,6 +9,7 @@
[script-property ([type string?]
[script (or/c path-string? (listof string?))])]
[css-addition ([path (or/c path-string? (cons/c 'collects (listof bytes?)) bytes?)])]
[js-addition ([path (or/c path-string? (cons/c 'collects (listof bytes?)) bytes?)])]
[html-defaults ([prefix-path (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))]
[style-path (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))]
[extra-files (listof (or/c path-string? (cons/c 'collects (listof bytes?))))])]

View File

@ -686,6 +686,19 @@
(list style-file)
style-extra-files))
,(scribble-js-contents script-file (lookup-path script-file alt-paths))
,@(map (lambda (script-file)
(if (bytes? script-file)
(scribble-js-contents script-file #f)
(let ([p (lookup-path script-file alt-paths)])
(unless p (install-file script-file))
(scribble-js-contents script-file p))))
(extract-part-style-files
d
ri
'css
(lambda (p) (part-whole-page? p ri))
js-addition?
js-addition-path))
,(xml:comment "[if IE 6]><style type=\"text/css\">.SIEHidden { overflow: hidden; }</style><![endif]")
,@(for/list ([p (style-properties (part-style d))]
#:when (head-extra? p))

View File

@ -1405,6 +1405,13 @@ The @racket[path] field can be a result of
@racket[path->main-collects-relative].}
@defstruct[js-addition ([path (or/c path-string?
(cons/c 'collects (listof bytes?))
bytes?)])]{
Like @racket[css-addition], but for a Javascript file instead of a CSS file.}
@defstruct[body-id ([value string?])]{
Used as a @tech{style property} to associate an @tt{id} attribute with