1 <h1>Beskär bild</h1>
2 <p id="cropimage-desc">
3 Välj hur bilden ska beskäras för att se så bra ut som möjligt.
5 <div id="cropimage-wrapper">
6 <img src="$image_url" id="croppa" class="imgCrop" alt="" />
8 <div id="cropimage-preview-wrapper" >
9 <div id="previewWrap" ></div>
12 <script type="text/javascript" language="javascript">
14 function onEndCrop( coords, dimensions ) {
15 $( 'x1' ).value = coords.x1;
16 $( 'y1' ).value = coords.y1;
17 $( 'x2' ).value = coords.x2;
18 $( 'y2' ).value = coords.y2;
19 $( 'width' ).value = dimensions.width;
20 $( 'height' ).value = dimensions.height;
23 Event.observe( window, 'load', function() {
24 new Cropper.ImgWithPreview(
27 previewWrap: 'previewWrap',
32 ratioDim: { x: 100, y:100 },
42 <form action="profile_photo/$resource" id="crop-image-form" method="post" />
44 <input type="hidden" name="imagename" value="$hash" />
45 <input type="hidden" name="cropfinal" value="1" />
46 <input type="hidden" name="xstart" id="x1" />
47 <input type="hidden" name="ystart" id="y1" />
48 <input type="hidden" name="xfinal" id="x2" />
49 <input type="hidden" name="yfinal" id="y2" />
50 <input type="hidden" name="height" id="height" />
51 <input type="hidden" name="width" id="width" />
53 <div id="crop-image-submit-wrapper" >
54 <input type="submit" name="submit" value="Spara" />