aboutsummaryrefslogtreecommitdiffstats
path: root/view/sv/cropbody.tpl
blob: ddc8047340c17ea60546b833bf45155b5f3759fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<h1>Besk&auml;r bild</h1>
<p id="cropimage-desc">
V&auml;lj hur bilden ska besk&auml;ras f&ouml;r att se s&aring; bra ut som m&ouml;jligt.
</p>
<div id="cropimage-wrapper">
<img src="$image_url" id="croppa" class="imgCrop" alt="" />
</div>
<div id="cropimage-preview-wrapper" >
<div id="previewWrap" ></div>
</div>

<script type="text/javascript" language="javascript">

	function onEndCrop( coords, dimensions ) {
		$( 'x1' ).value = coords.x1;
		$( 'y1' ).value = coords.y1;
		$( 'x2' ).value = coords.x2;
		$( 'y2' ).value = coords.y2;
		$( 'width' ).value = dimensions.width;
		$( 'height' ).value = dimensions.height;
	}

	Event.observe( window, 'load', function() {
		new Cropper.ImgWithPreview(
		'croppa',
		{
			previewWrap: 'previewWrap',
			minWidth: 175,
			minHeight: 175,
			maxWidth: 640,
			maxHeight: 640,
			ratioDim: { x: 100, y:100 },
			displayOnInit: true,
			onEndCrop: onEndCrop
		}
		);
	}
	);

</script>

<form action="profile_photo/$resource" id="crop-image-form" method="post" />

<input type="hidden" name="imagename" value="$hash" />
<input type="hidden" name="cropfinal" value="1" />
<input type="hidden" name="xstart" id="x1" />
<input type="hidden" name="ystart" id="y1" />
<input type="hidden" name="xfinal" id="x2" />
<input type="hidden" name="yfinal" id="y2" />
<input type="hidden" name="height" id="height" />
<input type="hidden" name="width"  id="width" />

<div id="crop-image-submit-wrapper" >
<input type="submit" name="submit" value="Spara" />
</div>

</form>