X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=cwiki-edit.el;h=4cad138c67bccaa63497d5cfee956d6174bbe4de;hb=0630e892f410f60514edaf2ed37dd3c577552c1f;hp=9bcda3bdc0d458fef9e62efb20c8207321d1c195;hpb=38f4c55ed6e32d862f32c88663726097c53ac4cd;p=chise%2Fest.git diff --git a/cwiki-edit.el b/cwiki-edit.el index 9bcda3b..4cad138 100644 --- a/cwiki-edit.el +++ b/cwiki-edit.el @@ -1,155 +1,164 @@ ;; -*- 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) +;; (require 'cwiki-format) +(require 'cwiki-view) -;; (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-input-box (object name value &optional format) +;; (when (stringp format) +;; (setq format (intern format))) +;; (let (prefix) +;; (if (or (eq format 'HEX) +;; (eq format 'hex)) +;; (if (integerp value) +;; (setq prefix "0x"))) +;; (princ (www-format-encode-string +;; (format "%s \u2190 %s" +;; name +;; (or prefix "")))) +;; (princ +;; (format " +;; +;; +;; " +;; (www-format-encode-string +;; (format "%s" name) 'without-tags) +;; (www-format-apply-value object name +;; format nil value +;; nil nil +;; 'without-tags) +;; )))) -;; (defun www-edit-display-char-feature-as-ucs (char feature-name &optional value) +;; (defun www-edit-display-feature-input-box (char feature-name +;; &optional format value) +;; (unless format +;; (setq format 'default)) ;; (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))) - (let (prefix) - (if (or (eq format 'HEX) - (eq format 'hex)) - (if (integerp value) - (setq prefix "0x"))) - (princ (www-format-encode-string - (format "%s \u2190 %s" - name - (or prefix "")))) - (princ - (format " - +;; (setq value (www-get-feature-value char feature-name))) +;; (princ +;; (format "
" +;; feature-name)) +;; (princ (encode-coding-string " \u2190 " 'utf-8-mcs-er)) +;; (princ +;; (format "%s +;;
+;; " +;; (if (or (eq format 'HEX)(eq format 'hex)) +;; "0x" +;; "") +;; format +;; (mapconcat (lambda (c) +;; (cond +;; ;; ((eq c ?<) "<") +;; ;; ((eq c ?>) ">") +;; ((eq c ?\u0022) """) +;; (t +;; (char-to-string c)))) +;; (est-format-unit +;; (est-eval-unit +;; (if (symbolp format) +;; (list format) +;; format) +;; char feature-name) +;; 'without-tags) +;; ;; (www-format-value char feature-name +;; ;; value format 'without-tags) +;; ""))) +;; ) -" - (www-format-encode-string - (format "%s" name) 'without-tags) - (www-format-apply-value object name - format nil value - nil nil - 'without-tags) - )))) - -(defun www-edit-display-feature-input-box (char feature-name - &optional format value) - (unless format - (setq format 'default)) - (unless value - (setq value (www-char-feature char feature-name))) - (princ - (format "" - feature-name)) - (princ (encode-coding-string " \u2190 " 'utf-8-mcs-er)) - (princ - (format "%s -
-" - (if (or (eq format 'HEX)(eq format 'hex)) - "0x" - "") - format - (mapconcat (lambda (c) - (cond - ;; ((eq c ?<) "<") - ;; ((eq c ?>) ">") - ((eq c ?\u0022) """) - (t - (char-to-string c)))) - (www-format-value char feature-name - value format 'without-tags) - ""))) - ) +(defun www-edit-display-object-desc (genre uri-object uri-feature-name + &optional lang format) + (www-display-object-desc genre uri-object lang 1 nil + uri-feature-name format)) -(defun www-edit-display-char-desc (uri-char uri-feature-name - &optional lang format) - (when (stringp format) - (setq format (intern format))) - (let ((char (www-uri-decode-char uri-char)) - (feature-name (www-uri-decode-feature-name uri-feature-name)) - base-name metadata-name - char-spec str) - (when (characterp char) - (princ - (format " -%s %s
\n%s %s
\n(ã«é\u5B9Aããªã) " - (decode-uri-string uri-char 'utf-8-mcs-er)) + (decode-uri-string uri-object 'utf-8-mcs-er)) 'utf-8-mcs-er)) (princ "
") (if (eq property-name 'name) @@ -218,13 +227,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) @@ -272,7 +290,8 @@ size=\"30\" maxlength=\"30\" value=\"%s\">ã«é\u5B9Aããªã) (split-string target "&"))) (setq ret (car target)) (cond ((eq (car ret) 'char) - (www-edit-display-char-desc + (www-edit-display-object-desc + 'character (cdr ret) ; (decode-uri-string (cdr ret) 'utf-8-mcs-er) (decode-uri-string (cdr (assq 'feature target)) 'utf-8-mcs-er) @@ -286,10 +305,20 @@ size=\"30\" maxlength=\"30\" value=\"%s\">ã«é\u5B9Aããªã) (decode-uri-string (cdr (assq 'property target)) 'utf-8-mcs-er) lang - (cdr (assq 'char target)) - ;; (decode-uri-string (cdr (assq 'char target)) - ;; 'utf-8-mcs-er) - ) + (car (nth 3 target)) + (cdr (nth 3 target)) + ;; (cdr (assq 'char target)) + ) + ) + (t + (www-edit-display-object-desc + (car ret) + (cdr ret) + (decode-uri-string (cdr (assq 'feature target)) + 'utf-8-mcs-er) + lang + (decode-uri-string (cdr (assq 'format target)) + 'utf-8-mcs-er)) )) (www-html-display-paragraph (format "%S" target)) @@ -299,7 +328,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\">ã«é\u5B9Aããªã) (princ (format "lang=%S\n" lang)) (princ emacs-version) (princ " CHISE ") - (princ xemacs-chise-version) + (princ (encode-coding-string xemacs-chise-version 'utf-8-jp-er)) (princ " ") @@ -307,3 +336,5 @@ size=\"30\" maxlength=\"30\" value=\"%s\">ã«é\u5B9Aããªã) (error nil (princ (format "%S" err))) )) + +(provide 'cwiki-edit)