aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropper/tests/example-CSS-Float.htm
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-28 21:11:52 -0700
committerFriendika <info@friendika.com>2011-06-28 21:11:52 -0700
commit0b221e8945ae785dc706d8ea9a9e8e25532c0096 (patch)
tree52d4978006b028c24ee1feb3cf6ba2907a48c88f /library/cropper/tests/example-CSS-Float.htm
parent60caa0349416dad1a3a891e3c0e00d33d25d7a91 (diff)
downloadvolse-hubzilla-0b221e8945ae785dc706d8ea9a9e8e25532c0096.tar.gz
volse-hubzilla-0b221e8945ae785dc706d8ea9a9e8e25532c0096.tar.bz2
volse-hubzilla-0b221e8945ae785dc706d8ea9a9e8e25532c0096.zip
bug #96 move libraries to library - better alignment of like rotator
Diffstat (limited to 'library/cropper/tests/example-CSS-Float.htm')
-rw-r--r--library/cropper/tests/example-CSS-Float.htm124
1 files changed, 124 insertions, 0 deletions
diff --git a/library/cropper/tests/example-CSS-Float.htm b/library/cropper/tests/example-CSS-Float.htm
new file mode 100644
index 000000000..5066553fe
--- /dev/null
+++ b/library/cropper/tests/example-CSS-Float.htm
@@ -0,0 +1,124 @@
+<!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" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Language" content="en-us" />
+ <title>CSS - Float test</title>
+ <script src="../lib/prototype.js" type="text/javascript"></script>
+ <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
+ <script src="../cropper.js" type="text/javascript"></script>
+
+
+ <script type="text/javascript" charset="utf-8">
+
+ // setup the callback function
+ function onEndCrop( coords, dimensions ) {
+ $( 'x1' ).value = coords.x1;
+ $( 'y1' ).value = coords.y1;
+ $( 'x2' ).value = coords.x2;
+ $( 'y2' ).value = coords.y2;
+ $( 'width' ).value = dimensions.width;
+ $( 'height' ).value = dimensions.height;
+ }
+
+ // float example
+ Event.observe(
+ window,
+ 'load',
+ function() {
+ new Cropper.Img(
+ 'testFloatImage',
+ {
+ onEndCrop: function( coords, dimensions ) {
+ $( 'floatX1' ).value = coords.x1;
+ $( 'floatY1' ).value = coords.y1;
+ $( 'floatX2' ).value = coords.x2;
+ $( 'floatY2' ).value = coords.y2;
+ $( 'floatWidth' ).value = dimensions.width;
+ $( 'floatHeight' ).value = dimensions.height;
+ }
+ }
+ );
+ }
+ );
+
+ if( typeof(dump) != 'function' ) {
+ Debug.init(true, '/');
+
+ function dump( msg ) {
+ Debug.raise( msg );
+ };
+ } else dump( '---------------------------------------\n' );
+
+
+ </script>
+ <link rel="stylesheet" type="text/css" href="debug.css" media="all" />
+ <style type="text/css">
+ label {
+ clear: left;
+ margin-left: 50px;
+ float: left;
+ width: 5em;
+ }
+
+ html, body {
+ margin: 0;
+ }
+
+ #testWrap {
+ margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */
+ }
+
+ #test-float {
+ width: 600px;
+ float: right;
+ background-color: #eee;
+ border: 3px solid #000;
+ margin: 10px;
+ padding: 5px;
+ }
+
+ </style>
+</head>
+<body>
+ <h2>Test page with floating wrapper</h2>
+ <p>
+ Some test content before the image
+ </p>
+
+<div id="test-float">
+ <h2>Float test</h2>
+ <div id="testFloatWrap">
+ <img src="castle.jpg" alt="test image" id="testFloatImage" width="500" height="333" />
+ </div>
+
+ <p>
+ <label for="floatX1">x1:</label>
+ <input type="text" name="floatX1" id="floatX1" />
+ </p>
+ <p>
+ <label for="floatY1">y1:</label>
+ <input type="text" name="floatY1" id="floatY1" />
+ </p>
+ <p>
+ <label for="floatX2">x2:</label>
+ <input type="text" name="floatX2" id="floatX2" />
+ </p>
+ <p>
+ <label for="floatY2">y2:</label>
+ <input type="text" name="floatY2" id="floatY2" />
+ </p>
+ <p>
+ <label for="floatWidth">width:</label>
+ <input type="text" name="floatWidth" id="floatWidth" />
+ </p>
+ <p>
+ <label for="floatHeight">height</label>
+ <input type="text" name="floatHeight" id="floatHeight" />
+ </p>
+</div>
+
+</body>
+</html>
+
+