From: MORIOKA Tomohiko Date: Thu, 9 Jun 2016 15:48:01 +0000 (+0900) Subject: (www-display-object-desc): X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3c56888c31904cd575de6b35c4d3d5a9800f4973;p=chise%2Fest.git (www-display-object-desc): - For each image segment, add link to the corresponding original image with zooming. - Implement zooming feature for `image-resource' genre. - Use HNG-card page of EsT instead of HNG-card image as link from HNG glyph-images. (www-batch-view-smart): Support "...$zoom-xywh=" modifier for `image-resource' genre. --- diff --git a/cwiki-view.el b/cwiki-view.el index 3ce51b5..8f55658 100644 --- a/cwiki-view.el +++ b/cwiki-view.el @@ -68,7 +68,8 @@ size=\"64\" maxlength=\"256\" value=\"%s\"> without-header logical-feature chise-wiki-displayed-features parents - GlyphWiki-id HNG-card ret object-spec) + GlyphWiki-id HNG-card ret object-spec + width height base-image x y w h) (if (eq level 0) (setq level 1 without-header nil) @@ -200,10 +201,56 @@ li { margin: 0 0 0 2em; } ((eq genre 'image-resource) (princ (if (setq ret (concord-object-get object '=location@iiif)) - (if (concord-object-get object 'image-offset-x) - (format "\"%s\"" + (if (setq base-image + (car (concord-object-get object '<-image-segment))) + (format "\"%s\"" + (www-uri-encode-object base-image) + (concord-object-get object 'image-offset-x) + (concord-object-get object 'image-offset-y) + (concord-object-get object 'image-width) + (concord-object-get object 'image-height) ret ret) - (format "
+ + +" + ret + (/ x width) + (/ y width) + (/ w width) + (/ h width) + )) + (format "
" - ret)) + ret))) (setq ret (concord-object-get object '=location)) (format "\"%s\"" ret ret))) @@ -242,10 +289,10 @@ style=\"height: 480px;\" />" (est-format-object object 'readable))) (setq HNG-card (if (string-match - "\"HNG\\([0-9]+\\)-\\([0-9]+\\)\""%s%s\n" level @@ -260,7 +307,7 @@ style=\"height: 480px;\" />" ) (HNG-card (format - "%s" + "%s" HNG-card ret) ) (t ret)) @@ -713,10 +760,18 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />" ret (substring cell (match-end 0))) (cons (intern (decode-uri-string genre 'utf-8-mcs-er)) - (if (string-match "/feature=" ret) - (list (substring ret 0 (match-beginning 0)) - (substring ret (match-end 0))) - (list ret)))) + (cond + ((string-match "/feature=" ret) + (list (substring ret 0 (match-beginning 0)) + (substring ret (match-end 0))) + ) + ((string-match "...$zoom-xywh=" ret) + (list (substring ret 0 (match-beginning 0)) + nil + (substring ret (match-end 0))) + ) + (t + (list ret))))) (list (decode-uri-string cell 'utf-8-mcs-er))) ;; (setq ret (split-string cell "/")) ;; (cons (intern @@ -794,7 +849,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />" (t (www-display-object-desc (car ret) (nth 1 ret) (nth 2 ret) - nil + (nth 3 ret) lang nil (eq mode 'simple)) ))