(www-display-object-desc): Modify to edit non-character object.
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Sat, 20 Nov 2010 05:09:45 +0000 (14:09 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Sat, 20 Nov 2010 05:09:45 +0000 (14:09 +0900)
(www-display-feature-desc): Add new argument `genre'.

cwiki-view.el

index ec3f256..6061fe9 100644 (file)
        (format
        (if simple
            "<div style=\"text-align:right;\">
-<a href=\"edit/view.cgi?char=%s\">
+<a href=\"edit/view.cgi?%s=%s\">
 <input type=\"submit\" value=\"Edit\" />
 </a>
 <input type=\"submit\" value=\"New Account\" />
 </div>
 <hr />\n"
          "<div style=\"text-align:right;\">
-<a href=\"../view.cgi?char=%s\">
+<a href=\"../view.cgi?%s=%s\">
 <input type=\"submit\" value=\"Simple\" />
 </a>
 </div>
 <hr />\n")
+       genre
        uri-object))
       (when (setq parents (www-get-feature-value object '<-denotational))
        (princ (format "<p>%s %s</p>\n<hr>\n"
            nil simple))
          (unless simple
            (princ
-            (format " <a href=\"%s?char=%s&feature=%s&format=wiki-text\"
+            (format " <a href=\"%s?%s=%s&feature=%s&format=wiki-text\"
 ><input type=\"submit\" value=\"note\" /></a>"
                     chise-wiki-edit-url
+                    genre
                     (www-format-encode-string uri-object)
                     (www-format-encode-string
                      (www-uri-encode-feature-name
         "<li>\n"))
       (unless simple
        (princ
-        (format "<a href=\"%s?char=%s\"
+        (format "<a href=\"%s?%s=%s\"
 ><input type=\"submit\" value=\"add feature\" /></a>
 "
                 chise-wiki-add-url
+                genre
                 (www-format-encode-string uri-object))))
       (princ
        (if (= level 1)
@@ -157,7 +160,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
         "<li>\n"))
       )))
 
-(defun www-display-feature-desc (uri-feature-name uri-object
+(defun www-display-feature-desc (uri-feature-name genre uri-object
                                                  &optional lang simple)
   (let ((feature-name (www-uri-decode-feature-name uri-feature-name))
        (name@lang (intern (format "name@%s" lang))))
@@ -173,19 +176,19 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
      (format
       (if simple
          "<div style=\"text-align:right;\">
-<a href=\"edit/view.cgi?feature=%s&char=%s\">
+<a href=\"edit/view.cgi?feature=%s&%s=%s\">
 <input type=\"submit\" value=\"Edit\" />
 </a>
 <input type=\"submit\" value=\"New Account\" />
 </div>
 <hr />\n"
          "<div style=\"text-align:right;\">
-<a href=\"../view.cgi?feature=%s&char=%s\">
+<a href=\"../view.cgi?feature=%s&%s=%s\">
 <input type=\"submit\" value=\"Simple\" />
 </a>
 </div>
 <hr />\n")
-      uri-feature-name uri-object))
+      uri-feature-name genre uri-object))
     (princ
      (format "<h1>%s</h1>\n"
             (www-format-encode-string
@@ -195,9 +198,10 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
     (unless simple
       (princ
        (format
-       " <a href=\"%s?feature=%s&property=name&format=string&char=%s\">"
+       " <a href=\"%s?feature=%s&property=name&format=string&%s=%s\">"
        chise-wiki-edit-url
        uri-feature-name
+       genre
        uri-object))
       (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
     (princ "</p>\n")
@@ -211,10 +215,11 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
       (unless simple
        (princ
         (format
-         " <a href=\"%s?feature=%s&property=%s&format=string&char=%s\">"
+         " <a href=\"%s?feature=%s&property=%s&format=string&%s=%s\">"
          chise-wiki-edit-url
          uri-feature-name
          name@lang
+         genre
          uri-object))
        (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
       (princ "</p>\n"))
@@ -233,10 +238,11 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
     (unless simple
       (princ
        (format
-       " <a href=\"%s?feature=%s&property=value-format&format=wiki-text&char=%s\"
+       " <a href=\"%s?feature=%s&property=value-format&format=wiki-text&%s=%s\"
 >"
        chise-wiki-edit-url
        uri-feature-name
+       genre
        uri-object))
       (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
     (princ "</p>\n")
@@ -250,10 +256,11 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
     (unless simple
       (princ
        (format
-       " <a href=\"%s?feature=%s&property=format&format=wiki-text&char=%s\"
+       " <a href=\"%s?feature=%s&property=format&format=wiki-text&%s=%s\"
 >"
        chise-wiki-edit-url
        uri-feature-name
+       genre
        uri-object))
       (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
     (princ "</p>\n")
@@ -325,6 +332,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
                ((eq (car ret) 'feature)
                 (www-display-feature-desc
                  (decode-uri-string (cdr ret) 'utf-8-mcs-er)
+                 (car ret)
                  (cdr (assq 'char target))
                  lang
                  (eq mode 'simple))