+ (cond
+ ((eq genre 'image-resource)
+ (princ
+ (if (setq ret (concord-object-get object '=location@iiif))
+ (if (setq base-image
+ (car (concord-object-get object '<-image-segment)))
+ (format "<a href=\"%s...$.zoom-xywh=%d,%d,%d,%d\"
+><img alt=\"%s\" src=\"%s\" /></a>"
+ (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)
+ (if (and image-selection
+ (string-match "\\([0-9]+\\),\\([0-9]+\\),\\([0-9]+\\),\\([0-9]+\\)" image-selection))
+ (progn
+ (setq x (string-to-int (match-string 1 image-selection))
+ y (string-to-int (match-string 2 image-selection))
+ w (string-to-int (match-string 3 image-selection))
+ h (string-to-int (match-string 4 image-selection)))
+ (setq width (float
+ (concord-object-get object 'image-width)))
+ ;; (setq height (float
+ ;; (concord-object-get object 'image-height)))
+ (format "<div id=\"openseadragon1\"
+ style=\"width: 800px; height: 600px;\"></div>
+
+<script type=\"text/javascript\">
+ var viewer;
+ viewer = OpenSeadragon({
+ id: \"openseadragon1\",
+ prefixUrl: \"http://hng.chise.org/openseadragon/images/\",
+ preserveViewport: true,
+ visibilityRatio: 1,
+ minZoomLevel: 1,
+ defaultZoomLevel: 1,
+ sequenceMode: true,
+ tileSources: [ \"%s/info.json\" ]
+ });
+ viewer.addHandler('open', function () {
+ var newBounds = new OpenSeadragon.Rect( %f, %f, %f, %f, 0 );
+ viewer.viewport.fitBounds(newBounds, true);
+ viewer.viewport.applyConstraints();
+ });
+</script>
+"
+ ret
+ (/ x width)
+ (/ y width)
+ (/ w width)
+ (/ h width)
+ ))
+ (format "<div id=\"openseadragon1\"
+ style=\"width: 800px; height: 600px;\"></div>
+
+<script type=\"text/javascript\">
+ OpenSeadragon({
+ id: \"openseadragon1\",
+ prefixUrl: \"http://hng.chise.org/openseadragon/images/\",
+ preserveViewport: true,
+ visibilityRatio: 1,
+ minZoomLevel: 1,
+ defaultZoomLevel: 1,
+ sequenceMode: true,
+ tileSources: [ \"%s/info.json\" ]
+ });
+</script>
+"
+ ret)))
+ (setq ret (concord-object-get object '=location))
+ (format "<img alt=\"%s\" src=\"%s\" />"
+ ret ret)))
+ )
+ ((and (eq genre 'glyph-image)
+ (setq image-cobj
+ (car (concord-object-get object '->image-resource))))
+ (if (and (setq ret (concord-object-get image-cobj '=location@iiif))
+ (setq base-image
+ (car (concord-object-get image-cobj '<-image-segment))))
+ (princ
+ (format "<a href=\"../image-resource/%s...$.zoom-xywh=%d,%d,%d,%d\"
+><img alt=\"%s\" src=\"%s\" /></a>"
+ (www-uri-encode-object base-image)
+ (concord-object-get image-cobj 'image-offset-x)
+ (concord-object-get image-cobj 'image-offset-y)
+ (concord-object-get image-cobj 'image-width)
+ (concord-object-get image-cobj 'image-height)
+ ret ret))
+ (setq ret (concord-object-get image-cobj '=location))
+ (princ (format "<img alt=\"%s\" src=\"%s\" />"
+ ret ret)))
+ )
+ ((and (eq genre 'hng-card)
+ (setq ret (concord-object-get object '=hng-card))
+ (setq ret (symbol-name ret))
+ (string-match "\\([0-9]+\\)-\\([0-9]+\\)" ret))
+ (princ
+ (format
+ "<img alt=\"HNG-card:%s\"
+src=\"http://hng.chise.org/images/HNG/%03d/card/%04d.jpg\"
+style=\"height: 480px;\" />"
+ ret
+ (string-to-int (match-string 1 ret))
+ (string-to-int (match-string 2 ret))))
+ )
+ (t
+ (setq ret (www-format-encode-string
+ (est-format-object object 'readable)))
+ (when (string-match
+ "<img alt=\"HNG\\([0-9]+\\)-\\([0-9]+\\)[a-z]?\"" ret)
+ (setq HNG-card-id
+ (intern
+ (format "%d-%d"
+ (string-to-int (match-string 1 ret))
+ (string-to-int (match-string 2 ret)))))
+ (setq HNG-card
+ (format "hng-card/rep.id=%s" HNG-card-id)))
+ (princ
+ (format "<h%d>%s%s</h%d>\n"
+ level
+ (cond
+ (uri-feature-name
+ (format "<a href=\"%s\">%s</a>"
+ ;; (if est-hide-cgi-mode
+ ;; "<a href=\"../%s\">%s</a>"
+ ;; "<a href=\"%s\">%s</a>")
+ (www-uri-make-object-url object uri-object)
+ ret)
+ )
+ (HNG-card
+ (format
+ "<a href=\"../%s\">%s</a>"
+ HNG-card ret)
+ )
+ (t ret))
+ (if GlyphWiki-id
+ (format
+ " <a href=\"http://glyphwiki.org/wiki/%s\"><img alt=\"%s\" src=\"http://glyphwiki.org/glyph/%s.50px.png\" /></a>"
+ GlyphWiki-id
+ GlyphWiki-id GlyphWiki-id)
+ "")
+ level))
+ ))