Commit 1ccd1a96 authored by engler's avatar engler

XUL: Digilib Buttons in chrome

parent 926fb20c
changes document for digilib-client
-----------------------------------
CURRENT SYMLINKS
navigation_XX.js -> navigation14_XX.js
digilib.jsp -> digilib19.jsp
CHANGES
24.1.2003 - [different files] : roc
- New Servlet version 1.5b with internal cleanup and new Request and
Configuration classes.
- New JSPs dlInfo-js.jsp and server/dlConfig.jsp to show the request parameter
as JavaScript and the configuration settings as HTML.
8.1.2003 - DigilibServlet.jar : roc
- New servlet and classes for JAI ImageIO (currently not used).
27.8.2002 - digilib.jsp, digicat.jsp, dlImage.jsp : roc
- Initialization of docBean only once in jspInit.
- Use of new DigilibRequest object for translation of +++-style requests
into parameter-style requests and processing of baseURL.
13.8.2002 - [different files] : roc
- changed all hardcoded occurrences of /docuserver/digitallibrary to
work relative or take the path from the request URL. Introduced a
variable baseURL to hold the URL path (up to digilib.jsp etc.). Now
it should be possible to install digilib in other directories.
20.05.2002 - navigation_o6.js : luginbuehl
- Opera browser support done. the 'b'-key does not work currently, beause
Opera uses this key on its own - have to work something out...
18.05.2002 - [different files] : luginbuehl
- works on Opera browser support (functionality is getting better, menu
still has lots of errors)
- working on a Opera version that does work independantly of the http
browser imitation set (though!)
18.05.2002 - modules/pagesTotal.js : luginbuehl
- fixied an error in function page(keepArea) which did not work on all
browsers correctly.
<!--
-->
<!-- Authentication configuration file for Digital Document Library -->
<auth-config>
<digilib-paths>
......
......@@ -13,6 +13,12 @@
Directories with low-resolution images are first in list. -->
<parameter name="basedir-list" value="/docuserver/scaled/small:/docuserver/images:/docuserver/scans/quellen" />
<!-- Java class to use for image operations -->
<parameter name="docuimage-class" value="digilib.image.JAIDocuImage" />
<!-- is sending whole image files with mo=file allowed? -->
<parameter name="sendfile-allowed" value="true" />
<!-- Restrict access to authorized users.
User authentication and roles are provided by the servlet container
(see tomcat-users.xml).
......
......@@ -3,81 +3,117 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- General description of your web application -->
<display-name>Docuserver</display-name>
<description>
This is the web frontend of Docuserver.
</description>
<servlet>
<servlet-name>Scaler</servlet-name>
<description>
The servlet to scale the digilib images.
</description>
<servlet-class>digilib.servlet.Scaler</servlet-class>
<!-- parameters to the servlet -->
<init-param>
<param-name>config-file</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<!-- Load this servlet at server startup time -->
<load-on-startup>5</load-on-startup>
</servlet>
<!-- General description of your web application -->
<display-name>
digilib
</display-name>
<description>
This is the web frontend of the Digital Document Library.
</description>
<!-- The Scaler servlet -->
<servlet>
<servlet-name>
Scaler
</servlet-name>
<description>
The servlet to scale the digilib images.
</description>
<servlet-class>
digilib.servlet.Scaler
</servlet-class>
<!-- parameters to the servlet -->
<init-param>
<param-name>
config-file
</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<!-- Load this servlet at server startup time -->
<load-on-startup>
5
</load-on-startup>
</servlet>
<!-- We want to finger around with the default JSP servlet... -->
<servlet>
<servlet-name>doc-jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>logVerbosityLevel</param-name>
<param-value>WARNING</param-value>
</init-param>
<!-- parameters to the servlet -->
<init-param>
<param-name>config-file</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
<servlet-name>
doc-jsp
</servlet-name>
<servlet-class>
org.apache.jasper.servlet.JspServlet
</servlet-class>
<!-- parameters to the JSP servlet -->
<init-param>
<param-name>
logVerbosityLevel
</param-name>
<param-value>
WARNING
</param-value>
</init-param>
<init-param>
<param-name>
config-file
</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<load-on-startup>
3
</load-on-startup>
</servlet>
<!-- The mapping for the Scaler servlet -->
<servlet-mapping>
<servlet-name>
Scaler
</servlet-name>
<url-pattern>
/servlet/Scaler/*
</url-pattern>
</servlet-mapping>
<!-- The mapping for the JSP servlet -->
<servlet-mapping>
<servlet-name>doc-jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<servlet-name>
doc-jsp
</servlet-name>
<url-pattern>
*.jsp
</url-pattern>
</servlet-mapping>
<!-- region for authenticated access -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Authenticated Digilib</web-resource-name>
<url-pattern>/authenticated/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<!--
<auth-method>BASIC</auth-method>
<realm-name>digilib</realm-name>
-->
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/digilib-login.html</form-login-page>
<form-error-page>/digilib-fail.html</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>
Authenticated Digilib
</web-resource-name>
<url-pattern>
/authenticated/*
</url-pattern>
</web-resource-collection>
<!-- we need a default user -->
<auth-constraint>
<role-name>
user
</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<!--
<auth-method>BASIC</auth-method>
<realm-name>digilib</realm-name>
-->
<auth-method>
FORM
</auth-method>
<form-login-config>
<form-login-page>
/digilib-login.html
</form-login-page>
<form-error-page>
/digilib-fail.html
</form-error-page>
</form-login-config>
</login-config>
</web-app>
function checkBrowser(){
this.ver = navigator.appVersion;
this.dom = document.getElementById ? 1 : 0;
this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom) ? 1 : 0;
this.ie4 = (document.all && !this.dom) ? 1 : 0;
this.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0;
this.ns4 = (document.layers && !this.dom) ? 1 : 0;
this.ie = (this.ie4 || this.ie5);
return this;
}
function checkBrowser() {
this.ua = navigator.userAgent;
this.ver = navigator.appVersion;
this.dom = ( document.getElementById );
this.opera = ( this.dom ) && ( this.ua.toLowerCase().indexOf("opera") > -1 );
this.ie4 = ( document.all ) && ( !this.dom );
this.ie5 = ( this.ver.indexOf("MSIE 5") > -1 ) && ( this.dom );
this.ie6 = ( this.ver.indexOf("MSIE 6") > -1 ) && ( this.dom );
this.ns4 = ( document.layers ) && ( !this.dom );
this.ns6 = ( this.dom ) && ( parseInt(this.ver) >= 5 ) && ( !this.opera );
this.ns = this.ns4 || this.ns6;
this.ie = this.ie4 || this.ie5 || this.ie6;
return this;
}
browser = new checkBrowser();
......@@ -63,7 +69,7 @@ function overItem(obj) {
}
function awayItem(obj) {
changeBc("menu" + obj, '');
changeBc("menu" + obj, '#666666');
timeID = setTimeout("hideMenu()", 700);
}
......@@ -138,10 +144,17 @@ function contextHelp(n) {
helpWindow.document.close();
// stupid workaround because of netscape 6, that doesen't know the opener property
// this workaround is still ok cause netscape 6 has eventbuffer checks so no overflow
if (browser.ns5) {
// this workaround is still ok because netscape 6 has eventbuffer checks so no overflow
if (browser.ns6) {
semaphor = true;
}
// next stupid workaround because of opera 6, that somehow don't start the 'onLoad'-
// attribute in the body tag (the helpwindow does not finish loading)
if (browser.opera) {
setTimeout("semaphor = true;", 50);
}
}
}
......
......@@ -8,7 +8,9 @@
<!-- Beginning of JavaScript --------
this.location = "http://"+location.host+"/docuserver/digitallibrary/digicat.jsp"+location.search;
//this.location = "http://"+location.host+"/docuserver/digitallibrary/digicat.jsp"+location.search;
this.location.replace(this.location.href.replace(/\.html/, ".jsp"));
// -- End of JavaScript code -------------- -->
......@@ -17,9 +19,12 @@ this.location = "http://"+location.host+"/docuserver/digitallibrary/digicat.jsp"
<body>
<h1>Digital Library Redirect</h1>
<p>You should automatically be redirected to the Digital Library page.</p>
<p>You should automatically be redirected to the Digital Library page.
(<tt>digicat.<b>jsp</b></tt>)</p>
<p>If this doesn't happen please <a href="digicat.jsp">click here</a>.</p>
<p>If this doesn't happen make shure JavaScript is enabled in your browser.
The Digital Library pages need JavaScript to work. If your problem still
remains, please contact the administrator.</p>
<hr>
<address>robert.casties@philo.unibe.ch</address>
......
<html>
<head>
<%@ page language="java" %>
<jsp:useBean id="DB" scope="page" class="digilib.servlet.DocumentBean" />
<%!
// authentication stuff - robert
// -----------------------------
// create DocumentBean instance for all JSP requests
digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
// initialize DocumentBean instance in JSP init
public void jspInit() {
try {
// set servlet init-parameter
docBean.setConfig(getServletConfig());
} catch (javax.servlet.ServletException e) {
System.out.println(e);
}
}
%>
<%
// set servlet init-parameter
DB.setConfig(getServletConfig());
// set up request object for base URL
digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
// check if authentication is needed and redirect if necessary
DB.doAuthentication(request, response);
docBean.doAuthentication(dlRequest, response);
// add number of pages
dlRequest.setPt(docBean.getNumPages(dlRequest));
%>
<html>
<head>
<script language="JavaScript">
// DEBUG
//alert('DIR: <%= DB.getDocuPath(request) %> PAGES: <%= DB.getNumPages(request) %>');
var baseUrl = "<%= dlRequest.getBaseURL() %>";
// the document's query string (minus "?")
var query = location.search.substring(1);
// first page number
var firstPage = <%= DB.getFirstPage(request) %>;
var firstPage = <%= docBean.getFirstPage(dlRequest) %>;
// number of pages of the document
var numPages = <%= DB.getNumPages(request) %>;
var numPages = <%= docBean.getNumPages(dlRequest) %>;
// browser version test to include the corresponding navigation-file
if ((navigator.appName.toLowerCase() == "netscape") && (parseFloat(navigator.appVersion) < 5.0)) {
......
......@@ -5,20 +5,24 @@
</head>
<script LANGUAGE="JavaScript">
<!-- Beginning of JavaScript --------
this.location = "http://"+location.host+"/docuserver/digitallibrary/digilib.jsp"+location.search;
// this.location = "http://"+location.host+"/docuserver/digitallibrary/digilib.jsp"+location.search;
this.location.replace(this.location.href.replace(/\.html/, ".jsp"));
// -- End of JavaScript code -------------- -->
</script>
</SCRIPT>
<body>
<h1>Digital Library Redirect</h1>
<p>You should automatically be redirected to the Digital Library page.</p>
<p>You should automatically be redirected to the Digital Library page.
(<tt>digilib.<b>jsp</b></tt>)</p>
<p>If this doesn't happen please <a href="digilib.jsp">click here</a>.</p>
<p>If this doesn't happen make shure JavaScript is enabled in your browser.
The Digital Library pages need JavaScript to work. If your problem still
remains, please contact the administrator.</p>
<hr>
<address>robert.casties@philo.unibe.ch</address>
......
This diff is collapsed.
<%
// checking if the height and width of this client is already known
if ((request.getParameter("dw") == null) || (request.getParameter("dh") == null)) {
%>
<html>
<head>
<script language="Javascript">
function redirect() {
if (navigator.appName.toLowerCase() == "netscape") { // mozilla-browsers (netscape 4.xx, netscape 6.xx, etc.)
client = "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30);
} else { // ie
client = "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30);
}
location.replace("dlImage.jsp?<%= request.getQueryString() %>" + client);
}
</script>
</head>
<body bgcolor="#666666" onload="redirect()">
</body>
</html>
<%
} else {
digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
/* default values for parameters
dlRequest.setFn("/"); // url of the page/document
dlRequest.setPn(1); // page number
dlRequest.setWs(1); // scale factor
dlRequest.setMo(""); // special options like 'fit' for gifs
dlRequest.setMk("0/0"); // marks
dlRequest.setWx(0); // left edge of image (float from 0 to 1)
dlRequest.setWy(0); // top edge in image (float from 0 to 1)
dlRequest.setWw(1); // width of image (float from 0 to 1)
dlRequest.setWh(1); // height of image (float from 0 to 1)
*/
// overrriding default parameters with provided parameters from query-string
dlRequest.setWithRequest(request);
String imageLocation = dlRequest.getBaseURL() + "/servlet/Scaler/?" + dlRequest.getAsString();
%>
<html>
<head>
<script language="JavaScript">
var baseUrl = "<%= dlRequest.getBaseURL() %>";
// browser version test to include the corresponding navigation-file
if (navigator.userAgent.toLowerCase().indexOf("opera") > -1) {
document.write('<script src="navigation_o6.js"><\/script>');
} else if (navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
document.write('<script src="navigation_ie.js"><\/script>');
} else if (navigator.userAgent.toLowerCase().indexOf("mozilla\/4") > -1) {
document.write('<script src="navigation_n4.js"><\/script>');
} else if (navigator.userAgent.toLowerCase().indexOf("mozilla\/5") > -1) {
document.write('<script src="navigation_n6.js"><\/script>');
} else {
alert('Your browser is not directly supported by this client right now.\n\nLoading now the optimised version for Netscape 6, that sticks the most to the w3c specifications.');
document.write('<script src="navigation_n6.js"><\/script>');
}
// add module to show the total number of pages (not browser dependant!)
document.write('<script src="modules\/pagesTotal.js"><\/script>');
// document.write('<script src="modules\/pdfMaker.js"><\/script>');
</script>
</head>
<body bgcolor="#666666" onload='init_pagesTotal("<%= dlRequest.getFilePath() %>", "<%= dlRequest.getPn() %>", "<%= dlRequest.getWs() %>", "<%= dlRequest.getMo() %>", "<%= dlRequest.getMk() %>", "<%= dlRequest.getWx() %>", "<%= dlRequest.getWy() %>", "<%= dlRequest.getWw() %>", "<%= dlRequest.getWh() %>", "<%= dlRequest.getPt() %>")'>
<div id="lay1" style="position: absolute; left: 10px; top: 10px; visibility: visible"><img name="pic" src="<%= imageLocation %>" border="0"></div>
<div id="dot0" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark1.gif" border="0"></div>
<div id="dot1" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark2.gif" border="0"></div>
<div id="dot2" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark3.gif" border="0"></div>
<div id="dot3" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark4.gif" border="0"></div>
<div id="dot4" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark5.gif" border="0"></div>
<div id="dot5" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark6.gif" border="0"></div>
<div id="dot6" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark7.gif" border="0"></div>
<div id="dot7" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark8.gif" border="0"></div>
<div id="eck1" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="olinks.gif" border="0"></div>
<div id="eck2" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="orechts.gif" border="0"></div>
<div id="eck3" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="ulinks.gif" border="0"></div>
<div id="eck4" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="urechts.gif" border="0"></div>
</body>
</html>
<%
}
%>
<%@ page language="java" %>
<%!
// authentication stuff - robert
// -----------------------------
// create DocumentBean instance for all JSP requests
digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
// initialize DocumentBean instance in JSP init
public void jspInit() {
try {
// set servlet init-parameter
docBean.setConfig(getServletConfig());
} catch (javax.servlet.ServletException e) {
System.out.println(e);
}
}
%>
<%
// parse the query
digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
// add number of pages from DocBean
dlRequest.setPt(docBean.getNumPages(dlRequest));
%>
// Automatically generated JavaScript snippet with parameters
var dlreqPt = <%= dlRequest.getPt() %>; // total number of pages (generated by sevlet)
var dlreqRequestPath = "<%= dlRequest.getRequestPath() %>"; // url of the page/document
var dlreqFn = "<%= dlRequest.getFn() %>"; // url of the page/document
var dlreqFilePath = "<%= dlRequest.getFilePath() %>"; // effective path of the page/document
var dlreqPn = "<%= dlRequest.getPn() %>"; // page number
var dlreqDw = "<%= dlRequest.getDw() %>"; // width of client in pixels
var dlreqDh = "<%= dlRequest.getDh() %>"; // height of client in pixels
var dlreqWx = "<%= dlRequest.getWx() %>"; // left edge of image (float from 0 to 1)
var dlreqWy = "<%= dlRequest.getWy() %>"; // top edge in image (float from 0 to 1)
var dlreqWw = "<%= dlRequest.getWw() %>"; // width of image (float from 0 to 1)
var dlreqWh = "<%= dlRequest.getWh() %>"; // height of image (float from 0 to 1)
var dlreqWs = "<%= dlRequest.getWs() %>"; // scale factor
var dlreqMo = "<%= dlRequest.getMo() %>"; // special options like 'fit' for gifs
var dlreqMk = "<%= dlRequest.getMk() %>"; // marks
var dlreqBaseURL = "<%= dlRequest.getBaseURL() %>"; // base URL (from http:// to below /servlet)
<html>
<head>
<style type="text/css">
.menu {position:absolute; visibility:hidden}
.item1 {position:absolute; left:33; width:50; height:14; clip:rect(0,50,14,0); visibility:hidden}
.item2 {position:absolute; left:43; width:40; height:14; clip:rect(0,40,14,0); visibility:hidden}
.item3 {position:absolute; left:3; width:80; height:14; clip:rect(0,80,14,0); visibility:hidden}
.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none}
</style>
<script language="JavaScript" src="buttons/menu.js"></script>
<script language="JavaScript">
// because on a netscape 4.xx bug (messing up with layers on resize) we cache the window
// resize event and redisplay the navigation frame
if (document.layers && !document.getElementById) {
window.onresize = function() {parent.rightFrame.location.reload();}
}
// variable that store the texts for contexthelp
var helpText = new Array();
helpText[0] = "'back'-button|Click on this button to load the previous image (usually the next page from a manuscript).";
helpText[1] = "'next'-button|Click on this button to load the next image (usually the next page from a manuscript).";
helpText[2] = "'page'-button|After clicking 'page' you will be prompted for a specific page you want to see.<br>Note that the page number refers to the same serie you are in now.";
helpText[3] = "'digicat'-button|Click here to open a new window containing thumbnails of the current series pages to navigate.";
helpText[4] = "'mark'-button|You can set marks into the picture. After hitting 'mark' you have to click on the desired picures location, a numbered mark appears.<br>Check out 'reference' to make these marks (up to 8) visible for others.";
helpText[5] = "'reference'-button|Choose LaTeX or HTML mode to get a link for the actual (zoomed) picture with all set marks.<br>This link can easily be included in a TeX- or HTML-formatted document/page.";
helpText[6] = "'zoom area'-button|With 'zoom area' you can zoom into any rectangular field for the current picture.<br>After clicking on the button click on the image to set any corner (ex. topleft), release the mousebutton and move the mouse until you have the desired size, then click again.";
helpText[7] = "'zoom point'-button|Click on 'zoom point' then click into a point of the picture. This gives you a zoomed picture centered around your clicked point.";
helpText[8] = "'zoom out'-button|To gain the original unzoomed picture, click on 'zoom out'.<br>Note that any set marks are still saved at their positions.";
helpText[9] = "'move to'-button|This button allows you change the center of a zoomed picture, while not changing the current zoom-factor.<br>Use: Click on the point in the picture you want to be the new center of the image.";
helpText[10] = "'scale'-button|By clicking on one of the menu entries you can select the factor the currently displayed picture will be scaled.<br>Note: a scale factor of '1.0' means that the picture fits right into the working area, while '2.0' means that it will be twice as high and large.";
//helpText[11] = "'make pdf'-button|You can make a PDF with several pictures from this directory in it. Click the button and follow the instructions.";
helpText[12] = "'?'-button|In its menu you are able change options like the visibility of this contextsensitive help, with 'Keep area' the program keeps its current area when changing to another page or with 'Fit GIFs' you can force to program to adjust the size of GIF-images to the working area.";
// boolean variable to eighter show or not show the additional help
// change in the menuitem its original mark
var showHelp = false;
// variable to tell if while changing to another page it should keep the area
// change in the menuitem its original mark