]> git.mxchange.org Git - friendica.git/blob - view/smarty3/cropbody.tpl
Merge pull request #580 from fermionic/20130111-better-conversion-scripts
[friendica.git] / view / smarty3 / cropbody.tpl
1 {{*
2  *      AUTOMATICALLY GENERATED TEMPLATE
3  *      DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
4  *
5  *}}
6 <h1>{{$title}}</h1>
7 <p id="cropimage-desc">
8 {{$desc}}
9 </p>
10 <div id="cropimage-wrapper">
11 <img src="{{$image_url}}" id="croppa" class="imgCrop" alt="{{$title}}" />
12 </div>
13 <div id="cropimage-preview-wrapper" >
14 <div id="previewWrap" ></div>
15 </div>
16
17 <script type="text/javascript" language="javascript">
18
19         function onEndCrop( coords, dimensions ) {
20                 $( 'x1' ).value = coords.x1;
21                 $( 'y1' ).value = coords.y1;
22                 $( 'x2' ).value = coords.x2;
23                 $( 'y2' ).value = coords.y2;
24                 $( 'width' ).value = dimensions.width;
25                 $( 'height' ).value = dimensions.height;
26         }
27
28         Event.observe( window, 'load', function() {
29                 new Cropper.ImgWithPreview(
30                 'croppa',
31                 {
32                         previewWrap: 'previewWrap',
33                         minWidth: 175,
34                         minHeight: 175,
35                         maxWidth: 640,
36                         maxHeight: 640,
37                         ratioDim: { x: 100, y:100 },
38                         displayOnInit: true,
39                         onEndCrop: onEndCrop
40                 }
41                 );
42         }
43         );
44
45 </script>
46
47 <form action="profile_photo/{{$resource}}" id="crop-image-form" method="post" />
48 <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
49
50 <input type='hidden' name='profile' value='{{$profile}}'>
51 <input type="hidden" name="cropfinal" value="1" />
52 <input type="hidden" name="xstart" id="x1" />
53 <input type="hidden" name="ystart" id="y1" />
54 <input type="hidden" name="xfinal" id="x2" />
55 <input type="hidden" name="yfinal" id="y2" />
56 <input type="hidden" name="height" id="height" />
57 <input type="hidden" name="width"  id="width" />
58
59 <div id="crop-image-submit-wrapper" >
60 <input type="submit" name="submit" value="{{$done}}" />
61 </div>
62
63 </form>