;;; Code:
+(defconst www-page-version "0.3")
+
(defvar www-page-coding-system
(if (featurep 'chise)
'utf-8-jp-er
(concat dest (substring string i))
coding-system))))
+(defun www-page-open-dir (url-dir &optional image-root)
+ (let* ((path (expand-file-name url-dir image-root))
+ (desc-file (expand-file-name "dir.desc" path)))
+ (cons (cons 'location path)
+ (with-temp-buffer
+ (when (file-exists-p desc-file)
+ (insert-file-contents desc-file)
+ (read (current-buffer)))))))
+
(defun www-page-display-dir (url-dir &optional size image-root
lang title parent-url hide-cgi)
(setq url-dir (file-name-as-directory url-dir))
(princ "Content-Type: text/html; charset=UTF-8
")
- (let* ((desc-file
- (expand-file-name "dir.desc"
- (expand-file-name url-dir image-root)))
- (params
- (with-temp-buffer
- (when (file-exists-p desc-file)
- (insert-file-contents desc-file)
- (read (current-buffer)))))
+ (let* ((params (www-page-open-dir url-dir image-root))
source-images ref-images
file i ref-file prev-file next-file file-desc
note)
(insert "</head>\n")
(insert "<body>\n")
(insert (format "<h1>%s</h1>\n" title))
-
(insert "
<hr>
")
+ (cond
+ ((or (eq lang 'ja)
+ (string= lang "ja"))
+ (insert
+ "[Note] \e$B%5%`%M%$%k$r%/%j%C%/$9$k$HBg$-$J2hA|$,I=<($5$l$^$9\e(B
+<hr>
+")
+ )
+ (t
+ (insert (format "lang = %s<br>\n" lang))))
(dolist (image-file source-images)
(setq file (file-name-nondirectory image-file))
(insert "<a href=\"")
(if parent-url
(insert (format "[<a href=\"%s\">Return</a>]\n" parent-url)))
+ (insert
+ (format "<hr>
+Powered by MnjAlbum WWW-Page Version %s." www-page-version))
(insert "
</body>
</html>
(when (file-exists-p desc-file)
(insert-file-contents desc-file)
(read (current-buffer)))))
- dir-desc-file
+ ;; dir-desc-file
image-file image-ref
prev-file next-file
prev-grade next-grade
rest spec ret)
(unless params
- (setq dir-desc-file
- (expand-file-name "dir.desc"
- (expand-file-name (file-name-directory file)
- image-root)))
+ ;; (setq dir-desc-file
+ ;; (expand-file-name "dir.desc"
+ ;; (expand-file-name (file-name-directory file)
+ ;; image-root)))
(setq params
- (with-temp-buffer
- (when (file-exists-p dir-desc-file)
- (insert-file-contents dir-desc-file)
- (read (current-buffer)))))
+ (www-page-open-dir (file-name-directory file) image-root)
+ ;; (with-temp-buffer
+ ;; (when (file-exists-p dir-desc-file)
+ ;; (insert-file-contents dir-desc-file)
+ ;; (read (current-buffer))))
+ )
(unless (assq 'refs params)
(if (setq rest (assq 'files params))
(setq rest (cdr rest))
(insert "<a href=\"")
(unless hide-cgi
(insert (format "page.cgi?%s" (file-name-directory file))))
- (insert (format "&lang=%s&size=%s\">[index]</a>"
+ (insert (format "&lang=%s&size=%s\">%s</a>"
(or lang 'en)
- size))
+ size
+ (cond ((eq lang 'ja)
+ "[index] \e$B$KLa$k\e(B")
+ (t
+ "[index]"))))
+ (insert
+ (cond ((eq lang 'ja)
+ "\e$B!JJQ99$7$?Bg$-$5$O0];}$5$l$^$9!K\e(B")
+ (t
+ "")))
+ (insert
+ (format "<hr>
+Powered by MnjAlbum WWW-Page Version %s." www-page-version))
(insert "
</body>
</html>