From 17676957186130d268a249f0736caaa9212f15cd Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Mon, 5 Apr 2010 08:49:07 +0900 Subject: [PATCH] (chise-wiki-edit-url): Use "edit.cgi" instead of "edit/edit.cgi". (chise-wiki-add-url): Use "add.cgi" instead of "edit/add.cgi". (www-display-char-desc): Add new optional argument `simple'; display "Edit" and "New Account" buttons when running with simple mode; display "Simple" button when running with edit mode. (www-batch-view): Modify to support mode. --- cwiki-view.el | 57 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/cwiki-view.el b/cwiki-view.el index a389aec..9893cfb 100644 --- a/cwiki-view.el +++ b/cwiki-view.el @@ -2,10 +2,10 @@ (require 'cwiki-common) (defvar chise-wiki-view-url "view.cgi") -(defvar chise-wiki-edit-url "edit/edit.cgi") -(defvar chise-wiki-add-url "edit/add.cgi") +(defvar chise-wiki-edit-url "edit.cgi") +(defvar chise-wiki-add-url "add.cgi") -(defun www-display-char-desc (uri-char &optional lang level) +(defun www-display-char-desc (uri-char &optional lang level simple) (unless level (setq level 1)) (let ((char (www-uri-decode-char uri-char)) @@ -27,6 +27,23 @@ (dolist (feature (char-feature-property '$object 'additional-features)) (mount-char-attribute-table (char-feature-name-at-domain feature '$rev=latest))) + (princ + (format + (if simple + "
+ + + + +
+
\n" + "
+ + + +
+
\n") + uri-char)) (when (setq parents (www-char-feature char '<-denotational)) (princ (format "

%s %s

\n
\n" (www-format-value-as-char-list parents) @@ -67,17 +84,19 @@ '((name) " : " (value))) char logical-feature ; (car cell) - lang uri-char)) - (princ - (format " " - chise-wiki-edit-url - (www-format-encode-string uri-char) - (www-format-encode-string - (www-uri-encode-feature-name - (intern (format "%s*note" - logical-feature ; (car cell) - )))))) + chise-wiki-edit-url + (www-format-encode-string uri-char) + (www-format-encode-string + (www-uri-encode-feature-name + (intern (format "%s*note" + logical-feature ; (car cell) + ))))))) (princ (if (= level 1) "

\n" @@ -222,6 +241,7 @@ size=\;; "30\" maxlength=\"30\" value=\"\" />") (let* ((target (pop command-line-args-left)) (user (pop command-line-args-left)) (accept-language (pop command-line-args-left)) + (mode (intern (pop command-line-args-left))) (lang (intern (car (split-string @@ -260,7 +280,7 @@ size=\;; "30\" maxlength=\"30\" value=\"\" />") (cond ((eq (car ret) 'char) (www-display-char-desc (cdr ret) ; (decode-uri-string (cdr ret) 'utf-8-mcs-er) - lang) + lang nil (eq mode 'simple)) ) ((eq (car ret) 'feature) (www-display-feature-desc @@ -271,12 +291,13 @@ size=\;; "30\" maxlength=\"30\" value=\"\" />") )) )) (princ "\n
\n") + (princ (format "mode=%S\n" mode)) (princ (format "user=%s\n" user)) - (princ (format "local user=%s\n" (user-login-name))) + ;; (princ (format "local user=%s\n" (user-login-name))) (princ (format "lang=%S\n" lang)) - (princ emacs-version) - (princ " CHISE ") - (princ xemacs-chise-version) + (princ (emacs-version)) + ;; (princ " CHISE ") + ;; (princ xemacs-chise-version) (princ " ") -- 1.7.10.4