view zpt/viewer/viewer_image.zpt @ 597:fabd394302f1

image search layer uses different color for its annotations.
author casties
date Mon, 19 Nov 2012 13:15:57 +0100
parents da7daa783df4
children
line wrap: on
line source

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
              viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
              availableLayers python:here.getAvailableLayers().get('image', None);
              tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
              numPages docinfo/numPages | nothing; dlBaseUrl docinfo/digilibBaseUrl | nothing;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
<link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.js"></script>
<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.cookie.js"></script>
<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.js"></script>
<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.geometry.js"></script>
<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.arrows.js"></script>
<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.marks.js"></script>
<link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/jquery.digilib.css" />

<script type="text/javascript"
  tal:content="python:'''\n
       var dlOpts = {\n
            'interactionMode' : 'fullscreen',\n
            'digilibBaseUrl' : '%s',\n
            'fn' : '%s',\n
            'pn' : '%s',\n
            'suppressParamNames' : ['fn'],\n
            'scalerInsets' : {'x':300, 'y':100}\n
        };\n'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>

<!--  layer headers (rendered always) -->
<tal:block tal:repeat="layer availableLayers">
  <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
    <metal:block metal:use-macro="python:path(mpath)" />
  </tal:block>
</tal:block>

<script type="text/javascript">
	// <!--
	$(document).ready(function() {
		// autosubmit forms
		$('form.autosubmit').find('.autosubmit').change(function() {
			this.form.submit();
		});
		$('form.autosubmit input[type="submit"]').hide();
		// get digilib div
		$digilib = $('div#scaler');
		// configure digilib
		$digilib.digilib(dlOpts);
	});
// -->
</script>
</head>
<body tal:condition="numPages">
  <tal:block
    tal:define="docpath docinfo/textURLPath | nothing;
              pn pageinfo/pn; 
              flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';">
    <div class="page-head">
      <metal:block metal:use-macro="here/template/common_template/macros/head" />
    </div>
    <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
      <!-- table of contents -->
      <div class="col toc">
        <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
      </div>
      <!-- col-main: document page -->
      <div class="col main">
        <div class="ruler top">
          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
        </div>
        <div tal:attributes="class string:content image $viewLayer">
          <div id="scaler">
            <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" />
          </div>
        </div>
        <!-- /content -->
      </div>
      <!-- /col-main -->
      
      <div class="col buttons">
        <!-- layer switcher -->
        <div class="options" tal:condition="availableLayers">
          <h4>Image layer</h4>
          <form tal:attributes="action viewerUrl" class="autosubmit">
            <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})"
              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
            <ul>
              <!-- layer select buttons (rendered always) -->
              <tal:block tal:repeat="layer availableLayers">
                <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/layer_select_li"
                  tal:condition="python:exists(mpath)">
                  <li metal:use-macro="python:path(mpath)" />
                </tal:block>
              </tal:block>
            </ul>
            <input type="submit" value="Go!" />
          </form>
        </div>

        <!-- digilib options -->
        <div class="options digilib">
          <ul>
            <li><a href="javascript:$digilib.digilib('zoomBy', 1.4)"> <img tal:condition="exists:here/template/zoom-in.png"
                tal:attributes="src here/template/zoom-in.png/absolute_url" /> zoom in
            </a></li>
            <li><a href="javascript:$digilib.digilib('zoomBy', 0.7)"> <img
                tal:condition="exists:here/template/zoom-out.png" tal:attributes="src here/template/zoom-out.png/absolute_url" />
                zoom out
            </a></li>
            <li><a href="javascript:$digilib.digilib('zoomArea')"> <img tal:condition="exists:here/template/zoom-area.png"
                tal:attributes="src here/template/zoom-area.png/absolute_url" /> zoom area
            </a></li>
            <li><a href="javascript:$digilib.digilib('zoomFull')"> <img tal:condition="exists:here/template/zoom-full.png"
                tal:attributes="src here/template/zoom-full.png/absolute_url" /> full page
            </a></li>
            <li><a href="javascript:$digilib.digilib('zoomFull', 'width')"> <img
                tal:condition="exists:here/template/pagewidth.png" tal:attributes="src here/template/pagewidth.png/absolute_url" /> page
                width
            </a></li>
            <li><a href="javascript:$digilib.digilib('setMark')"> <img tal:condition="exists:here/template/mark.png"
                tal:attributes="src here/template/mark.png/absolute_url" /> set mark
            </a></li>
            <li><a href="javascript:$digilib.digilib('removeMark')"> <img tal:condition="exists:here/template/delmark.png"
                tal:attributes="src here/template/delmark.png/absolute_url" /> remove mark
            </a></li>
            <li><a href="javascript:$digilib.digilib('reference')"> <img tal:condition="exists:here/template/reference.png"
                tal:attributes="src here/template/reference.png/absolute_url" /> get reference
            </a></li>
            <li><a href="javascript:$digilib.digilib('digilibUrl', 'open_new')"> <img
                tal:condition="exists:here/template/digilib.png" tal:attributes="src here/template/digilib.png/absolute_url" />
                digilib
            </a></li>
          </ul>
        </div>

        <!--  layer option boxes (rendered if active) -->
        <tal:block tal:repeat="layer availableLayers">
          <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/options_box"
            tal:condition="python:exists(mpath)">
            <metal:block metal:use-macro="python:path(mpath)" />
          </tal:block>
        </tal:block>
      </div>
    </div><!-- /page-body -->
    
    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
      <div class="errortext">Sorry, access to this document is restricted.</div>
    </div>
    <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
      <!-- footer -->
      <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
    </tal:block>
    
  </tal:block>
</body>
<body tal:condition="not:numPages">
  <div class="errortext">Sorry, document doesn't exist.</div>
  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
    <!-- footer -->
    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
  </tal:block>
</body>
</html>