X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=cwiki-view.el;h=bfc35fb9242daa9e2eba42c83e3009566d3d47fe;hb=c55487ded1a55be6a74ca88a61ebb46a303fd132;hp=c30519d35a54cd5e26ed035d9465c662d4b4aa63;hpb=f331f4e0bea2a62e9e030462c3072c1b1df37b66;p=chise%2Fest.git diff --git a/cwiki-view.el b/cwiki-view.el index c30519d..bfc35fb 100644 --- a/cwiki-view.el +++ b/cwiki-view.el @@ -1,124 +1,365 @@ ;; -*- 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-char-display-feature-default (char feature-name &optional value - lang uri-char) +(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 (char-feature char feature-name))) - (unless uri-char - (setq uri-char (char-to-string char))) - (www-html-display-paragraph - (format "[[%s|%?feature=%s&char=%s]] : %s [[[edit|%s?char=%s&feature=%s]]]" - (www-format-feature-name feature-name lang) - chise-wiki-view-url - (www-uri-encode-feature-name feature-name) - uri-char - (www-format-value value feature-name) - chise-wiki-edit-url - uri-char - (www-uri-encode-feature-name feature-name) - ))) - -(defun www-char-display-feature-as-ucs (char feature-name &optional value) - (unless value - (setq value (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))) + (setq value (www-get-feature-value char feature-name))) + (if (and (symbolp value) + (eq format 'wiki-text)) + (setq value (list (list value)))) + (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)))) + (est-format-list value format nil nil " ") + ""))) + ) -(defun www-display-char-desc (uri-char &optional lang level) +(defun www-display-object-desc (genre uri-object &optional uri-feature-name + lang level simple + uri-feature-name-to-edit editing-format) (unless level - (setq level 1)) - (let ((char (www-uri-decode-char uri-char))) - (when (characterp char) - (when (= (length uri-char) 1) - (setq uri-char (www-uri-encode-char char))) + (setq level 0)) + (let ((object (www-uri-decode-object genre uri-object)) + (est-eval-list-feature-items-limit est-eval-list-feature-items-limit) + (est-view-url-prefix (if uri-feature-name + "../.." + "..")) + (rdf-uri-object (if est-hide-cgi-mode + (if (string-match "=" uri-object) + (concat + (est-uri-decode-feature-name-body + (substring uri-object 0 (match-beginning 0))) + ":" + (est-uri-decode-feature-name-body + (substring uri-object (match-end 0)))) + uri-object))) + feature-name-to-display feature-name-to-edit + base-name-to-edit metadata-name-to-edit + without-header + logical-feature chise-wiki-displayed-features + parents + 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")) - (princ (format "%s\n" + (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 + (if simple + (format + (if est-hide-cgi-mode + "
+ + +\n" + "
+ + +\n") + genre rdf-uri-object) + (format + "
+ + +\n" + genre + (if (string-match ":" uri-object) + (concat + (est-uri-encode-feature-name-body + (substring uri-object 0 (match-beginning 0))) + "=" + (est-uri-encode-feature-name-body + (substring uri-object (match-end 0)))))))) + (princ + (format " + + + +
+
\n" + genre rdf-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-get-feature-value object '<-subsumptive)) + (princ (format "

%s %s

\n
\n" + (www-format-value-as-char-list parents) + (www-format-feature-name '->subsumptive lang)))) + (when (eq genre 'character) + (setq GlyphWiki-id (char-GlyphWiki-id object))) + (setq ret (www-format-encode-string + (est-format-object object 'readable))) + (princ (format "%s%s\n" level - (www-format-encode-string (char-to-string char)) + (if uri-feature-name + (format "%s" + ;; (if est-hide-cgi-mode + ;; "%s" + ;; "%s") + (www-uri-make-object-url object uri-object) + ret) + ret) + (if GlyphWiki-id + (format + " \"%s\"" + GlyphWiki-id + GlyphWiki-id GlyphWiki-id) + "") level)) (if (> level 1) (princ "