Changeset 28030
- Timestamp:
- 04/08/2014 01:54:44 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r27946 r28030 420 420 */ 421 421 openMedia: function(event) { 422 var suggestedWidth, suggestedHeight, 423 l10n = _wpMediaViewsL10n; 422 var l10n = _wpMediaViewsL10n; 424 423 425 424 event.preventDefault(); 426 427 suggestedWidth = l10n.suggestedWidth.replace('%d', _wpCustomizeHeader.data.width);428 suggestedHeight = l10n.suggestedHeight.replace('%d', _wpCustomizeHeader.data.height);429 430 /* '<span class="suggested-dimensions">' + suggestedWidth + ' ' + suggestedHeight + '</span>' */431 425 432 426 this.frame = wp.media({ … … 440 434 }, 441 435 multiple: false, 442 imgSelectOptions: this.calculateImageSelectOptions 436 crop: { 437 suggestedWidth: _wpCustomizeHeader.data.width, 438 suggestedHeight: _wpCustomizeHeader.data.height, 439 imgSelectOptions: this.calculateImageSelectOptions 440 } 443 441 }); 444 442 -
trunk/src/wp-includes/css/media-views.css
r27946 r28030 930 930 font-size: 13px; 931 931 color: #666; 932 margin-right: 0.5em; 932 933 } 933 934 -
trunk/src/wp-includes/js/media-views.js
r28019 r28030 3313 3313 } 3314 3314 }, 3315 3316 prepare: function() { 3317 var cropOptions = this.controller.options.crop; 3318 if ( cropOptions ) { 3319 return { 3320 suggestedWidth: cropOptions.suggestedWidth, 3321 suggestedHeight: cropOptions.suggestedHeight 3322 } 3323 } 3324 }, 3315 3325 /** 3316 3326 * @returns {wp.media.view.UploaderInline} Returns itself to allow chaining … … 5155 5165 5156 5166 createToolbar: function() { 5157 var filters, FiltersConstructor; 5167 var filters, FiltersConstructor, 5168 frameOptions = this.controller.options; 5158 5169 5159 5170 /** … … 5196 5207 this.toolbar.set( 'dragInfo', new media.View({ 5197 5208 el: $( '<div class="instructions">' + l10n.dragInfo + '</div>' )[0], 5209 priority: -40 5210 }) ); 5211 } 5212 5213 if ( frameOptions.crop ) { 5214 this.toolbar.set( 'suggestedDimensions', new media.View({ 5215 el: $( '<div class="instructions">' + l10n.suggestedDimensions + ' ' + frameOptions.crop.suggestedWidth + ' × ' + frameOptions.crop.suggestedHeight + '</div>' )[0], 5198 5216 priority: -40 5199 5217 }) ); … … 6231 6249 }, 6232 6250 onImageLoad: function() { 6233 var imgOptions = this.controller.frame.options. imgSelectOptions;6251 var imgOptions = this.controller.frame.options.crop.imgSelectOptions; 6234 6252 if (typeof imgOptions === 'function') { 6235 6253 imgOptions = imgOptions(this.options.attachment, this.controller); -
trunk/src/wp-includes/media-template.php
r28008 r28030 205 205 printf( __( 'Maximum upload file size: %d%s.' ), esc_html($upload_size_unit), esc_html($byte_sizes[$u]) ); 206 206 ?></p> 207 208 <# if ( data.suggestedWidth && data.suggestedHeight ) { #> 209 <p class="suggested-dimensions"> 210 <?php _e( 'Suggested image dimensions:' ); ?> {{{data.suggestedWidth}}} × {{{data.suggestedHeight}}} 211 </p> 212 <# } #> 207 213 208 214 <?php -
trunk/src/wp-includes/media.php
r28023 r28030 2526 2526 'cropYourImage' => __( 'Crop your image' ), 2527 2527 'cropping' => __( 'Cropping…' ), 2528 'suggestedWidth' => __( 'Suggested width is %d pixels.' ), 2529 'suggestedHeight' => __( 'Suggested height is %d pixels.' ), 2528 'suggestedDimensions' => __( 'Suggested image dimensions:' ), 2530 2529 'cropError' => __( 'There has been an error cropping your image.' ), 2531 2530
Note: See TracChangeset
for help on using the changeset viewer.