]> git.mxchange.org Git - friendica.git/blob - library/cropper/tests/example-CSS-Relative.htm
eliminate Cropper conflicts with jQuery
[friendica.git] / library / cropper / tests / example-CSS-Relative.htm
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
3 <head>\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>CSS - Relative 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
10         \r
11         \r
12         <script type="text/javascript" charset="utf-8">\r
13                 \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
22                 }\r
23                 \r
24                 // relative example\r
25                 Event.observe( \r
26                         window, \r
27                         'load', \r
28                         function() { \r
29                                 new Cropper.Img( \r
30                                         'testImage',\r
31                                         {\r
32                                                 onEndCrop: onEndCrop \r
33                                         }\r
34                                 ) \r
35                         }\r
36                 );      \r
37                                 \r
38                 if( typeof(dump) != 'function' ) {\r
39                         Debug.init(true, '/');\r
40                         \r
41                         function dump( msg ) {\r
42                                 Debug.raise( msg );\r
43                         };\r
44                 } else dump( '---------------------------------------\n' );\r
45                 \r
46                 \r
47         </script>\r
48         <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
49         <style type="text/css">\r
50                 label { \r
51                         clear: left;\r
52                         margin-left: 50px;\r
53                         float: left;\r
54                         width: 5em;\r
55                 }\r
56                 \r
57                 html, body { \r
58                         margin: 0;\r
59                 }\r
60                 \r
61                 #testWrap {\r
62                         margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
63                 }\r
64                 \r
65                 #test-relative {\r
66                         background-color: #ccc;\r
67                         border: 3px solid #ddd;\r
68                         position: relative;\r
69                         top: 25px;\r
70                         left: 25px;\r
71                 }\r
72         </style>\r
73 </head>\r
74 <body>\r
75         <h2>Test page with relatively positioned wrapper</h2>\r
76         <p>\r
77                 Some test content before the image\r
78         </p>\r
79 \r
80 <div id="test-relative">\r
81         <h2>Relative test</h2>\r
82         <div id="testWrap">\r
83                 <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
84         </div>\r
85         \r
86         \r
87         <p>\r
88                 <label for="x1">x1:</label>\r
89                 <input type="text" name="x1" id="x1" />\r
90         </p>\r
91         <p>\r
92                 <label for="y1">y1:</label>\r
93                 <input type="text" name="y1" id="y1" />\r
94         </p>\r
95         <p>\r
96                 <label for="x2">x2:</label>\r
97                 <input type="text" name="x2" id="x2" />\r
98         </p>\r
99         <p>\r
100                 <label for="y2">y2:</label>\r
101                 <input type="text" name="y2" id="y2" />\r
102         </p>\r
103         <p>\r
104                 <label for="width">width:</label>\r
105                 <input type="text" name="width" id="width" />\r
106         </p>\r
107         <p>\r
108                 <label for="height">height</label>\r
109                 <input type="text" name="height" id="height" />\r
110         </p>  \r
111 </div>  \r
112 \r
113 </body>\r
114 </html>\r
115 \r
116 \r