changeset 764:f640f1fe8f80 jquery

merge with 31664707999e6f7a1e9c7129958b13376c7429e8
author robcast
date Thu, 10 Feb 2011 13:01:10 +0100
parents aab01da232ef (diff) 31664707999e (current diff)
children 8d5239d7b1d4 68b0c7a8ca7c
files
diffstat 3 files changed, 76 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery-test-embedded.html	Thu Feb 10 12:51:19 2011 +0100
+++ b/client/digitallibrary/jquery/jquery-test-embedded.html	Thu Feb 10 13:01:10 2011 +0100
@@ -15,6 +15,11 @@
                 /* width: 220px; */
             }
 
+            div.svg {
+                position: absolute;
+                background: transparent;
+            }
+
             td {
                 vertical-align: top;
                 }
--- a/client/digitallibrary/jquery/jquery-test-full.html	Thu Feb 10 12:51:19 2011 +0100
+++ b/client/digitallibrary/jquery/jquery-test-full.html	Thu Feb 10 13:01:10 2011 +0100
@@ -9,6 +9,26 @@
                  background: silver;
             }
 
+            div.digilib {
+                /* padding for buttons and bird-div */
+                padding-right: 18px;
+                padding-bottom: 100px;
+                /* width: 220px; */
+            }
+
+            div.svg {
+                position: absolute;
+                background: transparent;
+            }
+
+            td {
+                vertical-align: top;
+                }
+
+            div#test:hover {
+                background-color: cornsilk;
+                }
+
             #debug {
                 background-color: beige;
                 position: absolute;
@@ -21,6 +41,17 @@
                 font-size: 9px;
                 }
 
+            div._log {
+                color: grey;
+                }
+
+            div._debug {
+                color: darkgreen;
+                }
+
+            div._error {
+                color: red;
+                }
         </style>
 
         <script type="text/javascript" src="jquery-1.4.4.js"></script>
--- a/client/digitallibrary/jquery/svg/svgBasics.html	Thu Feb 10 12:51:19 2011 +0100
+++ b/client/digitallibrary/jquery/svg/svgBasics.html	Thu Feb 10 13:01:10 2011 +0100
@@ -1,19 +1,28 @@
+
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<title>jQuery SVG Basics</title>
-<style type="text/css">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+        <title>jQuery SVG Basics</title>
+        <style type="text/css">
 @import "jquery.svg.css";
 
-#svgbasics { width: 400px; height: 300px; border: 1px solid #484; }
-</style>
-<script type="text/javascript" src="../jquery-1.4.4.js"></script>
-<script type="text/javascript" src="jquery.svg.js"></script>
-<script type="text/javascript">
+#svgbasics { position: absolute; border: 1px solid blue; }
+#img img {width: 400px; }
+
+        </style>
+        <script type="text/javascript" src="../dlGeometry.js"></script>
+        <script type="text/javascript" src="../jquery-1.4.4.js"></script>
+        <script type="text/javascript" src="jquery.svg.js"></script>
+        <script type="text/javascript">
 $(function() {
-	$('#svgbasics').svg({onLoad: drawInitial});
+    var geom = dlGeometry();
+    var svg = $('#svgbasics');
+    var $div = $('#img img');
+    var divrect = geom.rectangle($div);
+    divrect.addPosition({x: -1, y: -1}).adjustDiv(svg);
+    svg.svg({onLoad: drawInitial});
 	$('button').click(drawShape);
 });
 
@@ -22,6 +31,7 @@
 	var g = svg.group({stroke: 'black', 'stroke-width': 2});
 	svg.line(g, 15, 75, 135, 75);
 	svg.line(g, 75, 15, 75, 135);
+	svg.configure({viewPort: '0 0 100 100', overflow: 'visible' }, false);
 }
 
 var colours = ['purple', 'red', 'orange', 'yellow', 'lime', 'green', 'blue', 'navy', 'black'];
@@ -51,24 +61,30 @@
 	else if (shape == 'clear') {
 		svg.clear();
 	}
+	else if (shape == 'zoom') {
+		svg.clear();
+	}
+	
 }
 
 function random(range) {
 	return Math.floor(Math.random() * range);
 }
 </script>
-</head>
-<body>
-<h1>jQuery SVG Basics</h1>
-<p>This page demonstrates the very basics of the <a href="http://keith-wood.name/svg.html">jQuery SVG plugin</a>.
-	It contains the minimum requirements for using the plugin and
-	can be used as the basis for your own experimentation.</p>
-<p>The page creates an SVG document in the area below and draws an initial display.
-	The buttons then add randomly sized and coloured shapes on demand.</p>
-<p>For more detail see the <a href="http://keith-wood.name/svgRef.html">documentation reference</a> page.</p>
-<div id="svgbasics"></div>
-<p><button id="rect">Add rectangle</button> <button id="line">Add line</button>
-	<button id="circle">Add circle</button> <button id="ellipse">Add ellipse</button>
-	<button id="clear">Clear</button></p>
-</body>
+    </head>
+    <body>
+        <h1>jQuery SVG</h1>
+        <div id="img">
+            <img src="peterskuppel.jpg" />
+        </div>
+        <div id="svgbasics"></div>
+        <p>
+            <button id="rect">Add rectangle</button>
+            <button id="line">Add line</button>
+            <button id="circle">Add circle</button>
+            <button id="ellipse">Add ellipse</button>
+            <button id="zoom">Zoom</button>
+            <button id="clear">Clear</button>
+        </p>
+    </body>
 </html>