Mercurial > hg > digilib-old
changeset 98:7b5d0ff8f93f vendor
XUL-Dateien
author | engler |
---|---|
date | Mon, 05 May 2003 18:42:58 +0200 |
parents | c4a571313422 |
children | ecee3ff2f4d0 |
files | xul/buttons.xul xul/install_sidebar.jsp xul/menu.js |
diffstat | 3 files changed, 292 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xul/buttons.xul Mon May 05 18:42:58 2003 +0200 @@ -0,0 +1,1 @@ +<?xml version="1.0"?> <?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> <window xmlns:html="http://www.w3.org/1999/xhtml" xmlns= "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <script language="JavaScript"> // variable that store the texts for contexthelp var helpText = new Array(); helpText[0] = "'back'-button|Click this button to load the previous image (usually the previous page of a document)."; helpText[1] = "'next'-button|Click this button to load the next image (usually the next page of a document)."; helpText[2] = "'page'-button|After clicking 'page' you will be prompted for a specific page you want to see.(br)Please note that the numbers entered into the input line refer to digital images, notwithstanding the fact that more than one text page may be on it."; helpText[3] = "'digicat'-button|Click here to open a thumbnailview of the current document (image series)."; helpText[4] = "'mark'-button|You can insert marks onto the picture. After clicking 'mark' you can select the location in the image where a numbered mark will appear.(br)Check out 'reference' to communicate these marks (up to 8) to others."; helpText[5] = "'reference'-button|Choose LaTeX or HTML mode to receive a link for the actual (zoomed) picture including marks. 'New HTML' creates references that will open the respective digital object within the Mozilla version of DIGILIB, providing advanced functionality in the sidebar."; helpText[6] = "'zoom area'-button|With 'zoom area' you can zoom into any rectangular field of the current picture.(br)After clicking the button click on the image to determine any corner (for instance topleft), release the mousebutton and move the mouse until the rectangular has the desired size, then click again for fixing it."; helpText[7] = "'zoom point'-button|Click on 'zoom point', then click on the picture. This renders a zoomed picture centered around the selected point."; helpText[8] = "'zoom out'-button|To recover the original unzoomed picture (fitted to the window), click 'zoom out'.(br)Note that marks will be kept."; helpText[9] = "'move to'-button|This button changes the centre of a zoomed picture without changing the zoom-factor.(br)Click on the picture where you want to place the new centre 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 to.(br)Note: scale factor of '1.0' fits the picture right into the working area, while '2.0' makes it twice as high and large."; helpText[11] = "'mirror'-button|Mirrors the image either horizontally or vertically. Click the button and make your choice at the selection menu."; helpText[12] = "'rotate'-button|This function allows you to rotate the image by the angle you specify. Click on the button and enter a rotation angle in absolute degrees into the text box (clockwise)"; helpText[13] = "'brightness'-button|The brightness command helps you to adjust the brightness of an image. Click on the button and choose a brightness level at the selection menu."; helpText[14] = "'contrast'-button|The contrast command helps you to adjust the contrast of an image. Click on the button and choose a contrast level at the selection menu."; helpText[15] = "'color'-button|You can change the color values of each of the RGB channels. This can be done eighter by adding/substratcing a defined amount or by multiplying the pixel value by the desired factor."; helpText[16] = "'?'-button|The menu includes various options: activating this context sensitive help, 'Keep area' keeps the current image area when changing to another page, 'Fit GIFs' forces the program to adjust the size of GIF-images to the working area."; helpText[17] = "'metadata'-button|Shows the metadata to the document in the main window."; // 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 var keepArea = true; </script> <script language="JavaScript" src="http://hera.unibe.ch:8080/alcatraz/xul/menu.js"></script> <popupset> <popup id="scale_popup"> <menuitem label="0.7" oncommand="window.content.scale(0.7);" /> <menuitem label="1" oncommand="window.content.scale(1);" /> <menuitem label="1.5" oncommand="window.content.scale(1.5);" /> <menuitem label="2" oncommand="window.content.scale(2);" /> <menuitem label="2.5" oncommand="window.content.scale(2.5);" /> <menuitem label="3" oncommand="window.content.scale(3);" /> <menuitem label="pixel by pixel" oncommand="window.content.pixelByPixel();" /> </popup> </popupset> <popupset> <popup id="reference_popup"> <menuitem label="LaTex" oncommand="window.content.ref(0);" /> <menuitem label="HTML" oncommand="window.content.ref(1);" /> <menuitem label="new HTML" oncommand="window.content.ref(2);" /> </popup> </popupset> <popupset> <popup id="mirror_popup"> <menuitem label="Horizontal" oncommand="window.content.mirror('h');" /> <menuitem label="Vertical" oncommand="window.content.mirror('v');" /> </popup> </popupset> <popupset> <popup id="brightness_popup"> <menuitem label="very bright" oncommand="window.content.brightness(90);" /> <menuitem label="bright" oncommand="window.content.brightness(30);" /> <menuitem label="normal" oncommand="window.content.brightness(0);" /> <menuitem label="dark" oncommand="window.content.brightness(-30);" /> <menuitem label="very dark" oncommand="window.content.brightness(-90);" /> </popup> </popupset> <popupset> <popup id="contrast_popup"> <menuitem label="much" oncommand="window.content.contrast(0.5);" /> <menuitem label="more" oncommand="window.content.contrast(0.2);" /> <menuitem label="normal" oncommand="window.content.contrast(0.0);" /> <menuitem label="less" oncommand="window.content.contrast(-0.2);" /> <menuitem label="little" oncommand="window.content.contrast(-0.5);" /> </popup> </popupset> <popupset> <popup id="colors_popup"> <menuitem label="add" oncommand="color_add();" /> <menuitem label="multiply" oncommand="color_multiply();" /> </popup> </popupset> <popupset> <popup id="help_popup"> <menuitem label="Contexthelp" type="checkbox" oncommand="changeHelp();"/> <menuitem label="Keep Area" type="checkbox" checked="true" oncommand="keepArea = !keepArea;" /> <menuitem label="Fit GIFs" type="checkbox" oncommand="(window.content.att[3].indexOf('f') > -1) ? window.content.att[3] = '' : window.content.att[3] = 'fit'; window.content.loadPicture(2, keepArea);" /> </popup> </popupset> <hbox> <vbox flex="1" /> <vbox> <spacer style="height: 10px" /> <hbox> <button label="back" onclick="window.content.backPage(keepArea);" onmouseover="overButton(0)" /> <button label="next" onclick="window.content.nextPage(keepArea);" onmouseover="overButton(1)" /> </hbox> <button label="page" onclick="window.content.page(keepArea);" onmouseover="overButton(2)" /> <button label="digicat" onclick="window.content.digicat();" onmouseover="overButton(3)" /> <!-- <button label="metadata" onclick="showMetadata(window.content.location.href);" onmouseover="overButton(17)" /> --> <spacer style="height: 15px" /> <button label="mark" onclick="window.content.mark();" onmouseover="overButton(4)" /> <button label="reference" popup="reference_popup" onmouseover="overButton(5)" /> <spacer style="height: 15px" /> <button label="zoom area" onclick="window.content.zoomArea();" onmouseover="overButton(6)" /> <button label="zoom point" onclick="window.content.zoomPoint();" onmouseover="overButton(7)" /> <button label="zoom out" onclick="window.content.zoomOut();" onmouseover="overButton(8)" /> <button label="move to" onclick="window.content.moveTo();" onmouseover="overButton(9)" /> <spacer style="height: 15px" /> <button label="scale" popup="scale_popup" onmouseover="overButton(10)" /> <button label="mirror" popup="mirror_popup" onmouseover="overButton(11)" /> <button label="rotate" onclick="rotate();" onmouseover="overButton(12)" /> <spacer style="height: 15px" /> <button label="brightness" popup="brightness_popup" onmouseover="overButton(13)" /> <button label="contrast" popup="contrast_popup" onmouseover="overButton(14)" /> <button label="colors" popup="colors_popup" onmouseover="overButton(15)" /> <spacer style="height: 15px" /> <button label="?" popup="help_popup" onmouseover="overButton(16)" /> </vbox> <vbox flex="1" /> </hbox> </window> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xul/install_sidebar.jsp Mon May 05 18:42:58 2003 +0200 @@ -0,0 +1,52 @@ +<%@page contentType="text/html" import="java.util.*"%> +<% + String serverName = request.getServerName(); + int serverPort = request.getServerPort(); + String serverPATH = request.getRequestURI(); + int lastSlash = serverPATH.lastIndexOf("/"); + serverPATH=serverPATH.substring(0, lastSlash); +%> +<html> +<head> +<title>Alcatraz-XUL-Sidebars</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + +<script language="JavaScript"> +<!-- simple one-line side-bar-installer , addPanel("title in sidebar","url","url to customize tab. is optional") + + +// deluxe sidebar installer with browser testing + + function addSidebarPanel(name, url) { + if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) + { + window.sidebar.addPanel (name,url,""); + } + else + { + alert ("To use this functionality a Netscape 6+ or Mozilla browser is needed !"); + } + } +--> +</script> + + +</head> + +<body bgcolor="#FFFFFF" text="#000000"> +<div align=center> + +<br> <br> + +<h3>Alcatraz-XUL-Sidebars</h3> +<!-- installing tab into sidebar with javascript inside form--> + + Digilib-Buttons im Sidebar + <br> + <input type="submit" name="Abschicken" value="Install Button-List into Sidebar!" onClick="javascript:sidebar.addPanel('DIGILIB-Buttons', 'http://<%=serverName%>:<%=serverPort%><%=serverPATH%>/buttons.xul','');"> + <br><br> + +</div> +</body> + +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xul/menu.js Mon May 05 18:42:58 2003 +0200 @@ -0,0 +1,239 @@ +/* +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 +*/ +function rotate() { + value = prompt("Enter absolute rotation angle in degrees (clockwise orientation) :"); + + if (value) { + window.content.rotation(value); + } +} + +function color_add() { + + value = prompt("Enter the values you like to add to the red, green and blue color channel.\n\nFormat is R/G/B, where R,G,B are floating numbers between -255 and +255."); + + if (value) { + + values = value.split("/"); + + if (values.length != 3) alert("Illegal format"); + else if ((values[0] < -255) || (values[0] > 255)) alert("Illegal value for red"); + else if ((values[1] < -255) || (values[1] > 255)) alert("Illegal value for green"); + else if ((values[2] < -255) || (values[2] > 255)) alert("Illegal value for blue"); + + else window.content.rgba(value); + + } +} + +function color_multiply() { + + value = prompt("Enter the values you like to multiply with the different color channels.\n\nFormat is R/G/B, where R,G,B are floating numbers bigger than 0."); + + if (value) { + + values = value.split("/"); + + if (values.length != 3) alert("Illegal format"); + else if (values[0] < 0) alert("Illegal value for red"); + else if (values[1] < 0) alert("Illegal value for green"); + else if (values[2] < 0) alert("Illegal value for blue"); + + else window.content.rgbm(value); + + } +} + +function showMetadata(myurl){ + var arrUrl=myurl.split("?"); + var strDigilib=arrUrl[0]; + var strParams=arrUrl[1]; + var strArguments=strParams.split("&"); + var strDocDir=""; + for (i=0;i<strArguments.length;i++){ + var strArg=strArguments[i]; + var intPos=strArg.indexOf("fn="); + if (intPos>=0){ + strDocDir=strArg.substr(intPos+3); + } + } + if (strDocDir == ""){ + alert("no metadata available"); + }else{ + window.open("showMetadata.jsp?docdir="+strDocDir,"Metadata "+strDocDir,"menubar=no scrollbars=yes height=400 width=600"); + } +} + + +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(); + +function overButton(n) { + if (showHelp) contextHelp(n); +} + + +// just to be sure, that no buffer overflow can arrive +var semaphor = true; + +function contextHelp(n) { + + if (helpWindow.closed) { + changeHelp(); + return; + } + + if ((navigator.appVersion.indexOf("Macintosh") < 0) && semaphor) { + semaphor = false; + + var tmpHelp = helpText[n]; + tmpHelp = tmpHelp.replace(/\(br\)/,"<br>"); + var help = tmpHelp.split("|"); + + helpWindow.focus(); + helpWindow.document.open(); + helpWindow.document.write('<html><head><title>Context Help</title>'); + helpWindow.document.write('<style type="text/css">'); + helpWindow.document.write('.title {font-family: Verdana, sans-serif, Arial; font-size: 12px; font-weight: bold; color: #FFFFFF}'); + helpWindow.document.write('.text {font-family: Verdana, sans-serif, Arial; font-size: 10px; color: #000000}'); + helpWindow.document.write('</style></head><body bgcolor="#CCCCCC" leftmargin="7" topmargin="7" marginwidth="7" marginheight="7" onload="opener.semaphor = true;">'); + helpWindow.document.write('<table width="99%" border="0" cellspacing="0" cellpadding="3"><tr><td bgcolor="#666666" class="title">'); + helpWindow.document.write(help[0] + '</tr><tr><td class="text">'); + helpWindow.document.write(help[1] + '</tr></td></table></body></html>'); + helpWindow.document.close(); + + + // stupid workaround because of netscape 6, that doesen't know the opener property + // 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); + } + + } + +} + +function openContextHelp() { + if (navigator.appVersion.indexOf("Macintosh") > -1) { + openContextHelpMac(); + return; + } + + semaphor = false; + + var winWidth = 270; + var winHeight = 130; + + var xScreen = 0.9*(screen.width-winWidth); + var yScreen = 0.8*(screen.height-winHeight); + + helpWindow = window.open("", "ContextHelp", "width=" + winWidth + ",height=" + winHeight + ",screenX=" + xScreen + ",screenY=" + yScreen + ",left=" + xScreen + ",top=" + yScreen); + + helpWindow.focus(); + helpWindow.document.open(); + helpWindow.document.write('<html><head><title>Context Help</title>'); + helpWindow.document.write('<style type="text/css">'); + helpWindow.document.write('.title {font-family: Verdana, sans-serif, Arial; font-size: 12px; font-weight: bold; color: #FFFFFF}'); + helpWindow.document.write('.text {font-family: Verdana, sans-serif, Arial; font-size: 10px; color: #000000}'); + helpWindow.document.write('</style></head><body bgcolor="#CCCCCC" leftmargin="7" topmargin="7" marginwidth="7" marginheight="7">'); + helpWindow.document.write('<table width="99%" border="0" cellspacing="0" cellpadding="3"><tr><td bgcolor="#666666" class="title">'); + helpWindow.document.write('Context Help</tr><tr><td class="text">'); + helpWindow.document.write('Move over any button to get some more information about its function</tr></td></table></body></html>'); + helpWindow.document.close(); + + // for some safety reason help-requests have to be blocked while opening the window + setTimeout("semaphor = true;", 200); +} + +// because macs have a strange window focus behaviour we have to go a special + +// way for them - just opening a window that contains all button-descriptions + +function openContextHelpMac() { + + var winWidth = 270; + var winHeight = 600; + + var xScreen = 0.9*(screen.width-winWidth); + var yScreen = 0.8*(screen.height-winHeight); + + helpWindow = window.open("", "ContextHelp", "width=" + winWidth + ",height=" + winHeight + ",screenX=" + xScreen + ",screenY=" + yScreen + ",left=" + xScreen + ",top=" + yScreen + ",scrollbars"); + + helpWindow.focus(); + helpWindow.document.open(); + helpWindow.document.write('<html><head><title>Context Help Macintosh</title>'); + helpWindow.document.write('<style type="text/css">'); + helpWindow.document.write('.title {font-family: Verdana, sans-serif, Arial; font-size: 12px; font-weight: bold; color: #FFFFFF}'); + helpWindow.document.write('.text {font-family: Verdana, sans-serif, Arial; font-size: 10px; color: #000000}'); + helpWindow.document.write('</style></head><body bgcolor="#CCCCCC" leftmargin="7" topmargin="7" marginwidth="7" marginheight="7">'); + helpWindow.document.write('<table width="99%" border="0" cellspacing="0" cellpadding="3">'); + + for (n = 0; n < helpText.length; n++) { + + help = helpText[n].split("|"); + helpWindow.document.write('<tr><td bgcolor="#666666" class="title">'); + helpWindow.document.write(help[0] + '</tr><tr><td class="text">'); + helpWindow.document.write('<p>' + help[1] + '<br> </p></tr></td>'); + } + + helpWindow.document.write('</table></body></html>'); + helpWindow.document.close(); +} + +function closeContextHelp() { + if (helpWindow != '' && !helpWindow.closed) { + helpWindow.close(); + } + + helpWindow = ''; + +} + +function changeHelp() { + showHelp = !showHelp; + showHelp ? openContextHelp() : closeContextHelp(); +} + + +// variable containing the contextwindow + +var helpWindow = ''; \ No newline at end of file