changeset 778:f8235c42f4a0 jquery

more preparations for SVG measuring tool
author hertzhaft
date Sun, 13 Feb 2011 01:12:45 +0100
parents 34bba748004d
children 62c3b902f878
files client/digitallibrary/jquery/jquery-test-svg.html client/digitallibrary/jquery/jquery.digilib.js client/digitallibrary/jquery/svg/archimedes.json client/digitallibrary/jquery/svg/archimedes.xml client/digitallibrary/jquery/svg/jquery.digilibSVG.css client/digitallibrary/jquery/svg/jquery.digilibSVG.js
diffstat 6 files changed, 1636 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/jquery/jquery-test-svg.html	Sun Feb 13 01:12:45 2011 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>jQuery.digilibSVG test</title>
+
+        <style type="text/css">
+        </style>
+
+        <script type="text/javascript" src="jquery-1.4.4.js"></script>
+        <script type="text/javascript" src="dlGeometry.js"></script>
+        <script type="text/javascript" src="jquery.cookie.js"></script>
+        <script type="text/javascript" src="jquery.digilib.js"></script>
+        <script type="text/javascript" src="svg/jquery.svg.js"></script>
+        <script type="text/javascript" src="svg/jquery.digilibSVG.js"></script>
+        <link rel="stylesheet" type="text/css" href="jquery.digilib.css" />
+        <link rel="stylesheet" type="text/css" href="svg/jquery.digilibSVG.css" />
+
+
+        <script type="text/javascript">
+            $(document).ready(function(){
+                var opts = {
+                    interactionMode : 'fullscreen',
+                    scalerInset : 100,
+                    scalerBaseUrl : 'http://digilib.biblhertz.it/digilib04/servlet/Scaler'
+                    };
+                var $div = $('div.digilib');
+                $div.digilib(opts);
+                var svgopts = {};
+                $div.digilibSVG(svgopts);
+            });
+
+        </script>
+    </head>
+
+    <body>
+
+        <div id="digilib-1" class="digilib">
+            <img src="http://digilib.biblhertz.it/digilib04/servlet/Scaler?dw=200&amp;dh=200&amp;fn=/digisprint/jquery/FransHals-WillemVanHeythuysen" />
+        </div>
+        <div id="debug">DEBUG</div>
+    </body>
+</html>
+
--- a/client/digitallibrary/jquery/jquery.digilib.js	Fri Feb 11 23:19:39 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Sun Feb 13 01:12:45 2011 +0100
@@ -247,8 +247,9 @@
         // is the "about" window shown?
         'isAboutDivVisible' : false,
         // maximum width of background image for drag-scroll
-        'maxBgSize' : 10000
-
+        'maxBgSize' : 10000,
+        // space to be left free in full page display
+        'scalerInset' : 0,
         };
 
     // affine geometry classes
@@ -905,11 +906,12 @@
     };
 
     // returns maximum size for scaler img in fullscreen mode
-    var getFullscreenImgSize = function ($elem) {
+    var getFullscreenImgSize = function (data) {
         var $win = $(window);
         var winH = $win.height();
-        var winW = $win.width();
+        var winW = $win.width() - data.settings.scalerInset;
         // TODO: account for borders?
+        console.debug(winW, winH);
         return geom.size(winW, winH);
     };
 
@@ -923,7 +925,7 @@
         if (settings.interactionMode === 'fullscreen') {
             // fullscreen
             $elem.addClass('dl_fullscreen');
-            var imgSize = getFullscreenImgSize($elem);
+            var imgSize = getFullscreenImgSize(data);
             // fitwidth/height omits destination height/width
             if (data.dlOpts.fitheight == null) {
                 settings.dw = imgSize.width;
@@ -1737,10 +1739,11 @@
         }
 
     // hook plugin into jquery
-    $.fn.digilib = function(action, obj) {
+    $.fn.digilib = function(action) {
         // plugin extension mechanism
         if (action === 'extendPlugin') {
             // for each digilib $elem extend data.settings with obj.options
+            // TODO: couldn't other plugins just access $elem.data('digilib')?
             if (obj.options) {
                 this.each(function() {
                     var $elem = $(this);
@@ -1753,8 +1756,8 @@
                     $.extend(settings, obj.options);
                     // console.log('settings:', settings);
                     });
+                delete(obj.options);
                 }
-            delete(obj.options);
             // extend the plugin actions (to make this useful, 
             // maybe we need to expose some more internal functions)
             $.extend(actions, obj);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/jquery/svg/archimedes.json	Sun Feb 13 01:12:45 2011 +0100
@@ -0,0 +1,1050 @@
+{
+"comment" : [
+  "Angaben nach:",
+  "Klimpert, Richard: Lexikon der Münzen, Maße, Gewichte, Zählarten und Zeitgrößen aller Länder der Erde 2) Berlin 1896 (Reprint Graz 1972)",
+  "Doursther, Horace: Dictionnaire universel des poids et mesures anciens et modernes. Paris 1840 (Reprint Amsterdam 1965)"
+  ],
+"section" : [
+  {
+    "name"  : "Längenmaße: metrisch",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "m",
+      "factor" : "1"
+      },
+      {
+      "name" : "mm",
+      "factor" : "0.001"
+      },
+      {
+      "name" : "cm",
+      "factor" : "0.01"
+      },
+      {
+      "name" : "dm",
+      "factor" : "0.1"
+      },
+      {
+      "name" : "km",
+      "factor" : "1000"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: nautisch",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "geographische Meile",
+      "factor" : "7420"
+      },
+      {
+      "name" : "Seemeile",
+      "factor" : "1854.965"
+      },
+      {
+      "name" : "fathom",
+      "factor" : "1.828782"
+      },
+      {
+      "name" : "cable",
+      "factor" : "182.8782"
+      },
+      {
+      "name" : "league",
+      "factor" : "5564.895"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: England",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "foot",
+      "factor" : "0.304797",
+      "subunits" : "12"
+      },
+      {
+      "name" : "inch",
+      "factor" : "0.02539975"
+      },
+      {
+      "name" : "yard",
+      "factor" : "0.914391",
+      "subunits" : "3"
+      },
+      {
+      "name" : "pole",
+      "factor" : "5.0291505",
+      "subunits" : "11"
+      },
+      {
+      "name" : "chain",
+      "factor" : "20.116602",
+      "subunits" : "4"
+      },
+      {
+      "name" : "furlong",
+      "factor" : "201.16602"
+      },
+      {
+      "name" : "mile",
+      "factor" : "1609.32816",
+      "subunits" : "8"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: Italien",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "palmo d'architetto (Rom)",
+      "factor" : "0.223425",
+      "subunits" : "12"
+      },
+      {
+      "name" : "braccio (Florenz)",
+      "factor" : "0.5836"
+      },
+      {
+      "name" : "braccio (Mailand)",
+      "factor" : "0.5949"
+      },
+      {
+      "name" : "canna d'architetto (Rom)",
+      "factor" : "2.23425"
+      },
+      {
+      "name" : "canna di commercio (Rom)",
+      "factor" : "1.9920"
+      },
+      {
+      "name" : "canna d'architetto (Florenz)",
+      "factor" : "2.9180"
+      },
+      {
+      "name" : "canna di commercio (Florenz)",
+      "factor" : "2.3344"
+      },
+      {
+      "name" : "canna (Neapel)",
+      "factor" : "2.0961"
+      },
+      {
+      "name" : "miglio (Lombardei)",
+      "factor" : "1784.808"
+      },
+      {
+      "name" : "miglio (Neapel)",
+      "factor" : "1855.110"
+      },
+      {
+      "name" : "miglio (Rom)",
+      "factor" : "1489.50"
+      },
+      {
+      "name" : "minuta (Rom)",
+      "factor" : "0.00372375"
+      },
+      {
+      "name" : "oncia (Rom)",
+      "factor" : "0.01861875"
+      },
+      {
+      "name" : "oncia (Mailand)",
+      "factor" : "0.49575"
+      },
+      {
+      "name" : "palmo di commercio (Rom)",
+      "factor" : "0.249"
+      },
+      {
+      "name" : "palmo (Florenz)",
+      "factor" : "0.2918"
+      },
+      {
+      "name" : "piede (Brescia)",
+      "factor" : "0.471"
+      },
+      {
+      "name" : "piede (Carrara)",
+      "factor" : "0.2933"
+      },
+      {
+      "name" : "piede (Como)",
+      "factor" : "0.4512"
+      },
+      {
+      "name" : "piede (Modena)",
+      "factor" : "0.523048"
+      },
+      {
+      "name" : "piede (Reggio Em.)",
+      "factor" : "0.530898"
+      },
+      {
+      "name" : "piede (Venedig)",
+      "factor" : "0.347735"
+      },
+      {
+      "name" : "piede (Vicenza)",
+      "factor" : "0.3574"
+      },
+      {
+      "name" : "piede (Verona)",
+      "factor" : "0.3429"
+      },
+      {
+      "name" : "piede (Rom)",
+      "factor" : "0.297587"
+      },
+      {
+      "name" : "piede Lombardo",
+      "factor" : "0.435185"
+      },
+      {
+      "name" : "piede liprando (Turin)",
+      "factor" : "0.51377"
+      },
+      {
+      "name" : "piede manuale (Turin)",
+      "factor" : "0.342511"
+      },
+      {
+      "name" : "piede (Neapel, 'palmo')",
+      "factor" : "0.26455"
+      },
+      {
+      "name" : "soldo (Florenz)",
+      "factor" : "0.2918"
+      },
+      {
+      "name" : "trabucco piemontese (Turin)",
+      "factor" : "3.08259"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: Niederlande",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "voet (Amsterdam)",
+      "factor" : "0.283113"
+      },
+      {
+      "name" : "voet (Antwerpen)",
+      "factor" : "0.2868"
+      },
+      {
+      "name" : "voet (Aelst)",
+      "factor" : "0.2772"
+      },
+      {
+      "name" : "voet (Breda)",
+      "factor" : "0.28413"
+      },
+      {
+      "name" : "voet (Brügge)",
+      "factor" : "0.27439"
+      },
+      {
+      "name" : "voet (Brüssel)",
+      "factor" : "0.2757503"
+      },
+      {
+      "name" : "voet (Groningen)",
+      "factor" : "0.2922"
+      },
+      {
+      "name" : "voet (Haarlem)",
+      "factor" : "0.2858"
+      },
+      {
+      "name" : "voet (Kortrijk)",
+      "factor" : "0.2977"
+      },
+      {
+      "name" : "voet (Tournai)",
+      "factor" : "0.2977"
+      },
+      {
+      "name" : "voet (Utrecht)",
+      "factor" : "0.2683"
+      },
+      {
+      "name" : "voet (Ypern)",
+      "factor" : "0.2739"
+      },
+      {
+      "name" : "pied (Hainaut)",
+      "factor" : "0.2934"
+      },
+      {
+      "name" : "pied St. Hubert (Lüttich)",
+      "factor" : "0.294698"
+      },
+      {
+      "name" : "pied St. Lambert (Lüttich)",
+      "factor" : "0.291796"
+      },
+      {
+      "name" : "pied Ste. Gertrude (Nivelles)",
+      "factor" : "0.27709"
+      },
+      {
+      "name" : "steenvoet (Oudenaerde)",
+      "factor" : "0.2977"
+      },
+      {
+      "name" : "houtvoet (Oudenaerde)",
+      "factor" : "0.292"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: Frankreich",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "pied du Roi (Paris)",
+      "factor" : "0.32483938497"
+      },
+      {
+      "name" : "pied (Arras)",
+      "factor" : "0.29777"
+      },
+      {
+      "name" : "pied (Cambrai)",
+      "factor" : "0.29777"
+      },
+      {
+      "name" : "Burgundischer Fuß",
+      "factor" : "0.33212"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: Südeuropa",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "pié de Burgos (Spanien)",
+      "factor" : "0.278635"
+      },
+      {
+      "name" : "pé (Portugal)",
+      "factor" : "0.33"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: deutschspr. Länder",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "Fuß (Basel)",
+      "factor" : "0.29820"
+      },
+      {
+      "name" : "Fuß (Bayern)",
+      "factor" : "0.2918592"
+      },
+      {
+      "name" : "Fuß (Braunschweig)",
+      "factor" : "0.2853624"
+      },
+      {
+      "name" : "Fuß (Gotha)",
+      "factor" : "0.287622"
+      },
+      {
+      "name" : "Fuß (Hamburg)",
+      "factor" : "0.286575"
+      },
+      {
+      "name" : "Fuß (Hessen)",
+      "factor" : "0.287669"
+      },
+      {
+      "name" : "Fuß (Köln)",
+      "factor" : "0.2876"
+      },
+      {
+      "name" : "Fuß (Mecklenburg)",
+      "factor" : "0.291006"
+      },
+      {
+      "name" : "Fuß (Münster)",
+      "factor" : "0.2908"
+      },
+      {
+      "name" : "Fuß (Pommern)",
+      "factor" : "0.2921"
+      },
+      {
+      "name" : "Fuß (rheinisch)",
+      "factor" : "0.3138535"
+      },
+      {
+      "name" : "Fuß (Sachsen)",
+      "factor" : "0.2831901"
+      },
+      {
+      "name" : "Fuß (Preußen)",
+      "factor" : "0.3138535"
+      },
+      {
+      "name" : "Fuß (Wien)",
+      "factor" : "0.3180807"
+      },
+      {
+      "name" : "Fuß (Württemberg)",
+      "factor" : "0.2864903"
+      },
+      {
+      "name" : "Werkschuh (Frankfurt)",
+      "factor" : "0.2846143"
+      },
+      {
+      "name" : "Meile (Preußen)",
+      "factor" : "7532.485"
+      },
+      {
+      "name" : "Postmeile (Österreich)",
+      "factor" : "7585.937"
+      },
+      {
+      "name" : "Dezimalfuß (Preußen)",
+      "factor" : "0.3766242"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: Osteuropa",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "Fuß (Böhmen)",
+      "factor" : "0.2964"
+      },
+      {
+      "name" : "Fuß (Mähren)",
+      "factor" : "0.29596"
+      },
+      {
+      "name" : "stopa (Krakauer Fuß)",
+      "factor" : "0.3564"
+      },
+      {
+      "name" : "stopa (Warschauer Fuß)",
+      "factor" : "0.288"
+      },
+      {
+      "name" : "Fuß (Rußland)",
+      "factor" : "0.3556"
+      },
+      {
+      "name" : "arschin",
+      "factor" : "0.7112"
+      },
+      {
+      "name" : "saschen (Faden)",
+      "factor" : "2.133"
+      },
+      {
+      "name" : "werst",
+      "factor" : "1066.8"
+      },
+      {
+      "name" : "milja",
+      "factor" : "7468"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Längenmaße: Antike",
+    "group" : "1",
+    "unit" : [
+      {
+      "name" : "pes romanus",
+      "factor" : "0.2945"
+      },
+      {
+      "name" : "pollex (Zoll)",
+      "factor" : "0.0245416667"
+      },
+      {
+      "name" : "digitus (Fingerbreite)",
+      "factor" : "0.01840625"
+      },
+      {
+      "name" : "palmus (Handbreite)",
+      "factor" : "0.073625"
+      },
+      {
+      "name" : "cubitus (Elle)",
+      "factor" : "0.44175"
+      },
+      {
+      "name" : "passus (Doppelschritt)",
+      "factor" : "1.4725"
+      },
+      {
+      "name" : "pertica",
+      "factor" : "2.945"
+      },
+      {
+      "name" : "actus",
+      "factor" : "35.34"
+      },
+      {
+      "name" : "mille passus (Meile)",
+      "factor" : "1472.5"
+      },
+      {
+      "name" : "stadium (600 Fuß)",
+      "factor" : "176.7"
+      },
+      {
+      "name" : "stadium (1/8 Meile)",
+      "factor" : "184.0625"
+      },
+      {
+      "name" : "stadion (Olympia)",
+      "factor" : "192.25"
+      },
+      {
+      "name" : "Fuß (attisch)",
+      "factor" : "0.308"
+      },
+      {
+      "name" : "Fuß (Babylon)",
+      "factor" : "0.35"
+      },
+      {
+      "name" : "Fuß (Delphi)",
+      "factor" : "0.1848"
+      },
+      {
+      "name" : "Fuß (Olympia)",
+      "factor" : "0.32041667"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Zeitrechnung",
+    "group" : "3",
+    "unit" : [
+      {
+      "name" : "Anno Domini",
+      "factor" : "1",
+      "add" : "-1",
+      "subunits" : "x"
+      },
+      {
+      "name" : "ab urbe condita",
+      "factor" : "1",
+      "add" : "-753"
+      },
+      {
+      "name" : "jüdische Ära",
+      "factor" : "1",
+      "add" : "-3761"
+      },
+      {
+      "name" : "Olympiade",
+      "factor" : "4",
+      "add" : "-776"
+      },
+      {
+      "name" : "Indiktion",
+      "factor" : "15",
+      "add" : "3"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Münzen: Kirchenstaat",
+    "group" : "3",
+    "unit" : [
+      {
+      "name" : "Scudo",
+      "factor" : "1"
+      },
+      {
+      "name" : "Baiocco",
+      "factor" : "0.01"
+      },
+      {
+      "name" : "Paolo",
+      "factor" : "0.1"
+      },
+      {
+      "name" : "Quattrino",
+      "factor" : "0.2"
+      },
+      {
+      "name" : "Giulio",
+      "factor" : "0.1"
+      },
+      {
+      "name" : "Luitpold d'Or",
+      "factor" : "1.234"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Temperatur",
+    "group" : "5",
+    "unit" : [
+      {
+      "name" : "° Celsius",
+      "factor" : "1"
+      },
+      {
+      "name" : "° Fahrenheit",
+      "factor" : "0.5555555555556",
+      "add" : "-17.77777777778"
+      },
+      {
+      "name" : "° Reaumur",
+      "factor" : "1.25"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Gewichte: dezimal",
+    "group" : "6",
+    "unit" : [
+      {
+      "name" : "Gramm",
+      "factor" : "1"
+      },
+      {
+      "name" : "Milligramm",
+      "factor" : "0.001"
+      },
+      {
+      "name" : "Centigramm",
+      "factor" : "0.01"
+      },
+      {
+      "name" : "Pfund",
+      "factor" : "500"
+      },
+      {
+      "name" : "Kilogramm",
+      "factor" : "1000"
+      },
+      {
+      "name" : "Zentner",
+      "factor" : "50000"
+      },
+      {
+      "name" : "Doppelzentner",
+      "factor" : "100000"
+      },
+      {
+      "name" : "Tonne",
+      "factor" : "1000000"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Gewichte: England",
+    "group" : "6",
+    "unit" : [
+      {
+      "name" : "ounce",
+      "factor" : "31.104",
+      "subunits" : "8"
+      },
+      {
+      "name" : "grain",
+      "factor" : "0.065"
+      },
+      {
+      "name" : "scruple",
+      "factor" : "1.296",
+      "subunits" : "20"
+      },
+      {
+      "name" : "pennyweight",
+      "factor" : "1.555",
+      "subunits" : "24"
+      },
+      {
+      "name" : "dram",
+      "factor" : "3.888",
+      "subunits" : "3"
+      },
+      {
+      "name" : "pound",
+      "factor" : "373.24",
+      "subunits" : "12"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Gewichte: engl. Handel",
+    "group" : "6",
+    "unit" : [
+      {
+      "name" : "ounce",
+      "factor" : "28.349609375",
+      "subunits" : "16"
+      },
+      {
+      "name" : "dram",
+      "factor" : "1.771850585938"
+      },
+      {
+      "name" : "pound",
+      "factor" : "453.59375",
+      "subunits" : "16"
+      },
+      {
+      "name" : "stone",
+      "factor" : "6350.3125",
+      "subunits" : "14"
+      },
+      {
+      "name" : "quarter",
+      "factor" : "12700.625",
+      "subunits" : "28"
+      },
+      {
+      "name" : "hundredweight",
+      "factor" : "50802.5",
+      "subunits" : "4"
+      },
+      {
+      "name" : "long ton",
+      "factor" : "101604.16",
+      "subunits" : "20"
+      },
+      {
+      "name" : "cental",
+      "factor" : "45359.375"
+      },
+      {
+      "name" : "short ton",
+      "factor" : "907187.5",
+      "subunits" : "20"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Fläche",
+    "group" : "4",
+    "unit" : [
+      {
+      "name" : "qm",
+      "factor" : "1"
+      },
+      {
+      "name" : "qmm",
+      "factor" : "0.000001"
+      },
+      {
+      "name" : "qcm",
+      "factor" : "0.0001"
+      },
+      {
+      "name" : "qdm",
+      "factor" : "0.01"
+      },
+      {
+      "name" : "Ar",
+      "factor" : "100"
+      },
+      {
+      "name" : "Morgen",
+      "factor" : "2500"
+      },
+      {
+      "name" : "Hektar",
+      "factor" : "10000"
+      },
+      {
+      "name" : "qkm",
+      "factor" : "1000000"
+      },
+      {
+      "name" : "square inch",
+      "factor" : "0.0006452"
+      },
+      {
+      "name" : "square foot",
+      "factor" : "0.09288"
+      },
+      {
+      "name" : "square yard",
+      "factor" : "0.836",
+      "subunits" : "9"
+      },
+      {
+      "name" : "pole (rod, perch)",
+      "factor" : "25.289"
+      },
+      {
+      "name" : "rood",
+      "factor" : "1012",
+      "subunits" : "40"
+      },
+      {
+      "name" : "acre",
+      "factor" : "4048",
+      "subunits" : "4"
+      },
+      {
+      "name" : "square mile",
+      "factor" : "2590000"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Hohlmaße",
+    "group" : "2",
+    "unit" : [
+      {
+      "name" : "cbm",
+      "factor" : "1"
+      },
+      {
+      "name" : "cmm",
+      "factor" : "0.000000001"
+      },
+      {
+      "name" : "ccm",
+      "factor" : "0.000001"
+      },
+      {
+      "name" : "cdm (Liter)",
+      "factor" : "0.001"
+      },
+      {
+      "name" : "Hektoliter",
+      "factor" : "0.1"
+      },
+      {
+      "name" : "cubic inch",
+      "factor" : "0.000016387"
+      },
+      {
+      "name" : "cubic foot",
+      "factor" : "0.028317"
+      },
+      {
+      "name" : "cubic yard",
+      "factor" : "0.7646"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Flüssigkeit: England",
+    "group" : "2",
+    "unit" : [
+      {
+      "name" : "Liter",
+      "factor" : "1"
+      },
+      {
+      "name" : "gill",
+      "factor" : "0.142"
+      },
+      {
+      "name" : "pint",
+      "factor" : "0.568",
+      "subunits" : "4"
+      },
+      {
+      "name" : "quart",
+      "factor" : "1.136",
+      "subunits" : "8"
+      },
+      {
+      "name" : "gallon",
+      "factor" : "4.546",
+      "subunits" : "8"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Flüssigkeit: USA",
+    "group" : "2",
+    "unit" : [
+      {
+      "name" : "gill",
+      "factor" : "0.118"
+      },
+      {
+      "name" : "pint",
+      "factor" : "0.473",
+      "subunits" : "4"
+      },
+      {
+      "name" : "quart",
+      "factor" : "0.946",
+      "subunits" : "8"
+      },
+      {
+      "name" : "gallon",
+      "factor" : "3.787",
+      "subunits" : "8"
+      },
+      {
+      "name" : "barrel",
+      "factor" : "119.2"
+      },
+      {
+      "name" : "barrel of oil",
+      "factor" : "158.8",
+      "subunits" : "42"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Leistung",
+    "group" : "3",
+    "unit" : [
+      {
+      "name" : "Watt",
+      "factor" : "1"
+      },
+      {
+      "name" : "Milliwatt",
+      "factor" : "0.001"
+      },
+      {
+      "name" : "Kilowatt",
+      "factor" : "1000"
+      },
+      {
+      "name" : "Megawatt",
+      "factor" : "1000000"
+      },
+      {
+      "name" : "PS",
+      "factor" : "735.5"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Speicherplatz",
+    "group" : "3",
+    "unit" : [
+      {
+      "name" : "byte",
+      "factor" : "1"
+      },
+      {
+      "name" : "bit",
+      "factor" : "0.125"
+      },
+      {
+      "name" : "$100 byte",
+      "factor" : "256"
+      },
+      {
+      "name" : "kilobyte",
+      "factor" : "1000"
+      },
+      {
+      "name" : "KiloByte (Kb)",
+      "factor" : "1024"
+      },
+      {
+      "name" : "megabyte",
+      "factor" : "1000000"
+      },
+      {
+      "name" : "Megabyte (Mb)",
+      "factor" : "1048576"
+      },
+      {
+      "name" : "gigabyte",
+      "factor" : "1000000000"
+      },
+      {
+      "name" : "Gigabyte (Gb)",
+      "factor" : "1073741824"
+      }
+    ]
+  },
+
+  {
+    "name"  : "Sonstige",
+    "group" : "0",
+    "unit" : [
+      {
+      "name" : "Maßstab 1:200",
+      "factor" : "200"
+      },
+      {
+      "name" : "Maßstab",
+      "factor" : "1:100",
+      "add" : "100"
+      },
+      {
+      "name" : "Maßstab 1:75",
+      "factor" : "75"
+      },
+      {
+      "name" : "Maßstab 1:60",
+      "factor" : "60"
+      },
+      {
+      "name" : "Maßstab",
+      "factor" : "1:50",
+      "add" : "50"
+      },
+      {
+      "name" : "Maßstab 1:25",
+      "factor" : "25"
+      },
+      {
+      "name" : "Maßstab 1:20",
+      "factor" : "20"
+      },
+      {
+      "name" : "Maßstab 1:10",
+      "factor" : "10"
+      },
+      {
+      "name" : "Maßstab 1:5",
+      "factor" : "5"
+      },
+      {
+      "name" : "Maßstab 1:3",
+      "factor" : "3"
+      }
+    ]
+  }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/jquery/svg/archimedes.xml	Sun Feb 13 01:12:45 2011 +0100
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<units>
+<comment>
+  <p>Angaben nach:</p>
+  <p>Klimpert, Richard: Lexikon der Münzen, Maße, Gewichte, Zählarten und Zeitgrößen aller Länder der Erde 2) Berlin 1896 (Reprint Graz 1972)</p>
+  <p>Doursther, Horace: Dictionnaire universel des poids et mesures anciens et modernes. Paris 1840 (Reprint Amsterdam 1965)</p>
+</comment>
+<section icon="ruler" name="Längenmaße: metrisch">
+  <unit name="m" factor="1"/>
+  <unit name="mm" factor="0.001"/>
+  <unit name="cm" factor="0.01"/>
+  <unit name="dm" factor="0.1"/>
+  <unit name="km" factor="1000"/>
+</section>
+<section icon="ruler" name="Längenmaße: nautisch">
+  <unit name="geographische Meile" factor="7420"/>
+  <unit name="Seemeile" factor="1854.965"/>
+  <unit name="fathom" factor="1.828782"/>
+  <unit name="cable" factor="182.8782"/>
+  <unit name="league" factor="5564.895"/>
+</section>
+<section icon="ruler" name="Längenmaße: England">
+  <unit name="foot" factor="0.304797" subunits="12"/>
+  <unit name="inch" factor="0.02539975"/>
+  <unit name="yard" factor="0.914391" subunits="3"/>
+  <unit name="pole" factor="5.0291505" subunits="11"/>
+  <unit name="chain" factor="20.116602" subunits="4"/>
+  <unit name="furlong" factor="201.16602"/>
+  <unit name="mile" factor="1609.32816" subunits="8"/>
+</section>
+<section icon="ruler" name="Längenmaße: Italien">
+  <unit name="palmo d'architetto (Rom)" factor="0.223425" subunits="12"/>
+  <unit name="braccio (Florenz)" factor="0.5836"/>
+  <unit name="braccio (Mailand)" factor="0.5949"/>
+  <unit name="canna d'architetto (Rom)" factor="2.23425"/>
+  <unit name="canna di commercio (Rom)" factor="1.9920"/>
+  <unit name="canna d'architetto (Florenz)" factor="2.9180"/>
+  <unit name="canna di commercio (Florenz)" factor="2.3344"/>
+  <unit name="canna (Neapel)" factor="2.0961"/>
+  <unit name="miglio (Lombardei)" factor="1784.808"/>
+  <unit name="miglio (Neapel)" factor="1855.110"/>
+  <unit name="miglio (Rom)" factor="1489.50"/>
+  <unit name="minuta (Rom)" factor="0.00372375"/>
+  <unit name="oncia (Rom)" factor="0.01861875"/>
+  <unit name="oncia (Mailand)" factor="0.49575"/>
+  <unit name="palmo di commercio (Rom)" factor="0.249"/>
+  <unit name="palmo (Florenz)" factor="0.2918"/>
+  <unit name="piede (Brescia)" factor="0.471"/>
+  <unit name="piede (Carrara)" factor="0.2933"/>
+  <unit name="piede (Como)" factor="0.4512"/>
+  <unit name="piede (Modena)" factor="0.523048"/>
+  <unit name="piede (Reggio Em.)" factor="0.530898"/>
+  <unit name="piede (Venedig)" factor="0.347735"/>
+  <unit name="piede (Vicenza)" factor="0.3574"/>
+  <unit name="piede (Verona)" factor="0.3429"/>
+  <unit name="piede (Rom)" factor="0.297587"/>
+  <unit name="piede Lombardo" factor="0.435185"/>
+  <unit name="piede liprando (Turin)" factor="0.51377"/>
+  <unit name="piede manuale (Turin)" factor="0.342511"/>
+  <unit name="piede (Neapel, 'palmo')" factor="0.26455"/>
+  <unit name="soldo (Florenz)" factor="0.2918"/>
+  <unit name="trabucco piemontese (Turin)" factor="3.08259"/>
+</section>
+<section icon="ruler" name="Längenmaße: Niederlande">
+  <unit name="voet (Amsterdam)" factor="0.283113"/>
+  <unit name="voet (Antwerpen)" factor="0.2868"/>
+  <unit name="voet (Aelst)" factor="0.2772"/>
+  <unit name="voet (Breda)" factor="0.28413"/>
+  <unit name="voet (Brügge)" factor="0.27439"/>
+  <unit name="voet (Brüssel)" factor="0.2757503"/>
+  <unit name="voet (Groningen)" factor="0.2922"/>
+  <unit name="voet (Haarlem)" factor="0.2858"/>
+  <unit name="voet (Kortrijk)" factor="0.2977"/>
+  <unit name="voet (Tournai)" factor="0.2977"/>
+  <unit name="voet (Utrecht)" factor="0.2683"/>
+  <unit name="voet (Ypern)" factor="0.2739"/>
+  <unit name="pied (Hainaut)" factor="0.2934"/>
+  <unit name="pied St. Hubert (Lüttich)" factor="0.294698"/>
+  <unit name="pied St. Lambert (Lüttich)" factor="0.291796"/>
+  <unit name="pied Ste. Gertrude (Nivelles)" factor="0.27709"/>
+  <unit name="steenvoet (Oudenaerde)" factor="0.2977"/>
+  <unit name="houtvoet (Oudenaerde)" factor="0.292"/>
+</section>
+<section icon="ruler" name="Längenmaße: Frankreich">
+  <unit name="pied du Roi (Paris)" factor="0.32483938497"/>
+  <unit name="pied (Arras)" factor="0.29777"/>
+  <unit name="pied (Cambrai)" factor="0.29777"/>
+  <unit name="Burgundischer Fuß" factor="0.33212"/>
+</section>
+<section icon="ruler" name="Längenmaße: Südeuropa">
+  <unit name="pié de Burgos (Spanien)" factor="0.278635"/>
+  <unit name="pé (Portugal)" factor="0.33"/>
+</section>
+<section icon="ruler" name="Längenmaße: deutschspr. Länder">
+  <unit name="Fuß (Basel)" factor="0.29820"/>
+  <unit name="Fuß (Bayern)" factor="0.2918592"/>
+  <unit name="Fuß (Braunschweig)" factor="0.2853624"/>
+  <unit name="Fuß (Gotha)" factor="0.287622"/>
+  <unit name="Fuß (Hamburg)" factor="0.286575"/>
+  <unit name="Fuß (Hessen)" factor="0.287669"/>
+  <unit name="Fuß (Köln)" factor="0.2876"/>
+  <unit name="Fuß (Mecklenburg)" factor="0.291006"/>
+  <unit name="Fuß (Münster)" factor="0.2908"/>
+  <unit name="Fuß (Pommern)" factor="0.2921"/>
+  <unit name="Fuß (rheinisch)" factor="0.3138535"/>
+  <unit name="Fuß (Sachsen)" factor="0.2831901"/>
+  <unit name="Fuß (Preußen)" factor="0.3138535"/>
+  <unit name="Fuß (Wien)" factor="0.3180807"/>
+  <unit name="Fuß (Württemberg)" factor="0.2864903"/>
+  <unit name="Werkschuh (Frankfurt)" factor="0.2846143"/>
+  <unit name="Meile (Preußen)" factor="7532.485"/>
+  <unit name="Postmeile (Österreich)" factor="7585.937"/>
+  <unit name="Dezimalfuß (Preußen)" factor="0.3766242"/>
+</section>
+<section icon="ruler" name="Längenmaße: Osteuropa">
+  <unit name="Fuß (Böhmen)" factor="0.2964"/>
+  <unit name="Fuß (Mähren)" factor="0.29596"/>
+  <unit name="stopa (Krakauer Fuß)" factor="0.3564"/>
+  <unit name="stopa (Warschauer Fuß)" factor="0.288"/>
+  <unit name="Fuß (Rußland)" factor="0.3556"/>
+  <unit name="arschin" factor="0.7112"/>
+  <unit name="saschen (Faden)" factor="2.133"/>
+  <unit name="werst" factor="1066.8"/>
+  <unit name="milja" factor="7468"/>
+</section>
+<section icon="ruler" name="Längenmaße: Antike">
+  <unit name="pes romanus" factor="0.2945"/>
+  <unit name="pollex (Zoll)" factor="0.0245416667"/>
+  <unit name="digitus (Fingerbreite)" factor="0.01840625"/>
+  <unit name="palmus (Handbreite)" factor="0.073625"/>
+  <unit name="cubitus (Elle)" factor="0.44175"/>
+  <unit name="passus (Doppelschritt)" factor="1.4725"/>
+  <unit name="pertica" factor="2.945"/>
+  <unit name="actus" factor="35.34"/>
+  <unit name="mille passus (Meile)" factor="1472.5"/>
+  <unit name="stadium (600 Fuß)" factor="176.7"/>
+  <unit name="stadium (1/8 Meile)" factor="184.0625"/>
+  <unit name="stadion (Olympia)" factor="192.25"/>
+  <unit name="Fuß (attisch)" factor="0.308"/>
+  <unit name="Fuß (Babylon)" factor="0.35"/>
+  <unit name="Fuß (Delphi)" factor="0.1848"/>
+  <unit name="Fuß (Olympia)" factor="0.32041667"/>
+</section>
+<section icon="clock" name="Zeitrechnung">
+  <unit name="Anno Domini" factor="1" add="-1" subunits="x"/>
+  <unit name="ab urbe condita" factor="1" add="-753"/>
+  <unit name="jüdische Ära" factor="1" add="-3761"/>
+  <unit name="Olympiade" factor="4" add="-776"/>
+  <unit name="Indiktion" factor="15" add="3"/>
+</section>
+<section icon="coin" name="Münzen: Kirchenstaat">
+  <unit name="Scudo" factor="1"/>
+  <unit name="Baiocco" factor="0.01"/>
+  <unit name="Paolo" factor="0.1"/>
+  <unit name="Quattrino" factor="0.2"/>
+  <unit name="Giulio" factor="0.1"/>
+  <unit name="Luitpold d'Or" factor="1.234"/>
+</section>
+<section icon="scale" name="Temperatur">
+  <unit name="° Celsius" factor="1"/>
+  <unit name="° Fahrenheit" factor="0.5555555555556" add="-17.77777777778"/>
+  <unit name="° Reaumur" factor="1.25"/>
+</section>
+<section icon="weight" name="Gewichte: dezimal">
+  <unit name="Gramm" factor="1"/>
+  <unit name="Milligramm" factor="0.001"/>
+  <unit name="Centigramm" factor="0.01"/>
+  <unit name="Pfund" factor="500"/>
+  <unit name="Kilogramm" factor="1000"/>
+  <unit name="Zentner" factor="50000"/>
+  <unit name="Doppelzentner" factor="100000"/>
+  <unit name="Tonne" factor="1000000"/>
+</section>
+<section icon="weight" name="Gewichte: England">
+  <unit name="ounce" factor="31.104" subunits="8"/>
+  <unit name="grain" factor="0.065"/>
+  <unit name="scruple" factor="1.296" subunits="20"/>
+  <unit name="pennyweight" factor="1.555" subunits="24"/>
+  <unit name="dram" factor="3.888" subunits="3"/>
+  <unit name="pound" factor="373.24" subunits="12"/>
+</section>
+<section icon="weight" name="Gewichte: engl. Handel">
+  <unit name="ounce" factor="28.349609375" subunits="16"/>
+  <unit name="dram" factor="1.771850585938"/>
+  <unit name="pound" factor="453.59375" subunits="16"/>
+  <unit name="stone" factor="6350.3125" subunits="14"/>
+  <unit name="quarter" factor="12700.625" subunits="28"/>
+  <unit name="hundredweight" factor="50802.5" subunits="4"/>
+  <unit name="long ton" factor="101604.16" subunits="20"/>
+  <unit name="cental" factor="45359.375"/>
+  <unit name="short ton" factor="907187.5" subunits="20"/>
+</section>
+<section icon="area" name="Fläche">
+  <unit name="qm" factor="1"/>
+  <unit name="qmm" factor="0.000001"/>
+  <unit name="qcm" factor="0.0001"/>
+  <unit name="qdm" factor="0.01"/>
+  <unit name="Ar" factor="100"/>
+  <unit name="Morgen" factor="2500"/>
+  <unit name="Hektar" factor="10000"/>
+  <unit name="qkm" factor="1000000"/>
+  <unit name="square inch" factor="0.0006452"/>
+  <unit name="square foot" factor="0.09288"/>
+  <unit name="square yard" factor="0.836" subunits="9"/>
+  <unit name="pole (rod, perch)" factor="25.289"/>
+  <unit name="rood" factor="1012" subunits="40"/>
+  <unit name="acre" factor="4048" subunits="4"/>
+  <unit name="square mile" factor="2590000"/>
+</section>
+<section icon="ton" name="Hohlmaße">
+  <unit name="cbm" factor="1"/>
+  <unit name="cmm" factor="0.000000001"/>
+  <unit name="ccm" factor="0.000001"/>
+  <unit name="cdm (Liter)" factor="0.001"/>
+  <unit name="Hektoliter" factor="0.1"/>
+  <unit name="cubic inch" factor="0.000016387"/>
+  <unit name="cubic foot" factor="0.028317"/>
+  <unit name="cubic yard" factor="0.7646"/>
+</section>
+<section icon="ton" name="Flüssigkeit: England">
+  <unit name="Liter" factor="1"/>
+  <unit name="gill" factor="0.142"/>
+  <unit name="pint" factor="0.568" subunits="4"/>
+  <unit name="quart" factor="1.136" subunits="8"/>
+  <unit name="gallon" factor="4.546" subunits="8"/>
+</section>
+<section icon="ton" name="Flüssigkeit: USA">
+  <unit name="gill" factor="0.118"/>
+  <unit name="pint" factor="0.473" subunits="4"/>
+  <unit name="quart" factor="0.946" subunits="8"/>
+  <unit name="gallon" factor="3.787" subunits="8"/>
+  <unit name="barrel" factor="119.2"/>
+  <unit name="barrel of oil" factor="158.8" subunits="42"/>
+</section>
+<section icon="ton" name="Leistung">
+  <unit name="Watt" factor="1"/>
+  <unit name="Milliwatt" factor="0.001"/>
+  <unit name="Kilowatt" factor="1000"/>
+  <unit name="Megawatt" factor="1000000"/>
+  <unit name="PS" factor="735.5"/>
+</section>
+<section icon="other" name="Speicherplatz">
+  <unit name="byte" factor="1"/>
+  <unit name="bit" factor="0.125"/>
+  <unit name="$100 byte" factor="256"/>
+  <unit name="kilobyte" factor="1000"/>
+  <unit name="KiloByte (Kb)" factor="1024"/>
+  <unit name="megabyte" factor="1000000"/>
+  <unit name="Megabyte (Mb)" factor="1048576"/>
+  <unit name="gigabyte" factor="1000000000"/>
+  <unit name="Gigabyte (Gb)" factor="1073741824"/>
+</section>
+<section icon="other" name="Sonstige">
+  <unit name="Maßstab 1:1000" factor="1000"/>
+  <unit name="Maßstab 1:200" factor="200"/>
+  <unit name="Maßstab 1:100" factor="100"/>
+  <unit name="Maßstab 1:75" factor="75"/>
+  <unit name="Maßstab 1:60" factor="60"/>
+  <unit name="Maßstab 1:50" factor="50"/>
+  <unit name="Maßstab 1:25" factor="25"/>
+  <unit name="Maßstab 1:20" factor="20"/>
+  <unit name="Maßstab 1:10" factor="10"/>
+  <unit name="Maßstab 1:5" factor="5"/>
+  <unit name="Maßstab 1:3" factor="3"/>
+</section>
+</units>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/jquery/svg/jquery.digilibSVG.css	Sun Feb 13 01:12:45 2011 +0100
@@ -0,0 +1,79 @@
+/* 
+ * CSS style file for digilib SVG measuring tool
+ *
+ * Martin Raspe, Robert Casties, 11.1.2011
+ */
+body {
+    background: silver;
+    font-family: Tahoma, Helvetica, Arial;
+    }
+ 
+div#svg-toolbar {
+    border: 1px solid black;
+    color: black;
+    background-color: grey;
+    position: fixed;
+    left: 10px;
+    bottom: 10px;
+    }
+
+select {
+    border: none;
+    background-color: grey;
+    color: lightgreen;
+    font-size: 12px;
+    }
+
+span {
+    font-size: 12px;
+    }
+
+span#svg-pixel, span#svg-pixelfactor {
+    width: 50px;
+    background-color: silver;
+    color: white;
+    }
+
+
+div.digilib {
+    margin: 0px;
+}
+
+div.svg {
+    position: absolute;
+    background: transparent;
+}
+
+td {
+    vertical-align: top;
+    }
+
+div#test:hover {
+    background-color: cornsilk;
+    }
+
+#debug {
+    background-color: beige;
+    position: absolute;
+    opacity: 50%;
+    top: 4px;
+    left: 300px;
+    width: 500px;
+    padding: 0px 5px;
+    font-family: Arial;
+    font-size: 9px;
+    display: none;
+    }
+
+div._log {
+    color: grey;
+    }
+
+div._debug {
+    color: darkgreen;
+    }
+
+div._error {
+    color: red;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/jquery/svg/jquery.digilibSVG.js	Sun Feb 13 01:12:45 2011 +0100
@@ -0,0 +1,187 @@
+/* Copyright (c) 2011 Martin Raspe, Robert Casties
+ 
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+Authors:
+  Martin Raspe, Robert Casties, 9.2.2011
+*/
+
+/**
+ * digilib SVG plugin (measuring tool for use within the digilib jQuery plugin)
+**/ 
+
+
+/* jslint browser: true, debug: true, forin: true
+*/
+
+// fallback for console.log calls
+if (typeof(console) === 'undefined') {
+    var console = {
+        log : function(){}, 
+        debug : function(){}, 
+        error : function(){}
+        };
+    var customConsole = true;
+}
+
+(function($) {
+    console.debug('installing jquery.digilibSVG');
+    var pluginName = 'digilibSVG';
+    var defaults = {
+        // choice of colors offered by toolbar
+        lineColors : ['white', 'red', 'yellow', 'green', 'blue', 'black'],
+        // default color
+        lineColor : 'white',
+        // color while the line is drawn
+        drawColor : 'green',
+        // color of selected objects
+        selectColor : 'red',
+        // drawing shapes
+        shapes : ['line', 'polyline', 'rectangle', 'square', 'circle', 'arch',
+            'ratio', 'intercolumn', 'line grid'],
+        // default shape
+        shape : 'line',
+        // measuring unit (index into list)
+        unit : 1,
+        // converted unit (index into list)
+        converted : 2,
+        // last measured distance 
+        lastDistance : 0,
+        // last measured angle 
+        lastAngle : 0,
+        // maximal denominator for mixed fractions
+        maxDenominator : 20,
+        // number of decimal places for convert results
+        maxDecimals : 3,
+        // show convert result as mixed fraction?
+        showMixedFraction : false,
+        // show angle relative to last line?
+        showRelativeAngle : false,
+        // show distance numbers?
+        showDistanceNumbers : true,
+        // show ratio of rectangle sides?
+        showRectangleRatios : false,
+        // draw line ends as small crosses
+        drawEndPoints : true,
+        // draw mid points of lines
+        drawMidPoints : false,
+        // draw circle centers
+        drawCenters : false,
+        // draw rectangles from the diagonal and one point
+        drawFromDiagonal : false,
+        // draw circles from center
+        drawFromCenter : false,
+        // snap to endpoints
+        snapEndPoints : false,
+        // snap to mid points of lines
+        snapMidPoints : false,
+        // snap to circle centers
+        snapCenters : false,
+        // keep original object when moving/scaling/rotating
+        keepOriginal : false,
+        // number of copies when drawing grids
+        gridCopies : 10
+        };
+
+    // setup a div for accessing the main SVG functionality
+    var setupToolBar = function(settings) {
+        var $toolbar = $('<div id="svg-toolbar"/>');
+        // shapes select
+        var $shape = $('<select id="svg-shapes"/>');
+        for (var i = 0; i < settings.shapes.length; i++) {
+            var name = settings.shapes[i];
+            var $opt = $('<option value="' + i + '">' + name + '</option>');
+            $shape.append($opt);
+            }
+        // console.debug($xml);
+        var $xml = $(settings.xml);
+        var units = [];
+        $xml.find("unit").each(function() {
+            units.push({
+                'name' : $(this).attr("name"),
+                'factor' : $(this).attr("factor"), 
+                'add' : $(this).attr("add"), 
+                'subunits' : $(this).attr("subunits")
+                });
+            });
+        settings.units = units;
+        // unit selects
+        var $unit = $('<select id="svg-unit"/>');
+        var $conv = $('<select id="svg-convert"/>');
+        for (var i = 0; i < units.length; i++) {
+            var name = units[i].name;
+            var $opt = $('<option value="' + i + '">' + name + '</option>');
+            $unit.append($opt);
+            $conv.append($opt.clone());
+            }
+        // other elements
+        var $px = $('<span id="svg-pixel"/>');
+        var $pxlabel = $('<span id="svg-pixellabel"> px x </span>');
+        var $pxfactor = $('<span id="svg-pixelfactor"/>');
+        $('body').append($toolbar);
+        $toolbar.append($shape);
+        $toolbar.append($px);
+        $toolbar.append($pxlabel);
+        $toolbar.append($pxfactor);
+        $toolbar.append($unit);
+        $toolbar.append($conv);
+        };
+
+    var actions = {
+        "init" : function(options) {
+            var $digilib = this;
+            var settings = $.extend({}, defaults, options);
+            // prepare the AJAX call back
+            var onLoadXML = function (xml) {
+                settings.xml = xml;
+                setupToolBar(settings);
+                $digilib.each(function() {
+                    var $elem = $(this);
+                    $elem.data(pluginName, settings);
+                    });
+                };
+            // fetch the XML measuring unit list
+            $.ajax({
+                type : "GET",
+                url : "svg/archimedes.xml",
+                dataType : "xml",
+                success : onLoadXML
+                });
+            return this;
+            }
+
+        };
+
+ // hook plugin into jquery
+    $.fn[pluginName] = function(action) {
+        if (actions[action]) {
+            // call action on this with the remaining arguments (inserting data as first argument)
+            var $elem = $(this);
+            var data = $elem.data('digilib');
+            if (!data) {
+                return $.error(pluginName + ' action ' + action + ' needs a digilib element');
+                }
+            var args = Array.prototype.slice.call(arguments, 1);
+            args.unshift(data);
+            return actions[action].apply(this, args);
+        } else if (typeof(action) === 'object' || !action) {
+            // call init on this
+            return actions.init.apply(this, arguments);
+        } else {
+            $.error('action ' + action + ' does not exist on jQuery.' + pluginName);
+        }
+    };
+
+})(jQuery);
+