]> git.mxchange.org Git - friendica.git/blob - library/cropper/tests/example-Preview.htm
add remove_user hook (it looks like dreamhost changed all my file permissions, this...
[friendica.git] / library / cropper / tests / example-Preview.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></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                 function onEndCrop( coords, dimensions ) {\r
15                         $( 'x1' ).value = coords.x1;\r
16                         $( 'y1' ).value = coords.y1;\r
17                         $( 'x2' ).value = coords.x2;\r
18                         $( 'y2' ).value = coords.y2;\r
19                         $( 'width' ).value = dimensions.width;\r
20                         $( 'height' ).value = dimensions.height;\r
21                 }\r
22                 \r
23                 // example with a preview of crop results, must have minimumm dimensions\r
24                 Event.observe( \r
25                         window, \r
26                         'load', \r
27                         function() { \r
28                                 new Cropper.ImgWithPreview( \r
29                                         'testImage',\r
30                                         { \r
31                                                 minWidth: 200, \r
32                                                 minHeight: 120,\r
33                                                 ratioDim: { x: 200, y: 120 },\r
34                                                 displayOnInit: true, \r
35                                                 onEndCrop: onEndCrop,\r
36                                                 previewWrap: 'previewArea'\r
37                                         } \r
38                                 ) \r
39                         } \r
40                 );\r
41                 \r
42                 /*\r
43                 if( typeof(dump) != 'function' ) {\r
44                         Debug.init(true, '/');\r
45                         \r
46                         function dump( msg ) {\r
47                                 // Debug.raise( msg );\r
48                         };\r
49                 } else dump( '---------------------------------------\n' );\r
50                 */\r
51                 \r
52         </script>\r
53         <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
54         <style type="text/css">\r
55                 label { \r
56                         clear: left;\r
57                         margin-left: 50px;\r
58                         float: left;\r
59                         width: 5em;\r
60                 }\r
61                 \r
62                 #testWrap {\r
63                         width: 500px;\r
64                         float: left;\r
65                         margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
66                 }\r
67                 \r
68                 #previewArea {\r
69                         margin: 20px; 0 0 20px;\r
70                         float: left;\r
71                 }\r
72                 \r
73                 #results {\r
74                         clear: both;\r
75                 }\r
76         </style>\r
77 </head>\r
78 <body>  \r
79         <br /><br />\r
80         \r
81         <div id="testWrap">\r
82                 <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
83         </div>\r
84         \r
85         <div id="previewArea"></div>\r
86         \r
87         <div id="results">\r
88                 <p>\r
89                         <label for="x1">x1:</label>\r
90                         <input type="text" name="x1" id="x1" />\r
91                 </p>\r
92                 <p>\r
93                         <label for="y1">y1:</label>\r
94                         <input type="text" name="y1" id="y1" />\r
95                 </p>\r
96                 <p>\r
97                         <label for="x2">x2:</label>\r
98                         <input type="text" name="x2" id="x2" />\r
99                 </p>\r
100                 <p>\r
101                         <label for="y2">y2:</label>\r
102                         <input type="text" name="y2" id="y2" />\r
103                 </p>\r
104                 <p>\r
105                         <label for="width">width:</label>\r
106                         <input type="text" name="width" id="width" />\r
107                 </p>\r
108                 <p>\r
109                         <label for="height">height</label>\r
110                         <input type="text" name="height" id="height" />\r
111                 </p>\r
112         </div> \r
113         \r
114 </body>\r
115 </html>\r
116 \r
117 \r