annotate webapp/src/main/webapp/digimage_img_inc.jsp @ 1158:2ee261676828 default tip

better out-of-the box experience: * digilib works without config files using sensible defaults * new sample images folder used by default * config files moved to templates
author robcast
date Tue, 19 Feb 2013 17:32:25 +0100
parents 7779b37d1d05
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
243
4dbff786ff50 new digimage with red triangles for moving the zoomed area
robcast
parents:
diff changeset
1 <%@ page language="java" %><%
4dbff786ff50 new digimage with red triangles for moving the zoomed area
robcast
parents:
diff changeset
2 // retrieve objects from context
4dbff786ff50 new digimage with red triangles for moving the zoomed area
robcast
parents:
diff changeset
3 digilib.servlet.DocumentBean docBean = (digilib.servlet.DocumentBean) pageContext.getAttribute("docBean", pageContext.REQUEST_SCOPE);
903
7779b37d1d05 refactored into maven modules per servlet type.
robcast
parents: 892
diff changeset
4 digilib.servlet.DigilibServletRequest dlRequest = docBean.getRequest();
331
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
5 String ua = request.getHeader("User-Agent");
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
6 boolean isN4 = ((ua.indexOf("Mozilla/4.") > -1)&&(ua.indexOf("MSIE") == -1));
243
4dbff786ff50 new digimage with red triangles for moving the zoomed area
robcast
parents:
diff changeset
7 %>
331
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
8 <%
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
9 if (isN4) {
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
10 %><ilayer name="scaler"><%
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
11 } else {
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
12 %><div id="scaler"><%
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
13 }
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
14 %>
243
4dbff786ff50 new digimage with red triangles for moving the zoomed area
robcast
parents:
diff changeset
15 <script type="text/javascript">
4dbff786ff50 new digimage with red triangles for moving the zoomed area
robcast
parents:
diff changeset
16 var ps = bestPicSize(getElement('scaler'), 10);
331
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
17 document.write('<img id="pic" src="<%= dlRequest.getAsString("base.url") + "/servlet/Scaler?" + dlRequest.getAsString('s') %>&dw='+ps.width+'&dh='+ps.height+'" />');
243
4dbff786ff50 new digimage with red triangles for moving the zoomed area
robcast
parents:
diff changeset
18 </script>
331
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
19 <%
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
20 if (isN4) {
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
21 %></ilayer><%
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
22 } else {
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
23 %></div><%
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
24 }
07aac99066bf fixed problems with Netscape4 (silly error by me partly :-)
robcast
parents: 243
diff changeset
25 %>