X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=cwiki-view.el;h=1605d6811cce7c374cc1dca5d7cc7b59bf4b776a;hb=19098062c72923a2b738639148e909989ac9e587;hp=76ce3f34b7e5a19408e6f1650c8b4fad386d9c22;hpb=a4ea8dc921250abac392438dd83336c797b4cf8d;p=chise%2Fest.git diff --git a/cwiki-view.el b/cwiki-view.el index 76ce3f3..1605d68 100644 --- a/cwiki-view.el +++ b/cwiki-view.el @@ -1,44 +1,126 @@ ;; -*- coding: utf-8-mcs-er -*- -(require 'cwiki-common) +(require 'cwiki-format) (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-edit-display-feature-input-box (char feature-name + &optional format value) + (if (symbolp char) + (setq char (or (concord-decode-object '=id char 'feature) + (concord-make-object 'feature char)))) + (unless format + (setq format 'default)) + (unless value + (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 ?<) "&lt;") + ;; ((eq c ?>) "&gt;") + ((eq c ?\u0022) """) + (t + (char-to-string c)))) + (www-format-value char feature-name + value format 'without-tags) + ""))) + ) + +(defun www-display-object-desc (genre uri-object &optional lang level simple + uri-feature-name-to-edit editing-format) (unless level - (setq level 1)) - (let ((char (www-uri-decode-char uri-char)) - logical-feature displayed-features + (setq level 0)) + (let ((object (www-uri-decode-object genre uri-object)) + feature-name-to-edit + base-name-to-edit metadata-name-to-edit + without-header + logical-feature chise-wiki-displayed-features parents - GlyphWiki-id) - (when (characterp char) - (when (= (length uri-char) 1) - (setq uri-char (www-uri-encode-char char))) + GlyphWiki-id ret object-spec) + (if (eq level 0) + (setq level 1 + without-header nil) + (setq without-header t)) + (when object + (when uri-feature-name-to-edit + (setq feature-name-to-edit + (www-uri-decode-feature-name uri-feature-name-to-edit)) + (setq ret (symbol-name feature-name-to-edit)) + (if (string-match "\\*" ret) + (setq base-name-to-edit (intern + (substring ret 0 (match-beginning 0))) + metadata-name-to-edit (intern + (substring ret (match-end 0)))) + (setq base-name-to-edit feature-name-to-edit)) + (when (stringp editing-format) + (setq editing-format (intern editing-format)))) + (when (and (eq genre 'character) + (= (length uri-object) 1)) + (setq uri-object (www-uri-encode-object object))) (when (= level 1) (princ (encode-coding-string (format " -CHISE-wiki character: %s +EsT %s = %s \n" - (decode-uri-string uri-char 'utf-8-mcs-er)) + genre + (decode-uri-string uri-object 'utf-8-mcs-er)) 'utf-8-mcs-er)) (princ "\n")) - (dolist (feature (char-feature-property '$object 'additional-features)) - (mount-char-attribute-table - (char-feature-name-at-domain feature '$rev=latest))) - (when (setq parents (www-char-feature char '<-denotational)) + (when (eq genre 'character) + (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") + genre + uri-object)) + (when (setq parents (www-get-feature-value object '<-denotational)) (princ (format "

%s %s

\n
\n" (www-format-value-as-char-list parents) (www-format-feature-name '->denotational lang)))) - (when (setq parents (www-char-feature char '<-subsumptive)) + (when (setq parents (www-get-feature-value object '<-subsumptive)) (princ (format "

%s %s

\n
\n" (www-format-value-as-char-list parents) (www-format-feature-name '->subsumptive lang)))) - (setq GlyphWiki-id (char-GlyphWiki-id char)) + (when (eq genre 'character) + (setq GlyphWiki-id (char-GlyphWiki-id object))) (princ (format "%s%s\n" level - (www-format-encode-string (char-to-string char)) + (www-format-encode-string + (est-format-object object) + ;; (if (eq genre 'character) + ;; (char-to-string object) + ;; (format "%s" (concord-object-id object))) + ) (if GlyphWiki-id (format " \"%s\"" @@ -48,109 +130,170 @@ level)) (if (> level 1) (princ "