Changeset 8629
- Timestamp:
- 07/15/2014 11:37:32 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-cssjs.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-cssjs.php
r8612 r8629 67 67 // Bail if no image was uploaded 68 68 $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir ) ); 69 if ( empty( $image ) ) 69 if ( empty( $image ) ) { 70 70 return; 71 } 71 72 72 // 73 // Get avatar full width and height 73 74 $full_height = bp_core_avatar_full_height(); 74 75 $full_width = bp_core_avatar_full_width(); … … 92 93 onChange: showPreview, 93 94 onSelect: updateCoords, 94 aspectRatio: <?php echo $aspect_ratio; ?>,95 setSelect: [ <?php echo $crop_left; ?>, <?php echo $crop_top; ?>, <?php echo $crop_right; ?>, <?php echo$crop_bottom; ?> ]95 aspectRatio: <?php echo (int) $aspect_ratio; ?>, 96 setSelect: [ <?php echo (int) $crop_left; ?>, <?php echo (int) $crop_top; ?>, <?php echo (int) $crop_right; ?>, <?php echo (int) $crop_bottom; ?> ] 96 97 }); 97 updateCoords({x: <?php echo $crop_left; ?>, y: <?php echo $crop_top; ?>, w: <?php echo $crop_right; ?>, h: <?php echo$crop_bottom; ?>});98 updateCoords({x: <?php echo (int) $crop_left; ?>, y: <?php echo (int) $crop_top; ?>, w: <?php echo (int) $crop_right; ?>, h: <?php echo (int) $crop_bottom; ?>}); 98 99 }); 99 100 … … 107 108 function showPreview(coords) { 108 109 if ( parseInt(coords.w) > 0 ) { 109 var fw = <?php echo $full_width; ?>;110 var fh = <?php echo $full_height; ?>;110 var fw = <?php echo (int) $full_width; ?>; 111 var fh = <?php echo (int) $full_height; ?>; 111 112 var rx = fw / coords.w; 112 113 var ry = fh / coords.h; 113 114 114 115 jQuery( '#avatar-crop-preview' ).css({ 115 width: Math.round(rx * <?php echo $image[0]; ?>) + 'px',116 height: Math.round(ry * <?php echo $image[1]; ?>) + 'px',116 width: Math.round(rx * <?php echo (int) $image[0]; ?>) + 'px', 117 height: Math.round(ry * <?php echo (int) $image[1]; ?>) + 'px', 117 118 marginLeft: '-' + Math.round(rx * coords.x) + 'px', 118 119 marginTop: '-' + Math.round(ry * coords.y) + 'px'
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)