Changeset 10846 for trunk/wp-admin/custom-header.php
- Timestamp:
- 03/27/2009 04:45:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-header.php
r10623 r10846 80 80 wp_enqueue_script('farbtastic'); 81 81 elseif ( 2 == $step ) 82 wp_enqueue_script(' cropper');82 wp_enqueue_script('jcrop'); 83 83 } 84 84 … … 91 91 $step = $this->step(); 92 92 93 if ( 1 == $step ) {93 if ( 1 == $step ) 94 94 wp_enqueue_style('farbtastic'); 95 } 95 elseif ( 2 == $step ) 96 wp_enqueue_style('jcrop'); 96 97 } 97 98 … … 216 217 function js_2() { ?> 217 218 <script type="text/javascript"> 218 function onEndCrop( coords , dimensions) {219 jQuery( '#x1' ).val(coords.x 1);220 jQuery( '#y1' ).val(coords.y 1);219 function onEndCrop( coords ) { 220 jQuery( '#x1' ).val(coords.x); 221 jQuery( '#y1' ).val(coords.y); 221 222 jQuery( '#x2' ).val(coords.x2); 222 223 jQuery( '#y2' ).val(coords.y2); 223 jQuery( '#width' ).val( dimensions.width);224 jQuery( '#height' ).val( dimensions.height);224 jQuery( '#width' ).val(coords.w); 225 jQuery( '#height' ).val(coords.h); 225 226 } 226 227 … … 241 242 } 242 243 } 243 new Cropper.Img( 244 'upload', 245 { 246 ratioDim: { x: xinit, y: yinit }, 247 displayOnInit: true, 248 onEndCrop: onEndCrop 249 } 250 ) 244 245 $('#upload').Jcrop({ 246 aspectRatio: ratio, 247 setSelect: [ 0, 0, xinit, yinit ], 248 onSelect: onEndCrop 249 }); 251 250 }); 252 251 </script>
Note: See TracChangeset
for help on using the changeset viewer.