# HG changeset patch # User engler # Date 1052906440 -7200 # Node ID 489f61d9feace5c9d5c87e7f8a37c933d6f8a010 # Parent 200584e60a0bcbbabb9c3f2bcf286c68c1bca57d XUL Buttons in chrome diff -r 200584e60a0b -r 489f61d9feac client/digitallibrary/digilib.jsp --- a/client/digitallibrary/digilib.jsp Wed May 14 00:11:15 2003 +0200 +++ b/client/digitallibrary/digilib.jsp Wed May 14 12:00:40 2003 +0200 @@ -1,6 +1,25 @@ <%@ page language="java" %> <%! +/* +Copyright (C) 2003 WTWG, Uni Bern + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.3 +*/ // authentication stuff - robert // ----------------------------- // create DocumentBean instance for all JSP requests @@ -17,23 +36,202 @@ } %> + + + <% + // parsing the query // ----------------- -digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); +//digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); +digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(); +dlRequest.setWithRequest(request); // check if authentication is needed and redirect if necessary docBean.doAuthentication(dlRequest, response); -// add number of pages -dlRequest.setPt(docBean.getNumPages(dlRequest)); -// retrieve request in new paramter format -String query = "dlImage.jsp?" + dlRequest.getAsString(); +%> + +<% + +// the different levels of presentation +// ------------------------------------ + + +// level 3 representation hack - lugi + // it would be musch more interesting to check + // if the sidebar is actually installed and in + // the case it isn't - automatically do it. + // however this requires client-side tests and + // so slows down everything. + // we might want to talk about it for a future + // release + +if (dlRequest.getLv() == 3) { + String userAgent = request.getHeader("User-Agent").toLowerCase(); + + if (userAgent.indexOf("mozilla/5.0") == 0) { + + // mozilla 5 that does not support xul-sidebars + if (userAgent.indexOf("opera") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("chimera") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("camino") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("konqueror") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("safari") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("galeon") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("skipstone") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("k-meleon") > -1) dlRequest.setLv(2); + if (userAgent.indexOf("firebird") > -1) dlRequest.setLv(2); + + // the chance is quite big, that the browser supports xul-sidebars + dlRequest.setLv(1); + + } else { + + // redirect to level 2 because of definitive lack of sidebar support + dlRequest.setLv(2); + } +} + + + +switch (dlRequest.getLv()) { + + // LEVEL 0 -------------------------------------------------------------- + + case 0: +%> + +<% + break; // level 0 + + + + + // LEVEL 1 -------------------------------------------------------------- + + case 1: +%> + +<% + // checking if the height and width of this client is already known + if ((dlRequest.getDw() == 0) || (dlRequest.getDh() == 0)) { %>
-