Changeset 27946
- Timestamp:
- 04/04/2014 03:47:43 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r27757 r27946 390 390 instance: true, 391 391 persistent: true, 392 parent: this.$el,393 392 imageWidth: realWidth, 394 393 imageHeight: realHeight, -
trunk/src/wp-includes/css/media-views.css
r27918 r27946 610 610 } 611 611 612 .media-frame-content .crop-content {612 .media-frame-content .crop-content .crop-image { 613 613 display: block; 614 614 margin: auto; 615 615 max-width: 100%; 616 616 max-height: 100%; 617 } 618 619 .media-frame-content .crop-content .upload-errors 620 { 621 position: absolute; 622 width: 300px; 623 top: 50%; 624 left: 50%; 625 margin-left: -150px; 626 margin-right: -150px; 627 z-index: 600000; 617 628 } 618 629 -
trunk/src/wp-includes/js/media-views.js
r27942 r27946 1345 1345 self.controller.trigger('cropped', croppedImage ); 1346 1346 self.controller.close(); 1347 }).fail( function() { 1348 self.controller.trigger('content:error:crop'); 1347 1349 }); 1348 1350 } … … 6203 6205 */ 6204 6206 media.view.Cropper = media.View.extend({ 6205 tagName: 'img',6206 6207 className: 'crop-content', 6208 template: media.template('crop-content'), 6207 6209 initialize: function() { 6208 6210 _.bindAll(this, 'onImageLoad'); 6209 this.$el.attr('src', this.options.attachment.get('url'));6210 6211 }, 6211 6212 ready: function() { 6212 this.$el.on('load', this.onImageLoad); 6213 this.controller.frame.on('content:error:crop', this.onError, this); 6214 this.$image = this.$el.find('.crop-image'); 6215 this.$image.on('load', this.onImageLoad); 6213 6216 $(window).on('resize.cropper', _.debounce(this.onImageLoad, 250)); 6214 6217 }, … … 6230 6233 imgOptions = imgOptions(this.options.attachment, this.controller); 6231 6234 } 6235 6236 imgOptions = _.extend(imgOptions, {parent: this.$el}); 6232 6237 this.trigger('image-loaded'); 6233 this.controller.imgSelect = this.$el.imgAreaSelect(imgOptions); 6238 this.controller.imgSelect = this.$image.imgAreaSelect(imgOptions); 6239 }, 6240 onError: function() { 6241 var filename = this.options.attachment.get('filename'); 6242 6243 this.views.add( '.upload-errors', new media.view.UploaderStatusError({ 6244 filename: media.view.UploaderStatus.prototype.filename(filename), 6245 message: _wpMediaViewsL10n.cropError 6246 }), { at: 0 }); 6234 6247 } 6235 6236 6248 }); 6237 6249 -
trunk/src/wp-includes/media-template.php
r27918 r27946 1049 1049 </script> 1050 1050 1051 <script type="text/html" id="tmpl-crop-content"> 1052 <img class="crop-image" src="{{ data.url }}"> 1053 <div class="upload-errors"></div> 1054 </script> 1055 1051 1056 <?php 1052 1057 -
trunk/src/wp-includes/media.php
r27914 r27946 2530 2530 'suggestedWidth' => __( 'Suggested width is %d pixels.' ), 2531 2531 'suggestedHeight' => __( 'Suggested height is %d pixels.' ), 2532 'cropError' => __( 'There has been an error cropping your image.' ), 2532 2533 2533 2534 // Edit Audio
Note: See TracChangeset
for help on using the changeset viewer.