Blame view

sources/apps/contacts/js/cropphoto.js 599 Bytes
d1bafeea1   Kload   [fix] Upgrade to ...
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
  jQuery(function($) {
  	$('#cropbox').Jcrop({
  		onChange:	showCoords,
  		onSelect:	showCoords,
  		onRelease:	clearCoords,
  		maxSize:	[399, 399],
  		bgColor:	'black',
  		bgOpacity:	.4,
  		boxWidth: 	400,
  		boxHeight:	400,
  		setSelect:	[ 100, 130, 50, 50 ]//,
  		//aspectRatio: 0.8
  	});
  });
  // Simple event handler, called from onChange and onSelect
  // event handlers, as per the Jcrop invocation above
  function showCoords(c) {
  	$('#x1').val(c.x);
  	$('#y1').val(c.y);
  	$('#x2').val(c.x2);
  	$('#y2').val(c.y2);
  	$('#w').val(c.w);
  	$('#h').val(c.h);
  };
  
  function clearCoords() {
  	$('#coords input').val('');
  };