]> git.mxchange.org Git - friendica.git/blob - view/sv/cropbody.tpl
Edited view/sv/cropbody.tpl via GitHub
[friendica.git] / view / sv / cropbody.tpl
1 <h1>Besk&auml;r bild</h1>
2 <p id="cropimage-desc">
3 V&auml;lj hur bilden ska besk&auml;ras f&ouml;r att se s&aring; bra ut som m&ouml;jligt.
4 </p>
5 <div id="cropimage-wrapper">
6 <img src="$image_url" id="croppa" class="imgCrop" alt="" />
7 </div>
8 <div id="cropimage-preview-wrapper" >
9 <div id="previewWrap" ></div>
10 </div>
11
12 <script type="text/javascript" language="javascript">
13
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;
21         }
22
23         Event.observe( window, 'load', function() {
24                 new Cropper.ImgWithPreview(
25                 'croppa',
26                 {
27                         previewWrap: 'previewWrap',
28                         minWidth: 175,
29                         minHeight: 175,
30                         maxWidth: 640,
31                         maxHeight: 640,
32                         ratioDim: { x: 100, y:100 },
33                         displayOnInit: true,
34                         onEndCrop: onEndCrop
35                 }
36                 );
37         }
38         );
39
40 </script>
41
42 <form action="profile_photo/$resource" id="crop-image-form" method="post" />
43
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" />
52
53 <div id="crop-image-submit-wrapper" >
54 <input type="submit" name="submit" value="Spara" />
55 </div>
56
57 </form>