1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
\r
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
\r
4 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
\r
5 <meta http-equiv="Content-Language" content="en-us" />
\r
6 <title>Loading & displaying co-ordinates (with ratio) of crop area on attachment test<</title>
\r
7 <script src="../lib/prototype.js" type="text/javascript"></script>
\r
8 <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
\r
9 <script src="../cropper.js" type="text/javascript"></script>
\r
12 <script type="text/javascript" charset="utf-8">
\r
14 // setup the callback function
\r
15 function onEndCrop( coords, dimensions ) {
\r
16 $PR( 'x1' ).value = coords.x1;
\r
17 $PR( 'y1' ).value = coords.y1;
\r
18 $PR( 'x2' ).value = coords.x2;
\r
19 $PR( 'y2' ).value = coords.y2;
\r
20 $PR( 'width' ).value = dimensions.width;
\r
21 $PR( 'height' ).value = dimensions.height;
\r
32 onEndCrop: onEndCrop,
\r
33 displayOnInit: true,
\r
34 onloadCoords: { x1: 10, y1: 10, x2: 210, y2: 110 },
\r
35 ratioDim: { x: 200, y: 100 }
\r
42 if( typeof(dump) != 'function' ) {
\r
43 Debug.init(true, '/');
\r
45 function dump( msg ) {
\r
48 } else dump( '---------------------------------------\n' );
\r
52 <link rel="stylesheet" type="text/css" href="debug.css" media="all" />
\r
53 <style type="text/css">
\r
66 margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */
\r
71 <h2>Loading & displaying co-ordinates (with ratio) of crop area on attachment test</h2>
\r
73 Some test content before the image
\r
77 <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />
\r
82 <label for="x1">x1:</label>
\r
83 <input type="text" name="x1" id="x1" />
\r
86 <label for="y1">y1:</label>
\r
87 <input type="text" name="y1" id="y1" />
\r
90 <label for="x2">x2:</label>
\r
91 <input type="text" name="x2" id="x2" />
\r
94 <label for="y2">y2:</label>
\r
95 <input type="text" name="y2" id="y2" />
\r
98 <label for="width">width:</label>
\r
99 <input type="text" name="width" id="width" />
\r
102 <label for="height">height</label>
\r
103 <input type="text" name="height" id="height" />
\r