Changeset 14099 in project


Ignore:
Timestamp:
04/06/09 01:14:47 (11 years ago)
Author:
azul
Message:

Use new 'javascript' extension type.

Location:
release/3/svnwiki-image/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/3/svnwiki-image/trunk/svnwiki-image.meta

    r12533 r14099  
    66 (synopsis "Handles images in Svnwiki repositories, providing a convenient way to view them.")
    77 (category web)
    8  (needs svnwiki-extensions  svnwiki-extensions srfi-40 stream-ext srfi-1 svn-post-commit-hooks orders format-modular html-stream)
     8 (needs svnwiki-extensions srfi-40 stream-ext srfi-1 svn-post-commit-hooks orders format-modular html-stream)
    99 (license "GPL-3"))
  • release/3/svnwiki-image/trunk/svnwiki-image.scm

    r12574 r14099  
    66(use svnwiki-extensions-support srfi-40 stream-ext srfi-1 svn-post-commit-hooks orders format-modular html-stream content-type)
    77
    8 (define *image-javascript*
     8(define (image-javascript env)
    99#<<EOF
    1010if (typeof(svnwikiImage) != "object") {
     
    102102             (li ((a href (svnwiki-image-show-sizes-link env random-id)) "All sizes")))
    103103            ((div id (format #f "svnwikiImageSizes~A" random-id)))
    104             ((script type "text/javascript" src (format #f "~A/xsvnwiki-helper/image/image" static-url)))
    105104            ((img src (format #f "~A-~A" (last (string-split path "/")) (apply max (svnwiki-image-default-size env)))
    106105                  id (format #f "svnwikiImage~A" random-id)
     
    163162  '("png"
    164163    "jpeg"))
    165 
    166 (define (svnwiki-image-start-update-notify env)
    167   (let-from-environment env (path-out)
    168     (assert (and 'svnwiki-image-start-update-notify (string? path-out)))
    169     (unless (directory? (svnwiki-make-pathname path-out "xsvnwiki-helper"))
    170       (create-directory (svnwiki-make-pathname path-out "xsvnwiki-helper")))
    171     (unless (directory? (svnwiki-make-pathname (list path-out "xsvnwiki-helper") "image"))
    172       (create-directory (svnwiki-make-pathname (list path-out "xsvnwiki-helper") "image")))
    173     (write-file-with-tmp
    174       (svnwiki-make-pathname (list "xsvnwiki-helper" "image") "image")
    175       "text/javascript"
    176       path-out
    177       (string->stream
    178         *image-javascript*))))
    179164
    180165; Returns the image subtype as a string (eg. "png") or #f is the file is not an
     
    261246(svnwiki-extension-define 'render-file-contents 'image svnwiki-image-handler-render)
    262247(svnwiki-extension-define 'update-notify-recursive 'image svnwiki-image-update)
    263 (svnwiki-extension-define 'start-update-notify 'image svnwiki-image-start-update-notify)
     248(svnwiki-extension-define 'javascript 'image image-javascript)
    264249(svnwiki-extension-define 'code-break 'image svnwiki-image-code-break)
Note: See TracChangeset for help on using the changeset viewer.