Mercurial > hg > digilib-old
changeset 535:9936604d466e
cleaning old stuff and CVS cruft.
author | robcast |
---|---|
date | Wed, 14 Jul 2010 16:36:42 +0200 |
parents | 6a5154af3563 |
children | e758a49258e8 1f666c2b4578 |
files | CVSROOT/checkoutlist CVSROOT/commitinfo CVSROOT/config CVSROOT/cvswrappers CVSROOT/editinfo CVSROOT/loginfo CVSROOT/modules CVSROOT/notify CVSROOT/rcsinfo CVSROOT/taginfo CVSROOT/verifymsg docu/installation.html xul/alcatraz.jar xul/alcatraz.xpi xul/alcatraz_ohne_annota.jar xul/content/alcatraz.xul xul/content/alcatraz_ohne_annota.xul xul/content/alcatraz_toolbar.js xul/content/alcatraz_toolbar.xul xul/content/annota.js xul/content/annota.xul xul/content/annota_ohne_annota.js xul/content/astrosearch.js xul/content/astrosearch.xul xul/content/blank.html xul/content/contents.rdf xul/content/dialog_annotate.js xul/content/dialog_annotate.xul xul/content/dialog_brightnesscontrast.js xul/content/dialog_brightnesscontrast.xul xul/content/dialog_colors.js xul/content/dialog_colors.xul xul/content/dialog_options.js xul/content/dialog_options.xul xul/content/dialog_originalsize.js xul/content/dialog_originalsize.xul xul/content/dialog_page.js xul/content/dialog_page.xul xul/content/dialog_rotate.js xul/content/dialog_rotate.xul xul/content/imago.js xul/content/imago.xul xul/content/navigio.js xul/content/navigio.xul xul/content/navigio_tree.xul xul/content/rdfds.js xul/content/search.js xul/content/search.xul xul/content/settings.js xul/content/sidebar/install.xul xul/content/sidebar/installer.js xul/content/tools_dialog.xul xul/content/tree.js xul/content/tree.xul xul/content/tree_nav.js xul/content/wtwg_bern.xul xul/install.html xul/install.js xul/locale/en-US/contents.rdf xul/make_alcatraz.sh xul/skin/alcatraz.css xul/skin/contents.rdf xul/skin/dialog_originalsize.css xul/skin/dialogs.css xul/skin/images/echo.png xul/skin/images/first.png xul/skin/images/horizontal_bar.png xul/skin/images/last.png xul/skin/images/next.png xul/skin/images/prev.png xul/skin/images/vertical_bar.png |
diffstat | 71 files changed, 0 insertions(+), 4927 deletions(-) [+] |
line wrap: on
line diff
--- a/CVSROOT/checkoutlist Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# The "checkoutlist" file is used to support additional version controlled -# administrative files in $CVSROOT/CVSROOT, such as template files. -# -# The first entry on a line is a filename which will be checked out from -# the corresponding RCS file in the $CVSROOT/CVSROOT directory. -# The remainder of the line is an error message to use if the file cannot -# be checked out. -# -# File format: -# -# [<whitespace>]<filename><whitespace><error message><end-of-line> -# -# comment lines begin with '#'
--- a/CVSROOT/commitinfo Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -# The "commitinfo" file is used to control pre-commit checks. -# The filter on the right is invoked with the repository and a list -# of files to check. A non-zero exit of the filter program will -# cause the commit to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT".
--- a/CVSROOT/config Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -# Set this to "no" if pserver shouldn't check system users/passwords -#SystemAuth=no - -# Put CVS lock files in this directory rather than directly in the repository. -#LockDir=/var/lock/cvs - -# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top -# level of the new working directory when using the `cvs checkout' -# command. -#TopLevelAdmin=no - -# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the -# history file, or a subset as needed (ie `TMAR' logs all write operations) -#LogHistory=TOFEWGCMAR
--- a/CVSROOT/cvswrappers Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# This file affects handling of files based on their names. -# -# The -t/-f options allow one to treat directories of files -# as a single file, or to transform a file in other ways on -# its way in and out of CVS. -# -# The -m option specifies whether CVS attempts to merge files. -# -# The -k option specifies keyword expansion (e.g. -kb for binary). -# -# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) -# -# wildcard [option value][option value]... -# -# where option is one of -# -f from cvs filter value: path to filter -# -t to cvs filter value: path to filter -# -m update methodology value: MERGE or COPY -# -k expansion mode value: b, o, kkv, &c -# -# and value is a single-quote delimited value. -# For example: -#*.gif -k 'b'
--- a/CVSROOT/editinfo Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# The "editinfo" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository.
--- a/CVSROOT/loginfo Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -# The "loginfo" file controls where "cvs commit" log information -# is sent. The first entry on a line is a regular expression which must match -# the directory that the change is being made to, relative to the -# $CVSROOT. If a match is found, then the remainder of the line is a filter -# program that should expect log information on its standard input. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name ALL appears as a regular expression it is always used -# in addition to the first matching regex or DEFAULT. -# -# You may specify a format string as part of the -# filter. The string is composed of a `%' followed -# by a single format character, or followed by a set of format -# characters surrounded by `{' and `}' as separators. The format -# characters are: -# -# s = file name -# V = old version number (pre-checkin) -# v = new version number (post-checkin) -# -# For example: -#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog -# or -#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog -# -ALL /usr/local/bin/log.pl %s -f /cvsroot/digilib/CVSROOT/commitlog -m digilib-cvs@lists.berlios.de
--- a/CVSROOT/modules Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository.
--- a/CVSROOT/notify Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -# The "notify" file controls where notifications from watches set by -# "cvs watch add" or "cvs edit" are sent. The first entry on a line is -# a regular expression which is tested against the directory that the -# change is being made to, relative to the $CVSROOT. If it matches, -# then the remainder of the line is a filter program that should contain -# one occurrence of %s for the user to notify, and information on its -# standard input. -# -# "ALL" or "DEFAULT" can be used in place of the regular expression. -# -# For example: -#ALL mail %s -s "CVS notification"
--- a/CVSROOT/rcsinfo Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# The "rcsinfo" file is used to control templates with which the editor -# is invoked on commit and import. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being made to, relative to the -# $CVSROOT. For the first match that is found, then the remainder of the -# line is the name of the file that contains the template. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT".
--- a/CVSROOT/taginfo Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# The "taginfo" file is used to control pre-tag checks. -# The filter on the right is invoked with the following arguments: -# -# $1 -- tagname -# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d -# $3 -- repository -# $4-> file revision [file revision ...] -# -# A non-zero exit of the filter program will cause the tag to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT".
--- a/CVSROOT/verifymsg Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# The "verifymsg" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository.
--- a/docu/installation.html Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,372 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<html> -<head> -<title>Installation of alcatraz/digilib</title> -</head> - -<body> -<h1>What you need to install digilib</h1> - -<ul> - <li><a href="http://java.sun.com/downloads/index.html" >Java JDK</a> >1.2 (preferred 1.4 and up)</li> - - <li><a href="http://jakarta.apache.org/tomcat/index.html" >Jakarta - Tomcat</a> version 4 or later (preferred 4.1 and up) from - <a href="http://jakarta.apache.org<" >http://jakarta.apache.org</a></li> - - <li>The digilib distribution packages (from - <a href="http://developer.berlios.de" >http://developer.berlios.de</a>) - <ul> - <li>alcatraz/digilib scripts and servlets package - <a href="http://download.berlios.de/digilib/alcatraz-core-0.3.zip"><code>alcatraz-core.zip</code></a></li> - <li>digilib configuration files for tomcat 4 package on Linux/Unix - <a href="http://download.berlios.de/digilib/digilib-tomconf-1.0.zip"><code>digilib-tomconf.zip</code></a> (Not essential)</li> - <li>digilib configuration files for tomcat 4 package on Windows - <a href="http://download.berlios.de/digilib/digilib-win-conf-1.0.zip"><code>digilib-win-conf.zip</code></a> (Not essential)</li> - </ul> - </li> -</ul> - -<h1>Installation</h1> - -<h2>On Linux/Unix</h2> - -<ol> - <li>Make shure the Java JDK is installed (a JRE won't do).</li> - - <li>Create a base directory for docuserver (the default used here is - <code>/docuserver</code>) and for the web interface - (<code>/docuserver/www</code>).</li> - - <li>Unpack the <code>alcatraz-core</code> package in the web - interface directory (<code>/docuserver/www</code>). This will create - the digilib directory <code>digitallibrary</code>.</li> - - <li>Unpack Jakarta Tomcat 4.1.24 in <code>/docuserver</code> This should - produce a directory <code>/docuserver/jakarta-tomcat-4.1.24</code>. Create a - link <code>/docuserver/tomcat</code> to the new directory.</li> - - <li>(optional) Unpack the configuration files package - <code>digilib-tomconf</code> in the tomcat directory.</li> - - <li>Create a link from the digilib directory into the Tomcat webapps - directory <code>/docuserver/tomcat/webapps</code> (type <code>ln -s - /docuserver/www/digitallibrary /docuserver/tomcat/webapps</code>) This is - the default installation running on port 8080 as - <code>http://myserver:8080/digitallibrary/</code>.</li> - - <li>Adjust the path to the JDK and its options in - <code>catalina.sh</code> (in the directory - <code>/docuserver/tomcat/bin</code>, see below for details)</li> - - <li>(optional) For SuSE Linux you can use the startup skript - <code>tomcat/bin/rctomcat</code> - to start and stop the tomcat server. Copy the script into - <code>/etc/init.d</code> as <code>tomcat</code> and set runlevel - links accordingly.</li> - - <li>(optional) Set the tomcat directory and all files to be owned by - the user <code>wwwrun</code> (or whatever your webserver runs) and - use this account to start the tomcat server.</li> - - <li>(optional) To use Mozilla-XUL functionality Alcatraz users have - to open the page - <code>http://myserver:8080/docuserver/digitallibrary/xul/install.html</code> - in a Mozilla compatible browser. There the users can find - instructions to install XUL-Components into their browser. </li> - -</ol> - - -<!-- -<h2>Apache connector module</h2> - -<p>digilib currently needs to be accessed through the Apache -webserver. There are two possible connectors for Apache and Tomcat4: -<code>mod_webapp</code> and <code>mod_jk</code>. Only -<code>mod_webapp</code> has been tested so far.</p> - -<ol> - <li>Get the sources for <code>mod_webapp</code></li> -</ol> ---> - -<h2>On Windows (quick install)</h2> - -<p>Set the following Environment Variables:<br /> - <code>CATALINA_HOME = C:\jakarta-tomcat-4.1.24</code> (or similar)<br /> - <code>JAVA_HOME = C:\j2sdk</code> (or similar) -</p> - -<p> -Start Tomcat server: Open a console window (start <code>cmd.exe</code>).<br /> -Type: <code>%CATALINA_HOME%\bin\startup</code> -</p> - -<p> -Try the following URL in your browser: -<code>http://localhost:8080</code> or -<code>http://127.0.0.1:8080</code> -</p> - -<p> -You should now be able to see the Tomcat opening screen: <em>If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!</em> -</p> - -<p> -Shut it down again: In the console window type <code>%CATALINA_HOME%\bin\shutdown</code>. - -<p> -Extract the "Alcatraz" distribution, possibly to <code>C:\docuserver</code>. Modify the following configuration files according to your paths (as in the "On Linux" section): -</p> - -<p>For tomcat</p> -<ul> - <li><code>C:\jakarta-tomcat-4.1.24\conf\server.xml</code></li> - <li><code>C:\jakarta-tomcat-4.1.24\conf\tomcat-users.xml</code></li> -</ul> - - -<p>For digilib</p> -<ul> - <li><code>C:\docuserver\digitallibrary\WEB-INF\web.xml</code></li> - <li><code>C:\docuserver\digitallibrary\WEB-INF\digilib-config.xml</code></li> - <li><code>C:\docuserver\digitallibrary\WEB-INF\digilib-auth.xml</code></li> -</ul> - -<p>In the <code>alcatraz-win-conf.zip</code> package you can find -prepared configuration files with the following default values: - -<ul> - <li>The image file directory is <code>C:\bilder</code>. </li> - <li>The username for viewing image files is <code>digilib</code>.</li> - <li>The password for viewing image files is <code>digilib</code>.</li> - <li>The digilib server runs on Port <code>9090</code>.</li> -</ul> - -<p> -Now you can restart the Tomcat server: <code>http://localhost:9090</code> or -<code>http://127.0.0.1:9090</code>.</p> - -<p> -Watch the images: -<code>http://localhost:9090/docuserver/digitallibrary/digilib.jsp?&lv=2</code> -</p> - - -<h1>Configuration</h1> - -<h2>Tomcat</h2> - -<h3>catalina.sh / catalina.bat</h3> - -<p>The file <code>catalina.sh</code> (in <code>/docuserver/tomcat/bin</code> -can be modified to provide the path to the JDK and runtime options -for the Java VM. Somewhere at the beginning of the file you can put two lines -like this:</p> - -<pre> -export JAVA_HOME=/usr/local/lib/IBMJava2-14 -export CATALINA_OPTS="-mx512m" -</pre> - -<p>or, on Windows<p> - -<pre> -set CATALINA_HOME=C:\jakarta-tomcat-4.1.24 -set JAVA_HOME=C:\j2sdk -</pre> - -<p>Adjust the <code>JAVA_HOME</code> path to point to your Java JDK -installation directory. You can adjust the memory used by the Java VM -with the <code>-mx</code> option.</p> - -<p>You can delete those two lines if you set these variables in your -shell before starting tomcat in that same shell. These lines are -needed if you want to use the startup script mentioned above under -linux .</p> - - -<h3>tomcat-users.xml</h3> - -<p>All passwords and usernames have to be set up in the file -<code>tomcat-users.xml</code> in <code>/docuserver/tomcat/conf</code> if you -want to use authentication in digilib. The file looks like this:</p> - -<pre> -<tomcat-users> - <user name="tomcat" password="tomcat" roles="tomcat" /> - <user name="role1" password="tomcat" roles="role1" /> - <user name="both" password="tomcat" roles="tomcat,role1" /> -</tomcat-users> -</pre> - -<p>A user is identified by a <code>name</code> and -<code>password</code>. These two elements have to be entered in a -authentication form presented by the browser when accessing a -restricted resource. A user can have one or more -<code>roles</code>. These roles will be used by digilib to decide if -an authenticated user is allowed to access a document (see -<code>digilib-auth.xml</code> below).</p> - -<p>If you want to use the webinterface to configure Tomcat, you have to -add administrational account with the roles <code>admin</code> and -<code>manager</code>.</p> - -<p>tomcat has to be restarted before changes to -<code>tomcat-users.xml</code> have effect!</p> - - -<h2>Digilib</h2> - -<h3>web.xml</h3> - -<p>The deployment of the digilib servlets and JSPs is defined in the -file <code>web.xml</code> in the <code>WEB-INF</code> subdirectory of -the digilib directory -(<code>/docuserver/www/digitallibrary/WEB-INF</code>).</p> - -<p>The only parameter you will have to adjust is the position of the -digilib configuration file. The parameter occurs twice in the file and -looks like this:</p> - -<pre> -<!-- parameters to the servlet --> -<init-param> - <param-name>config-file</param-name> - <param-value> - <b>/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml</b> - </param-value> -</init-param> -</pre> - -<p>Change the path to point where you installed the configuration files.</p> - -<p>Make shure to change the parameter in both places in the config -file! It is needed both for the servlet and the JSP pages!</p> - - -<h3>digilib-config.xml</h3> - -<p>The main configuration for digilib is -<code>digilib-config.xml</code>. It's position is defined by the -<code>config-file</code> init-parameter to the servlets (see -above).</p> - -<p>In the configuration file you can set several paths and -options. The file looks like this:</p> - -<pre> -<!-- Digilib servlet config file --> - -<digilib-config> - <parameter name="debug-level" value="0" /> - - <!-- Image to be sent to indicate general failure. --> - <parameter name="error-image" value=<b>"/docuserver/images/icons/broken.gif"</b> /> - - <!-- Image to be sent to indicate authorization failure. --> - <parameter name="denied-image" value=<b>"/docuserver/images/icons/alert.red.gif"</b> /> - - <!-- List of directories where images are searched. - The authoritative directory with the high-resolution images - is first in list. --> - <parameter name="basedir-list" value=<b>"/docuserver/images:/docuserver/scaled/small"</b> /> - - <!-- 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). - Authorization for resources (directories) is evaluated by the servlet - (see auth-file). --> - <parameter name="use-authorization" value="true" /> - - <!-- Location of XML file with authorization requirements. --> - <parameter name="auth-file" value=<b>"/docuserver/www/digitallibrary/WEB-INF/digilib-auth.xml"</b> /> - - <!-- Part of URL to indicate authenticated access to Tomcat. --> - <parameter name="auth-url-path" value="authenticated/" /> -</digilib-config> -</pre> - -<p>You have to adjust the <code>basedir-list</code> parameter to the -directories where your images are installed. You need only one -directory if you do not have prescaled low resolution versions of your -images. The directory with the high-resolution versions must be the -first entry in the list.</p> - -<p>You can supply your own images for the "error" and -"access denied" messages by the servlet. Standard images -will be used if these parameters are undefined.</p> - -<p>The <code>auth-file</code> parameter has to point to the -authorization configuration file (see below).</p> - -<p>You can specify the Java toolkit implementation with the -<code>docuimage-class</code> parameter. The -<code>ImageLoaderDocuImage</code> might give best performance but -works only with JDK 1.4 and up. <code>JAIDocuImage</code> works with -JDK 1.3 and up.</p> - -<h3>digilib-auth.xml</h3> - -<p>The digilib access authorization is defined in the file defined by -the <code>auth-file</code> parameter (usually -<code>digilib-auth.xml</code> in <code>WEB-INF</code>). </p> - -<p>The file has two parts <code>diglib-paths</code> and -<code>diglib-addresses</code>. It looks like this:</p> - -<pre> -<auth-config> - - <digilib-paths> - <!-- - A user must supply one of the roles under "role" - to access the directory "name". - Roles under "role" must be separated by comma only (no spaces). - --> - <path name="histast/eastwood-collection" role="eastwood-coll" /> - <path name="ptolemaios_geo" role="ptolemaios-geo" /> - </digilib-paths> - - <digilib-addresses> - <!-- - A computer with an ip address that matches "ip" - is automatically granted all roles under "role". - The ip address is matched from the left (in full quads). - Roles under "role" must be separated by comma only (no spaces). - --> - <address ip="127" role="local" /> - <address ip="130.92.68" role="eastwood-coll,ptolemaios-geo" /> - <address ip="130.92.151" role="ALL" /> - </digilib-addresses> - -</auth-config> -</pre> - -<p><code>diglib-paths</code> defines restricted directories and -the roles needed for access. The roles are defined with the users in -<code>tomcat-users.xml</code> (see above). All subdirectories of the -given directories have the same restrictions. All directories not -listed here (and not subdirectories of listed directories) are freely -accessible.</p> - -<p><code>diglib-addresses</code> defines hosts or networks of -computers that are automatically authenticated without username and -password. Hosts can be assigned roles. The special keyword <code>ALL</code> -authorizes for everything. If the role assigned to the computer is not -sufficient to access a resource the user will be asked for username -and password.</p> - - - -<hr> -<address>robert.casties@philo.unibe.ch</address> -<!-- hhmts start -->Last modified: Tue Sep 16 20:37:12 CEST 2003 <!-- hhmts end --> -</body> </html>
--- a/xul/content/alcatraz.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns:html="http://www.w3.org/1999/xhtml" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > - -<tabbox flex="1"> - <tabs> - <tab label="Navigio" /> - <tab label="Imago" /> - <tab label="Annota" /> - </tabs> - <tabpanels flex="1"> - <tabpanel id="navigio_tab"> - <tabbox flex="1"> - <iframe id="navigio_frame" src="navigio.xul" flex="1" /> - </tabbox> - </tabpanel> - <tabpanel id="imago_tab" selected="true"> - <tabbox flex="1"> - <iframe id="imago_frame" src="imago.xul" flex="1" /> - </tabbox> - </tabpanel> - <tabpanel id="annota_tab" orient="vertical"> - <tabbox flex="1"> - <iframe id="annota_frame" src="annota.xul" flex="1" /> - </tabbox> - </tabpanel> - </tabpanels> - </tabbox> -</window>
--- a/xul/content/alcatraz_ohne_annota.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns:html="http://www.w3.org/1999/xhtml" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - onload="setTreeDirectory()"> - -<script type="application/x-javascript" src="chrome://jslib/content/jslib.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/alcatraz.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/annota.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/rdfds.js" /> - -<popupset> - <popup id="scale_popup" onpopupshowing="markCurrentScale()"> - <menuitem id="scale_07" label="0.7" type="checkbox" oncommand="window.content.scale(0.7);" /> - <menuitem id="scale_10" label="1" type="checkbox" oncommand="window.content.scale(1);" /> - <menuitem id="scale_15" label="1.5" type="checkbox" oncommand="window.content.scale(1.5);" /> - <menuitem id="scale_20" label="2" type="checkbox" oncommand="window.content.scale(2);" /> - <menuitem id="scale_25" label="2.5" type="checkbox" oncommand="window.content.scale(2.5);" /> - <menuitem id="scale_30" label="3" type="checkbox" oncommand="window.content.scale(3);" /> - <menuitem id="scale_pbp" label="pixel by pixel" type="checkbox" oncommand="window.content.pixelByPixel();" /> - <menuitem id="scale_os" label="original size" type="checkbox" oncommand="dialog_originalsize();" /> - </popup> -</popupset> - -<popupset> - <popup id="mirror_popup" onpopupshowing="markCurrentMirror()"> - <menuitem id="mirror_h" label="Horizontal" type="checkbox" oncommand="window.content.mirror('h');" /> - <menuitem id="mirror_v" label="Vertical" type="checkbox" oncommand="window.content.mirror('v');" /> - </popup> -</popupset> - -<hbox> - <vbox flex="1" /> - <vbox> - <spacer style="height: 10px" /> - <hbox> - <button id="button_annotate" label="annotate" onclick="dialog_annotate();" flex="1" /> - </hbox> - <spacer style="height: 15px" /> - </vbox> - <vbox flex="1" /> -</hbox> -<tabbox flex="1"> - <tabs> - <tab label="Imago" /> - <tab label="Annota" /> - <tab label="Search" /> - </tabs> - <tabpanels flex="1"> - <tabpanel id="imago_tab" selected="true"> - <vbox flex="1" /> - <vbox> - <button id="button_scale" label="scale" popup="scale_popup" /> - <button id="button_mirror" label="mirror" popup="mirror_popup" /> - <button id="button_rotate" label="rotate" onclick="dialog_rotate();" /> - <spacer flex="1" /> - <button id="button_brightnesscontrast" label="brightness/contrast" onclick="dialog_brightnesscontrast();" /> - <button id="button_colors" label="colors" onclick="dialog_colors();" /> - <spacer flex="100" /> - </vbox> - <vbox flex="1" /> - </tabpanel> - <tabpanel id="annota_tab" orient="vertical"> - <vbox flex="1"> - <hbox> - <toolbarbutton id="annota_file" type="menu" label="File"> - <menupopup id="file_popup"> - <menuitem label="Save" onclick="file_save()" /> - </menupopup> - </toolbarbutton> - <toolbarbutton id="annota_options" type="menu" label="Options"> - <menupopup id="options_popup"> - <menuitem id="local" label="Local" type="radio" name="location" checked="true" onclick="file_local()" /> - <menuitem id="annotaDB" label="Annota DB" type="radio" name="location" onclick="file_annotaDB()" /> - <menuseparator/> - <menuitem id="tool_path" label="Tool URL" onclick="show_dialog('tool path')" /> - <menuitem id="annotations_path" label="Path to annotations" onclick="file_open()" /> - <menuseparator/> - <menuitem id="save_options" label="Save Options" onclick="setProfile()" /> - </menupopup> - </toolbarbutton> - </hbox> - - <tree id="file_tree" flex="100" datasources="rdf:files" ref="file:///" ondblclick="tree_click()"> - - <treecols id="cols"> - <treecol id="name" label="Name" primary="true" flex="1"/> - <treecol id="url" label="URL" hidden="true" flex="1"/> - </treecols> - - <template> - - <rule> - <treechildren flex="1" > - <treeitem uri="rdf:*" persist="open"> - <treerow> - <treecell label="rdf:http://home.netscape.com/NC-rdf#Name"/> - <treecell label="rdf:http://home.netscape.com/NC-rdf#URL"/> - </treerow> - </treeitem> - </treechildren> - </rule> - - </template> - </tree> - - </vbox> - </tabpanel> - <tabpanel id="search_tab"> - <tabbox flex="1"> - - <tabs> - <tab id="search_tab" selected="true" label="search" /> - <tab id="tree_tab" label="tree" /> - </tabs> - - <tabpanels flex="1"> - <tabpanel orient="vertical"> - <iframe id="search_frame" src="search.xul" height="180" /> - <iframe id="result_frame" flex="1" /> - </tabpanel> - <tabpanel> - <iframe id="tree_frame" src="tree.xul" flex="1" /> - </tabpanel> - </tabpanels> - </tabbox> - </tabpanel> - </tabpanels> -</tabbox> -</window>
--- a/xul/content/alcatraz_toolbar.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -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.5 -*/ - - -function dialog_page() { - window.openDialog("chrome://alcatraz/content/dialog_page.xul", "dialog_page", "chrome,dialog,resizable=no", ""); -} - - -function dialog_options() { - window.openDialog("chrome://alcatraz/content/dialog_options.xul", "dialog_options", "chrome,dialog,resizable=no", ""); -} - - -function updatePageDisplay() { - if ( typeof(window.content.getParameter) == 'function' ) { - var actual = window.content.getParameter('pn'); - var total = window.content.getParameter('pt'); - - if ( (parseInt(actual) > 0) && (parseInt(total) > 0)) { - document.getElementById('button_page').setAttribute('label', actual + " of " + total); - } - } - - setTimeout('updatePageDisplay()', 200); -} -setTimeout('updatePageDisplay()', 200); - - -function page(value) { - - var keeparea = getSetting( 'keeparea' ); - - if ( keeparea == 'true' ) { - window.content.page(value, 2); - } else if ( keeparea == 'false' ) { - window.content.page(value, 1); - } else { - // no preferences saved - window.content.page(value, 1); - } - -} - - -function zoomIn() { - - var zoomkind = getSetting( 'zoomkind' ); - - if ( zoomkind == 'zoomarea' ) { - window.content.zoomArea(); - } else if ( zoomkind == 'zoompoint' ) { - window.content.zoomPoint(); - } else { - // no preferences saved - window.content.zoomArea(); - } - -} - - -function zoomOut() { - - var zoomkind = getSetting( 'zoomkind' ); - - if ( zoomkind == 'zoomarea' ) { - window.content.zoomExtends(); - } else if ( zoomkind == 'zoompoint' ) { - window.content.zoomOut(); - } else { - // no preferences saved - window.content.zoomExtends(); - } - -} - - -function change_help() { - - if ( document.getElementById('item_contexthelp').getAttribute('checked') == 'true' ) { - - document.getElementById('button_first').setAttribute('tooltiptext', 'Go to the first page of this document'); - document.getElementById('button_prev').setAttribute('tooltiptext', 'Go to the previous page of this document'); - document.getElementById('button_page').setAttribute('tooltiptext', 'Go to a specific page you enter'); - document.getElementById('button_next').setAttribute('tooltiptext', 'Go to the next page of this document'); - document.getElementById('button_last').setAttribute('tooltiptext', 'Go to the last page of this document'); - document.getElementById('button_mark').setAttribute('tooltiptext', 'Place marks on the picture. Left-click on the image to place a numbered mark'); - document.getElementById('button_ref').setAttribute('tooltiptext', 'Get a hyperlink eighter which can reproduce your selected area and marks'); - document.getElementById('button_thumbs').setAttribute('tooltiptext', 'Open a thumbnailview of the current document (image serie)'); - document.getElementById('button_zoomin').setAttribute('tooltiptext', 'Zoom into the picture (behaviour is selected under ? -> Options)'); - document.getElementById('button_zoomout').setAttribute('tooltiptext', 'Zooms out of the selected region'); - - document.getElementById('button_help').setAttribute('tooltiptext', 'Change default options or (de)select the context-help'); - - document.getElementById('button_scale').setAttribute('tooltiptext', 'Select the factor the picture will be scaled to (relative to the size of the working area)'); - document.getElementById('button_mirror').setAttribute('tooltiptext', 'Mirrors the image eighter horizontally or vertically'); - document.getElementById('button_rotate').setAttribute('tooltiptext', 'Rotate the image by the angle you specify'); - document.getElementById('button_brightnesscontrast').setAttribute('tooltiptext', 'Adjust the brightness and contrast of the picture'); - document.getElementById('button_colors').setAttribute('tooltiptext', 'Adjust the values of each RGB color-channel'); - - } else { - - var buttons = document.getElementsByTagName('button'); - - for ( i = 0; i < buttons.length; i++ ) { - buttons[i].removeAttribute('tooltiptext'); - } - - } - -}
--- a/xul/content/alcatraz_toolbar.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet href="chrome://alcatraz/skin/" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<overlay id="alcatraz_toolbar" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - - <script type="application/x-javascript" src="chrome://jslib/content/jslib.js" /> - <script type="application/x-javascript" src="chrome://alcatraz/content/settings.js" /> - <script type="application/x-javascript" src="chrome://alcatraz/content/alcatraz_toolbar.js" /> - - <toolbox id="navigator-toolbox"> - <toolbar id="alcatraz_bar" tbalign="stretch"> - <image id="image_echo" /> - <toolbarbutton id="button_first" onclick="page('1');" /> - <toolbarbutton id="button_prev" onclick="page('-1');" /> - <toolbarbutton id="button_page" label="x of y" onclick="dialog_page();" /> - <toolbarbutton id="button_next" onclick="page('+1');" /> - <toolbarbutton id="button_last" onclick="page(window.content.getParameter('pt'));" /> - <toolbarseparator /> - <toolbarbutton id="button_thumbs" label="thumbs" onclick="window.content.digicat();" /> - <toolbarseparator /> - <toolbarbutton id="button_mark" label="mark" onclick="window.content.mark();" /> - <toolbarbutton id="button_ref" type="menu" label="ref"> - <menupopup 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);" /> - </menupopup> - </toolbarbutton> - <toolbarseparator /> - <toolbarbutton id="button_zoomin" label="zoom +" onclick="zoomIn();" /> - <toolbarbutton id="button_zoomout" label="zoom -" onclick="zoomOut();" /> - <toolbarseparator /> - <spacer flex="1" /> - <toolbarseparator /> - <toolbarbutton id="button_help" type="menu" label="?"> - <menupopup id="help_popup" > - <menuitem id="item_contexthelp" label="Contexthelp" type="checkbox" oncommand="change_help();"/> - <menuitem id="item_options" label="Options" oncommand="dialog_options();"/> - </menupopup> - </toolbarbutton> - </toolbar> - </toolbox> - -</overlay>
--- a/xul/content/annota.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,687 +0,0 @@ -include ('chrome://jslib/content/io/dir.js'); -include ('chrome://jslib/content/io/file.js'); -/*include ('chrome://jslib/content/io/rdfBase.js'); -include ('chrome://jslib/content/io/rdfResource.js'); -include ('chrome://jslib/content/io/rdfContainer.js');*/ -include ('chrome://jslib/content/io/rdf.js');/* -include ('chrome://jslib/content/io/rdfFile.js');*/ -include ('chrome://jslib/content/io/fileUtils.js'); - -/* Konstanten */ -var BEGIN_OF_URI = 'urn:echo'; -var TREE_ID = 'annotation_tree'; -var ECHO = 'http://echo.unibe.ch/digilib/rdf#'; -var HEADER_URI = 'urn:header:'; - -var slash='/'; -if (navigator.platform=="Win32"){ - slash='\\'; -} - -var directory=slash; -var digilib_path=slash; -var creator = 'unknown'; -var rdfTree; - -getProfile(); -getAnnotations(); - - -/** - * Opens a Dialog to make a text annotation. - */ -function dialog_annotate() { - if(this.getAttributeOfSelectedNode('url') != '') { - window.openDialog("chrome://alcatraz/content/dialog_annotate.xul", "dialog_annotate", "chrome,dialog,resizable=no", ""); - } else { - alert('No Annotation is selected!'); - } -} - - -function makePathCompatible(path){ - if (navigator.platform=="Win32"){ - // slash durch backslash ersetzten - path=path.replace(/\//g,"\\"); - // nur 2 backslashs am anfang - path=path.replace(/^\\{3}/,"\\\\"); - // vor Laufwerkbuchstaben kein Backslash - if (path.indexOf(":")>0){ - path=path.replace(/^\\/g,""); - } - // nur ein Slash gibt Absturz - path=path.replace(/^\\$/,"c:\\"); - //alert(path); - } - return path; -} - -function file_open(){ - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(window, "Select a Directory", nsIFilePicker.modeGetFolder); - - // set default directory - var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - directory=makePathCompatible(directory); - aLocalFile.initWithPath(directory); - fp.displayDirectory=aLocalFile; - - var res=fp.show(); - if (res==nsIFilePicker.returnOK){ - directory=fp.fileURL.path; - directory=makePathCompatible(directory); - this.setTreeDirectory(); - } -} - -function setTreeDirectory(){ - this.rdfTree = new RDFTree(this.TREE_ID); - this.rdfTree.addDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf'); -} - -function setCreatorName() { - -} - -function refreshTree(){ - this.rdfTree = new RDFTree(this.TREE_ID); - this.rdfTree.doSort('name'); - this.rdfTree.rebuild(); -} - -function getAttributeOfSelectedNode(attribute) { - this.rdfTree = new RDFTree(this.TREE_ID); - var tree = this.rdfTree.tree; - try { - return tree.view.getCellText(tree.currentIndex,attribute); - } catch(e) { - return ''; - } -} - -function getURIOfSelectedNode() { - var url = this.getAttributeOfSelectedNode('url'); - if(url != '') { - return id = this.BEGIN_OF_URI + ':' + url - + '|' + this.getAttributeOfSelectedNode('pagenumber') - + '|' + this.getAttributeOfSelectedNode('name'); - } - return ''; -} - -/** - * Deletes the selected Annotation - */ -function deleteAnnotation() { - var name = this.getAttributeOfSelectedNode('name'); - if(name != '') { - var isSure = window.confirm('Do you really want to delete the Annotations "' - + name + '?'); - if(isSure) { - var dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf'); - containerNode = dataSource.getNode(this.BEGIN_OF_URI); - var uri = this.getURIOfSelectedNode(); - containerNode.removeChild(dataSource.getNode(uri)); -// alert(this.HEADER_URI+this.getURIOfSelectedNode()); - //alert(uri); - dataSource.deleteRecursive(this.HEADER_URI+uri); // Delete the Header - dataSource.deleteRecursive(uri); - this.refreshTree(); - dataSource.save(); - } - } - -} - -/** - * Adds a Textannotation to an existing annotation. - */ -function addTextAnnotation(text) { - var id = this.getURIOfSelectedNode(); - dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf'); - var node = dataSource.getNode(id); - if(node.propertyExists('http://purl.org/dc/elements/1.0/title')) { - /** Do something */ - } else { // Should never be reached - alert('AddTextAnnotation: No Annotation is selected!'); - } - //alert(text); -} - -function getCurrentDate() { - var now = new Date(); - return date = ((now.getYear() < 999) ? (now.getYear()+1900) : now.getYear()) + '-' - +now.getDate() + '-' + now.getDay() + ', ' - +now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + ' ' - +(now.getTimezoneOffset()/60) + ':00 GMT'; -} - -/** - * Creates A Complex RDF entry and adds it to the base Container. - * @params String The urn of the new node without(!) title (so far). - * @todo isn't complex yet... - */ -function createComplexRDFEntry(inCompleteURN) { - var title = window.prompt("Please enter a title for this Annotation" - ,this.getAttributeOfSelectedNode('name')); - if(title != null) { - var completeURN = inCompleteURN+title; - var echoContainer = dataSource.getNode(BEGIN_OF_URI); - echoContainer.makeSeq(); - - echoContainer.addChild(completeURN); -/* var node = dataSource.getNode(completeURN); - node.addTarget(ECHO + 'template','text_digilib'); - node.addTarget(ECHO + 'echo','basic'); - node.addTarget(ECHO + 'lv","1"); - node.addTarget("http://purl.org/dc/elements/1.0/title",title); - node.addTarget("http://purl.org/dc/elements/1.0/creator",""); - node.addTarget("http://purl.org/dc/elements/1.0/date",""); - node.addTarget("http://www.w3.org/2000/10/annotation-ns#created",""); - node.addTarget("http://www.w3.org/1999/02/22-rdf-syntax-ns#type",'Annotation'); - - var arrayParams=window.content.listParameters(); - - var s = ''; - for (i=0; i< arrayParams.length; i++){ - s += arrayParams[i] + ' ' + window.content.getParameter(arrayParams[i]) + '\n'; - //var value=window.content.getParameter(arrayParams[i]); - //alert(arrayParams[i]+":"+value); - //node.addTarget(ECHO + '+arrayParams[i],value); - } - alert(s); - - node.addTarget(ECHO + 'lv',"1"); - node.addTarget("http://purl.org/dc/elements/1.0/title",title); - node.addTarget("http://purl.org/dc/elements/1.0/creator",""); - node.addTarget("http://purl.org/dc/elements/1.0/date",""); - node.addTarget("http://www.w3.org/2000/10/annotation-ns#created",""); - //node.addTarget("http://www.w3.org/2000/10/annotation-ns#Annotation","targetof"); - //var node2 = dataSource.getNode("targetof"); - //node2.addTarget(ECHO + 'lv',"1"); -*/ - var date = this.getCurrentDate(); - var node = dataSource.getNode(this.HEADER_URI + completeURN); - var created = ''; - /** @Todo Doesn't work correctly, if the selected one isn't the overwritten one! */ - if(!node.propertyExists('http://purl.org/dc/elements/1.0/title')) { - created = date; - } else { - created = this.getAttributeOfSelectedNode('created'); - } - var fn = window.content.getParameter('fn'); - var pn = window.content.getParameter('pn'); - var ws = window.content.getParameter('ws'); - var mk = window.content.getParameter('mk'); - var wx = window.content.getParameter('wx'); - var wy = window.content.getParameter('wy'); - var ww = window.content.getParameter('ww'); - var wh = window.content.getParameter('wh'); - var pt = window.content.getParameter('pt'); - - var brgt = window.content.getParameter('brgt'); - var cont = window.content.getParameter('cont'); - var rot = window.content.getParameter('rot'); - var rgba = window.content.getParameter('rgba'); - var rgbm = window.content.getParameter('rgbm'); - var ddpix = window.content.getParameter('ddpix'); - var ddpiy = window.content.getParameter('ddpiy'); - - var lv = 1; /** @todo get the parameter right */ - - - var rdfHeader = '<?xml version="1.0" ?>\n' - +'<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n' - +' xmlns:echo="' + ECHO + '"\n' - +' xmlns:a="http://www.w3.org/2000/10/annotation-ns#"\n' - +' xmlns:d="http://purl.org/dc/elements/1.0/">\n\n' - var rdfFooter = '</RDF:RDF>\n'; - - var rdf = rdfHeader; - if(true) { // annotation is basic - rdf += ' <RDF:Description RDF:about="' + completeURN + '">\n' - + ' <!-- Annotations Type -->\n' - + ' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>\n' - + ' <echo:type rdf:resource="' + ECHO + 'Digilib"/>\n' //echo -> RDF - + ' <!-- Echo Digilib Parameters -->\n' - + ' <echo:fn>' + fn + '</echo:fn>\n' - + ' <echo:pn>' + pn + '</echo:pn>\n' - + ' <echo:ws>' + ws + '</echo:ws>\n' - + ' <echo:mk>' + mk + '</echo:mk>\n' // As there isn't a textmark yet, I only set mk - + ' <echo:wx>' + wx + '</echo:wx>\n' - + ' <echo:wy>' + wy + '</echo:wy>\n' - + ' <echo:ww>' + ww + '</echo:ww>\n' - + ' <echo:wh>' + wh + '</echo:wh>\n' - + ' <echo:pt>' + pt + '</echo:pt>\n' - + ' <echo:brgt>' + brgt + '</echo:brgt>\n' - + ' <echo:cont>' + cont + '</echo:cont>\n' - + ' <echo:rot>' + rot + '</echo:rot>\n' - + ' <echo:rgba>' + rgba + '</echo:rgba>\n' - + ' <echo:rgbm>' + rgbm + '</echo:rgbm>\n' - + ' <echo:ddpix>' + ddpix + '</echo:ddpix>\n' - + ' <echo:ddpiy>' + ddpiy + '</echo:ddpiy>\n' - + ' <echo:lv>' + lv + '</echo:lv>\n' - + ' <!-- Dublin Core -->\n' - + ' <d:title>' + title + '</d:title>\n' - + ' <d:creator>' + creator + '</d:creator>\n' - + ' <d:date>' + date + '</d:date>\n' - + ' <!-- WWW.W3.org Annotations -->\n' - + ' <a:created>' + created + '</a:created>\n' - + ' </RDF:Description>\n'; - } else { // annotation is complex /** @Todo The other components aren't correct yet*/ - - rdf +=' <RDF:Description RDF:about="' + this.HEADER_URI + completeURN + '">\n' - + ' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>\n' - + ' <echo:template>text_digilib</echo:template>\n' // are there other templates? - + ' <!-- Dublin Core -->\n' - + ' <d:title>' + title + '</d:title>\n' - + ' <d:creator>' + creator + '</d:creator>\n' - + ' <d:date>' + date + '</d:date>\n' - + ' <!-- WWW.W3.org Annotations -->\n' - + ' <a:created>' + created + '</a:created>\n'; - - rdf +=' <echo:type rdf:resource="' + ECHO + 'complex"/>\n'; //echo -> RDF - + ' <echo:annotation RDF:resource="' + completeURN +'"/>\n' - + ' </RDF:Description>\n\n'; - } - - rdf += rdfFooter; - //alert(rdf); - var ds = new RDFDataSource(); - - //Remove the original to add the new one - dataSource.deleteRecursive(this.HEADER_URI+completeURN); - ds.parseFromString(rdf,'file://'+this.getProfileDirectory()+slash+'annotations.rdf'); - ds.copyAllToDataSource(dataSource); - -/******************************************************* - - var rdf ='<?xml version="1.0" ?>' - +'<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"' - +' xmlns:echo="' + ECHO + '"' - +' xmlns:a="http://www.w3.org/2000/10/annotation-ns#"' - +' xmlns:d="http://purl.org/dc/elements/1.0/">' - - +' <RDF:Description rdf:about="'+completeURN+'">' - +' <echo:template>text_digilib</echo:template>' - +' <echo:type rdf:resource="' + ECHO + 'complex"/>' //echo -> RDF - +' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>' - +' <echo:annotation>' - +' <RDF:Description>' - +' <!-- Annotations Type -->' - +' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>' - +' <echo:type rdf:resource="' + ECHO + 'Digilib"/>' //echo -> RDF - +' <!-- Echo Digilib Parameters -->' - +' <echo:fn>histbot/botany</echo:fn>' - +' <echo:pn>1</echo:pn>' - +' <echo:ws>1.0</echo:ws>' - +' <echo:text_mark echo:mk="0.6021/0.8411">' - +' <RDF:Description>' - +' <!-- Annotations Type -->' - +' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation" />' - +' <echo:type rdf:resource="' + ECHO + 'Text" />'//echo -> RDF - +' <!-- Alcatraz Text -->' - +' <echo:txt>Mark 1 shows the root of the Anthoxanthum odoratum <br /> there is a lot of textand textt and text and text and text</echo:txt>' - +' <!-- Dublin Core -->' - +' <d:title>Text Annotation of Mark1</d:title>' - +' <d:creator>erwin.mueller@philo.unibe.ch</d:creator>' - +' <d:date>2003-07-11T19:13:52+01:00</d:date>' - +' <!-- WWW.W3.org Annotations -->' - +' <a:created>2003-07-11T19:13:16+01:00</a:created>' - +' </RDF:Description>' - +' </echo:text_mark>' - +' <echo:wx>0.2626</echo:wx>' - +' <echo:wy>0.8123</echo:wy>' - +' <echo:ww>0.4747</echo:ww>' - +' <echo:wh>0.1484</echo:wh>' - +' <echo:pt>249</echo:pt>' - +' <echo:lv>1</echo:lv>' - +' <!-- Dublin Core -->' - +' <d:title>Ruchgras</d:title>' - +' <d:creator>daniel.engler@philo.unibe.ch</d:creator>' - +' <d:date>2003-05-11T16:42:52+01:00</d:date>' - +' <!-- WWW.W3.org Annotations -->' - +' <a:created>2003-05-11T16:34:16+01:00</a:created>' - +' </RDF:Description>' - +' </echo:annotation>' // rdf:resource="echo00765"/>' - +' <d:title>Complex Annotation Digilib and Text</d:title>' - +' <d:creator>karl.gerber@germ.unibe.ch</d:creator>' - +' <d:date>2003-01-13T19:13:52+01:00</d:date>' - +' <!-- WWW.W3.org Annotations -->' - +' <a:created>2003-01-13T19:13:16+01:00</a:created>' - +' </RDF:Description>' - +'</RDF:RDF>'; - ds = new RDFDataSource(); - ds.parseFromString(rdf,"http://echo.unibe.ch/digilib/rdf/digilib.rdf"); - //alert('Beispiel einer komplexen Annotation:\n\n'+ds.serializeToString()); -***************************************************************/ - } -} - -/** - * Saves the open echo-site in the annotation.rdf-file without asking. - * @todo The <code>about</code> has to be modified if the URN's are changing! - */ -function quickSave() { - var about=''; - try { - var identify; - try { - identify = (typeof(window.content.identify()) != 'undefined') - ? window.content.identify() : false; - } catch(e) { - identify = false; - } - about = window.content.getParameter('fn'); - about += '|' + window.content.getParameter('pn') + '|'; - } catch (e){ - about = ''; - } - if (about != ''){ - //alert('Creator: '+this.creator); - while(this.creator == 'unknown' || this.creator == '') { - this.creator = window.prompt("Please enter a username:",this.creator); - } - this.setProfile(); - - //URN isn't complete yet! - var urn = BEGIN_OF_URI + ':' + about; - //alert('Documentpath: '+documentpath); - - dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf'); - - this.createComplexRDFEntry(urn); - dataSource.save(); - refreshTree(); - - } else{ - alert("Error: no alcatraz component. can't create an annotation."); - } -} - -/** @todo Allow the users to save their RDF-Files anywhere. -function saveAs(){ - - // get Digilib-Parameter form Browser - //alert(window.content.location.href); - - var documentpath=''; - try{ - documentpath=window.content.getParameter('fn'); - documentpath=documentpath.replace(':',';'); - }catch (e){ - documentpath=''; - } - if (documentpath != ''){ - //documentpath=documentpath.replace(slash,':'); - //alert(documentpath); - var docPath = BEGIN_OF_URI + ':' + documentpath; - - var t=document.getElementById("file_tree"); - dataSource = new RDFDataSource(); - this.createComplexRDFEntry(docPath); - - //dataSource.save(); - //refreshTree(); - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(window, "Select a File", nsIFilePicker.modeSave); - - // set default direcotry - var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - directory=makePathCompatible(directory); - aLocalFile.initWithPath(directory); - fp.displayDirectory=aLocalFile; - - fp.appendFilter("Annotations","*.rdf; *.RDF"); - var res=fp.show(); - if (res==nsIFilePicker.returnOK){ - var thefile=fp.file; - // --- do something with the file here --- - //alert(fp.file); - //alert(fp.fileURL.path); - - var strFilePath=fp.file.path; - strFilePath=strFilePath.toLowerCase(); - if (strFilePath.indexOf('.rdf')<0){ - strFilePath=fp.fileURL.path+".rdf"; - }else{ - strFilePath=fp.fileURL.path; - } - strFilePath=makePathCompatible(strFilePath); - var f=new File(strFilePath); - //var boolFileExists=f.exists(); - //alert(boolFileExists); - f.create(); - f.open('w'); - f.write(dataSource.serializeToString()); - f.close(); - refreshTree(); - } - - } else{ - alert("Error: no alcatraz component. can't create an annotation."); - } -} -//*/ - -function file_local(){ - // noch nicht programmiert -} - -function file_annotaDB(){ - alert("At the moment it is not possible to use the annota DB! This feature is not yet programmed."); - var menu_item=document.getElementById('local'); - menu_item.setAttribute('checked','true'); -} - -function tree_click(){ - var rdfFile = this.getURIOfSelectedNode(); - if (rdfFile!=''){ - //alert('New identifier: '+ rdfFile); - this.send_annotation(rdfFile); - } -} - - -/*** -* Diese Funktion wird gebraucht um im Dialog den Pfad zu digilib zu setzen -* -***/ -function setDigilibPath(digilibPathValue){ - digilib_path=digilibPathValue; -} - -/*** -* Dialog tools momentan kann man nur den Pfad zu digilib setzen -* -***/ -function show_dialog(dialog){ - if (dialog=="tool path"){ - window.openDialog("tools_dialog.xul","funny dialog", - "chrome",digilib_path,setDigilibPath); - } - if (dialog == 'creator') { - var creatorName = window.prompt('Enter the name of the creator of the annotations:' - ,this.creator); - if(creatorName != '') { - this.creator = creatorName; - } - } -} - - -/*** -* Gibt den Inhalt eines Files als String zurueck -* -***/ -function readFile(fileName){ - var file = new File(fileName); - var string = ''; - if (file.isFile()){ - file.open(); - string=file.read(); - file.close(); - } - return string; -} - -/** - * @todo digilib.jsp sollte hier nicht auf die urn schauen, sondern auf den fn parameter! - */ -function getContentOfRdfDescription(id) { - dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf'); - var inMemoryDataSource = new RDFDataSource(); - var node = dataSource.getNode(id); - var properties = node.getProperties(); - var urn = this.getAttributeOfSelectedNode('url'); - urn = urn.replace(/^file:\/\//,""); - urn = this.makePathCompatible(urn); - var inMemoryNode = inMemoryDataSource.getNode(this.BEGIN_OF_URI+':'+urn); - while(properties.hasMoreElements()) { - var property = properties.getNext(); - var target = node.getTarget(property); - inMemoryNode.addTarget(property,target); - } - return inMemoryDataSource.serializeToString(); -} - -/** - * @todo check if it is platform independant - */ -function send_annotation(rdfFilePath){ - //digilib_path = 'http://pythia2.unibe.ch:8080/docuserver/digitallibrary'; - strRdfFile = this.getContentOfRdfDescription(rdfFilePath); - //alert(strRdfFile); - if (strRdfFile!=''){ - var formid = 'mainform'; - var form = this.createForm(formid, digilib_path+"/digilib.jsp", "post", "_content"); - this.setFormData(form, formid, strRdfFile); - form.submit(); - } -} - -function createForm(formid, action, method, target) { - var form = document.getElementById(formid); - if(form != null) - document.documentElement.removeChild(form); - - var form = document.createElementNS("http://www.w3.org/1999/xhtml", "form"); - form.setAttribute("id", formid); - form.setAttribute("action", action); - form.setAttribute("method", method); - form.setAttribute("target", target); - document.documentElement.appendChild(form); - return form; -} - -function setFormData(form, formid, rdf) { - var val1 = document.createElementNS("http://www.w3.org/1999/xhtml", "input"); - val1.setAttribute('type', 'hidden'); - val1.setAttribute('name', 'rdf'); - val1.setAttribute('value', rdf); - form.appendChild(val1); -} - - -function getProfileDirectory(){ - // First get the directory service and query interface it to - // nsIProperties - var dirService = Components. - classes['@mozilla.org/file/directory_service;1']. - getService(Components.interfaces.nsIProperties); - - // Next get the "ProfD" property of type nsIFile from the directory - // service, FYI this constant is defined in - // mozilla/xpcom/io/nsAppDirectoryServiceDefs.h - - const NS_APP_USER_PROFILE_50_DIR = "ProfD"; - profileDir = dirService.get(NS_APP_USER_PROFILE_50_DIR, - Components.interfaces.nsIFile); - - // Now that we have it we can show it's path. See nsIFile for the - // other things you that can be done with profileDir - //alert(profileDir.path); - return profileDir.path; -} - -function getProfile(){ - var strProfile=readFile(getProfileDirectory()+slash+"annota.dat"); - if (strProfile==""){ - directory=slash; - digilib_path="http://hera.unibe.ch:8080/alcatraz"; - creator = 'unknown' - setProfile(); - } else { - var params=strProfile.split("\n"); - for (var i=0;i<params.length;i++){ - var key_value=params[i].split("|"); - if (key_value[0]=='directory'){ - directory=key_value[1]; - } - if (key_value[0]=='tool path'){ - digilib_path=key_value[1]; - } - if(key_value[0] == 'creator') { - creator = key_value[1]; - } - } - } -} - -/** - * @todo Menuentry where the user can set the creator name. - */ -function setProfile(){ - var file = new File(getProfileDirectory()+slash+'annota.dat'); - file.create(); - file.open('w'); - file.write('directory|'+directory+'\n' - +'tool path|'+digilib_path+'\n' - +'creator|'+this.creator+'\n'); - file.close(); -} - -function getAnnotations() { - var annotations = this.readFile(this.getProfileDirectory()+slash+'annotations.rdf'); - if(annotations=='') { - this.setAnnotations(); - } -} - -function setAnnotations() { - var file = new File(this.getProfileDirectory()+slash+'annotations.rdf'); - //alert(this.getProfileDirectory()+slash+'annotations.rdf'); - file.create(); - file.open('w'); - file.write('<?xml version="1.0"?>\n' - +'<RDF:RDF xmlns:ECHO="' + ECHO + '"\n' - +' xmlns:ANNOTATION=\"http://www.w3.org/2000/10/annotation-ns#"' - +' xmlns:DC=\"http://purl.org/dc/elements/1.0/"' - +' xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#">' - +'</RDF:RDF>\n'); - file.close(); -} - -function traverse(node){ - if (node.hasChildNodes){ - var arr_nodes=node.childNodes; - for (var i=0;i<arr_nodes.length;i++){ - if (arr_nodes[i].getAttribute("open")){ - //alert(arr_nodes[i].getAttribute("open")); - if (arr_nodes[i].hasChildNodes && arr_nodes[i].firstChild.hasChildNodes){ - alert(arr_nodes[i].firstChild.firstChild.getAttribute("label")); - } - } - traverse(arr_nodes[i]); - } - } -} - -function traverseTree(){ - var t=document.getElementById("file_tree"); - traverse(t); -}
--- a/xul/content/annota.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns:html="http://www.w3.org/1999/xhtml" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - onload="setTreeDirectory()"> - -<script type="application/x-javascript" src="chrome://jslib/content/jslib.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/alcatraz.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/annota.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/rdfds.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/RDFTree.js" /> - - -<!-- ANNOTA --> - <tabpanel id="annota_tab" orient="vertical"> - <vbox flex="1" > - <hbox> - <toolbarbutton id="annota_file" type="menu" label="File"> - <menupopup id="file_popup"> - <menuitem label="Save" onclick="quickSave()"/> - <menuitem label="Delete" oncommand="deleteAnnotation()"/> - <!-- <menuitem label="Save as..." onclick="saveAs()" /> --> - </menupopup> - </toolbarbutton> - <toolbarbutton id="annota_options" type="menu" label="Options"> - <menupopup id="options_popup"> - <menuitem id="local" label="Local" type="radio" name="location" checked="true" onclick="file_local()" /> - <menuitem id="annotaDB" label="Annota DB" type="radio" name="location" onclick="file_annotaDB()" /> - <menuseparator/> - <menuitem id="tool_path" label="Tool URL" onclick="show_dialog('tool path')" /> - <menuitem id="annotations_path" label="Path to annotations" onclick="file_open()" /> - <menuitem id="creator_name" label="Name of creator" onclick="show_dialog('creator')" /> - <menuseparator/> - <menuitem id="save_options" label="Save Options" onclick="setProfile()" /> - </menupopup> - </toolbarbutton> - <toolbarbutton id="annota_annotation" type="menu" label="Annotation"> - <menupopup id="text_popup"> - <menuitem label="Text Annotation" onclick="dialog_annotate();" /> - </menupopup> - </toolbarbutton> - </hbox> - - <tree id="annotation_tree" flex="1" datasources="rdf:null" ref="urn:echo" ondblclick="tree_click()" - height="300" width="100" flags="dont-build-content"> - - <treecols id="cols"> - <treecol id="name" label="Name" primary="true" flex="10" - class="sortDirectionIndicator" sortActive="true" - sortDirection="ascending" - sort="rdf:http://purl.org/dc/elements/1.0/title"/> - <splitter/> - <treecol id="pagenumber" label="Page" flex="1" - class="sortDirectionIndicator" - sort="rdf:http://echo.unibe.ch/digilib/rdf#pn"/> - <treecol id="url" label="URL" hidden="true" flex="5" - class="sortDirectionIndicator" - sort="rdf:http://echo.unibe.ch/digilib/rdf#fn"/> - <treecol id="created" label="Created" hidden="true" flex="5" - class="sortDirectionIndicator" - sort="rdf:http://www.w3.org/2000/10/annotation-ns#created"/> - </treecols> - - <template> - <rule> - <treechildren> - <treeitem uri="rdf:*"> - <treerow> - <treecell id="nameHeader" label="rdf:http://purl.org/dc/elements/1.0/title"/> - <treecell id="pagenumberHeader" label="rdf:http://echo.unibe.ch/digilib/rdf#pn"/> - <treecell id="urlHeader" label="rdf:http://echo.unibe.ch/digilib/rdf#fn"/> - <treecell id="createdHeader" label="rdf:http://www.w3.org/2000/10/annotation-ns#created"/> - </treerow> - </treeitem> - </treechildren> - </rule> - </template> - </tree> - </vbox> - </tabpanel> -</window>
--- a/xul/content/annota_ohne_annota.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,319 +0,0 @@ -include ('chrome://jslib/content/io/dir.js'); -include ('chrome://jslib/content/io/file.js'); -include ('chrome://jslib/content/io/rdfBase.js'); -include ('chrome://jslib/content/io/rdfResource.js'); -include ('chrome://jslib/content/io/rdfContainer.js'); -include ('chrome://jslib/content/io/rdf.js'); -include ('chrome://jslib/content/io/rdfFile.js'); -include ('chrome://jslib/content/io/fileUtils.js'); - -var slash='/'; -if (navigator.platform=="Win32"){ - slash='\\'; -} - -var directory=slash; -var digilib_path=slash; - -getProfile(); - -function makePathCompatible(path){ - if (navigator.platform=="Win32"){ - // slash durch backslash ersetzten - path=path.replace(/\//g,"\\"); - // nur 2 backslashs am anfang - path=path.replace(/^\\{3}/,"\\\\"); - // vor Laufwerkbuchstaben kein Backslash - if (path.indexOf(":")>0){ - path=path.replace(/^\\/g,""); - } - // nur ein Slash gibt Absturz - path=path.replace(/^\\$/,"c:\\"); - //alert(path); - } - return path; -} - -function file_open(){ - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(window, "Select a Directory", nsIFilePicker.modeGetFolder); - - // set default direcotry - var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - directory=makePathCompatible(directory); - aLocalFile.initWithPath(directory); - fp.displayDirectory=aLocalFile; - - var res=fp.show(); - if (res==nsIFilePicker.returnOK){ - directory=fp.fileURL.path; - directory=makePathCompatible(directory); - setTreeDirectory(); - } -} - -function setTreeDirectory(){ - var t=document.getElementById("file_tree"); - t.setAttribute("ref","file://"+directory); -} - -function refreshTree(){ - var t=document.getElementById("file_tree"); - t.builder.rebuild(); -} - -function file_save(){ - - // get Digilib-Parameter form Browser - // alert(window.content.location.href); - - var documentpath=''; - try{ - documentpath=window.content.getParameter('fn'); - }catch (e){ - documentpath=''; - } - if (documentpath != ''){ - var docPath='urn:echo:'+documentpath; - - var rdfString='<?xml version="1.0"?>' + - '<RDF:RDF xmlns:NS1="http://echo.unibe.ch/digilib/rdf#"' + - ' xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"' + - ' xmlns:d="http://purl.org/dc/elements/1.0/"' + - ' xmlns:a="http://www.w3.org/2000/10/annotation-ns#">' + - ' <RDF:Seq RDF:about="urn:echo">' + - ' <RDF:li RDF:resource="'+docPath+'"/>' + - ' </RDF:Seq>' + - ' <RDF:Description RDF:about="'+docPath+'" NS1:page=0"/>'+ - '</RDF:RDF>'; - - var ds=new RDFDataSource(); - ds.parseFromString(rdfString,"http://echo.unibe.ch/digilib/rdf/digilib.rdf"); - var node=ds.getNode(docPath); - var arrayParams=window.content.listParameters(); - for (i=0; i< arrayParams.length; i++){ - var value=window.content.getParameter(arrayParams[i]); - //alert(arrayParams[i]+":"+value); - node.addTarget("http://echo.unibe.ch/digilib/rdf#"+arrayParams[i],value); - } - node.addTarget("http://echo.unibe.ch/digilib/rdf#lv","1"); - //alert(ds.serializeToString()); - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(window, "Select a File", nsIFilePicker.modeSave); - - // set default direcotry - var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - directory=makePathCompatible(directory); - aLocalFile.initWithPath(directory); - fp.displayDirectory=aLocalFile; - - fp.appendFilter("Annotations","*.rdf; *.RDF"); - var res=fp.show(); - if (res==nsIFilePicker.returnOK){ - var thefile=fp.file; - // --- do something with the file here --- - //alert(fp.file); - //alert(fp.fileURL.path); - - var strFilePath=fp.file.path; - strFilePath=strFilePath.toLowerCase(); - if (strFilePath.indexOf('.rdf')<0){ - strFilePath=fp.fileURL.path+".rdf"; - }else{ - strFilePath=fp.fileURL.path; - } - strFilePath=makePathCompatible(strFilePath); - var f=new File(strFilePath); - //var boolFileExists=f.exists(); - //alert(boolFileExists); - f.create(); - f.open('w'); - f.write(ds.serializeToString()); - f.close(); - refreshTree(); - } - }else{ - alert("Error: no alcatraz component. can't create an annotation."); - } -} - -function file_local(){ - // noch nicht programmiert -} - -function file_annotaDB(){ - alert("At the moment it is not possible to use the annota DB! This feature is not yet programmed."); - var menu_item=document.getElementById('local'); - menu_item.setAttribute('checked','true'); -} - -function tree_click(){ - var t=document.getElementById("file_tree"); //tree element - var l=t.view.getItemAtIndex(t.currentIndex); //aus baum treeitem herausholen mit dem selected index (currentIndex) - //l.firstChild ist treeitem - var d=l.firstChild.firstChild; //treecell - var firstLabel=d.getAttribute("label"); - var cols=document.getElementById("cols"); - var col=cols.childNodes; - var nodes=l.firstChild.childNodes; - var rdf_file=""; - for (var i=0;i<nodes.length;i++){ - if (col[i].getAttribute("label")=="URL"){ - rdf_file=nodes[i].getAttribute("label"); - } - } - if (rdf_file!=""){ - send_annotation(rdf_file); - } - return rdf_file; -} - - -/*** -* Diese Funktion wird gebraucht um im Dialog den Pfad zu digilib zu setzen -* -***/ -function setDigilibPath(digilibPathValue){ - digilib_path=digilibPathValue; -} - -/*** -* Dialog tools momentan kann man nur den Pfad zu digilib setzen -* -***/ -function show_dialog(dialog){ - if (dialog=="tool path"){ - window.openDialog("tools_dialog.xul","funny dialog", - "chrome",digilib_path,setDigilibPath); - } -} - - -/*** -* Gibt den Inhalt eines Files als String zurueck -* -***/ -function readFile(str_Filename){ - var f=new File(str_Filename); - var str=""; - if (f.isFile()){ - f.open(); - str=f.read(); - f.close(); - } - return str; -} - - - -function send_annotation(rdf_file){ - rdf_file=rdf_file.replace(/^file:\/\//,""); - rdf_file=makePathCompatible(rdf_file); - strRdfFile=readFile(rdf_file); - if (strRdfFile!=""){ - var formid='mainform'; - var form = createForm(formid, digilib_path+"/digilib.jsp", "post", "_content"); - //var form = createForm(formid, "http://sophia.unibe.ch:8080/examples/servlet/RequestRDF", "post", "_content"); - //var form = createForm(formid, "http://hera.unibe.ch:8080/examples/servlet/RequestRDF", "post", "_content"); - setFormData(form, formid, strRdfFile); - form.submit(); - } -} - -function createForm(formid, action, method, target) -{ - var form = document.getElementById(formid); - if(form != null) - document.documentElement.removeChild(form); - - var form = document.createElementNS("http://www.w3.org/1999/xhtml", "form"); - form.setAttribute("id", formid); - form.setAttribute("action", action); - form.setAttribute("method", method); - form.setAttribute("target", target); - document.documentElement.appendChild(form); - return form; -} - -function setFormData(form, formid, rdf) -{ - var val1 = document.createElementNS("http://www.w3.org/1999/xhtml", "input"); - val1.setAttribute('type', 'hidden'); - val1.setAttribute('name', 'rdf'); - val1.setAttribute('value', rdf); - form.appendChild(val1); -} - - -function getProfileDirectory(){ - // First get the directory service and query interface it to - // nsIProperties - var dirService = Components. - classes['@mozilla.org/file/directory_service;1']. - getService(Components.interfaces.nsIProperties); - - // Next get the "ProfD" property of type nsIFile from the directory - // service, FYI this constant is defined in - // mozilla/xpcom/io/nsAppDirectoryServiceDefs.h - - const NS_APP_USER_PROFILE_50_DIR = "ProfD"; - profileDir = dirService.get(NS_APP_USER_PROFILE_50_DIR, - Components.interfaces.nsIFile); - - // Now that we have it we can show it's path. See nsIFile for the - // other things you that can be done with profileDir - //alert(profileDir.path); - return profileDir.path; -} - -function getProfile(){ - var strProfile=readFile(getProfileDirectory()+slash+"annota.dat"); - if (strProfile==""){ - directory=slash; - digilib_path="http://hera.unibe.ch:8080/alcatraz"; - setProfile(); - }else{ - var params=strProfile.split("\n"); - for (var i=0;i<params.length;i++){ - var key_value=params[i].split("|"); - if (key_value[0]=='directory'){ - directory=key_value[1]; - } - if (key_value[0]=='tool path'){ - digilib_path=key_value[1]; - } - } - } -} - -function setProfile(){ - var f=new File(getProfileDirectory()+slash+'annota.dat'); - f.create(); - f.open('w'); - f.write('directory|'+directory+'\n'+'tool path|'+digilib_path+'\n'); - f.close(); -} - -function traverse(node){ - if (node.hasChildNodes){ - var arr_nodes=node.childNodes; - for (var i=0;i<arr_nodes.length;i++){ - if (arr_nodes[i].getAttribute("open")){ - //alert(arr_nodes[i].getAttribute("open")); - if (arr_nodes[i].hasChildNodes && arr_nodes[i].firstChild.hasChildNodes){ - alert(arr_nodes[i].firstChild.firstChild.getAttribute("label")); - } - } - traverse(arr_nodes[i]); - } - } -} - -function traverseTree(){ - var t=document.getElementById("file_tree"); - traverse(t); -}
--- a/xul/content/astrosearch.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -var key=''; - -function start_search(){ - var target_iframe=document.getElementById('astro_resultframe'); - var boolIsManuscript=document.getElementById("manuscript").selected==true; - var strDocType="image"; - if (boolIsManuscript){ - strDocType="manuscript"; - } - var strLibrary=document.getElementById("bibliothek").label; - var strCentury=document.getElementById("century").label; - var strAuthor=document.getElementById('autorenkontext').label; - var strImageType=document.getElementById('bildtyp').label; - - //target_iframe.setAttribute('src','astro_search.jsp?key='+key+'&cat='+search_category+'&str='+search_string); - //target_iframe.setAttribute('src','result.htm'); - target_iframe.setAttribute('src','http://hera.unibe.ch:8080/alcatraz/xul/astro_search.jsp?doctype='+strDocType+'&lib='+strLibrary+'&aut='+strAuthor+'¢='+strCentury+'&type='+strImageType); -} - - -function changeRadioGroup(sel){ - key=sel.id; - if (key=="image"){ - document.getElementById("bildtyp").disabled=false; - document.getElementById("lblbildtyp").disabled=false; - document.getElementById("bildtyp").label="all"; - }else{ - document.getElementById("bildtyp").disabled=true; - document.getElementById("lblbildtyp").disabled=true; - document.getElementById("bildtyp").label=""; - } -}
--- a/xul/content/astrosearch.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -<?xml version="1.0"?> - -<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> - -<window - flex="1" - xmlns:html="http://www.w3.org/1999/xhtml" - xmlns= "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > - -<script language="JavaScript" src="astrosearch.js" /> - -<vbox flex="1"> - <radiogroup orient="horizontal" onclick="changeRadioGroup(event.target);" > - <radio id="manuscript" selected="true" label="Manuscript"/> - <radio id="image" label="Diagram"/> - </radiogroup> - - <html:b><label value="Library:" flex="1" /></html:b> - <menulist id="bibliothek" label="" type="menu" - datasources="http://hera.unibe.ch:8080/alcatraz/xul/astrowerkRDF.jsp" ref="urn:echonavigation:data" flex="1" editable="true"> - <template> - - <rule> - <menupopup id="menupop1" > - <menuitem label="all" selected="true" /> - <menuitem uri="rdf:*" label="rdf:http://www.echo.eu/rdf#name" /> - </menupopup> - </rule> - </template> - - </menulist> - - <html:b><label value="Century:" flex="1" /></html:b> - <menulist id="century" label="" flex="1" editable="true"> - <menupopup > - <menuitem label="all" selected="true" /> - <menuitem label="IX" /> - <menuitem label="X"/> - <menuitem label="XI" /> - <menuitem label="XII"/> - <menuitem label="XIII"/> - <menuitem label="XIV"/> - <menuitem label="XV"/> - </menupopup> - </menulist> - - <html:b><label value="Context Author:" flex="1" /></html:b> - <menulist id="autorenkontext" label="" type="menu" - datasources="http://hera.unibe.ch:8080/alcatraz/xul/astroautorenRDF.jsp" ref="urn:echonavigation:data" flex="1" editable="true"> - <template> - <rule> - <menupopup id="menupop1" > - <menuitem label="all" selected="true" /> - <menuitem uri="rdf:*" label="rdf:http://www.echo.eu/rdf#name" /> - </menupopup> - </rule> - </template> - </menulist> - - <html:b><label id="lblbildtyp" value="Type of Image:" flex="1" disabled="true" /></html:b> - <menulist id="bildtyp" label=" " type="menu" - datasources="http://hera.unibe.ch:8080/alcatraz/xul/astroartRDF.jsp" ref="urn:echonavigation:data" flex="1" editable="true" disabled="true"> - <template> - <rule> - <menupopup id="menupop1" > - <menuitem label="all" selected="true" /> - <menuitem uri="rdf:*" label="rdf:http://www.echo.eu/rdf#name" /> - </menupopup> - </rule> - </template> - </menulist> - <button id="start_search" label="Search" onclick="start_search()" flex="1" /> -</vbox> - <splitter id="navigio_splitter" state="opened" collapse="before" resizeafter="nearest"> - <grippy/> - </splitter> - <iframe id="astro_resultframe" src="blank.html" flex="1" /> -</window>
--- a/xul/content/blank.html Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -<html> - <head> - </head> - <body> - </body> -</html>
--- a/xul/content/contents.rdf Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -<?xml version="1.0"?> - -<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> - - <RDF:Description about="urn:mozilla:package:alcatraz" - chrome:displayName="alcatraz tool" - chrome:author="Daniel Engler:Christian Luginbuehl" - chrome:name="alcatraz"> - </RDF:Description> - - <RDF:Seq about="urn:mozilla:package:root"> - <RDF:li resource="urn:mozilla:package:alcatraz" /> - </RDF:Seq> - - <RDF:Seq about="urn:mozilla:overlays"> - <RDF:li resource="chrome://navigator/content/navigator.xul" /> - <RDF:li resource="chrome://browser/content/browser.xul" /> - </RDF:Seq> - - <RDF:Seq about="chrome://navigator/content/navigator.xul"> - <RDF:li>chrome://alcatraz/content/alcatraz_toolbar.xul</RDF:li> - </RDF:Seq> - - <RDF:Seq about="chrome://browser/content/browser.xul"> - <RDF:li>chrome://alcatraz/content/alcatraz_toolbar.xul</RDF:li> - </RDF:Seq> - -</RDF:RDF>
--- a/xul/content/dialog_annotate.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -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.4 -Author: Beat Halter, 18.03.2004, Version Alcatraz ... -*/ - -function accept() { - var text = document.getElementById('annotation_value').value; - addTextAnnotation(text); - //opener.content.annotation(text); - return true; - -} - - -function cancel() { - - // 'true' says closing the window - return true; - -}
--- a/xul/content/dialog_annotate.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialogs.css" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="DIGILIB annotate" - buttons="accept,cancel" - ondialogaccept="return accept();" - ondialogcancel="return cancel();" - onload="window.sizeToContent(); window.focus();"> - - <script src="chrome://alcatraz/content/dialog_annotate.js" /> - - <groupbox> - <caption label="DIGILIB annotate" /> - <description id="dialog_desc">Annotate the picture with its current parameters :</description> - <spacer style="height: 10px" /> - <hbox> - <textbox id="annotation_value" size="2000" multiline="true" rows="8" cols="72" onclick="this.select();" /> - <spacer flex="1" /> - </hbox> - - </groupbox> - -</dialog>
--- a/xul/content/dialog_brightnesscontrast.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -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 markCurrentBrightnessContrast() { - - var brightness = opener.content.getParameter('brgt'); - - var items = document.getElementById('brightness_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(brightness) ) { - document.getElementById('brightness_list').selectedItem = items[i]; - } - - } - - - var contrast = opener.content.getParameter('cont'); - - items = document.getElementById('contrast_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(contrast) ) { - document.getElementById('contrast_list').selectedItem = items[i]; - } - } - -} - - -function change() { - - var brightness = 0.0; - var contrast = 0.0; - - var old_brightness = opener.content.getParameter('brgt'); - var old_contrast = opener.content.getParameter('cont'); - - var items = document.getElementById('brightness_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - brightness = items[i].getAttribute('value'); - } - } - - items = document.getElementById('contrast_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - contrast = items[i].getAttribute('value'); - } - } - - if ( (brightness != old_brightness) || (contrast != old_contrast) ) { - opener.content.brightnessContrast(brightness, contrast); - } - -} - - -function close_dialog() { - - close(); - -}
--- a/xul/content/dialog_brightnesscontrast.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialogs.css" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="DIGILIB brightness/contrast" - onload="markCurrentBrightnessContrast(); window.sizeToContent(); window.focus();"> - - <script src="chrome://alcatraz/content/dialog_brightnesscontrast.js" /> - - <groupbox> - <caption label="DIGILIB brightness/contrast" /> - <description>Choose the brightness/contrast :</description> - <spacer style="height: 10px" /> - <groupbox> - <caption label="Brightness" /> - <menulist id="brightness_list"> - <menupopup id="brightness_popup"> - <menuitem value="255" label="+9" /> - <menuitem value="240" label="+8" /> - <menuitem value="210" label="+7" /> - <menuitem value="180" label="+6" /> - <menuitem value="150" label="+5" /> - <menuitem value="120" label="+4" /> - <menuitem value="90" label="+3" /> - <menuitem value="60" label="+2" /> - <menuitem value="30" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-30" label="-1" /> - <menuitem value="-60" label="-2" /> - <menuitem value="-90" label="-3" /> - <menuitem value="-120" label="-4" /> - <menuitem value="-150" label="-5" /> - <menuitem value="-180" label="-6" /> - <menuitem value="-210" label="-7" /> - <menuitem value="-240" label="-8" /> - <menuitem value="-255" label="-9" /> - </menupopup> - </menulist> - </groupbox> - <groupbox> - <caption label="Contrast" /> - <menulist id="contrast_list"> - <menupopup id="contrast_popup"> - <menuitem value="1.7" label="+9" /> - <menuitem value="1.3" label="+8" /> - <menuitem value="1.0" label="+7" /> - <menuitem value="0.7" label="+6" /> - <menuitem value="0.5" label="+5" /> - <menuitem value="0.3" label="+4" /> - <menuitem value="0.2" label="+3" /> - <menuitem value="0.1" label="+2" /> - <menuitem value="0.05" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-0.05" label="-1" /> - <menuitem value="-0.1" label="-2" /> - <menuitem value="-0.2" label="-3" /> - <menuitem value="-0.3" label="-4" /> - <menuitem value="-0.5" label="-5" /> - <menuitem value="-0.7" label="-6" /> - <menuitem value="-1.0" label="-7" /> - <menuitem value="-1.3" label="-8" /> - <menuitem value="-1.7" label="-9" /> - </menupopup> - </menulist> - </groupbox> - - <hbox flex="1" pack="end"> - <button label="Change" oncommand="change();" /> - <button label="Close" oncommand="close_dialog();" /> - </hbox> - </groupbox> - -</window>
--- a/xul/content/dialog_colors.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -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 markCurrentColors() { - - var add = opener.content.getParameter('rgba'); - var mult = opener.content.getParameter('rgbm'); - - if ( add == '' ) { - add = "0/0/0"; - } - - if ( mult == '' ) { - mult = "0/0/0"; - } - - add = add.split("/"); - mult = mult.split("/"); - - var items = document.getElementById('add_red_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(add[0]) ) { - document.getElementById('add_red_list').selectedItem = items[i]; - } - } - - items = document.getElementById('add_green_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(add[1]) ) { - document.getElementById('add_green_list').selectedItem = items[i]; - } - } - - items = document.getElementById('add_blue_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(add[2]) ) { - document.getElementById('add_blue_list').selectedItem = items[i]; - } - } - - items = document.getElementById('mult_red_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(mult[0]) ) { - document.getElementById('mult_red_list').selectedItem = items[i]; - } - } - - items = document.getElementById('mult_green_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(mult[1]) ) { - document.getElementById('mult_green_list').selectedItem = items[i]; - } - } - - items = document.getElementById('mult_blue_popup').childNodes; - - for ( i = 0; i < items.length; i++ ) { - if ( parseFloat(items[i].getAttribute('value')) == parseFloat(mult[2]) ) { - document.getElementById('mult_blue_list').selectedItem = items[i]; - } - } - - -} - - -function change() { - - var old_add = opener.content.getParameter('rgba'); - var old_mult = opener.content.getParameter('rgbm'); - - var add = new Array(); - var mult = new Array(); - - if ( old_add == '' ) { - old_add = "0/0/0"; - } - - if ( old_mult == '' ) { - old_mult = "0/0/0"; - } - - - var items = document.getElementById('add_red_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - add[0] = items[i].getAttribute('value'); - } - } - - items = document.getElementById('add_green_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - add[1] = items[i].getAttribute('value'); - } - } - - items = document.getElementById('add_blue_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - add[2] = items[i].getAttribute('value'); - } - } - - add = add.join("/"); - - items = document.getElementById('mult_red_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - mult[0] = items[i].getAttribute('value'); - } - } - - items = document.getElementById('mult_green_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - mult[1] = items[i].getAttribute('value'); - } - } - - items = document.getElementById('mult_blue_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - mult[2] = items[i].getAttribute('value'); - } - } - - mult = mult.join("/"); - - if ( (add != old_add) || (mult != old_mult) ) { - opener.content.colors(add, mult); - } -} - - -function close_dialog() { - - window.close(); - -}
--- a/xul/content/dialog_colors.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialogs.css" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="DIGILIB colors" - onload="markCurrentColors(); window.sizeToContent(); window.focus();"> - - <script src="chrome://alcatraz/content/dialog_colors.js" /> - - <groupbox> - <caption label="DIGILIB colors" /> - <description>Color manipulation :</description> - <spacer style="height: 10px" /> - <groupbox> - <caption label="Additioner" /> - <hbox> - <vbox align="center"> - <description value="Red" /> - <menulist id="add_red_list"> - <menupopup id="add_red_popup"> - <menuitem value="255" label="+9" /> - <menuitem value="240" label="+8" /> - <menuitem value="210" label="+7" /> - <menuitem value="180" label="+6" /> - <menuitem value="150" label="+5" /> - <menuitem value="120" label="+4" /> - <menuitem value="90" label="+3" /> - <menuitem value="60" label="+2" /> - <menuitem value="30" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-30" label="-1" /> - <menuitem value="-60" label="-2" /> - <menuitem value="-90" label="-3" /> - <menuitem value="-120" label="-4" /> - <menuitem value="-150" label="-5" /> - <menuitem value="-180" label="-6" /> - <menuitem value="-210" label="-7" /> - <menuitem value="-240" label="-8" /> - <menuitem value="-255" label="-9" /> - </menupopup> - </menulist> - </vbox> - <vbox align="center"> - <description value="Green" /> - <menulist id="add_green_list"> - <menupopup id="add_green_popup"> - <menuitem value="255" label="+9" /> - <menuitem value="240" label="+8" /> - <menuitem value="210" label="+7" /> - <menuitem value="180" label="+6" /> - <menuitem value="150" label="+5" /> - <menuitem value="120" label="+4" /> - <menuitem value="90" label="+3" /> - <menuitem value="60" label="+2" /> - <menuitem value="30" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-30" label="-1" /> - <menuitem value="-60" label="-2" /> - <menuitem value="-90" label="-3" /> - <menuitem value="-120" label="-4" /> - <menuitem value="-150" label="-5" /> - <menuitem value="-180" label="-6" /> - <menuitem value="-210" label="-7" /> - <menuitem value="-240" label="-8" /> - <menuitem value="-255" label="-9" /> - </menupopup> - </menulist> - </vbox> - <vbox align="center"> - <description value="Blue" /> - <menulist id="add_blue_list"> - <menupopup id="add_blue_popup"> - <menuitem value="255" label="+9" /> - <menuitem value="240" label="+8" /> - <menuitem value="210" label="+7" /> - <menuitem value="180" label="+6" /> - <menuitem value="150" label="+5" /> - <menuitem value="120" label="+4" /> - <menuitem value="90" label="+3" /> - <menuitem value="60" label="+2" /> - <menuitem value="30" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-30" label="-1" /> - <menuitem value="-60" label="-2" /> - <menuitem value="-90" label="-3" /> - <menuitem value="-120" label="-4" /> - <menuitem value="-150" label="-5" /> - <menuitem value="-180" label="-6" /> - <menuitem value="-210" label="-7" /> - <menuitem value="-240" label="-8" /> - <menuitem value="-255" label="-9" /> - </menupopup> - </menulist> - </vbox> - </hbox> - </groupbox> - <groupbox> - <caption label="Multiplier" /> - <hbox> - <vbox align="center"> - <description value="Red" /> - <menulist id="mult_red_list"> - <menupopup id="mult_red_popup"> - <menuitem value="3.0" label="+9" /> - <menuitem value="2.0" label="+8" /> - <menuitem value="1.5" label="+7" /> - <menuitem value="1.0" label="+6" /> - <menuitem value="0.7" label="+5" /> - <menuitem value="0.5" label="+4" /> - <menuitem value="0.3" label="+3" /> - <menuitem value="0.2" label="+2" /> - <menuitem value="0.1" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-0.1" label="-1" /> - <menuitem value="-0.2" label="-2" /> - <menuitem value="-0.3" label="-3" /> - <menuitem value="-0.5" label="-4" /> - <menuitem value="-0.7" label="-5" /> - <menuitem value="-1.0" label="-6" /> - <menuitem value="-1.5" label="-7" /> - <menuitem value="-2.0" label="-8" /> - <menuitem value="-3.0" label="-9" /> - </menupopup> - </menulist> - </vbox> - <vbox align="center"> - <description value="Green" /> - <menulist id="mult_green_list"> - <menupopup id="mult_green_popup"> - <menuitem value="3.0" label="+9" /> - <menuitem value="2.0" label="+8" /> - <menuitem value="1.5" label="+7" /> - <menuitem value="1.0" label="+6" /> - <menuitem value="0.7" label="+5" /> - <menuitem value="0.5" label="+4" /> - <menuitem value="0.3" label="+3" /> - <menuitem value="0.2" label="+2" /> - <menuitem value="0.1" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-0.1" label="-1" /> - <menuitem value="-0.2" label="-2" /> - <menuitem value="-0.3" label="-3" /> - <menuitem value="-0.5" label="-4" /> - <menuitem value="-0.7" label="-5" /> - <menuitem value="-1.0" label="-6" /> - <menuitem value="-1.5" label="-7" /> - <menuitem value="-2.0" label="-8" /> - <menuitem value="-3.0" label="-9" /> - </menupopup> - </menulist> - </vbox> - <vbox align="center"> - <description value="Blue" /> - <menulist id="mult_blue_list"> - <menupopup id="mult_blue_popup"> - <menuitem value="3.0" label="+9" /> - <menuitem value="2.0" label="+8" /> - <menuitem value="1.5" label="+7" /> - <menuitem value="1.0" label="+6" /> - <menuitem value="0.7" label="+5" /> - <menuitem value="0.5" label="+4" /> - <menuitem value="0.3" label="+3" /> - <menuitem value="0.2" label="+2" /> - <menuitem value="0.1" label="+1" /> - <menuitem value="0" label="normal" /> - <menuitem value="-0.1" label="-1" /> - <menuitem value="-0.2" label="-2" /> - <menuitem value="-0.3" label="-3" /> - <menuitem value="-0.5" label="-4" /> - <menuitem value="-0.7" label="-5" /> - <menuitem value="-1.0" label="-6" /> - <menuitem value="-1.5" label="-7" /> - <menuitem value="-2.0" label="-8" /> - <menuitem value="-3.0" label="-9" /> - </menupopup> - </menulist> - </vbox> - </hbox> - </groupbox> - - <hbox flex="1" pack="end"> - <button label="Change" oncommand="change();" /> - <button label="Close" oncommand="close_dialog();" /> - </hbox> - </groupbox> - -</window>
--- a/xul/content/dialog_options.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -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, 23.01.2004 , Version Alcatraz 0.5 -*/ - - -function getCurrentOptions() { - - var keeparea = getSetting('keeparea'); - - if (keeparea != '') { - document.getElementById('keeparea_check').setAttribute('checked', keeparea); - } - - var items = document.getElementById('zoom_popup').childNodes; - var zoomkind = getSetting('zoomkind'); - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('value') == zoomkind ) { - document.getElementById('zoom_menu').selectedItem = items[i]; - } - } - -} - - -function apply() { - - var keeparea = document.getElementById('keeparea_check').getAttribute('checked'); - // beautify - if ( keeparea == '' ) { - keeparea = 'false'; - } - - saveSetting('keeparea', keeparea); - - var zoomkind; - var items = document.getElementById('zoom_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - zoomkind = items[i].getAttribute('value'); - } - } - saveSetting('zoomkind', zoomkind); - - close(); - -} - - -function cancel() { - - close(); - -}
--- a/xul/content/dialog_options.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialogs.css" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="DIGILIB options" - onload="getCurrentOptions(); window.sizeToContent(); window.focus();"> - - <script src="chrome://jslib/content/jslib.js" /> - <script src="chrome://alcatraz/content/settings.js" /> - <script src="chrome://alcatraz/content/dialog_options.js" /> - - <groupbox> - <caption label="DIGILIB options" /> - <description>Change the default behaviour of your sidebar</description> - <spacer style="height: 10px" /> - <groupbox> - <caption label="Zooming" /> - <description>Choose eighter 'zoom area' or 'zoom point' as the behaviour of the - zooming functionality.</description> - <hbox> - <menulist id="zoom_menu"> - <menupopup id="zoom_popup"> - <menuitem label="Zoom area" value="zoomarea" selected="true" /> - <menuitem label="Zoom point" value="zoompoint" /> - </menupopup> - </menulist> - <spacer flex="1" /> - </hbox> - </groupbox> - <groupbox> - <caption label="Keep area" /> - <description>Choose 'keep area' in order to keep the zoomed part when - jumping to another page.</description> - <checkbox id="keeparea_check" value="keeparea" label="Keep area" /> - </groupbox> - - <hbox flex="1" pack="end"> - <button label="Apply" oncommand="apply();" /> - <button label="Cancel" oncommand="cancel();" /> - </hbox> - </groupbox> - -</window>
--- a/xul/content/dialog_originalsize.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -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 -*/ - -var VERTICAL_PIXELS = 500; -var HORIZONTAL_PIXELS = 500; - -function getCurrentOriginalSize() { - - var v_value = getSetting('originalsize_v_value'); - var v_unit = getSetting('originalsize_v_unit'); - var h_value = getSetting('originalsize_h_value'); - var h_unit = getSetting('originalsize_h_unit'); - - document.getElementById('vertical_value').setAttribute('value', v_value); - document.getElementById('horizontal_value').setAttribute('value', h_value); - - var items = document.getElementById('vertical_unit_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('value') == v_unit ) { - document.getElementById('vertical_unit_list').selectedItem = items[i]; - } - } - - items = document.getElementById('horizontal_unit_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('value') == h_unit ) { - document.getElementById('horizontal_unit_list').selectedItem = items[i]; - } - } - -} - - -function apply() { - - var v_value = document.getElementById('vertical_value').value; - var h_value = document.getElementById('horizontal_value').value; - - var v_unit; - var h_unit; - - var items = document.getElementById('vertical_unit_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - v_unit = items[i].getAttribute('value'); - } - } - - items = document.getElementById('vertical_unit_popup').childNodes; - - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - h_unit = items[i].getAttribute('value'); - } - } - - if ( (parseFloat(v_value) == v_value) && - (parseFloat(h_value) == h_value) ) { - - saveSetting('originalsize_v_value', v_value); - saveSetting('originalsize_v_unit', v_unit); - saveSetting('originalsize_h_value', h_value); - saveSetting('originalsize_h_unit', h_unit); - - var dpi_v = (v_unit == "inch") ? VERTICAL_PIXELS / v_value : - (v_unit == "cm") ? VERTICAL_PIXELS / (v_value/2.54) : - v_value; - - var dpi_h = (h_unit == "inch") ? VERTICAL_PIXELS / h_value : - (h_unit == "cm") ? VERTICAL_PIXELS / (h_value/2.54) : - h_value; - - opener.content.originalSize(dpi_v, dpi_h); - - close(); - - } else { - alert("Illegal value(s)!"); - } - -} - - -function cancel() { - - close(); - -}
--- a/xul/content/dialog_originalsize.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialog_originalsize.css" type="text/css" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialogs.css" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="DIGILIB original size" - onload="getCurrentOriginalSize(); window.sizeToContent(); window.focus();"> - - <script src="chrome://jslib/content/jslib.js" /> - <script src="chrome://alcatraz/content/settings.js" /> - <script src="chrome://alcatraz/content/dialog_originalsize.js" /> - - <groupbox> - <caption label="DIGILIB original size" /> - <hbox> - <vbox> - <image id="vertical_bar" /> - </vbox> - <vbox> - <spacer flex="1" /> - <image id="horizontal_bar" /> - <spacer flex="1" /> - </vbox> - </hbox> - <groupbox> - <caption label="Original size" /> - <description>In order to see the images in original size, measure the bars and enter its values.</description> - <hbox> - <vbox> - <spacer width="10px" /> - <hbox align="center"> - <description value="Vertical" /> - <textbox id="vertical_value" size="8" flex="1" /> - <menulist id="vertical_unit_list"> - <menupopup id="vertical_unit_popup"> - <menuitem value="cm" label="cm" /> - <menuitem value="inch" label="inch" /> - <menuitem value="dpi" label="dpi" /> - </menupopup> - </menulist> - </hbox> - </vbox> - <vbox> - <spacer width="10px" /> - <hbox align="center"> - <spacer width="20px" /> - <description value="Horizontal" /> - <textbox id="horizontal_value" size="8" /> - <menulist id="horizontal_unit_list"> - <menupopup id="horizontal_unit_popup"> - <menuitem value="cm" label="cm" /> - <menuitem value="inch" label="inch" /> - <menuitem value="dpi" label="dpi" /> - </menupopup> - </menulist> - </hbox> - </vbox> - </hbox> - </groupbox> - - <hbox flex="1" pack="end"> - <button label="Apply" oncommand="apply();" /> - <button label="Cancel" oncommand="cancel();" /> - </hbox> - </groupbox> - -</window>
--- a/xul/content/dialog_page.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -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 markCurrentPage() { - - var current_page = opener.content.getParameter('pn'); - var total_pages = opener.content.getParameter('pt'); - - if ( total_pages ) { - document.getElementById('dialog_desc').setAttribute('value', "Choose the page to go (1 - " + total_pages + ") :"); - } - - document.getElementById('page_value').setAttribute('value', current_page); - -} - - -function go() { - - var old_current_page = opener.content.getParameter('pn'); - var total_pages = opener.content.getParameter('pt'); - - var page = document.getElementById('page_value').value; - - if ( parseInt(page) != page ) { - alert ("Illegal value!"); - } else if ( parseInt(page) < 1 ) { - alert ("Illegal value!"); - } else if ( total_pages && parseInt(page) > total_pages ) { - alert ("Illegal value!"); - } else { - var allcookies = opener.content.document.cookie; - - var pos = allcookies.indexOf('keeparea='); - - if ( pos > -1 ) { - var start = pos + 9; - var end = allcookies.indexOf(';', start); - if ( end == -1 ) { - end = allcookies.length; - } - - if ( allcookies.slice(start, end) == 'true' ) { - opener.content.page(page, 2); - } else { - opener.content.page(page, 1); - } - } else { - // default - opener.content.page(page, 2); - } - - close(); - } - -} - - -function cancel() { - - close(); - -} \ No newline at end of file
--- a/xul/content/dialog_page.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialogs.css" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="DIGILIB brightness/contrast" - onload="markCurrentPage(); window.sizeToContent(); window.focus();"> - - <script src="chrome://alcatraz/content/dialog_page.js" /> - - <groupbox> - <caption label="DIGILIB page" /> - <description id="dialog_desc">Choose the page to go :</description> - <spacer style="height: 10px" /> - <hbox> - <textbox id="page_value" size="6" onclick="this.select();" /> - <spacer flex="1" /> - </hbox> - - - <hbox flex="1" pack="end"> - <button label="Go" oncommand="go();" /> - <button label="Cancel" oncommand="cancel();" /> - </hbox> - </groupbox> - -</window>
--- a/xul/content/dialog_rotate.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -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 markCurrentRotation() { - - var angle = opener.content.getParameter('rot'); - - if ( angle && (angle == 0.0 || angle == 90.0 || angle == 180.0 || angle == 270.0) ) { - var item = "rotation_" + parseInt(angle); - document.getElementById(item).setAttribute('selected', 'true'); - } else if ( angle && angle == parseFloat(angle) ) { - document.getElementById('rotation_custom').setAttribute('selected', 'true'); - document.getElementById('rotation_custom_value').setAttribute('value', angle); - } - -} - - -function input() { - - document.getElementById('rotation_custom').setAttribute('selected', 'true'); - -} - -function rotate() { - - var angle = 0.0; - - var items = document.getElementById('rotation_group').childNodes; - - if ( document.getElementById('rotation_custom').getAttribute('selected') == 'true' ) { - angle = document.getElementById('rotation_custom_value').value; - } else { - for ( i = 0; i <items.length; i++ ) { - if ( items[i].getAttribute('selected') == 'true' ) { - angle = items[i].getAttribute('value'); - } - } - } - - if ( angle != parseFloat(angle) ) { - alert ("Illegal value!" + angle); - } - - if ( angle != opener.content.getParameter('rot') ) { - opener.content.rotation(angle); - } - close(); -} - - -function cancel() { - - close(); - -}
--- a/xul/content/dialog_rotate.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/dialogs.css" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="DIGILIB rotate" - onload="markCurrentRotation(); window.sizeToContent(); window.focus();"> - - <script src="chrome://alcatraz/content/dialog_rotate.js" /> - - <groupbox> - <caption label="DIGILIB rotate" /> - <description>Choose the rotation angle (clockwise orientation) :</description> - <radiogroup id="rotation_group"> - <radio id="rotation_0" value="0" label="0 degrees" /> - <radio id="rotation_90" value="90" label="90 degrees" /> - <radio id="rotation_180" value="180" label="180 degrees" /> - <radio id="rotation_270" value="270" label="270 degrees" /> - <hbox> - <radio id="rotation_custom" value="custom" label="Custom:" /> - <textbox id="rotation_custom_value" size="6" oninput="input();" /> - </hbox> - </radiogroup> - - <hbox flex="1" pack="end"> - <button label="Rotate" oncommand="rotate();" /> - <button label="Cancel" oncommand="cancel();" /> - </hbox> - </groupbox> - -</window>
--- a/xul/content/imago.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -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, 26.02.2004 , Version Alcatraz 0.6 -*/ - - -function markCurrentScale() { - - var menuitems = document.getElementById('scale_popup').childNodes; - - for ( i = 0; i < menuitems.length; i++ ) { - menuitems[i].setAttribute('checked', 'false'); - } - - if ( window.content.getParameter('mo').indexOf('clip') > -1 ) { - document.getElementById('scale_pbp').setAttribute('checked', 'true'); - } else if ( window.content.getParameter('mo').indexOf('osize') > -1 ) { - document.getElementById('scale_os').setAttribute('checked', 'true'); - } else { - var item = "scale_" + window.content.getParameter('ws').replace(/\./, ""); - - if ( document.getElementById(item) ) { - document.getElementById(item).setAttribute('checked', 'true'); - } - } - -} - - -function markCurrentMirror() { - - var menuitems = document.getElementById('mirror_popup').childNodes; - - for ( i = 0; i < menuitems.length; i++ ) { - menuitems[i].setAttribute('checked', 'false'); - } - - if ( window.content.getParameter('mo').indexOf('hmir') > -1 ) { - document.getElementById('mirror_h').setAttribute('checked', 'true'); - } - - if ( window.content.getParameter('mo').indexOf('vmir') > -1 ) { - document.getElementById('mirror_v').setAttribute('checked', 'true'); - } - -} - - -function dialog_originalsize() { - window.openDialog("chrome://alcatraz/content/dialog_originalsize.xul", "dialog_originalsize", "chrome,dialog,resizable=no", ""); -} - - -function dialog_rotate() { - window.openDialog("chrome://alcatraz/content/dialog_rotate.xul", "dialog_rotate", "chrome,dialog,resizable=no", ""); -} - - -function dialog_brightnesscontrast() { - window.openDialog("chrome://alcatraz/content/dialog_brightnesscontrast.xul", "dialog_brightnesscontrast", "chrome,dialog,resizable=no", ""); -} - - -function dialog_colors() { - window.openDialog("chrome://alcatraz/content/dialog_colors.xul", "dialog_colors", "chrome,dialog,resizable=no", ""); -} \ No newline at end of file
--- a/xul/content/imago.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/" type="text/css" ?> -<?xml-stylesheet href="chrome://global/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 type="application/x-javascript" src="chrome://jslib/content/jslib.js" /> -<script type="application/x-javascript" src="chrome://alcatraz/content/imago.js" /> - - <popupset> - <popup id="scale_popup" onpopupshowing="markCurrentScale()"> - <menuitem id="scale_07" label="0.7" type="checkbox" oncommand="window.content.scale(0.7);" /> - <menuitem id="scale_10" label="1" type="checkbox" oncommand="window.content.scale(1);" /> - <menuitem id="scale_15" label="1.5" type="checkbox" oncommand="window.content.scale(1.5);" /> - <menuitem id="scale_20" label="2" type="checkbox" oncommand="window.content.scale(2);" /> - <menuitem id="scale_25" label="2.5" type="checkbox" oncommand="window.content.scale(2.5);" /> - <menuitem id="scale_30" label="3" type="checkbox" oncommand="window.content.scale(3);" /> - <menuitem id="scale_pbp" label="pixel by pixel" type="checkbox" oncommand="window.content.pixelByPixel();" /> - <menuitem id="scale_os" label="original size" type="checkbox" oncommand="dialog_originalsize();" /> - </popup> - </popupset> - - <popupset> - <popup id="mirror_popup" onpopupshowing="markCurrentMirror()"> - <menuitem id="mirror_h" label="Horizontal" type="checkbox" oncommand="window.content.mirror('h');" /> - <menuitem id="mirror_v" label="Vertical" type="checkbox" oncommand="window.content.mirror('v');" /> - </popup> - </popupset> - - <vbox> - <button id="button_scale" label="scale" popup="scale_popup" /> - <button id="button_mirror" label="mirror" popup="mirror_popup" /> - <button id="button_rotate" label="rotate" onclick="dialog_rotate();" /> - <spacer flex="1" /> - <button id="button_brightnesscontrast" label="brightness/contrast" onclick="dialog_brightnesscontrast();" /> - <button id="button_colors" label="colors" onclick="dialog_colors();" /> - <spacer flex="100" /> - </vbox> - <vbox flex="1" /> - -</window>
--- a/xul/content/navigio.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -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.5 -*/ - -function set_project(search,result){ - var navigio_frame=document.getElementById('navigio_frame'); - var navigio_result_frame=document.getElementById('resultframe'); - var navigio_splitter=document.getElementById('navigio_splitter'); - navigio_frame.setAttribute('src',search); - navigio_frame.setAttribute('flex','1'); - navigio_result_frame.setAttribute('src',result); - navigio_result_frame.setAttribute('flex','1'); - navigio_splitter.setAttribute('state','open'); - navigio_splitter.setAttribute('collapse','before'); - -}
--- a/xul/content/navigio.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/" type="text/css" ?> -<?xml-stylesheet href="chrome://global/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 type="application/x-javascript" src="chrome://alcatraz/content/navigio.js" /> - <hbox> - <toolbarbutton id="navigio_project" type="menu" label="Project" datasources="http://hera.unibe.ch/navigo/navigio_project.rdf" ref="urn:echoproject:data" > - <template> - <rule> - <menupopup id="options_popup"> - <menuitem uri="rdf:*" label="rdf:http://echo.unibe.ch/echo/rdf/projects#name" type="radio" - onclick="set_project(' rdf:http://echo.unibe.ch/echo/rdf/projects#search ',' rdf:http://echo.unibe.ch/echo/rdf/projects#default ')"/> - </menupopup> - </rule> - </template> - </toolbarbutton> - </hbox> - <iframe id="navigio_frame" src="wtwg_bern.xul" flex="1"/> -</window>
--- a/xul/content/navigio_tree.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -<?xml version="1.0"?> - -<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> - -<window id="example-window" title="Example 6.8.2" - xmlns:html="http://www.w3.org/1999/xhtml" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - -<script language="JavaScript" src="tree_nav.js" /> - -<tree id="menu_tree" onselect="open_link();" flex="1" width="200" height="200" - datasources="http://sophia.unibe.ch/~kausaman/navigio/meta.rdf http://sophia.unibe.ch/~kausaman/navigio/tree.rdf" ref="urn:echo:data"> - - <treecols> - <treecol id="name" label="Name" primary="true" flex="1"/> - </treecols> - - <template> - <rule> - <treechildren> - <treeitem uri="rdf:*"> - <treerow> - <treecell label="rdf:http://echo.unibe.ch/rdf#name" link="rdf:http://echo.unibe.ch/rdf#link"/> - </treerow> - </treeitem> - </treechildren> - </rule> - - </template> -</tree> - - -</window> -
--- a/xul/content/rdfds.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,760 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is rdfds - * - * The Initial Developer of the Original Code is Neil Deakin - * Portions created by Neil Deakin are Copyright (C) 2002 Neil Deakin. - * All Rights Reserved. - * - * Contributor(s): - */ - -/* This is a library for easier access to RDF datasources and resources. - * It contains four objects, RDFDataSource, RDFNode, RDFLiteral. and - * RDFEnumerator. - * - * An RDF DataSource is a graph of nodes and literals. The constructor - * for RDFDataSource takes one argument, a URI of an RDF file to use. - * If the URI exists, the contents of the RDF file are loaded. If it - * does not exist, resources can be added to it and then written using - * this save method. If the URL argument is null, a blank datasource - * is created. - * - * This library is designed for convenience not for efficiency. - * - * The API is documented at: - * http://www.xulplanet.com/tutorials/xultu/rdfds/ - * - * Example: - * - * var ds=new RDFDataSource("file:///main/mozilla/mimtest.rdf"); - * var node=ds.getNode("urn:xpimaker:packlist"); - * var child=ds.getNode("urn:xpimaker:packlist:appinfo"); - * child=node.addChild(child); - * child.addTarget("http://www.xulplanet.com/rdf/xpimaker#appname","Find Files"); - * ds.save(); - * - */ - -var RDFService = "@mozilla.org/rdf/rdf-service;1"; -RDFService = Components.classes[RDFService].getService(); -RDFService = RDFService.QueryInterface(Components.interfaces.nsIRDFService); - -var RDFContainerUtilsService = "@mozilla.org/rdf/container-utils;1"; -RDFContainerUtilsService = Components.classes[RDFContainerUtilsService].getService(); -RDFContainerUtilsService = RDFContainerUtilsService.QueryInterface(Components.interfaces.nsIRDFContainerUtils); - -/* RDFLoadObserver - * this object is necessary to listen to RDF files being loaded. The Init - * function should be called to initialize the callback when the RDF file is - * loaded. - */ -function RDFLoadObserver(){} - -RDFLoadObserver.prototype = -{ - callback: null, - callbackDataSource: null, - - Init: function(c,cDS){ - this.callback=c; - this.callbackDataSource=cDS; - }, - - QueryInterface: function(iid){ - if (iid.equals(Components.interfaces.nsIRDFXMLSinkObserver)) return this; - else throw Components.results.NS_ERROR_NO_INTERFACE; - }, - - onBeginLoad : function(sink){}, - onInterrupt : function(sink){}, - onResume : function(sink){}, - onError : function(sink,status,msg){}, - - onEndLoad : function(sink){ - if (this.callback!=null) this.callback(this.callbackDataSource); - } -}; - -function RDFDataSource(uri,callbackFn) -{ - if (uri==null) this.datasource=null; - else this.load(uri,callbackFn); -} - -RDFDataSource.prototype.load= - function(uri,callbackFn) -{ - if (uri.indexOf(":") == -1){ - var docurl=document.location.href; - if (document.location.pathname == null) uri=docurl+"/"+uri; - else uri=docurl.substring(0,docurl.lastIndexOf("/")+1)+uri; - } - - if (callbackFn == null){ - this.datasource=RDFService.GetDataSourceBlocking(uri); - } - else { - this.datasource=RDFService.GetDataSource(uri); - var ds; - try { - var ds=this.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); - } - catch (ex){ - callbackFn(this); - return; - } - if (ds.loaded){ - callbackFn(this); - return; - } - - var packObserver=new RDFLoadObserver(); - packObserver.Init(callbackFn,this); - - var rawsource=this.datasource; - rawsource=rawsource.QueryInterface(Components.interfaces.nsIRDFXMLSink); - rawsource.addXMLSinkObserver(packObserver); - } -} - -RDFDataSource.prototype.Init= - function (dsource) -{ - this.datasource=dsource; -} - -RDFDataSource.prototype.parseFromString= - function (str,baseUri) -{ - if (this.datasource==null) this.makeemptyds(); - var ios=Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService); - baseUri=ios.newURI(baseUri,null,null); - var xmlParser=Components.classes["@mozilla.org/rdf/xml-parser;1"] - .createInstance(Components.interfaces.nsIRDFXMLParser); - xmlParser.parseString(this.datasource,baseUri,str); -} - -RDFDataSource.prototype.serializeToString= - function () -{ - var outputStream = { - data: "", - close : function(){}, - flush : function(){}, - write : function (buffer,count){ - this.data += buffer; - return count; - }, - writeFrom : function (stream,count){}, - isNonBlocking: false - } - this.serializeToStream(outputStream); - return outputStream.data; -} - -RDFDataSource.prototype.serializeToStream= - function (outputStream) -{ - var ser=Components.classes["@mozilla.org/rdf/xml-serializer;1"] - .createInstance(Components.interfaces.nsIRDFXMLSerializer); - ser.init(this.datasource); - ser.QueryInterface(Components.interfaces.nsIRDFXMLSource).Serialize(outputStream); -} - -RDFDataSource.prototype.makeemptyds= - function (uri) -{ - this.datasource=Components.classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"] - .createInstance(Components.interfaces.nsIRDFDataSource); -} - -RDFDataSource.prototype.getAllResources= - function () -{ - if (this.datasource==null) return null; - return new RDFEnumerator(this.datasource.GetAllResources(),this.datasource); -} - -RDFDataSource.prototype.getRawDataSource= - function () -{ - if (this.datasource==null) this.makeemptyds(); - return this.datasource; -} - -RDFDataSource.prototype.getNode= - function (uri) -{ - if (this.datasource==null) this.makeemptyds(); - var node=new RDFNode(uri,this); - return node; -} - -RDFDataSource.prototype.getAnonymousNode= - function () -{ - if (this.datasource==null) this.makeemptyds(); - - var anon=RDFService.GetAnonymousResource(); - var node=new RDFNode(); - node.Init(anon,this.datasource); - return node; -} - -RDFDataSource.prototype.getLiteral= - function (uri) -{ - if (this.datasource==null) this.makeemptyds(); - - return new RDFLiteral(uri,this); -} - -RDFDataSource.prototype.refresh= - function (sync) -{ - try { - var ds=this.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); - ds.Refresh(sync); - return true; - } - catch (ex){ - return false; - } -} - -RDFDataSource.prototype.save= - function () -{ - try { - var ds=this.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); - ds.Flush(); - return true; - } - catch (ex){ - return false; - } -} - -RDFDataSource.prototype.copyAllToDataSource= - function (dsource2) -{ - if (this.datasource==null) this.makeemptyds(); - if (dsource2.datasource==null) dsource2.makeemptyds(); - - var dsource1=this.datasource; - dsource2=dsource2.datasource; - - var sourcelist=dsource1.GetAllResources(); - while(sourcelist.hasMoreElements()){ - var source=sourcelist.getNext(); - var props=dsource1.ArcLabelsOut(source); - while(props.hasMoreElements()){ - var prop=props.getNext(); - prop=prop.QueryInterface(Components.interfaces.nsIRDFResource); - var target=dsource1.GetTarget(source,prop,true); - if (target!=null) dsource2.Assert(source,prop,target,true); - } - } -} - -RDFDataSource.prototype.deleteRecursive= - function (val) -{ - var node; - var dsource=this.datasource; - - if (dsource==null) return; - - if (typeof val == "string") node=RDFService.GetResource(val); - else node=val.source; - - this.deleteRecursiveH(dsource,node); // remove descendants - - // remove the node itself - var props=dsource.ArcLabelsIn(node); - while(props.hasMoreElements()){ - var prop=props.getNext(); - var source=dsource.GetSource(prop,node,true); - dsource.Unassert(source,prop,node); - } -} - -RDFDataSource.prototype.deleteRecursiveH= - function (dsource,node) -{ - var props=dsource.ArcLabelsOut(node); - while(props.hasMoreElements()){ - var prop=props.getNext(); - var target=dsource.GetTarget(node,prop,true); - try { - target=target.QueryInterface(Components.interfaces.nsIRDFResource); - this.deleteRecursiveH(dsource,target); - } - catch (e){} - dsource.Unassert(node,prop,target) - } -} - -function RDFNode(uri,dsource) -{ - if (uri==null) this.source=null; - else this.source=RDFService.GetResource(uri); - - if (dsource==null) this.datasource=null; - else this.datasource=dsource.datasource; - - this.container=null; -} - -RDFNode.prototype.Init= - function (source,dsource) -{ - this.source=source; - this.datasource=dsource; - this.container=null; -} - -RDFNode.prototype.getValue= - function () -{ - return this.source.Value; -} - -RDFNode.prototype.rlify= - function (val) -{ - var res=null; - - if (val!=null){ - try { - val=val.QueryInterface(Components.interfaces.nsIRDFResource); - res=new RDFNode(); - res.Init(val,this.datasource); - } - catch (ex){ - try { - val=val.QueryInterface(Components.interfaces.nsIRDFLiteral); - res=new RDFLiteral(); - res.Init(val,this.datasource); - } - catch (ex2){ - } - } - } - return res; -} - -RDFNode.prototype.makeres= - function (val) -{ - if (typeof val == "string") return RDFService.GetResource(val); - else return val.source; -} - -RDFNode.prototype.makelit= - function (val) -{ - if (typeof val == "string") return RDFService.GetLiteral(val); - else return val.source; -} - -RDFNode.prototype.makecontain= - function () -{ - if (this.container!=null) return true; - - var RDFContainer = '@mozilla.org/rdf/container;1'; - RDFContainer = Components.classes[RDFContainer].createInstance(); - RDFContainer = RDFContainer.QueryInterface(Components.interfaces.nsIRDFContainer); - - try { - RDFContainer.Init(this.datasource,this.source); - this.container=RDFContainer; - return true; - } - catch (ex){ - return false; - } -} - -RDFNode.prototype.addTarget= - function (prop,target) -{ - prop=this.makeres(prop); - target=this.makelit(target); - this.datasource.Assert(this.source,prop,target,true); -} - -RDFNode.prototype.addTargetOnce= - function (prop,target) -{ - prop=this.makeres(prop); - target=this.makelit(target); - - var oldtarget=this.datasource.GetTarget(this.source,prop,true); - if (oldtarget!=null){ - this.datasource.Change(this.source,prop,oldtarget,target); - } - else { - this.datasource.Assert(this.source,prop,target,true); - } -} - -RDFNode.prototype.modifyTarget= - function (prop,oldtarget,newtarget) -{ - prop=this.makeres(prop); - oldtarget=this.makelit(oldtarget); - newtarget=this.makelit(newtarget); - this.datasource.Change(this.source,prop,oldtarget,newtarget); -} - -RDFNode.prototype.modifySource= - function (prop,oldsource,newsource) -{ - prop=this.makeres(prop); - oldsource=this.makeres(oldsource); - newsource=this.makeres(newsource); - this.datasource.Move(oldsource,newsource,prop,this.source); -} - -RDFNode.prototype.targetExists= - function (prop,target) -{ - prop=this.makeres(prop); - target=this.makelit(target); - return this.datasource.HasAssertion(this.source,prop,target,true); -} - -RDFNode.prototype.removeTarget= - function (prop,target) -{ - prop=this.makeres(prop); - target=this.makelit(target); - this.datasource.Unassert(this.source,prop,target); -} - -RDFNode.prototype.getProperties= - function () -{ - return new RDFEnumerator(this.datasource.ArcLabelsOut(this.source),this.datasource); -} - -RDFNode.prototype.getInProperties= - function () -{ - return new RDFEnumerator(this.datasource.ArcLabelsIn(this.source),this.datasource); -} - -RDFNode.prototype.propertyExists= - function (prop) -{ - prop=this.makeres(prop); - return this.datasource.hasArcOut(this.source,prop); -} - -RDFNode.prototype.inPropertyExists= - function (prop) -{ - prop=this.makeres(prop); - return this.datasource.hasArcIn(this.source,prop); -} - -RDFNode.prototype.getTarget= - function (prop) -{ - prop=this.makeres(prop); - return this.rlify(this.datasource.GetTarget(this.source,prop,true)); -} - -RDFNode.prototype.getSource= - function (prop) -{ - prop=this.makeres(prop); - var src=this.datasource.GetSource(prop,this.source,true); - if (src==null) return null; - var res=new RDFNode(); - res.Init(src,this.datasource); - return res; -} - -RDFNode.prototype.getTargets= - function (prop) -{ - prop=this.makeres(prop); - return new RDFEnumerator( - this.datasource.GetTargets(this.source,prop,true),this.datasource); -} - -RDFNode.prototype.getSources= - function (prop) -{ - prop=this.makeres(prop); - return new RDFEnumerator( - this.datasource.GetSources(prop,this.source,true),this.datasource); -} - -RDFNode.prototype.makeBag= - function () -{ - this.container=RDFContainerUtilsService.MakeBag(this.datasource,this.source); -} - -RDFNode.prototype.makeSeq= - function () -{ - this.container=RDFContainerUtilsService.MakeSeq(this.datasource,this.source); -} - -RDFNode.prototype.makeAlt= - function () -{ - this.container=RDFContainerUtilsService.MakeAlt(this.datasource,this.source); -} - -RDFNode.prototype.isBag= - function () -{ - return RDFContainerUtilsService.isBag(this.datasource,this.source); -} - -RDFNode.prototype.isSeq= - function () -{ - return RDFContainerUtilsService.isSeq(this.datasource,this.source); -} - -RDFNode.prototype.isAlt= - function () -{ - return RDFContainerUtilsService.isAlt(dsource,this.source); -} - -RDFNode.prototype.isContainer= - function () -{ - return RDFContainerUtilsService.IsContainer(this.datasource,this.source); -} - -RDFNode.prototype.getChildCount= - function () -{ - if (this.makecontain()){ - return this.container.GetCount(); - } - return -1; -} - -RDFNode.prototype.getChildren= - function () -{ - if (this.makecontain()){ - return new RDFEnumerator(this.container.GetElements(),this.datasource); - } - else return null; -} - -RDFNode.prototype.addChild= - function (child,exists) -{ - if (this.makecontain()){ - var childres=null; - if (typeof child == "string"){ - childres=RDFService.GetResource(child); - child=new RDFNode(); - child.Init(childres,this.datasource); - } - else childres=child.source; - - if (!exists && this.container.IndexOf(childres)>=0) return child; - - this.container.AppendElement(childres); - return child; - } - else return null; -} - -RDFNode.prototype.addChildAt= - function (child,idx) -{ - if (this.makecontain()){ - var childres=null; - if (typeof child == "string"){ - childres=RDFService.GetResource(child); - child=new RDFNode(); - child.Init(childres,this.datasource); - } - else childres=child.source; - this.container.InsertElementAt(childres,idx,true); - return child; - } - else return null; -} - -RDFNode.prototype.removeChild= - function (child) -{ - if (this.makecontain()){ - var childres=null; - if (typeof child == "string"){ - childres=RDFService.GetResource(child); - child=new RDFNode(); - child.Init(childres,this.datasource); - } - else childres=child.source; - this.container.RemoveElement(childres,true); - return child; - } - else return null; -} - -RDFNode.prototype.removeChildAt= - function (idx) -{ - if (this.makecontain()){ - var childres=this.container.RemoveElementAt(idx,true); - return this.rlify(childres); - } - else return null; -} - -RDFNode.prototype.getChildIndex= - function (child) -{ - if (this.makecontain()){ - return this.container.IndexOf(child.source); - } - else return -1; -} - -RDFNode.prototype.type="Node"; - - -function RDFLiteral(val,dsource) -{ - if (val==null) this.source=null; - else this.source=RDFService.GetLiteral(val); - - if (dsource==null) this.datasource=null; - else this.datasource=dsource.datasource; -} - -RDFLiteral.prototype.Init= - function (source,dsource) -{ - this.source=source; - this.datasource=dsource; -} - -RDFLiteral.prototype.getValue= - function () -{ - return this.source.Value; -} - -RDFLiteral.prototype.makeres= - function (val) -{ - if (typeof val == "string") return RDFService.GetResource(val); - else return val.source; -} - -RDFLiteral.prototype.makelit= - function (val) -{ - if (typeof val == "string") return RDFService.GetLiteral(val); - else return val.source; -} - -RDFLiteral.prototype.modifySource= - function (prop,oldsource,newsource) -{ - prop=this.makeres(prop); - oldsource=this.makeres(oldsource); - newsource=this.makeres(newsource); - this.datasource.Move(oldsource,newsource,prop,this.source); -} - -RDFLiteral.prototype.getInProperties= - function (prop) -{ - return new RDFEnumerator(this.datasource.ArcLabelsIn(this.source),this.datasource); -} - -RDFLiteral.prototype.inPropertyExists= - function (prop) -{ - prop=this.makeres(prop); - return this.datasource.hasArcIn(this.source,prop); -} - -RDFLiteral.prototype.getSource= - function (prop) -{ - prop=this.makeres(prop); - var src=this.datasource.GetSource(prop,this.source,true); - if (src==null) return null; - var res=new RDFNode(); - res.Init(src,this.datasource); - return res; -} - -RDFLiteral.prototype.getSources= - function (prop) -{ - prop=this.makeres(prop); - return new RDFEnumerator( - this.datasource.GetSources(prop,this.source,true),this.datasource); -} - -RDFLiteral.prototype.type="Literal"; - - -function RDFEnumerator(enumeration,dsource) -{ - this.enumeration=enumeration; - this.datasource=dsource; -} - -RDFEnumerator.prototype.hasMoreElements= - function () -{ - return this.enumeration.hasMoreElements(); -} - -RDFEnumerator.prototype.getNext= - function () -{ - var res=null; - var val=this.enumeration.getNext(); - - if (val!=null){ - try { - val=val.QueryInterface(Components.interfaces.nsIRDFResource); - res=new RDFNode(); - res.Init(val,this.datasource); - } - catch (ex){ - try { - val=val.QueryInterface(Components.interfaces.nsIRDFLiteral); - res=new RDFLiteral(); - res.Init(val,this.datasource); - } - catch (ex2){ - } - } - } - return res; -} -
--- a/xul/content/search.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -var key=''; - -function start_search(){ - var search_string=document.getElementById("search_value").value; - var search_category=document.getElementById("category").selectedItem.label; - var target_iframe=parent.document.getElementById('result_frame'); - if (search_string!='' || search_category=='none'){ - var level1=document.getElementById("level1"); - var level2=document.getElementById("level2"); - var level3=document.getElementById("level3"); - target_iframe.setAttribute('src','http://hera.unibe.ch:8080/alcatraz/xul/digilib_search.jsp?key='+key+'&cat='+search_category+'&str='+search_string); - //target_iframe.setAttribute('src','result.htm'); - }else{ - alert("Fehler: Kein Suchstring definiert!"); - } -} - - -function changeMenuList(){ - if (document.getElementById("category").selectedItem.label !='none'){ - document.getElementById("search_value").disabled=false; - document.getElementById("search_value").value=''; - }else{ - document.getElementById("search_value").disabled=true; - document.getElementById("search_value").value=''; - } -} - - -function changeCollection(sel){ - key=sel.value; - var levels=sel.label.split(";"); - var level1=document.getElementById("level1"); - var level2=document.getElementById("level2"); - var level3=document.getElementById("level3"); - if (levels.length>0){ - level1.setAttribute('value',levels[0]); - }else{ - level1.setAttribute('value',''); - } - if (levels.length>1){ - level2.setAttribute('value',' '+levels[1]); - } else{ - level2.setAttribute('value',''); - } - if (levels.length>2){ - level3.setAttribute('value',' '+levels[2]); - }else{ - level3.setAttribute('value',''); - } - -} \ No newline at end of file
--- a/xul/content/search.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<?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" - flex="1" > - -<script type="application/x-javascript" src="chrome://alcatraz/content/search.js" /> - -<vbox> - -<button id="collection" label="Collections" type="menu" onclick="changeCollection(event.target); return false;" - datasources="http://hera.unibe.ch:8080/alcatraz/xul/digilibcollections.jsp" ref="urn:echonavigation:data" flex="1"> - - <template> - <rule> - <menupopup id="menupop1" > - <menuitem label="none" selected="true" /> - <menuitem uri="rdf:*" value="rdf:http://www.echo.eu/rdf#link" label="rdf:http://www.echo.eu/rdf#name" /> - </menupopup> - </rule> - </template> - -</button> - -<label id="level1" value="" flex="1" crop="end" /> -<label id="level2" value="" flex="1" crop="end" /> -<label id="level3" value="" flex="1" crop="end" /> -<label value="Category:" flex="1" /> -<menulist id="category" label="none" onclick="changeMenuList();" flex="1" > - <menupopup> - <menuitem label="none" selected="true" /> - <menuitem label="Author" /> - <menuitem label="Title"/> - <menuitem label="Year" /> - <menuitem label="Journal/Magazine"/> - <menuitem label="Keywords"/> - </menupopup> -</menulist> -<textbox id="search_value" disabled="true" flex="1" /> -<button id="start_search" label="Search" onclick="start_search()" flex="1" /> - -</vbox> - -</window>
--- a/xul/content/settings.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -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, 24.01.2004 , Version Alcatraz 0.5 -*/ - - -include(jslib_dirutils); -include(jslib_file); - -var du = new DirUtils(); -var f = new File('alcatraz.pref'); - -f.initPath(du.getPrefsDir()); -f.append('alcatraz.pref'); - -function getSetting(name) { - - if (f.exists()) { - - f.open(); - var content = f.read(); - f.close(); - - var lines = content.split(/\n/); - - for (i = 0; i <lines.length; i++) { - var line = lines[i].split('='); - if (line[0] == name) { - return line[1]; - } - } - } - - return null; -} - - -function saveSetting(name, value) { - - var content = ""; - - if (f.exists()) { - f.open(); - content = f.read(); - f.close(); - f.remove(); - } - - f.create(); - f.open('w'); - f.write(name + '=' + value + '\n'); - - var lines = content.split(/\n/); - - for (i = 0; i < lines.length; i++) { - var line = lines[i].split('='); - if (line[0] != name && line[0] != '') { - f.write(line[0] + '=' + line[1] + '\n'); - } - } - f.close(); -}
--- a/xul/content/sidebar/install.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://communicator/skin/" type="text/css" ?> - -<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - xmlns:html="http://www.w3.org/1999/xhtml" - title="ALCATRAZ SIDEBAR INSTALLER" - orient="vertical"> - - <script src="chrome://alcatraz/content/sidebar/installer.js" /> - <script> - function install() { - var Installer = new MOZ_SidebarInstaller('Alcatraz', 'chrome://alcatraz/content/alcatraz.xul', ''); //no customization - Installer.setUp(); - } - </script> - - <groupbox style="-moz-box-align: center; -moz-box-pack: center;"> - <caption label="Alcatraz" /> - <description>Click the button to install the Alcatraz-Sidebar panel</description> - <button label="INSTALL Alcatraz Sidebar" - oncommand="install();" - flex="0" /> - <description>Alcatraz uses Mozilla Java Script Library:</description> - <description><html:a href='http://jslib.mozdev.org/installation.html' target='blank'> jslib http://jslib.mozdev.org/installation.html</html:a></description> - </groupbox> - -</window>
--- a/xul/content/sidebar/installer.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -//@@@@@@@@@@@@@@@@ -function MOZ_SidebarInstaller //<c><a>public<d>Mozilla Sidebar installer class -( -_title, //<p>string<d>Sidebar title -_url, //<p>string<d>Sidebar URL -_customize //<p>string<d>Sidebar customization -){ -const -INTERFACES = Components.interfaces, -nsIRDFRemoteDataSource = INTERFACES.nsIRDFRemoteDataSource, -nsIRDFService = INTERFACES.nsIRDFService, RDF_CID = "@mozilla.org/rdf/rdf-service;1", -nsIRDFContainer = INTERFACES.nsIRDFContainer, CONTAINER_CID = "@mozilla.org/rdf/container;1", -nsIProperties = INTERFACES.nsIProperties, DIR_SERV_CID = "@mozilla.org/file/directory_service;1", -nsIIOService = INTERFACES.nsIIOService, IO_SERVICE_CID = '@mozilla.org/network/io-service;1', -NC_NAMESPACE = 'http://home.netscape.com/NC-rdf#', -SIDEBAR_PANEL_URN = NC_NAMESPACE + 'panel-list', -SIDEBAR_CUR_URN = 'urn:sidebar:current-panel-list', -SIDEBAR_3RD_URN = 'urn:sidebar:3rdparty-panel:', -PANELS_RDF_FILE = "UPnls"; //directory services property to find panels.rdf -const -MSG_PANEL_IN_LIST = ' panel is already in Sidebar list\nSelect it in the Tabs > Customize Sidebar... menu', -MSG_PANEL_REFRESHED = ' panel successfully refreshed', -MSG_PANEL_ADDED = ' panel has been successfully added to your sidebar', -MSG_PANEL_SOURCE = 'Sidebar datasource is busted', -MSG_NO_RDF_FILE = 'panels.rdf file does not exist in your profile\nInstallation aborted'; - - - -//================ -this.MOZ_SidebarInstaller = function //<m>void<a>private<d>class constructor -( -title, //<p>string<d>Sidebar panel title -url, //<p>string<d>Sidebar panel URL -customize //<p>string<d>Sidebar panel customization preferences -){ -this.className = 'MOZ_SidebarInstaller'; -this.title = title; -this.url = url; -this.customize = customize; -this.setIn(); -}//</m>MOZ_SidebarInstaller - - - -//================ -this.setIn = function //<m>void<a>private<d>Instance i12n -(){ -this.rdf = Components.classes[RDF_CID].getService(nsIRDFService); -this.container = Components.classes[CONTAINER_CID].createInstance(nsIRDFContainer); -this.source = this.rdf.GetDataSource(this.getSource()); -this.currentResource = this.rdf.GetResource(SIDEBAR_CUR_URN); -this.installResource = this.rdf.GetResource(SIDEBAR_3RD_URN + this.url); -}//</m>setIn - - - -//================ -this.setUp = function //<m>void<a>public<d>Installation execution method -(){ -if(!this.source) return; -this.container.Init(this.source, this.getPanelList()); -if (this.container.IndexOf(this.installResource) == -1) { - this.setPanelResource(this.installResource); - this.setPanelRefresh(); - this.setOutput(this.title + MSG_PANEL_ADDED); -} else { - this.setPanelRefresh(); - this.setOutput(this.title + MSG_PANEL_REFRESHED); -} -}//</m>setUp - - - -//================ -this.setPanelResource = function //<m>void<a>public<d>Create a resource for the new panel and add it to the sidebar panel list -( -resource //<p>Object<d>Sidebar panel RDF resource -){ -this.setRDFTriple(resource, 'title', this.title, true); -this.setRDFTriple(resource, 'content', this.url, true); -if(this.customize) this.setRDFTriple(resource, 'customize', this.customize, true); -this.container.AppendElement(resource); -}//</m>setPanelResource - - - -//================ -this.setPanelRefresh = function //<m>void<a>public<d>Refresh Sidebar panels -(){ -this.setRDFTriple(this.currentResource, 'refresh', 'true', true); -this.setRDFTriple(this.currentResource, 'refresh', 'false', false); -this.source.QueryInterface(nsIRDFRemoteDataSource).Flush(); -}//</m>setPanelRefresh<d>& -/* -We pass a "refresh" event to all sidebars observers watching for this assertion (in sidebarOverlay.js) -*/ - - - -//================ -this.getPanelList = function //<m>Object<a>public<d>Get Sidebar panel resource -(){ -var -panelList = this.source.GetTarget(this.currentResource, this.rdf.GetResource(SIDEBAR_PANEL_URN), true); -if(panelList) panelList.QueryInterface(INTERFACES.nsIRDFResource); -else this.setOutput(MSG_PANEL_SOURCE); -return panelList; -}//</m>getPanelList - - - -//================ -this.getSource = function //<m>string<a>private<d>Get the Sidebar panels.rdf datasource URL -(){ -try{ - var - dirService = Components.classes[DIR_SERV_CID].getService(); - dirService = dirService.QueryInterface(nsIProperties); - var - sidebarFile = dirService.get(PANELS_RDF_FILE, INTERFACES.nsIFile); - if(!sidebarFile.exists()) throw MSG_NO_RDF_FILE; - var - ioService = Components.classes[IO_SERVICE_CID].getService(nsIIOService), - fileURL = ioService.newFileURI(sidebarFile); - fileURL = fileURL.QueryInterface(INTERFACES.nsIFileURL); - return fileURL.spec; - } -catch(e){ - return this.setOutput(e); - } -}//</m>getSource<d>& -/* -panels.rdf file is located in the user profile directory -If the file does not exist already, it is copied from /bin/defaults/profile/panels.rdf -*/ - - - -//================ -this.setRDFTriple = function //<m>void<a>private<d>Setup an assertion in the RDF datasource member -( -subject, //<p>string<d>Assertion subject -property, //<p>string<d>Assertion property -object, //<p>string<d>Assertion object -asserting //<p>boolean<d>Set or remove Assertion -){ -this.source[asserting ? 'Assert' : 'Unassert'](subject, this.rdf.GetResource(NC_NAMESPACE + property), this.rdf.GetLiteral(object), true); -}//</m>setRDFTriple - - - -//================ -this.setOutput = function //<m>boolean<a>private<d>Dump message to output console -( -output //<p>string<d>Message to output -){ -var -/*string*/out = //'[' + this.className + ']\n' + - output + '\n'; -window.alert(out); //dump(output); -return null; -}//</m>setOutput<d>& -/* -Use either console or window alert output -*/ - - - -this.MOZ_SidebarInstaller(_title, _url, _customize); -}//</c>MOZ_SidebarInstaller - - -
--- a/xul/content/tools_dialog.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -<?xml version="1.0"?> - -<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> - -<dialog id="donothing" title="tool path" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - buttons="accept,cancel" - ondialogaccept="return doOK();" - ondialogcancel="return doCancel();"> - -<label control="digilib_path" value="tool path (where you can find digilib.jsp)"/> -<textbox id="digilib_path"/> -<script> -document.getElementById('digilib_path').value=window.arguments[0]; - -function doOK() -{ - window.arguments[1](document.getElementById('digilib_path').value); - return true; -} - -function doCancel() -{ - return true; -} - -</script> - -</dialog>
--- a/xul/content/tree.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -function open_link() -{ -var t=document.getElementById("menu_tree"); //baum in variable t holen -var l=t.view.getItemAtIndex(t.currentIndex); //aus baum treeitem herausholen mit dem selected index (currentIndex) -var d=l.firstChild.firstChild.getAttribute("link"); //aus treeitem treecell (mit firstChild.firstChild) und dann dort wert von id herausholen (mit getAttribute) -if (d!=""){ - //alert(d); - var isHera=d.search(/pythia2\.unibe\.ch/); - if (isHera!=-1){ - window.content.location.href=d; - }else{ - // window.content.location.href="http://hera.unibe.ch:8080/alcatraz/xul/"+d; - window.content.location.href="http://pythia2.unibe.ch:8080/docuserver/digitallibrary/"+d; - } -} -}
--- a/xul/content/tree.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> - -<window id="example-window" title="Example 6.8.2" - xmlns:html="http://www.w3.org/1999/xhtml" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - -<script language="JavaScript" src="tree.js" /> - -<tree id="menu_tree" onselect="open_link();" flex="1" width="200" height="200" - datasources="http://hera.unibe.ch:8080/alcatraz/xul/echonavigation.jsp" ref="urn:echonavigation:data"> - - <treecols> - <treecol id="name" label="Name" primary="true" flex="1"/> - </treecols> - <template> - <rule> - <treechildren> - <treeitem uri="rdf:*"> - <treerow> - <treecell label="rdf:http://www.echo.eu/rdf#name" link="rdf:http://www.echo.eu/rdf#link"/> - </treerow> - </treeitem> - </treechildren> - </rule> - </template> -</tree> -</window> -
--- a/xul/content/tree_nav.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -function open_link() -{ -var t=document.getElementById("menu_tree"); //baum in variable t holen -var l=t.view.getItemAtIndex(t.currentIndex); //aus baum treeitem herausholen mit dem selected index (currentIndex) -var d=l.firstChild.firstChild.getAttribute("link"); //aus treeitem treecell (mit firstChild.firstChild) und dann dort wert von id herausholen (mit getAttribute) -if (d!=""){ - //alert(d); - - window.content.location.href="http://pythia2.unibe.ch:8080/docuserver/digitallibrary/digilib.jsp?lv=1&fn="+d; - -} -}
--- a/xul/content/wtwg_bern.xul Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<?xml version="1.0" ?> -<?xml-stylesheet href="chrome://alcatraz/skin/" type="text/css" ?> -<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> - -<window xmlns:html="http://www.w3.org/1999/xhtml" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - onload="setTreeDirectory()"> - <tabbox flex="1"> - <tabs> - <tab id="search_tab" selected="true" label="search" /> - <tab id="tree_tab" label="tree" /> - </tabs> - <tabpanels flex="1"> - <tabpanel orient="vertical"> - <iframe id="search_frame" src="search.xul" height="180" /> - <splitter id="navigio_splitter" state="opened" collapse="before" resizeafter="nearest"> - <grippy/> - </splitter> - <iframe id="result_frame" src="blank.html" flex="1" /> - </tabpanel> - <tabpanel> - <iframe id="tree_frame" src="tree.xul" flex="1" /> - </tabpanel> - </tabpanels> - </tabbox> -</window>
--- a/xul/install.html Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -<html> -<head> - -<title>Install Alcatraz</title> - -<script type="application/x-javascript"> - -function install() { - InstallTrigger.install ( {'alcatraz' : 'alcatraz.xpi'} ); -} - -</script> - -</head> -<body> - -<h3>Alcatraz XUL Package</h3> -<p>contains a sidebar and beta-verion of a toolbar</p> -<h4>Installation:</h4> -<p>(maybe it is a good idea to print this side or to set a bookmark because you will have to close the browser during the installation)</p> -<ol> - press the "install alcatraz" button<br><br> - <form> - <input type="button" name="install alcatraz" value="install alcatraz" onClick="install();"><br> - </form> - </li> - - <li>restart mozilla (and you will find the new toolbar installed)</li> - - <li>enter chrome://alcatraz/content/sidebar/install.xul in the input field of the URL bar</li> - - <li>a dialog is asking you to install the Alcatraz-Sidebar, open the Sidebar (F9) and press the button</li> - -</ol> - -<p><b>Beware :</b> Due to the very early stage of the toolbar and the missing tools to -easily remove it, the installation with toolbar is primarily for developers. If you -still installed the toolbar-version and now want to get rid of it, you have to delete the lines -in <pre>[loacal_chrome]/overlayinfo/browser/content/overlays.rdf</pre> and -<pre>[local_chrome]/overlayinfo/navigator/content/overlays.rdf</pre> containing -'alcatraz_toolbar'. Then restart mozilla and pray that the toolbar has disappeared ...</p> - -<hr> - -<address><a href="mailto:engler@philo.unibe.ch">Daniel Engler</a></address> -<address><a href="mailto:luginbuehl@student.unibe.ch">Christian Luginbuehl</a></address> -<!-- Created: Mon May 12 19:44:41 CEST 2003 --> -<!-- hhmts start --> -Last modified: Tue May 13 20:17:00 CEST 2003 -<!-- hhmts end --> - </body> -</html>
--- a/xul/install.js Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* - -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, 22.05.2003 , Version Alcatraz 0.5 - -*/ - -var authorName = "ubern"; - - -var appName = "ALCATRAZ"; -var appVersion = "0.5.0"; -var appChromeName = "alcatraz"; -var appFile = "alcatraz.jar"; - -var jarAppPath = "content/"; -var jarSkinPath = "skin/"; -var jarLocalePath = "locale/en-US/"; - -var userChrome = getFolder("Profile", "chrome"); - -var successMessage = "The ALCATRAZ package has been successfully installed.\n\nRestart your browser to continue ..."; -var errorMessage = "Installation failed! Well, I have no idea what to do now ... sorry :-("; - - -initInstall(appName, authorName + appChromeName, appVersion); - -addFile(appName, appVersion, appFile, userChrome, '', true); - -registerChrome(Install.CONTENT | Install.PROFILE_CHROME, getFolder(userChrome, appFile), jarAppPath); -registerChrome(Install.SKIN | Install.PROFILE_CHROME, getFolder(userChrome, appFile), jarSkinPath); -registerChrome(Install.LOCALE | Install.PROFILE_CHROME, getFolder(userChrome, appFile), jarLocalePath); - -/** - * pretty simple error handling - */ -var code = getLastError(); - -if (code == SUCCESS) { - code = performInstall(); - - if (code == SUCCESS ||code == REBOOT_NEEDED) { - alert(successMessage); - } else { - alert(errorMessage); - cancelInstall(code) - } -} else { - cancelInstall(code); -}
--- a/xul/locale/en-US/contents.rdf Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<?xml version="1.0"?> - -<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> - - <!-- list all the packages being supplied by this jar --> - <RDF:Seq RDF:about="urn:mozilla:locale:root"> - <RDF:li RDF:resource="urn:mozilla:locale:en-US"/> - </RDF:Seq> - - <!-- locale information --> - <RDF:Description RDF:about="urn:mozilla:locale:en-US" - chrome:displayName="English(US)" - chrome:author="Daniel Engler:Christian Luginbuehl" - chrome:name="en-US"> - <chrome:packages> - <RDF:Seq RDF:about="urn:mozilla:locale:en-US:packages"> - <RDF:li RDF:resource="urn:mozilla:locale:en-US:alcatraz"/> - </RDF:Seq> - </chrome:packages> - </RDF:Description> - - <!-- Version Information. --> - <RDF:Description RDF:about="urn:mozilla:locale:en-US:alcatraz" - chrome:localeVersion="1.0"/> -</RDF:RDF>
--- a/xul/make_alcatraz.sh Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -#!/bin/sh -jar -cf alcatraz.jar content skin locale -jar -cf alcatraz.xpi alcatraz.jar install.js -echo "alcatraz created ... trying to copy to pythia2 (password for user 'alcatraz' required)" -scp alcatraz.xpi install.html alcatraz@pythia2.unibe.ch:/data01/docuserver/www/digitallibrary/xul
--- a/xul/skin/alcatraz.css Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -button { - margin: 1px; - min-width: 0px; -} - -.button-text { - margin: 0px !important; - font-size: 8pt; -} - -menuitem { - font-size: 8pt; -} - -.menu-iconic-icon { - width: 16px; - height: 10px; - list-style-image: inherit; -} - -.tab-text { - font-size: 9pt; -} - -tabpanels { - font-size: 8pt; -} - -toolbarbutton { - margin: 1px; - padding: 3px; - min-width: 1cm; -} - -#image_echo { - list-style-image: url('chrome://alcatraz/skin/images/echo.png'); -} - -#button_first { - min-width: 0px; - list-style-image: url('chrome://alcatraz/skin/images/first.png'); -} - -#button_prev { - min-width: 0px; - list-style-image: url('chrome://alcatraz/skin/images/prev.png'); -} - -#button_next { - min-width: 0px; - list-style-image: url(chrome://alcatraz/skin/images/next.png); -} - -#button_last { - min-width: 0px; - list-style-image: url(chrome://alcatraz/skin/images/last.png); -}
--- a/xul/skin/contents.rdf Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -<?xml version="1.0" ?> - -<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> - - <RDF:Seq RDF:about="urn:mozilla:skin:root"> - <RDF:li RDF:resource="urn:mozilla:skin:classic/1.0" /> - </RDF:Seq> - - <RDF:Description RDF:about="urn:mozilla:skin:classic/1.0"> - <chrome:packages> - <RDF:Seq RDF:about="urn:mozilla:skin:classic/1.0:packages"> - <RDF:li RDF:resource="urn:mozilla:skin:classic/1.0:alcatraz" /> - </RDF:Seq> - </chrome:packages> - </RDF:Description> -</RDF:RDF> -
--- a/xul/skin/dialog_originalsize.css Wed Jul 14 13:29:56 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -#vertical_bar { - list-style-image: url('chrome://alcatraz/skin/images/vertical_bar.png'); - margin: 5px; -} - -#horizontal_bar { - list-style-image: url('chrome://alcatraz/skin/images/horizontal_bar.png'); - margin: 5px; -} \ No newline at end of file