diff options
Diffstat (limited to 'views/default/forms/avatar/crop.php')
-rw-r--r-- | views/default/forms/avatar/crop.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php index 1082ab803..856546020 100644 --- a/views/default/forms/avatar/crop.php +++ b/views/default/forms/avatar/crop.php @@ -9,10 +9,7 @@ $master_image = $vars['entity']->getIcon('master'); ?> <p> - <?php echo elgg_echo("avatar:create:instructions"); ?> -</p> -<p> - <img id="user_avatar" src="<?php echo $master_image; ?>" alt="<?php echo elgg_echo('avatar'); ?>" /> + <img id="user-avatar" src="<?php echo $master_image; ?>" alt="<?php echo elgg_echo('avatar'); ?>" /> </p> <div class="clearfloat"></div> @@ -28,7 +25,7 @@ echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create'))); ?> <!-- grab the required js for icon cropping --> -<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/profile/views/default/js/jquery.imgareaselect-0.8.min.js"></script> +<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.imgareaselect-0.8.min.js"></script> <script type="text/javascript"> @@ -39,11 +36,11 @@ echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create'))); return; } - var origWidth = $("#user_avatar").width(); //get the width of the users master photo - var origHeight = $("#user_avatar").height(); //get the height of the users master photo + var origWidth = $("#user-avatar").width(); //get the width of the users master photo + var origHeight = $("#user-avatar").height(); //get the height of the users master photo var scaleX = 100 / selection.width; var scaleY = 100 / selection.height; - $('#user_avatar_preview > img').css({ + $('#user-avatar-preview > img').css({ width: Math.round(scaleX * origWidth) + 'px', height: Math.round(scaleY * origHeight) + 'px', marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', @@ -60,12 +57,12 @@ echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create'))); } $(document).ready(function() { - $('<div id="user_avatar_preview"><img src="<?php echo $master_image; ?>" /></div>').insertAfter($('#user_avatar')); - $('<div id="user_avatar_preview_title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div>').insertBefore($('#user_avatar_preview')); + $('<div id="user-avatar-preview"><img src="<?php echo $master_image; ?>" /></div>').insertAfter($('#user-avatar')); + $('<div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div>').insertBefore($('#user-avatar-preview')); // this produces the coordinates - $('#user_avatar').imgAreaSelect({ selectionOpacity: 0, onSelectEnd: selectChange }); + $('#user-avatar').imgAreaSelect({ selectionOpacity: 0, onSelectEnd: selectChange }); // show the preview - $('#user_avatar').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview }); + $('#user-avatar').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview }); }); </script> |