(www-edit-display-feature-input-box): Use `www-get-feature-value'
[chise/est.git] / cwiki-edit.el
index 9bcda3b..a669186 100644 (file)
@@ -1,32 +1,9 @@
 ;; -*- coding: utf-8-mcs-er -*-
-(defvar chise-wiki-view-url "../view.cgi")
+(defvar chise-wiki-view-url "view.cgi")
 (defvar chise-wiki-edit-url "edit.cgi")
 
 (require 'cwiki-common)
 
-;; (defun www-edit-display-char-feature-default (char feature-name &optional value
-;;                                               lang)
-;;   (unless value
-;;     (setq value (www-char-feature char feature-name)))
-;;   (www-html-display-paragraph
-;;    (format "[[%s|%s?feature=%s]] : %s [[[edit|edit.cgi?char=%s&feature=%s]]]"
-;;            (www-format-feature-name feature-name lang)
-;;            chise-wiki-view-url
-;;            (www-uri-encode-feature-name feature-name)
-;;            (www-format-value char feature-name value nil 'without-tags)
-;;            (char-to-string char)
-;;            (www-uri-encode-feature-name feature-name)
-;;            )))
-
-;; (defun www-edit-display-char-feature-as-ucs (char feature-name &optional value)
-;;   (unless value
-;;     (setq value (www-char-feature char feature-name)))
-;;   (www-html-display-paragraph
-;;    (format "= [[U+%s|http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%s]] (%d)"
-;;            (www-format-value-as-HEX value)
-;;            (www-format-value-as-HEX value)
-;;            value)))
-
 (defun www-edit-display-input-box (object name value &optional format)
   (when (stringp format)
     (setq format (intern format)))
@@ -58,7 +35,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\">
   (unless format
     (setq format 'default))
   (unless value
-    (setq value (www-char-feature char feature-name)))
+    (setq value (www-get-feature-value char feature-name)))
   (princ
    (format "<p><input type=\"text\" name=\"feature-name\"
 size=\"32\" maxlength=\"256\" value=\"%s\">"
@@ -89,7 +66,7 @@ size=\"64\" maxlength=\"256\" value=\"%s\">
                                            &optional lang format)
   (when (stringp format)
     (setq format (intern format)))
-  (let ((char (www-uri-decode-char uri-char))
+  (let ((char (www-uri-decode-object 'character uri-char))
        (feature-name (www-uri-decode-feature-name uri-feature-name))
        base-name metadata-name
        char-spec str)
@@ -218,13 +195,22 @@ size=\"30\" maxlength=\"30\" value=\"%s\">に限\u5B9Aしない)
         (or (www-feature-value-format feature-name)
             'default))
       (www-html-display-paragraph
-       (format "value-format : %s [[[edit|edit.cgi?feature=%s&property=name]]]"
+       (format "value-format : %s [[[edit|edit.cgi?feature=%s&property=value-format]]]"
               (www-xml-format-list
                (or (www-feature-value-format feature-name)
                    'default))
-              ;; (char-feature-property feature-name 'name)
-              uri-feature-name ; (www-uri-encode-feature-name feature-name)
-              )))
+              uri-feature-name)))
+    (if (eq property-name 'format)
+       (www-edit-display-feature-input-box
+        feature-name property-name
+        'wiki-text
+        (or (char-feature-property feature-name 'format)
+            '((name) " : " (value))))
+      (www-html-display-paragraph
+       (format "format : %s [[[edit|edit.cgi?feature=%s&property=format]]]"
+              (www-xml-format-list
+               (char-feature-property feature-name 'format))
+              uri-feature-name)))
     (www-html-display-paragraph
      (format "description : %s"
              (or (char-feature-property feature-name 'description)