From dc28ff0bed2216d97e24b1286c68190c843cb684 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 23 Jun 2008 16:23:58 +0000 Subject: added coordinates to the icon cropper git-svn-id: https://code.elgg.org/elgg/trunk@1067 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/profile/views/default/profile/editicon.php | 41 ++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/profile/views/default/profile/editicon.php b/mod/profile/views/default/profile/editicon.php index 670cf83dc..c3da9511a 100644 --- a/mod/profile/views/default/profile/editicon.php +++ b/mod/profile/views/default/profile/editicon.php @@ -52,19 +52,56 @@ marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' }); } + var $x1, $y1, $x2, $y2, $w, $h; + + function selectChange(img, selection){ + $x1.text(selection.x1); + $y1.text(selection.y1); + $x2.text(selection.x2); + $y2.text(selection.y2); + $w.text(selection.width); + $h.text(selection.height); + } + $(document).ready(function () { + $x1 = $('#x1'); + $y1 = $('#y1'); + $x2 = $('#x2'); + $y2 = $('#y2'); + $w = $('#w'); + $h = $('#h'); + $('
') .css({ float: 'left', position: 'relative', overflow: 'hidden', width: '100px', height: '100px' }) .insertAfter($('#user_avatar')); }); $(window).load(function () { + + $('#user_avatar').imgAreaSelect({ selectionOpacity: 0, onSelectEnd: selectChange }); $('#user_avatar').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview }); - $('#user_avatar').imgAreaSelect({ x1: 100, y1: 100, x2: 200, y2: 200 }); + }); +

User profile photo -

\ No newline at end of file +

+
+

+ Selection coordinates:
+ + X1:
+ Y1:
+ X2:
+ + Y2:
+
+ Selection dimensions:
+ Width:
+ Height: + +

+
\ No newline at end of file -- cgit v1.2.3