+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
- <meta http-equiv="Content-Language" content="en-us" />\r
- <title>Min (single axis) dimensions test</title>\r
- <script src="../lib/prototype.js" type="text/javascript"></script> \r
- <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
- <script src="../cropper.js" type="text/javascript"></script>\r
- \r
- \r
- <script type="text/javascript" charset="utf-8">\r
- \r
- function onEndCrop( coords, dimensions ) {\r
- $PR( 'x1' ).value = coords.x1;\r
- $PR( 'y1' ).value = coords.y1;\r
- $PR( 'x2' ).value = coords.x2;\r
- $PR( 'y2' ).value = coords.y2;\r
- $PR( 'width' ).value = dimensions.width;\r
- $PR( 'height' ).value = dimensions.height;\r
- }\r
- \r
- // example with minimum dimensions\r
- Event.observe( \r
- window, \r
- 'load', \r
- function() { \r
- new Cropper.Img( \r
- 'testImage', \r
- { \r
- minWidth: 200, \r
- displayOnInit: true, \r
- onEndCrop: onEndCrop \r
- } \r
- ) \r
- } \r
- );\r
- \r
- /*\r
- if( typeof(dump) != 'function' ) {\r
- Debug.init(true, '/');\r
- \r
- function dump( msg ) {\r
- // Debug.raise( msg );\r
- };\r
- } else dump( '---------------------------------------\n' );\r
- */\r
- \r
- </script>\r
- <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
- <style type="text/css">\r
- label { \r
- clear: left;\r
- margin-left: 50px;\r
- float: left;\r
- width: 5em;\r
- }\r
- \r
- #testWrap {\r
- margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
- }\r
- </style>\r
-</head>\r
-<body> \r
- <h2>Minimum (single axis) dimension test</h2>\r
- <p>\r
- Test of applying a minimum dimension to only one axis (width in this case) to the cropper\r
- </p>\r
- <br />\r
- <br /><br />\r
- \r
- <div id="testWrap">\r
- <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
- </div>\r
- \r
- \r
- <p>\r
- <label for="x1">x1:</label>\r
- <input type="text" name="x1" id="x1" />\r
- </p>\r
- <p>\r
- <label for="y1">y1:</label>\r
- <input type="text" name="y1" id="y1" />\r
- </p>\r
- <p>\r
- <label for="x2">x2:</label>\r
- <input type="text" name="x2" id="x2" />\r
- </p>\r
- <p>\r
- <label for="y2">y2:</label>\r
- <input type="text" name="y2" id="y2" />\r
- </p>\r
- <p>\r
- <label for="width">width:</label>\r
- <input type="text" name="width" id="width" />\r
- </p>\r
- <p>\r
- <label for="height">height</label>\r
- <input type="text" name="height" id="height" />\r
- </p> \r
- \r
-</body>\r
-</html>\r
-\r
-\r