toc links on main pages go to user pages where needed
svn: r9993
This commit is contained in:
parent
9127cdaaf8
commit
9b0492e320
|
@ -27,10 +27,12 @@ function SetPLTRoot(ver, relative) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// adding index.html works because of the above
|
// adding index.html works because of the above
|
||||||
function GotoPLTRoot(ver) {
|
function GotoPLTRoot(ver, relative) {
|
||||||
var u = GetCookie("PLT_Root."+ver);
|
var u = GetCookie("PLT_Root."+ver);
|
||||||
if (u == null) return true; // no cookie: use plain up link
|
if (u == null) return true; // no cookie: use plain up link
|
||||||
location = u + "index.html";
|
// the relative path is optional, default goes to the toplevel start page
|
||||||
|
if (!relative) relative = "index.html";
|
||||||
|
location = u + relative;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,19 +57,29 @@
|
||||||
(map (lambda (item)
|
(map (lambda (item)
|
||||||
(if (eq? item '---)
|
(if (eq? item '---)
|
||||||
(list '--- (make-toc-element #f null '(nbsp)))
|
(list '--- (make-toc-element #f null '(nbsp)))
|
||||||
(let* ([id (car item)]
|
(let ()
|
||||||
[info (page-info id)]
|
(define id (car item))
|
||||||
[label (car info)]
|
(define info (page-info id))
|
||||||
[root (cadr info)]
|
(define label (car info))
|
||||||
[path (caddr info)]
|
(define root (cadr info))
|
||||||
[text (make-element "tocsubseclink" (list label))]
|
(define path (caddr info))
|
||||||
[dest (case root
|
(define text (make-element "tocsubseclink" (list label)))
|
||||||
|
(define dest
|
||||||
|
(case root
|
||||||
[(plt) (build-path (find-doc-dir) path)]
|
[(plt) (build-path (find-doc-dir) path)]
|
||||||
[(user) (string-append up path)]
|
[(user) (string-append up path)]
|
||||||
[(#f) path]
|
[(#f) path]
|
||||||
[else (error "internal error (main-page)")])]
|
[else (error "internal error (main-page)")]))
|
||||||
[elt (lambda (style)
|
(define (onclick style)
|
||||||
|
(if (eq? root 'user)
|
||||||
|
(make-with-attributes
|
||||||
|
style
|
||||||
|
`([onclick
|
||||||
|
. ,(format "return GotoPLTRoot(\"~a\", \"~a\");"
|
||||||
|
(version) path)]))
|
||||||
|
style))
|
||||||
|
(define (elt style)
|
||||||
(make-toc-element
|
(make-toc-element
|
||||||
#f null (list (link dest #:style style text))))])
|
#f null (list (link dest #:style (onclick style) text))))
|
||||||
(list id (elt "tocviewlink") (elt "tocviewselflink")))))
|
(list id (elt "tocviewlink") (elt "tocviewselflink")))))
|
||||||
links))
|
links))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user