Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.1 KiB

11 years ago
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4. <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  5. <meta http-equiv="Content-Language" content="en-us" />
  6. <title>CSS - Float test</title>
  7. <script src="../lib/prototype.js" type="text/javascript"></script>
  8. <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
  9. <script src="../cropper.js" type="text/javascript"></script>
  10. <script type="text/javascript" charset="utf-8">
  11. // setup the callback function
  12. function onEndCrop( coords, dimensions ) {
  13. $( 'x1' ).value = coords.x1;
  14. $( 'y1' ).value = coords.y1;
  15. $( 'x2' ).value = coords.x2;
  16. $( 'y2' ).value = coords.y2;
  17. $( 'width' ).value = dimensions.width;
  18. $( 'height' ).value = dimensions.height;
  19. }
  20. // float example
  21. Event.observe(
  22. window,
  23. 'load',
  24. function() {
  25. new Cropper.Img(
  26. 'testFloatImage',
  27. {
  28. onEndCrop: function( coords, dimensions ) {
  29. $( 'floatX1' ).value = coords.x1;
  30. $( 'floatY1' ).value = coords.y1;
  31. $( 'floatX2' ).value = coords.x2;
  32. $( 'floatY2' ).value = coords.y2;
  33. $( 'floatWidth' ).value = dimensions.width;
  34. $( 'floatHeight' ).value = dimensions.height;
  35. }
  36. }
  37. );
  38. }
  39. );
  40. if( typeof(dump) != 'function' ) {
  41. Debug.init(true, '/');
  42. function dump( msg ) {
  43. Debug.raise( msg );
  44. };
  45. } else dump( '---------------------------------------\n' );
  46. </script>
  47. <link rel="stylesheet" type="text/css" href="debug.css" media="all" />
  48. <style type="text/css">
  49. label {
  50. clear: left;
  51. margin-left: 50px;
  52. float: left;
  53. width: 5em;
  54. }
  55. html, body {
  56. margin: 0;
  57. }
  58. #testWrap {
  59. margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */
  60. }
  61. #test-float {
  62. width: 600px;
  63. float: right;
  64. background-color: #eee;
  65. border: 3px solid #000;
  66. margin: 10px;
  67. padding: 5px;
  68. }
  69. </style>
  70. </head>
  71. <body>
  72. <h2>Test page with floating wrapper</h2>
  73. <p>
  74. Some test content before the image
  75. </p>
  76. <div id="test-float">
  77. <h2>Float test</h2>
  78. <div id="testFloatWrap">
  79. <img src="castle.jpg" alt="test image" id="testFloatImage" width="500" height="333" />
  80. </div>
  81. <p>
  82. <label for="floatX1">x1:</label>
  83. <input type="text" name="floatX1" id="floatX1" />
  84. </p>
  85. <p>
  86. <label for="floatY1">y1:</label>
  87. <input type="text" name="floatY1" id="floatY1" />
  88. </p>
  89. <p>
  90. <label for="floatX2">x2:</label>
  91. <input type="text" name="floatX2" id="floatX2" />
  92. </p>
  93. <p>
  94. <label for="floatY2">y2:</label>
  95. <input type="text" name="floatY2" id="floatY2" />
  96. </p>
  97. <p>
  98. <label for="floatWidth">width:</label>
  99. <input type="text" name="floatWidth" id="floatWidth" />
  100. </p>
  101. <p>
  102. <label for="floatHeight">height</label>
  103. <input type="text" name="floatHeight" id="floatHeight" />
  104. </p>
  105. </div>
  106. </body>
  107. </html>