From: tomo Date: Wed, 17 Oct 2007 10:24:23 +0000 (+0000) Subject: (www-page-version): New constant. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=887eb63ca7a5981c0dadf60c6a17fee51d2303cd;p=elisp%2Falbum.git (www-page-version): New constant. (www-page-open-dir): New function. (www-page-display-dir): Use `www-page-open-dir'; display a note in Japanese mode; display this program name and version. (www-page-display-page): Likewise. --- diff --git a/www-page.el b/www-page.el index 02d6a1d..d06d497 100644 --- a/www-page.el +++ b/www-page.el @@ -27,6 +27,8 @@ ;;; Code: +(defconst www-page-version "0.3") + (defvar www-page-coding-system (if (featurep 'chise) 'utf-8-jp-er @@ -67,20 +69,22 @@ (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) @@ -115,10 +119,19 @@ (insert "\n") (insert "\n") (insert (format "

%s

\n" title)) - (insert "
") + (cond + ((or (eq lang 'ja) + (string= lang "ja")) + (insert + "[Note] サムネイルをクリックすると大きな画像が表示されます +
+") + ) + (t + (insert (format "lang = %s
\n" lang)))) (dolist (image-file source-images) (setq file (file-name-nondirectory image-file)) (insert "Return]\n" parent-url))) + (insert + (format "
+Powered by MnjAlbum WWW-Page Version %s." www-page-version)) (insert " @@ -227,21 +243,23 @@ (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)) @@ -408,9 +426,21 @@ (insert "[index]" + (insert (format "&lang=%s&size=%s\">%s" (or lang 'en) - size)) + size + (cond ((eq lang 'ja) + "[index] に戻る") + (t + "[index]")))) + (insert + (cond ((eq lang 'ja) + "(変更した大きさは維持されます)") + (t + ""))) + (insert + (format "
+Powered by MnjAlbum WWW-Page Version %s." www-page-version)) (insert "