1 ;; -*- coding: utf-8-mcs-er -*-
2 (require 'cwiki-format)
3 (require 'char-db-json)
4 (require 'concord-turtle-dump)
6 (defvar chise-wiki-view-url "view.cgi")
7 (defvar chise-wiki-edit-url "edit.cgi")
8 (defvar chise-wiki-add-url "add.cgi")
10 (defun www-edit-display-feature-input-box (char feature-name
11 &optional format value)
13 (setq char (or (concord-decode-object '=id char 'feature)
14 (concord-make-object 'feature char))))
16 (setq format 'default))
18 (setq value (www-get-feature-value char feature-name)))
19 (if (and (symbolp value)
20 (eq format 'wiki-text))
21 (setq value (list (list value))))
23 (format "<p><input type=\"text\" name=\"feature-name\"
24 size=\"32\" maxlength=\"256\" value=\"%s\">"
26 (princ (encode-coding-string " \u2190 " 'utf-8-mcs-er))
28 (format "%s<input type=\"text\" name=\"%s\"
29 size=\"64\" maxlength=\"256\" value=\"%s\">
30 <input type=\"submit\" value=\"set\" /></p>
32 (if (or (eq format 'HEX)(eq format 'hex))
36 (mapconcat (lambda (c)
38 ;; ((eq c ?<) "&lt;")
39 ;; ((eq c ?>) "&gt;")
40 ((eq c ?\u0022) """)
43 (est-format-list value format nil nil " ")
47 (defun www-display-object-desc (genre uri-object &optional uri-feature-name
50 uri-feature-name-to-edit editing-format)
53 (let ((object (www-uri-decode-object genre uri-object))
54 (est-eval-list-feature-items-limit est-eval-list-feature-items-limit)
55 (est-view-url-prefix (if uri-feature-name
58 (rdf-uri-object (if est-hide-cgi-mode
59 (if (string-match "=" uri-object)
61 (est-uri-decode-feature-name-body
62 (substring uri-object 0 (match-beginning 0)))
64 (est-uri-decode-feature-name-body
65 (substring uri-object (match-end 0))))
67 feature-name-to-display feature-name-to-edit
68 base-name-to-edit metadata-name-to-edit
70 logical-feature chise-wiki-displayed-features
72 GlyphWiki-id HNG-card HNG-card-id HNG-card-cobj ret object-spec
74 item-code page char-num glyph-image-id
75 width height image-cobj base-image x y w h)
79 (setq without-header t))
81 (when uri-feature-name-to-edit
82 (setq feature-name-to-edit
83 (www-uri-decode-feature-name uri-feature-name-to-edit))
84 (setq ret (symbol-name feature-name-to-edit))
85 (if (string-match "\\*" ret)
86 (setq base-name-to-edit (intern
87 (substring ret 0 (match-beginning 0)))
88 metadata-name-to-edit (intern
89 (substring ret (match-end 0))))
90 (setq base-name-to-edit feature-name-to-edit))
91 (when (stringp editing-format)
92 (setq editing-format (intern editing-format))))
93 (when (and (eq genre 'character)
94 (= (length uri-object) 1))
95 (setq uri-object (www-uri-encode-object object)))
100 <style type=\"text/css\">
102 h1 { font-size: 60px; vertical-align: super; }
104 .ids { vertical-align: middle; font-size: 40px; line-height: 100%%; }
105 a { text-decoration: none; }
106 .ids a { color: black; }
107 ul { margin: 0 0; color: black; }
108 li { margin: 0 0 0 2em; }
109 .feature-name { font-family: sans-serif; font-weight: bold; }
110 .feature-name a { color: black; }
114 display: inline-block;
115 border-bottom: 1px dotted black;
118 .tooltip .tooltiptext {
124 background-color: black;
134 .value .image-list img { height: 320px; vertical-align: top; }
136 .list .tooltip:hover .tooltiptext {
143 src=\"https://image.chise.org/openseadragon/openseadragon.min.js\"></script>
145 <title>EsT %s = %s</title>
148 (decode-uri-string uri-object 'utf-8-mcs-er))
151 (when (eq genre 'character)
152 (dolist (feature (char-feature-property '$object 'additional-features))
153 (mount-char-attribute-table
154 (char-feature-name-at-domain feature '$rev=latest))))
158 (if est-hide-cgi-mode
159 "<div style=\"text-align:right;\">
160 <a href=\"../../edit/view.cgi?%s=%s\">
161 <input type=\"submit\" value=\"Edit\" />
163 "<div style=\"text-align:right;\">
164 <a href=\"edit/view.cgi?%s=%s\">
165 <input type=\"submit\" value=\"Edit\" />
167 genre rdf-uri-object)
169 "<div style=\"text-align:right;\">
170 <a href=\"../view/%s/%s\">
171 <input type=\"submit\" value=\"Simple\" />
174 (if (string-match ":" uri-object)
176 (est-uri-encode-feature-name-body
177 (substring uri-object 0 (match-beginning 0)))
179 (est-uri-encode-feature-name-body
180 (substring uri-object (match-end 0))))))))
182 (format "<input type=\"submit\" value=\"New Account\" />
183 <a href=\"./%s/index.ttl\"><input type=\"submit\" value=\"RDF (Turtle)\" /></a>
184 <a href=\"http://www.chise.org/est/rdf.cgi?%s=%s\">
185 <input type=\"submit\" value=\"XML (old RDF)\" />
191 (if (eq genre 'character)
193 <a href=\"/est/view/%s/%s/data.json\">
194 <input type=\"submit\" value=\"JSON\" />
197 (if (and (or (char-feature object '->HNG@CN/manuscript)
198 (char-feature object '->HNG@CN/printed)
199 (char-feature object '->HNG@JP/manuscript)
200 (char-feature object '->HNG@JP/printed)
201 (char-feature object '->HNG@KR)
202 (char-feature object '->HNG@MISC))
203 (setq ucs (char-ucs object))
204 (setq ret (decode-char '=ucs ucs))
206 (if (setq ucs (get-char-attribute
208 (decode-char '=ucs ucs)
211 <a href=\"https://search.hng-data.org/search/%s\">
212 <input type=\"submit\" value=\"HNG-data\" />
214 (www-uri-encode-object ret))
217 (when (setq parents (www-get-feature-value object '<-denotational))
218 (if (characterp parents)
219 (setq parents (list parents)))
220 (princ (format "<p>%s %s</p>\n<hr>\n"
221 (www-format-value-as-char-list parents)
222 (www-format-feature-name '->denotational lang))))
223 (when (setq parents (www-get-feature-value object '<-subsumptive))
224 (if (characterp parents)
225 (setq parents (list parents)))
226 (princ (format "<p>%s %s</p>\n<hr>\n"
227 (www-format-value-as-char-list parents)
228 (www-format-feature-name '->subsumptive lang))))
229 (when (eq genre 'character)
230 (setq GlyphWiki-id (char-GlyphWiki-id object)))
232 ((eq genre 'image-resource)
234 (if (setq ret (concord-object-get object '=location@iiif))
236 (car (concord-object-get object '<-image-segment)))
237 (format "<a href=\"%s...$.zoom-xywh=%d,%d,%d,%d\"
238 ><img alt=\"%s\" src=\"%s\" /></a>"
239 (www-uri-encode-object base-image)
240 (concord-object-get object 'image-offset-x)
241 (concord-object-get object 'image-offset-y)
242 (concord-object-get object 'image-width)
243 (concord-object-get object 'image-height)
245 (if (and image-selection
246 (string-match "\\([0-9]+\\),\\([0-9]+\\),\\([0-9]+\\),\\([0-9]+\\)" image-selection))
248 (setq x (string-to-int (match-string 1 image-selection))
249 y (string-to-int (match-string 2 image-selection))
250 w (string-to-int (match-string 3 image-selection))
251 h (string-to-int (match-string 4 image-selection)))
253 (concord-object-get object 'image-width)))
254 ;; (setq height (float
255 ;; (concord-object-get object 'image-height)))
256 (format "<div id=\"openseadragon1\"
257 style=\"width: 800px; height: 600px;\"></div>
259 <script type=\"text/javascript\">
261 viewer = OpenSeadragon({
262 id: \"openseadragon1\",
263 prefixUrl: \"https://image.chise.org/openseadragon/images/\",
264 preserveViewport: true,
269 tileSources: [ \"%s/info.json\" ]
271 viewer.addHandler('open', function () {
272 var newBounds = new OpenSeadragon.Rect( %f, %f, %f, %f, 0 );
273 viewer.viewport.fitBounds(newBounds, true);
274 viewer.viewport.applyConstraints();
284 (format "<div id=\"openseadragon1\"
285 style=\"width: 800px; height: 600px;\"></div>
287 <script type=\"text/javascript\">
289 id: \"openseadragon1\",
290 prefixUrl: \"https://image.chise.org/openseadragon/images/\",
291 preserveViewport: true,
296 tileSources: [ \"%s/info.json\" ]
301 (setq ret (concord-object-get object '=location))
302 (format "<img alt=\"%s\" src=\"%s\" />"
305 ((and (eq genre 'character)
307 (setq ret (or (encode-char object '=chise-hdic-tsj)
308 (encode-char object '===chise-hdic-tsj)))
309 (setq ret (decode-char '===chise-hdic-tsj ret))
310 (setq ret (get-char-attribute ret 'hdic-tsj-word-id)))
312 (format "<a href=\"https://viewer.hdic.jp/tsj2/%s\"
315 (www-format-encode-string
316 (est-format-object object 'readable))))
318 ((and (eq genre 'character)
320 (setq ret (or (encode-char object '=chise-hdic-syp)
321 (encode-char object '===chise-hdic-syp)))
322 (setq ret (decode-char '===chise-hdic-syp ret))
323 (setq ret (get-char-attribute ret '=hdic-syp-entry-id)))
325 (format "<a href=\"https://viewer.hdic.jp/syp/%s\"
328 (www-format-encode-string
329 (est-format-object object 'readable))))
331 ((or (and (eq genre 'glyph-image)
333 (car (concord-object-get object '->image-resource))))
334 (and (eq genre 'character)
335 ;; (setq ret (www-format-encode-string
336 ;; (est-format-object object 'readable)))
338 ;; "<img alt=\"SW-JIGUGE\\([45]\\)-\\([0-9][0-9][0-9]\\)\\([0-9][0-9]\\)"
340 ;; (setq item-code (string-to-int (match-string 1 ret))
341 ;; page (string-to-int (match-string 2 ret))
342 ;; char-num (string-to-int (match-string 3 ret)))
343 (cond ((setq ret (or (encode-char object '=shuowen-jiguge)
344 (encode-char object '===shuowen-jiguge5)))
347 char-num (% ret 100)))
348 ((setq ret (encode-char object '===shuowen-jiguge4))
351 char-num (% ret 100))))
353 (cond ((eq item-code 4)
355 (format "zinbun/toho/A024/A024%04d/char=%d"
356 (+ page 18) char-num))
360 (format "zinbun/toho/A020/A020%04d/char=%d"
361 (+ page 16) char-num))
364 (concord-decode-object '=id glyph-image-id 'glyph-image))
366 (car (concord-object-get image-cobj '->image-resource)))
368 (if (and (setq ret (concord-object-get image-cobj '=location@iiif))
370 (car (concord-object-get image-cobj '<-image-segment))))
372 (format "<a href=\"../image-resource/%s...$.zoom-xywh=%d,%d,%d,%d\"
373 ><img alt=\"%s\" src=\"%s\" /></a>"
374 (www-uri-encode-object base-image)
375 (concord-object-get image-cobj 'image-offset-x)
376 (concord-object-get image-cobj 'image-offset-y)
377 (concord-object-get image-cobj 'image-width)
378 (concord-object-get image-cobj 'image-height)
380 (setq ret (concord-object-get image-cobj '=location))
381 (princ (format "<img alt=\"%s\" src=\"%s\" />"
384 ((and (eq genre 'hng-card)
385 (setq ret (concord-object-get object '=hng-card))
386 (setq ret (symbol-name ret))
387 (string-match "\\([0-9]+\\)-\\([0-9]+\\)" ret))
390 "<img alt=\"HNG-card:%s\"
391 src=\"https://image.hng-data.org/images/HNG/%03d/card/%04d.jpg\"
392 style=\"height: 480px;\" />"
394 (string-to-int (match-string 1 ret))
395 (string-to-int (match-string 2 ret))))
398 (car (concord-object-get object '->image-resource)))
399 (format "<a href=\"../image-resource/%s\">%s</a>"
400 (www-uri-encode-object image-cobj)
405 (setq ret (www-format-encode-string
406 (est-format-object object 'readable)))
408 "<img alt=\"HNG\\([0-9]+\\)-\\([0-9]+\\)[a-z]?\"" ret)
412 (string-to-int (match-string 1 ret))
413 (string-to-int (match-string 2 ret)))))
415 (format "hng-card/rep.id=%s" HNG-card-id)))
417 (format "<h%d>%s%s</h%d>\n"
421 (format "<a href=\"%s\">%s</a>"
422 ;; (if est-hide-cgi-mode
423 ;; "<a href=\"../%s\">%s</a>"
424 ;; "<a href=\"%s\">%s</a>")
425 (www-uri-make-object-url object uri-object)
430 "<a href=\"../%s\">%s</a>"
436 " <a href=\"https://glyphwiki.org/wiki/%s\"><img alt=\"%s\" src=\"%s/%s.svg\" style=\"vertical-align:middle; width: 60px; height: 60px\"/></a>"
439 chise-wiki-glyphwiki-glyph-image-url
446 (when feature-name-to-edit
447 (princ "<form action=\"set.cgi\" method=\"GET\">\n")
449 (encode-coding-string
450 (format "<p>(%s : <input type=\"text\" name=\"%s\"
451 size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
454 (decode-uri-string uri-object 'utf-8-mcs-er))
456 (when (and HNG-card-id
457 (eq genre 'character)
459 (concord-decode-object
462 (put-char-attribute object 'sources@HNG/card (list HNG-card-cobj))
463 (cond ((setq ret (concord-object-get
465 '->glyph-image@zinbun/takuhon))
466 (put-char-attribute object 'sources@zinbun/takuhon ret)
468 ((setq ret (concord-object-get
470 '->glyph-image@gallica))
471 (put-char-attribute object 'sources@gallica ret)
477 (setq feature-name-to-display
478 (www-uri-decode-feature-name uri-feature-name))
479 (setq est-eval-list-feature-items-limit nil)
481 (cons feature-name-to-display
482 (if (eq genre 'character)
483 (get-char-attribute object feature-name-to-display)
484 (concord-object-get object feature-name-to-display)))))
486 (if (eq genre 'character)
487 (char-attribute-alist object)
488 (concord-object-spec object)))))
489 (when feature-name-to-edit
490 (unless (assq base-name-to-edit object-spec)
491 (setq object-spec (cons (cons base-name-to-edit nil)
493 (dolist (cell (sort object-spec
495 (char-attribute-name<
496 (char-feature-name-sans-versions (car a))
497 (char-feature-name-sans-versions (car b))))))
498 (setq logical-feature (char-feature-name-sans-versions (car cell)))
499 (unless (memq logical-feature chise-wiki-displayed-features)
500 (push logical-feature chise-wiki-displayed-features)
502 ((and feature-name-to-edit
503 (eq (car cell) feature-name-to-edit))
504 (www-edit-display-feature-input-box
505 object feature-name-to-edit editing-format)
510 "<div class=\"feature\" style=\"line-height:150%\">\n"
513 (www-format-eval-list
514 (www-feature-format logical-feature)
516 logical-feature ; (car cell)
521 (format " <a href=\"%s?%s=%s&feature=%s&format=wiki-text\"
522 ><input type=\"submit\" value=\"note\" /></a>"
525 (www-format-encode-string uri-object)
526 (www-format-encode-string
527 (www-uri-encode-feature-name
528 (intern (format "%s*note"
529 logical-feature ; (car cell)
531 (when (and feature-name-to-edit
532 (eq base-name-to-edit (car cell)) metadata-name-to-edit)
535 (www-edit-display-feature-input-box
536 object feature-name-to-edit editing-format)
549 (when feature-name-to-edit
553 (format "<a href=\"%s?%s=%s\"
554 ><input type=\"submit\" value=\"add feature\" /></a>
558 (www-format-encode-string uri-object))))
563 (when (eq genre 'character)
564 (let ((object-str (est-format-object object))
565 encoded-object-for-form)
567 "<form action=\"https://www.chise.org/ids-find\">\n")
568 (princ (www-format-encode-string object-str))
569 (setq encoded-object-for-form
571 (insert (encode-coding-string object-str 'utf-8-jp-er))
572 (goto-char (point-min))
573 (while (search-forward ">-" nil t)
574 (replace-match "&GT-" t t)
579 " <input type=\"text\" name=\"components\"
580 size=\"30\" maxlength=\"30\" value=\"%s\" />"
581 encoded-object-for-form))
583 (www-format-encode-string
584 "を\u542Bむ\u6F22\u5B57を\u63A2す"))
585 (princ " <input type=\"submit\" value=\"search\" />\n")
589 "<form action=\"https://www.chise.org/hng-ids-find\">\n")
590 (princ (www-format-encode-string object-str))
594 " <input type=\"text\" name=\"components\"
595 size=\"30\" maxlength=\"30\" value=\"%s\" />"
596 encoded-object-for-form))
598 (www-format-encode-string
599 "を\u542Bむ HNG の\u6F22\u5B57を\u63A2す"))
600 (princ " <input type=\"submit\" value=\"search\" />\n")
609 (defun www-display-feature-desc (uri-feature-name genre uri-object
610 &optional lang simple)
611 (let ((rdf-uri-object (if est-hide-cgi-mode
613 (string-match "=" uri-object)
615 (est-uri-decode-feature-name-body
616 (substring uri-object 0 (match-beginning 0)))
618 (est-uri-decode-feature-name-body
619 (substring uri-object (match-end 0)))))
621 (feature-name (www-uri-decode-feature-name uri-feature-name))
622 (name@lang (intern (format "name@%s" lang))))
624 (encode-coding-string
626 <title>EsT feature: %s</title>
634 (if est-hide-cgi-mode
635 "<div style=\"text-align:right;\">
636 <a href=\"../../../edit/view.cgi?feature=%s&%s=%s\">
637 <input type=\"submit\" value=\"Edit\" />
639 <input type=\"submit\" value=\"New Account\" />
642 "<div style=\"text-align:right;\">
643 <a href=\"edit/view.cgi?feature=%s&%s=%s\">
644 <input type=\"submit\" value=\"Edit\" />
646 <input type=\"submit\" value=\"New Account\" />
649 uri-feature-name genre rdf-uri-object)
651 "<div style=\"text-align:right;\">
652 <a href=\"../view/feature/%s&%s/%s\">
653 <input type=\"submit\" value=\"Simple\" />
657 uri-feature-name genre uri-object)))
659 (format "<h1>%s</h1>\n"
660 (www-format-encode-string
661 (symbol-name feature-name))))
662 (princ (format "<p>name : %s "
663 (or (www-format-feature-name feature-name) "")))
667 " <a href=\"%s?feature=%s&property=name&format=string&%s=%s\">"
672 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
677 (www-format-encode-string
680 (or (char-feature-property feature-name name@lang) ""))))
684 " <a href=\"%s?feature=%s&property=%s&format=string&%s=%s\">"
690 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
692 (www-html-display-paragraph
694 (or (www-feature-type feature-name)
695 ;; (char-feature-property feature-name 'type)
697 (princ (format "<p>value-format : %s "
700 (or (www-feature-value-format feature-name)
708 " <a href=\"%s?feature=%s&property=value-format&format=wiki-text&%s=%s\"
714 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
717 (princ (format "<p>value-presentation-format : %s "
719 nil 'value-presentation-format
720 (or (www-feature-value-format feature-name)
728 " <a href=\"%s?feature=%s&property=value-presentation-format&format=wiki-text&%s=%s\"
734 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
737 (princ "<p>format : ")
738 (www-html-display-text
739 (decode-coding-string
741 (www-feature-format feature-name))
746 " <a href=\"%s?feature=%s&property=format&format=wiki-text&%s=%s\"
752 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
755 (www-html-display-paragraph
756 (format "description : %s"
757 (or (decode-coding-string
758 (or (char-feature-property feature-name 'description)
763 (www-html-display-paragraph
764 (format "description@%s : %s"
766 (or (char-feature-property
768 (intern (format "description@%s" lang)))
772 (defun www-batch-view ()
773 (setq terminal-coding-system 'binary)
775 (let* ((target (pop command-line-args-left))
776 (user (pop command-line-args-left))
777 (accept-language (pop command-line-args-left))
778 (mode (intern (pop command-line-args-left)))
783 (car (split-string accept-language ","))
787 (princ "Content-Type: text/html; charset=UTF-8
789 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
790 \"http://www.w3.org/TR/html4/loose.dtd\">
795 (when (string-match "^char=\\(&[^&;]+;\\)" target)
796 (setq ret (match-end 0))
799 (www-uri-encode-object
800 (www-uri-decode-object
801 'character (match-string 1 target)))
802 (substring target ret))))
804 (mapcar (lambda (cell)
805 (if (string-match "=" cell)
807 (setq genre (substring cell 0 (match-beginning 0))
808 ret (substring cell (match-end 0)))
811 (decode-uri-string genre 'utf-8-mcs-er))
813 (list (decode-uri-string cell 'utf-8-mcs-er))))
814 (split-string target "&")))
815 (setq ret (car target))
816 (cond ((eq (car ret) 'char)
817 (www-display-object-desc
818 'character (cdr ret) (cdr (assq 'feature target))
823 ((eq (car ret) 'feature)
824 (www-display-feature-desc
825 (decode-uri-string (cdr ret) 'utf-8-mcs-er)
832 (www-display-object-desc
833 (car ret) (cdr ret) (cdr (assq 'feature target))
840 (princ (format "mode=%S\n" mode))
841 (princ (format "user=%s\n" user))
842 ;; (princ (format "local user=%s\n" (user-login-name)))
843 (princ (format "lang=%S\n" lang))
844 (princ (encode-coding-string (emacs-version) 'utf-8-jp-er))
846 ;; (princ xemacs-chise-version)
852 (princ (format "%S" err)))
855 (defun www-batch-view-smart ()
856 (setq debug-on-error t)
857 (setq terminal-coding-system 'binary)
859 (let* ((est-hide-cgi-mode t)
860 (target (pop command-line-args-left))
861 (user (pop command-line-args-left))
862 (accept-language (pop command-line-args-left))
863 (mode (intern (pop command-line-args-left)))
868 (car (split-string accept-language ","))
871 ret genre feature obj-url json turtle obj)
875 ((string-match "/data\\.json$" target)
877 target (substring target 0 (match-beginning 0)))
879 ((string-match "/index\\.ttl$" target)
881 target (substring target 0 (match-beginning 0)))
883 ((string-match "/index\\.\\(...*\\)\\.html$" target)
884 (setq lang (intern (match-string 1 target))
885 target (substring target 0 (match-beginning 0)))
887 (when (string-match "^char/\\(&[^&;]+;\\)" target)
888 (setq ret (match-end 0))
891 (www-uri-encode-object
892 (www-uri-decode-object
893 'character (match-string 1 target)))
894 (substring target ret))))
898 (if (string-match "/" cell)
900 (setq genre (substring cell 0 (match-beginning 0))
901 ret (substring cell (match-end 0)))
903 (intern (decode-uri-string genre 'utf-8-mcs-er))
905 ((string-match "/feature=" ret)
906 (list (substring ret 0 (match-beginning 0))
907 (substring ret (match-end 0)))
909 ((string-match "...$.zoom-xywh=" ret)
910 (list (substring ret 0 (match-beginning 0))
912 (substring ret (match-end 0)))
916 (list (decode-uri-string cell 'utf-8-mcs-er)))
917 ;; (setq ret (split-string cell "/"))
919 ;; (decode-uri-string (car ret) 'utf-8-mcs-er))
922 (split-string target "&")))
923 (setq ret (car target))
925 (princ "Content-Type: text/turtle; charset=UTF-8
930 (princ "Content-Type: application/json; charset=UTF-8
935 (princ "Content-Type: text/html; charset=UTF-8
937 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
938 \"http://www.w3.org/TR/html4/loose.dtd\">
942 ;; (princ (format "<p>%S, %S, %S</p>"
943 ;; (car ret)(nth 1 ret)(nth 2 ret)))
944 ;; (princ (format "// %S %S\n" ret json))
947 (setq obj (www-uri-decode-object (car ret)(nth 1 ret)))
948 (concord-turtle-insert-char-data obj)
949 (goto-char (point-min))
950 (concord-turtle-insert-prefix)
952 (encode-coding-region
953 (point-min)(point-max)
954 char-db-file-coding-system)
955 (princ (buffer-string)))
957 ((or (eq (car ret) 'char)
958 (eq (car ret) 'character))
960 (setq obj (www-uri-decode-object
961 (car ret)(nth 1 ret)))
964 ;; (princ (encode-coding-string
965 ;; (format "// %S\n" obj)
966 ;; char-db-file-coding-system))
967 (char-db-json-char-data-with-variant obj 'printable)
968 (encode-coding-region
969 (point-min)(point-max)
970 char-db-file-coding-system)
971 (princ (buffer-string))
973 (www-display-object-desc
974 'character (nth 1 ret) (nth 2 ret)
979 ((eq (car ret) 'feature)
980 (www-display-feature-desc
981 (decode-uri-string (nth 1 ret) 'utf-8-mcs-er)
983 (nth 1 (nth 1 target))
987 ;; ((eq (car ret) 'image-resource)
989 ;; ;; ((string-match "^\\.iiif=" (nth 1 ret))
990 ;; ;; (setq obj-url (decode-uri-string
991 ;; ;; (substring (nth 1 ret) (match-end 0))
992 ;; ;; 'utf-8-mcs-er))
993 ;; ;; (setq obj (concord-images-add-iiif obj-url))
994 ;; ;; (www-display-object-desc
995 ;; ;; 'image-resource
996 ;; ;; (www-uri-encode-object obj)
999 ;; ;; (eq mode 'simple))
1002 ;; (princ (nth 1 ret))
1003 ;; (www-display-object-desc
1004 ;; 'image-resource (nth 1 ret) (nth 2 ret)
1006 ;; (eq mode 'simple))
1010 (www-display-object-desc
1011 (car ret) (nth 1 ret) (nth 2 ret)
1017 (unless (or json turtle)
1019 (princ (format "mode=%S\n" mode))
1020 (princ (format "user=%s\n" user))
1021 ;; (princ (format "local user=%s\n" (user-login-name)))
1022 (princ (format "lang=%S\n" lang))
1023 (princ (encode-coding-string (emacs-version) 'utf-8-jp-er))
1024 ;; (princ " CHISE ")
1025 ;; (princ xemacs-chise-version)
1032 (princ (format "%S" err)))
1035 (provide 'cwiki-view)