# HG changeset patch
# User hertzhaft
# Date 1297555965 -3600
# Node ID f8235c42f4a07b6770d49fbd9764c07c9374ab64
# Parent 34bba748004d0432bb25de7748468bd47a195d50
more preparations for SVG measuring tool
diff -r 34bba748004d -r f8235c42f4a0 client/digitallibrary/jquery/jquery-test-svg.html
--- /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 @@
+
+
+
+
+ jQuery.digilibSVG test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DEBUG
+
+
+
diff -r 34bba748004d -r f8235c42f4a0 client/digitallibrary/jquery/jquery.digilib.js
--- 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);
diff -r 34bba748004d -r f8235c42f4a0 client/digitallibrary/jquery/svg/archimedes.json
--- /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"
+ }
+ ]
+ }
+ ]
+}
diff -r 34bba748004d -r f8235c42f4a0 client/digitallibrary/jquery/svg/archimedes.xml
--- /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 @@
+
+
+
+ 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)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 34bba748004d -r f8235c42f4a0 client/digitallibrary/jquery/svg/jquery.digilibSVG.css
--- /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;
+ }
+
diff -r 34bba748004d -r f8235c42f4a0 client/digitallibrary/jquery/svg/jquery.digilibSVG.js
--- /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 .
+
+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 = $('');
+ // shapes select
+ var $shape = $('');
+ for (var i = 0; i < settings.shapes.length; i++) {
+ var name = settings.shapes[i];
+ var $opt = $('');
+ $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 = $('');
+ var $conv = $('');
+ for (var i = 0; i < units.length; i++) {
+ var name = units[i].name;
+ var $opt = $('');
+ $unit.append($opt);
+ $conv.append($opt.clone());
+ }
+ // other elements
+ var $px = $('');
+ var $pxlabel = $(' px x ');
+ var $pxfactor = $('');
+ $('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);
+