]> git.mxchange.org Git - friendica.git/blob - library/cropper/tests/example-Basic.htm
Merge pull request #674 from fermionic/20130503-basic-video-support
[friendica.git] / library / cropper / tests / example-Basic.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>Basic cropper 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                         $( 'x1' ).value = coords.x1;\r
17                         $( 'y1' ).value = coords.y1;\r
18                         $( 'x2' ).value = coords.x2;\r
19                         $( 'y2' ).value = coords.y2;\r
20                         $( 'width' ).value = dimensions.width;\r
21                         $( 'height' ).value = dimensions.height;\r
22                 }\r
23                 \r
24                 // basic 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                 \r
39                 if( typeof(dump) != 'function' ) {\r
40                         Debug.init(true, '/');\r
41                         \r
42                         function dump( msg ) {\r
43                                 Debug.raise( msg );\r
44                         };\r
45                 } else dump( '---------------------------------------\n' );\r
46                 \r
47                 \r
48         </script>\r
49         <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
50         <style type="text/css">\r
51                 label { \r
52                         clear: left;\r
53                         margin-left: 50px;\r
54                         float: left;\r
55                         width: 5em;\r
56                 }\r
57                 \r
58                 html, body { \r
59                         margin: 0;\r
60                 }\r
61                 \r
62                 #testWrap {\r
63                         margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
64                 }\r
65         </style>\r
66 </head>\r
67 <body>\r
68         <h2>Basic cropper test</h2>\r
69         <p>\r
70                 Some test content before the image\r
71         </p>\r
72         \r
73         <div id="testWrap">\r
74                 <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
75         </div>\r
76         \r
77         \r
78         <p>\r
79                 <label for="x1">x1:</label>\r
80                 <input type="text" name="x1" id="x1" />\r
81         </p>\r
82         <p>\r
83                 <label for="y1">y1:</label>\r
84                 <input type="text" name="y1" id="y1" />\r
85         </p>\r
86         <p>\r
87                 <label for="x2">x2:</label>\r
88                 <input type="text" name="x2" id="x2" />\r
89         </p>\r
90         <p>\r
91                 <label for="y2">y2:</label>\r
92                 <input type="text" name="y2" id="y2" />\r
93         </p>\r
94         <p>\r
95                 <label for="width">width:</label>\r
96                 <input type="text" name="width" id="width" />\r
97         </p>\r
98         <p>\r
99                 <label for="height">height</label>\r
100                 <input type="text" name="height" id="height" />\r
101         </p>  \r
102         \r
103 </body>\r
104 </html>\r
105 \r
106 \r