Ticket #16434: 16434.23.diff
File 16434.23.diff, 41.5 KB (added by , 9 years ago) |
---|
-
src/wp-admin/admin-ajax.php
62 62 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs', 63 63 'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail', 64 64 'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'press-this-save-post', 65 'press-this-add-category', 'crop-image', 65 'press-this-add-category', 'crop-image', 'set-site-icon', 66 66 ); 67 67 68 68 // Deprecated -
src/wp-admin/css/site-icon.css
2 2 28.0 - Site Icon 3 3 ------------------------------------------------------------------------------*/ 4 4 5 #site-icon[src=""], 6 #site-icon[src=""] ~ p .remove-site-icon { 7 display: none; 8 } 9 5 10 .site-icon-image { 6 11 float: left; 7 12 margin: 0 20px 0 0; -
src/wp-admin/includes/ajax-actions.php
3088 3088 $attachment_id = $wp_site_icon->insert_attachment( $object, $cropped ); 3089 3089 remove_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) ); 3090 3090 3091 // Additional sizes in wp_prepare_attachment_for_js(). 3092 add_filter( 'image_size_names_choose', array( $wp_site_icon, 'additional_sizes' ) ); 3091 if ( isset( $_POST['customize'] ) && 'on' == $_POST['customize'] ) { 3092 // Additional sizes in wp_prepare_attachment_for_js(). 3093 add_filter( 'image_size_names_choose', array( $wp_site_icon, 'additional_sizes' ) ); 3094 } else { 3095 update_option( 'site_icon', $attachment_id ); 3096 } 3093 3097 break; 3094 3098 3095 3099 default: … … 3152 3156 3153 3157 wp_send_json_success( wp_prepare_attachment_for_js( $attachment_id ) ); 3154 3158 } 3159 3160 3161 /** 3162 * AJAX handler for saving a Site Icon. 3163 * 3164 * @since 4.3.0 3165 */ 3166 function wp_ajax_set_site_icon() { 3167 $attachment_id = absint( $_POST['id'] ); 3168 3169 check_ajax_referer( 'image_editor-' . $attachment_id, 'nonce' ); 3170 if ( ! current_user_can( 'manage_options' ) ) { 3171 wp_send_json_error(); 3172 } 3173 3174 if ( update_option( 'site_icon', $attachment_id ) ) { 3175 wp_send_json_success(); 3176 } else { 3177 wp_send_json_error(); 3178 } 3179 } -
src/wp-admin/js/customize-controls.js
2038 2038 * @augments wp.customize.Class 2039 2039 */ 2040 2040 api.SiteIconControl = api.CroppedImageControl.extend({ 2041 2042 /** 2043 * Create a media modal select frame, and store it so the instance can be reused when needed. 2044 */ 2045 initFrame: function() { 2046 var l10n = _wpMediaViewsL10n; 2047 2048 this.frame = wp.media({ 2049 button: { 2050 text: l10n.select, 2051 close: false 2052 }, 2053 states: [ 2054 new wp.media.controller.Library({ 2055 title: this.params.button_labels.frame_title, 2056 library: wp.media.query({ type: 'image' }), 2057 multiple: false, 2058 date: false, 2059 priority: 20, 2060 suggestedWidth: this.params.width, 2061 suggestedHeight: this.params.height 2062 }), 2063 new wp.media.controller.SiteIconCropper({ 2064 imgSelectOptions: this.calculateImageSelectOptions, 2065 control: this 2066 }) 2067 ] 2068 }); 2069 2070 this.frame.on( 'select', this.onSelect, this ); 2071 this.frame.on( 'cropped', this.onCropped, this ); 2072 this.frame.on( 'skippedcrop', this.onSkippedCrop, this ); 2073 }, 2074 2041 2075 /** 2042 2076 * Updates the setting and re-renders the control UI. 2043 2077 * -
src/wp-admin/js/site-icon.js
1 1 (function($) { 2 var frame ;2 var frame, siteIcon; 3 3 4 4 $( function() { 5 5 // Build the choose from library frame. … … 7 7 var $el = $(this); 8 8 event.preventDefault(); 9 9 10 // If the media frame already exists, reopen it.11 if ( frame ) {12 frame.open();13 return;14 }15 16 10 // Create the media frame. 17 11 frame = wp.media({ 18 12 // Customize the submit button. 19 13 button: { 20 14 // Set the text of the button. 21 text: $el.data( 'update'),22 // Tell the button not to close the modal, since we're 23 // going to refresh the page when the image is selected.15 text: $el.data( 'update' ), 16 17 // Don't close the modal, we're going to refresh the page when the image is selected. 24 18 close: false 25 19 }, 26 20 states: [ 21 new wp.media.controller.SiteIconCropper({ 22 imgSelectOptions: siteIcon.calculateImageSelectOptions 23 }), 27 24 new wp.media.controller.Library({ 28 25 title: $el.data( 'choose' ), 29 26 library: wp.media.query({ type: 'image' }), … … 35 32 }); 36 33 37 34 // When an image is selected, run a callback. 38 frame.on( 'select', function() { 39 // Grab the selected attachment. 40 var attachment = frame.state().get('selection').first(), 41 link = $el.data('updateLink'); 35 frame.on( 'select', siteIcon.imageSelected ); 42 36 43 // Tell the browser to navigate to the crop step. 44 window.location = link + '&file=' + attachment.id; 45 }); 37 // After the image has been cropped, apply the cropped image data to the setting. 38 frame.on( 'cropped', siteIcon.setImageFromAttachment ); 46 39 47 40 frame.open(); 48 41 }); 49 42 }); 43 44 siteIcon = { 45 46 imageSelected: function() { 47 var attachment = frame.state().get( 'selection' ).first().toJSON(), 48 min_size = $( '#choose-from-library-link' ).data( 'size' ); 49 50 if ( min_size === attachment.width && min_size === attachment.height ) { 51 siteIcon.setImageFromAttachment( attachment ); 52 siteIcon.setSiteIcon( attachment ); 53 } else { 54 frame.setState( 'cropper' ); 55 } 56 }, 57 58 setImageFromAttachment: function( attachment ) { 59 $( '#site-icon').attr( 'src', attachment.sizes.thumbnail.url ); 60 61 if ( frame ) { 62 frame.close(); 63 } 64 }, 65 66 setSiteIcon: function( attachment ) { 67 return wp.ajax.post( 'set-site-icon', { 68 nonce: attachment.nonces.edit, 69 id: attachment.id 70 } ); 71 }, 72 73 /** 74 * Returns a set of options, computed from the attached image data and 75 * control-specific data, to be fed to the imgAreaSelect plugin in 76 * wp.media.view.Cropper. 77 * 78 * @param {wp.media.model.Attachment} attachment 79 * @param {wp.media.controller.Cropper} controller 80 * @returns {Object} Options 81 */ 82 calculateImageSelectOptions: function( attachment, controller ) { 83 var $el = $( '#choose-from-library-link' ), 84 realWidth = attachment.get( 'width' ), 85 realHeight = attachment.get( 'height' ), 86 xInit = parseInt( $el.data( 'size' ), 10), 87 yInit = parseInt( $el.data( 'size' ), 10), 88 ratio = xInit / yInit; 89 90 controller.set( 'canSkipCrop', ( xInit === realWidth && yInit === realHeight ) || ( realWidth < xInit ) ); 91 92 if (realWidth / realHeight > ratio) { 93 yInit = realHeight; 94 xInit = yInit * ratio; 95 } else { 96 xInit = realWidth; 97 yInit = xInit / ratio; 98 } 99 100 return { 101 handles: true, 102 keys: true, 103 instance: true, 104 persistent: true, 105 imageWidth: realWidth, 106 imageHeight: realHeight, 107 aspectRatio: xInit + ':' + yInit, 108 maxHeight: yInit, 109 maxWidth: xInit, 110 x1: 0, 111 y1: 0, 112 x2: xInit, 113 y2: yInit 114 }; 115 } 116 }; 50 117 }(jQuery)); -
src/wp-admin/options-general.php
128 128 <th scope="row"><?php _e( 'Site Icon' ); ?></th> 129 129 <td> 130 130 <?php 131 $upload_url = admin_url( 'options-general.php?page=site-icon' ); 132 $update_url = esc_url( add_query_arg( array( 133 'page' => 'site-icon', 134 'action' => 'crop_site_icon', 135 ), wp_nonce_url( admin_url( 'options-general.php' ), 'crop-site-icon' ) ) ); 136 137 wp_enqueue_media(); 138 wp_enqueue_script( 'site-icon' ); 139 140 if ( has_site_icon() ) : 131 $upload_url = admin_url( 'options-general.php?page=site-icon' ); 141 132 $remove_url = add_query_arg( array( 142 133 'action' => 'remove_site_icon', 143 134 ), wp_nonce_url( admin_url( 'options-general.php' ), 'remove-site-icon' ) ); 135 136 wp_enqueue_media(); 137 wp_enqueue_script( 'site-icon' ); 144 138 ?> 145 139 146 <img class="avatar avatar-150" src="<?php site_icon_url( null, 150 ); ?>" height="150" width="150" alt="" />140 <img id="site-icon" class="avatar avatar-150" src="<?php site_icon_url( null, 150 ); ?>" height="150" width="150" alt="" /> 147 141 <p class="hide-if-no-js"> 148 <button type="button" id="choose-from-library-link" class="button" data-size=" <?php echo absint( $GLOBALS['wp_site_icon']->min_size ); ?>" data-update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"><?php _e( 'Update Site Icon' ); ?></button>149 <a href="<?php echo esc_url( $remove_url ); ?>"><?php _e( 'Remove Site Icon' ); ?></a>142 <button type="button" id="choose-from-library-link" class="button" data-size="512" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>" aria-label="<?php esc_attr_e( 'Choose an image from your media library' ); ?>" aria-describedby="site-icon-description"><?php _e( 'Choose Image' ); ?></button> 143 <a class="remove-site-icon" href="<?php echo esc_url( $remove_url ); ?>"><?php _e( 'Remove Site Icon' ); ?></a> 150 144 </p> 151 145 <p class="hide-if-js"> 152 <a href="<?php echo esc_url( $upload_url ); ?>" class="button"><?php _e( 'Update Site Icon' ); ?></a> 153 <a href="<?php echo esc_url( $remove_url ); ?>"><?php _e( 'Remove Site Icon' ); ?></a> 154 </p> 155 156 <?php else : ?> 157 158 <p class="hide-if-no-js"> 159 <button type="button" id="choose-from-library-link" class="button" data-size="<?php echo absint( $GLOBALS['wp_site_icon']->min_size ); ?>" data-update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>" aria-label="<?php esc_attr_e( 'Choose an image from your media library' ); ?>" aria-describedby="site-icon-description"><?php _e( 'Choose Image' ); ?></button> 146 <a class="button" href="<?php echo esc_url( $upload_url ); ?>"><?php _e( 'Choose Image' ); ?></a> 147 <a class="remove-site-icon" href="<?php echo esc_url( $remove_url ); ?>"><?php _e( 'Remove Site Icon' ); ?></a> 160 148 </p> 161 <a class="button hide-if-js" href="<?php echo esc_url( $upload_url ); ?>"><?php _e( 'Add a Site Icon' ); ?></a>162 163 <?php endif; ?>164 149 <p id="site-icon-description" class="description"><?php _e( 'The Site Icon is used as a browser and app icon for your site.' ); ?></p> 165 150 </td> 166 151 </tr> -
src/wp-includes/css/media-views.css
696 696 height: 100%; 697 697 } 698 698 699 .media-frame-content .crop-content.site-icon { 700 margin-right: 300px; 701 } 702 699 703 .media-frame-content .crop-content .crop-image { 700 704 display: block; 701 705 margin: auto; -
src/wp-includes/js/media/controllers/customize-image-cropper.js
1 /*globals wp */ 2 3 /** 4 * wp.media.controller.Cropper 5 * 6 * A state for cropping an image. 7 * 8 * @class 9 * @augments wp.media.controller.State 10 * @augments Backbone.Model 11 */ 12 var CustomizeImageCropper; 13 14 CustomizeImageCropper = wp.media.controller.Cropper.extend({ 15 doCrop: function( attachment ) { 16 var cropDetails = attachment.get( 'cropDetails' ), 17 control = this.get( 'control' ); 18 19 cropDetails.dst_width = control.params.width; 20 cropDetails.dst_height = control.params.height; 21 22 return wp.ajax.post( 'crop-image', { 23 wp_customize: 'on', 24 nonce: attachment.get( 'nonces' ).edit, 25 id: attachment.get( 'id' ), 26 context: control.id, 27 cropDetails: cropDetails 28 } ); 29 } 30 }); 31 32 module.exports = CustomizeImageCropper; -
src/wp-includes/js/media/controllers/site-icon-cropper.js
1 /*globals wp, Backbone, jQuery */ 2 3 /** 4 * wp.media.controller.Cropper 5 * 6 * A state for cropping an image. 7 * 8 * @class 9 * @augments wp.media.controller.State 10 * @augments Backbone.Model 11 */ 12 var $ = jQuery, 13 SiteIconCropper; 14 15 SiteIconCropper = wp.media.controller.Cropper.extend({ 16 activate: function() { 17 this.frame.on( 'content:create:crop', this.createCropContent, this ); 18 this.frame.on( 'close', this.removeCropper, this ); 19 this.set('selection', new Backbone.Collection(this.frame._selection.single)); 20 }, 21 22 createCropContent: function() { 23 this.cropperView = new wp.media.view.SiteIconCropper({ 24 controller: this, 25 attachment: this.get('selection').first() 26 }); 27 this.cropperView.on('image-loaded', this.createCropToolbar, this); 28 this.frame.content.set(this.cropperView); 29 30 }, 31 32 doCrop: function( attachment ) { 33 var cropDetails = attachment.get( 'cropDetails' ), 34 $el = $( '#choose-from-library-link' ); 35 36 cropDetails.dst_width = $el.data( 'size' ); 37 cropDetails.dst_height = $el.data( 'size' ); 38 39 return wp.ajax.post( 'crop-image', { 40 nonce: attachment.get( 'nonces' ).edit, 41 id: attachment.get( 'id' ), 42 context: 'site-icon', 43 cropDetails: cropDetails 44 } ); 45 } 46 }); 47 48 module.exports = SiteIconCropper; -
src/wp-includes/js/media/views/site-icon-cropper.js
1 /*globals wp, _ */ 2 3 /** 4 * wp.media.view.Cropper 5 * 6 * Uses the imgAreaSelect plugin to allow a user to crop an image. 7 * 8 * Takes imgAreaSelect options from 9 * wp.customize.HeaderControl.calculateImageSelectOptions via 10 * wp.customize.HeaderControl.openMM. 11 * 12 * @class 13 * @augments wp.media.View 14 * @augments wp.Backbone.View 15 * @augments Backbone.View 16 */ 17 var View = wp.media.view, 18 SiteIconCropper; 19 20 SiteIconCropper = View.Cropper.extend({ 21 className: 'crop-content site-icon', 22 23 onImageLoad: function() { 24 var imgOptions = this.controller.get('imgSelectOptions'); 25 if (typeof imgOptions === 'function') { 26 imgOptions = imgOptions(this.options.attachment, this.controller); 27 } 28 29 imgOptions = _.extend(imgOptions, {parent: this.$el}); 30 this.trigger('image-loaded'); 31 this.controller.imgSelect = this.$image.imgAreaSelect(imgOptions); 32 33 this.sidebar = new wp.media.view.Sidebar({ 34 controller: this.controller 35 }); 36 this.sidebar.set( 'preview', new wp.media.view.SiteIconPreview({ 37 controller: this.controller, 38 attachment: this.options.attachment 39 }) ); 40 41 this.controller.cropperView.views.add( this.sidebar ); 42 } 43 }); 44 45 module.exports = SiteIconCropper; -
src/wp-includes/js/media/views/site-icon-preview.js
1 /*globals wp, jQuery */ 2 3 /** 4 * wp.media.view.Cropper 5 * 6 * Uses the imgAreaSelect plugin to allow a user to crop an image. 7 * 8 * Takes imgAreaSelect options from 9 * wp.customize.HeaderControl.calculateImageSelectOptions via 10 * wp.customize.HeaderControl.openMM. 11 * 12 * @class 13 * @augments wp.media.View 14 * @augments wp.Backbone.View 15 * @augments Backbone.View 16 */ 17 var View = wp.media.View, 18 $ = jQuery, 19 SiteIconPreview; 20 21 SiteIconPreview = View.extend({ 22 className: 'site-icon-preview', 23 template: wp.template( 'site-icon-preview' ), 24 25 ready: function() { 26 this.controller.imgSelect.setOptions({ 27 onInit: this.updatePreview, 28 onSelectChange: this.updatePreview 29 }); 30 }, 31 32 prepare: function() { 33 return { 34 url: this.options.attachment.get('url') 35 }; 36 }, 37 38 updatePreview: function(img, coords) { 39 var rx = 64 / coords.width, 40 ry = 64 / coords.height, 41 preview_rx = 16 / coords.width, 42 preview_ry = 16 / coords.height; 43 44 $( '#preview-homeicon' ).css({ 45 width: Math.round(rx * this.imageWidth ) + 'px', 46 height: Math.round(ry * this.imageHeight ) + 'px', 47 marginLeft: '-' + Math.round(rx * coords.x1) + 'px', 48 marginTop: '-' + Math.round(ry * coords.y1) + 'px' 49 }); 50 51 $( '#preview-favicon' ).css({ 52 width: Math.round( preview_rx * this.imageWidth ) + 'px', 53 height: Math.round( preview_ry * this.imageHeight ) + 'px', 54 marginLeft: '-' + Math.round( preview_rx * coords.x1 ) + 'px', 55 marginTop: '-' + Math.floor( preview_ry* coords.y1 ) + 'px' 56 }); 57 } 58 }); 59 60 module.exports = SiteIconPreview; -
src/wp-includes/js/media/views.manifest.js
90 90 media.controller.MediaLibrary = require( './controllers/media-library.js' ); 91 91 media.controller.Embed = require( './controllers/embed.js' ); 92 92 media.controller.Cropper = require( './controllers/cropper.js' ); 93 media.controller.CustomizeImageCropper = require( './controllers/customize-image-cropper.js' ); 94 media.controller.SiteIconCropper = require( './controllers/site-icon-cropper.js' ); 93 95 94 96 media.View = require( './views/view.js' ); 95 97 media.view.Frame = require( './views/frame.js' ); … … 143 145 media.view.EmbedImage = require( './views/embed/image.js' ); 144 146 media.view.ImageDetails = require( './views/image-details.js' ); 145 147 media.view.Cropper = require( './views/cropper.js' ); 148 media.view.SiteIconCropper = require( './views/site-icon-cropper.js' ); 149 media.view.SiteIconPreview = require( './views/site-icon-preview.js' ); 146 150 media.view.EditImage = require( './views/edit-image.js' ); 147 151 media.view.Spinner = require( './views/spinner.js' ); -
src/wp-includes/js/media-views.js
387 387 /*globals wp */ 388 388 389 389 /** 390 * wp.media.controller.Cropper 391 * 392 * A state for cropping an image. 393 * 394 * @class 395 * @augments wp.media.controller.State 396 * @augments Backbone.Model 397 */ 398 var CustomizeImageCropper; 399 400 CustomizeImageCropper = wp.media.controller.Cropper.extend({ 401 doCrop: function( attachment ) { 402 var cropDetails = attachment.get( 'cropDetails' ), 403 control = this.get( 'control' ); 404 405 cropDetails.dst_width = control.params.width; 406 cropDetails.dst_height = control.params.height; 407 408 return wp.ajax.post( 'crop-image', { 409 wp_customize: 'on', 410 nonce: attachment.get( 'nonces' ).edit, 411 id: attachment.get( 'id' ), 412 context: control.id, 413 cropDetails: cropDetails 414 } ); 415 } 416 }); 417 418 module.exports = CustomizeImageCropper; 419 420 },{}],5:[function(require,module,exports){ 421 /*globals wp */ 422 423 /** 390 424 * wp.media.controller.EditImage 391 425 * 392 426 * A state for editing (cropping, etc.) an image. … … 461 495 462 496 module.exports = EditImage; 463 497 464 },{}], 5:[function(require,module,exports){498 },{}],6:[function(require,module,exports){ 465 499 /*globals wp, _, Backbone */ 466 500 467 501 /** … … 599 633 600 634 module.exports = Embed; 601 635 602 },{}], 6:[function(require,module,exports){636 },{}],7:[function(require,module,exports){ 603 637 /*globals wp, _ */ 604 638 605 639 /** … … 723 757 724 758 module.exports = FeaturedImage; 725 759 726 },{}], 7:[function(require,module,exports){760 },{}],8:[function(require,module,exports){ 727 761 /*globals wp, _ */ 728 762 729 763 /** … … 816 850 817 851 module.exports = GalleryAdd; 818 852 819 },{}], 8:[function(require,module,exports){853 },{}],9:[function(require,module,exports){ 820 854 /*globals wp */ 821 855 822 856 /** … … 960 994 961 995 module.exports = GalleryEdit; 962 996 963 },{}], 9:[function(require,module,exports){997 },{}],10:[function(require,module,exports){ 964 998 /*globals wp, _ */ 965 999 966 1000 /** … … 1024 1058 1025 1059 module.exports = ImageDetails; 1026 1060 1027 },{}],1 0:[function(require,module,exports){1061 },{}],11:[function(require,module,exports){ 1028 1062 /*globals wp, _, Backbone */ 1029 1063 1030 1064 /** … … 1298 1332 1299 1333 module.exports = Library; 1300 1334 1301 },{}],1 1:[function(require,module,exports){1335 },{}],12:[function(require,module,exports){ 1302 1336 /*globals wp, _ */ 1303 1337 1304 1338 /** … … 1350 1384 1351 1385 module.exports = MediaLibrary; 1352 1386 1353 },{}],1 2:[function(require,module,exports){1387 },{}],13:[function(require,module,exports){ 1354 1388 /*globals Backbone, _ */ 1355 1389 1356 1390 /** … … 1531 1565 1532 1566 module.exports = Region; 1533 1567 1534 },{}],1 3:[function(require,module,exports){1568 },{}],14:[function(require,module,exports){ 1535 1569 /*globals wp, _ */ 1536 1570 1537 1571 /** … … 1641 1675 1642 1676 module.exports = ReplaceImage; 1643 1677 1644 },{}],14:[function(require,module,exports){ 1678 },{}],15:[function(require,module,exports){ 1679 /*globals wp, Backbone, jQuery */ 1680 1681 /** 1682 * wp.media.controller.Cropper 1683 * 1684 * A state for cropping an image. 1685 * 1686 * @class 1687 * @augments wp.media.controller.State 1688 * @augments Backbone.Model 1689 */ 1690 var $ = jQuery, 1691 SiteIconCropper; 1692 1693 SiteIconCropper = wp.media.controller.Cropper.extend({ 1694 activate: function() { 1695 this.frame.on( 'content:create:crop', this.createCropContent, this ); 1696 this.frame.on( 'close', this.removeCropper, this ); 1697 this.set('selection', new Backbone.Collection(this.frame._selection.single)); 1698 }, 1699 1700 createCropContent: function() { 1701 this.cropperView = new wp.media.view.SiteIconCropper({ 1702 controller: this, 1703 attachment: this.get('selection').first() 1704 }); 1705 this.cropperView.on('image-loaded', this.createCropToolbar, this); 1706 this.frame.content.set(this.cropperView); 1707 1708 }, 1709 1710 doCrop: function( attachment ) { 1711 var cropDetails = attachment.get( 'cropDetails' ), 1712 $el = $( '#choose-from-library-link' ); 1713 1714 cropDetails.dst_width = $el.data( 'size' ); 1715 cropDetails.dst_height = $el.data( 'size' ); 1716 1717 return wp.ajax.post( 'crop-image', { 1718 nonce: attachment.get( 'nonces' ).edit, 1719 id: attachment.get( 'id' ), 1720 context: 'site-icon', 1721 cropDetails: cropDetails 1722 } ); 1723 } 1724 }); 1725 1726 module.exports = SiteIconCropper; 1727 1728 },{}],16:[function(require,module,exports){ 1645 1729 /*globals _, Backbone */ 1646 1730 1647 1731 /** … … 1767 1851 1768 1852 module.exports = StateMachine; 1769 1853 1770 },{}],1 5:[function(require,module,exports){1854 },{}],17:[function(require,module,exports){ 1771 1855 /*globals _, Backbone */ 1772 1856 1773 1857 /** … … 2010 2094 2011 2095 module.exports = State; 2012 2096 2013 },{}],1 6:[function(require,module,exports){2097 },{}],18:[function(require,module,exports){ 2014 2098 /*globals _ */ 2015 2099 2016 2100 /** … … 2078 2162 2079 2163 module.exports = selectionSync; 2080 2164 2081 },{}],1 7:[function(require,module,exports){2165 },{}],19:[function(require,module,exports){ 2082 2166 /*globals wp, jQuery, _, Backbone */ 2083 2167 2084 2168 var media = wp.media, … … 2171 2255 media.controller.MediaLibrary = require( './controllers/media-library.js' ); 2172 2256 media.controller.Embed = require( './controllers/embed.js' ); 2173 2257 media.controller.Cropper = require( './controllers/cropper.js' ); 2258 media.controller.CustomizeImageCropper = require( './controllers/customize-image-cropper.js' ); 2259 media.controller.SiteIconCropper = require( './controllers/site-icon-cropper.js' ); 2174 2260 2175 2261 media.View = require( './views/view.js' ); 2176 2262 media.view.Frame = require( './views/frame.js' ); … … 2224 2310 media.view.EmbedImage = require( './views/embed/image.js' ); 2225 2311 media.view.ImageDetails = require( './views/image-details.js' ); 2226 2312 media.view.Cropper = require( './views/cropper.js' ); 2313 media.view.SiteIconCropper = require( './views/site-icon-cropper.js' ); 2314 media.view.SiteIconPreview = require( './views/site-icon-preview.js' ); 2227 2315 media.view.EditImage = require( './views/edit-image.js' ); 2228 2316 media.view.Spinner = require( './views/spinner.js' ); 2229 2317 2230 },{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./controllers/ edit-image.js":4,"./controllers/embed.js":5,"./controllers/featured-image.js":6,"./controllers/gallery-add.js":7,"./controllers/gallery-edit.js":8,"./controllers/image-details.js":9,"./controllers/library.js":10,"./controllers/media-library.js":11,"./controllers/region.js":12,"./controllers/replace-image.js":13,"./controllers/state-machine.js":14,"./controllers/state.js":15,"./utils/selection-sync.js":16,"./views/attachment-compat.js":18,"./views/attachment-filters.js":19,"./views/attachment-filters/all.js":20,"./views/attachment-filters/date.js":21,"./views/attachment-filters/uploaded.js":22,"./views/attachment.js":23,"./views/attachment/details.js":24,"./views/attachment/edit-library.js":25,"./views/attachment/edit-selection.js":26,"./views/attachment/library.js":27,"./views/attachment/selection.js":28,"./views/attachments.js":29,"./views/attachments/browser.js":30,"./views/attachments/selection.js":31,"./views/button-group.js":32,"./views/button.js":33,"./views/cropper.js":34,"./views/edit-image.js":35,"./views/embed.js":36,"./views/embed/image.js":37,"./views/embed/link.js":38,"./views/embed/url.js":39,"./views/focus-manager.js":40,"./views/frame.js":41,"./views/frame/image-details.js":42,"./views/frame/post.js":43,"./views/frame/select.js":44,"./views/iframe.js":45,"./views/image-details.js":46,"./views/label.js":47,"./views/media-frame.js":48,"./views/menu-item.js":49,"./views/menu.js":50,"./views/modal.js":51,"./views/priority-list.js":52,"./views/router-item.js":53,"./views/router.js":54,"./views/search.js":55,"./views/selection.js":56,"./views/settings.js":57,"./views/settings/attachment-display.js":58,"./views/settings/gallery.js":59,"./views/settings/playlist.js":60,"./views/sidebar.js":61,"./views/spinner.js":62,"./views/toolbar.js":63,"./views/toolbar/embed.js":64,"./views/toolbar/select.js":65,"./views/uploader/editor.js":66,"./views/uploader/inline.js":67,"./views/uploader/status-error.js":68,"./views/uploader/status.js":69,"./views/uploader/window.js":70,"./views/view.js":71}],18:[function(require,module,exports){2318 },{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./controllers/customize-image-cropper.js":4,"./controllers/edit-image.js":5,"./controllers/embed.js":6,"./controllers/featured-image.js":7,"./controllers/gallery-add.js":8,"./controllers/gallery-edit.js":9,"./controllers/image-details.js":10,"./controllers/library.js":11,"./controllers/media-library.js":12,"./controllers/region.js":13,"./controllers/replace-image.js":14,"./controllers/site-icon-cropper.js":15,"./controllers/state-machine.js":16,"./controllers/state.js":17,"./utils/selection-sync.js":18,"./views/attachment-compat.js":20,"./views/attachment-filters.js":21,"./views/attachment-filters/all.js":22,"./views/attachment-filters/date.js":23,"./views/attachment-filters/uploaded.js":24,"./views/attachment.js":25,"./views/attachment/details.js":26,"./views/attachment/edit-library.js":27,"./views/attachment/edit-selection.js":28,"./views/attachment/library.js":29,"./views/attachment/selection.js":30,"./views/attachments.js":31,"./views/attachments/browser.js":32,"./views/attachments/selection.js":33,"./views/button-group.js":34,"./views/button.js":35,"./views/cropper.js":36,"./views/edit-image.js":37,"./views/embed.js":38,"./views/embed/image.js":39,"./views/embed/link.js":40,"./views/embed/url.js":41,"./views/focus-manager.js":42,"./views/frame.js":43,"./views/frame/image-details.js":44,"./views/frame/post.js":45,"./views/frame/select.js":46,"./views/iframe.js":47,"./views/image-details.js":48,"./views/label.js":49,"./views/media-frame.js":50,"./views/menu-item.js":51,"./views/menu.js":52,"./views/modal.js":53,"./views/priority-list.js":54,"./views/router-item.js":55,"./views/router.js":56,"./views/search.js":57,"./views/selection.js":58,"./views/settings.js":59,"./views/settings/attachment-display.js":60,"./views/settings/gallery.js":61,"./views/settings/playlist.js":62,"./views/sidebar.js":63,"./views/site-icon-cropper.js":64,"./views/site-icon-preview.js":65,"./views/spinner.js":66,"./views/toolbar.js":67,"./views/toolbar/embed.js":68,"./views/toolbar/select.js":69,"./views/uploader/editor.js":70,"./views/uploader/inline.js":71,"./views/uploader/status-error.js":72,"./views/uploader/status.js":73,"./views/uploader/window.js":74,"./views/view.js":75}],20:[function(require,module,exports){ 2231 2319 /*globals _ */ 2232 2320 2233 2321 /** … … 2314 2402 2315 2403 module.exports = AttachmentCompat; 2316 2404 2317 },{}], 19:[function(require,module,exports){2405 },{}],21:[function(require,module,exports){ 2318 2406 /*globals _, jQuery */ 2319 2407 2320 2408 /** … … 2393 2481 2394 2482 module.exports = AttachmentFilters; 2395 2483 2396 },{}],2 0:[function(require,module,exports){2484 },{}],22:[function(require,module,exports){ 2397 2485 /*globals wp */ 2398 2486 2399 2487 /** … … 2485 2573 2486 2574 module.exports = All; 2487 2575 2488 },{}],2 1:[function(require,module,exports){2576 },{}],23:[function(require,module,exports){ 2489 2577 /*globals wp, _ */ 2490 2578 2491 2579 /** … … 2528 2616 2529 2617 module.exports = DateFilter; 2530 2618 2531 },{}],2 2:[function(require,module,exports){2619 },{}],24:[function(require,module,exports){ 2532 2620 /*globals wp */ 2533 2621 2534 2622 /** … … 2589 2677 2590 2678 module.exports = Uploaded; 2591 2679 2592 },{}],2 3:[function(require,module,exports){2680 },{}],25:[function(require,module,exports){ 2593 2681 /*globals wp, _, jQuery */ 2594 2682 2595 2683 /** … … 3137 3225 3138 3226 module.exports = Attachment; 3139 3227 3140 },{}],2 4:[function(require,module,exports){3228 },{}],26:[function(require,module,exports){ 3141 3229 /*globals wp, _ */ 3142 3230 3143 3231 /** … … 3277 3365 3278 3366 module.exports = Details; 3279 3367 3280 },{}],2 5:[function(require,module,exports){3368 },{}],27:[function(require,module,exports){ 3281 3369 /*globals wp */ 3282 3370 3283 3371 /** … … 3297 3385 3298 3386 module.exports = EditLibrary; 3299 3387 3300 },{}],2 6:[function(require,module,exports){3388 },{}],28:[function(require,module,exports){ 3301 3389 /*globals wp */ 3302 3390 3303 3391 /** … … 3318 3406 3319 3407 module.exports = EditSelection; 3320 3408 3321 },{}],2 7:[function(require,module,exports){3409 },{}],29:[function(require,module,exports){ 3322 3410 /*globals wp */ 3323 3411 3324 3412 /** … … 3338 3426 3339 3427 module.exports = Library; 3340 3428 3341 },{}], 28:[function(require,module,exports){3429 },{}],30:[function(require,module,exports){ 3342 3430 /*globals wp */ 3343 3431 3344 3432 /** … … 3362 3450 3363 3451 module.exports = Selection; 3364 3452 3365 },{}], 29:[function(require,module,exports){3453 },{}],31:[function(require,module,exports){ 3366 3454 /*globals wp, _, jQuery */ 3367 3455 3368 3456 /** … … 3663 3751 3664 3752 module.exports = Attachments; 3665 3753 3666 },{}],3 0:[function(require,module,exports){3754 },{}],32:[function(require,module,exports){ 3667 3755 /*globals wp, _, jQuery */ 3668 3756 3669 3757 /** … … 4109 4197 4110 4198 module.exports = AttachmentsBrowser; 4111 4199 4112 },{}],3 1:[function(require,module,exports){4200 },{}],33:[function(require,module,exports){ 4113 4201 /*globals wp, _ */ 4114 4202 4115 4203 /** … … 4141 4229 4142 4230 module.exports = Selection; 4143 4231 4144 },{}],3 2:[function(require,module,exports){4232 },{}],34:[function(require,module,exports){ 4145 4233 /*globals _, Backbone */ 4146 4234 4147 4235 /** … … 4189 4277 4190 4278 module.exports = ButtonGroup; 4191 4279 4192 },{}],3 3:[function(require,module,exports){4280 },{}],35:[function(require,module,exports){ 4193 4281 /*globals _, Backbone */ 4194 4282 4195 4283 /** … … 4277 4365 4278 4366 module.exports = Button; 4279 4367 4280 },{}],3 4:[function(require,module,exports){4368 },{}],36:[function(require,module,exports){ 4281 4369 /*globals wp, _, jQuery */ 4282 4370 4283 4371 /** … … 4346 4434 4347 4435 module.exports = Cropper; 4348 4436 4349 },{}],3 5:[function(require,module,exports){4437 },{}],37:[function(require,module,exports){ 4350 4438 /*globals wp, _ */ 4351 4439 4352 4440 /** … … 4404 4492 4405 4493 module.exports = EditImage; 4406 4494 4407 },{}],3 6:[function(require,module,exports){4495 },{}],38:[function(require,module,exports){ 4408 4496 /** 4409 4497 * wp.media.view.Embed 4410 4498 * … … 4468 4556 4469 4557 module.exports = Embed; 4470 4558 4471 },{}],3 7:[function(require,module,exports){4559 },{}],39:[function(require,module,exports){ 4472 4560 /*globals wp */ 4473 4561 4474 4562 /** … … 4503 4591 4504 4592 module.exports = EmbedImage; 4505 4593 4506 },{}], 38:[function(require,module,exports){4594 },{}],40:[function(require,module,exports){ 4507 4595 /*globals wp, _, jQuery */ 4508 4596 4509 4597 /** … … 4594 4682 4595 4683 module.exports = EmbedLink; 4596 4684 4597 },{}], 39:[function(require,module,exports){4685 },{}],41:[function(require,module,exports){ 4598 4686 /*globals wp, _, jQuery */ 4599 4687 4600 4688 /** … … 4675 4763 4676 4764 module.exports = EmbedUrl; 4677 4765 4678 },{}],4 0:[function(require,module,exports){4766 },{}],42:[function(require,module,exports){ 4679 4767 /** 4680 4768 * wp.media.view.FocusManager 4681 4769 * … … 4721 4809 4722 4810 module.exports = FocusManager; 4723 4811 4724 },{}],4 1:[function(require,module,exports){4812 },{}],43:[function(require,module,exports){ 4725 4813 /*globals _, Backbone */ 4726 4814 4727 4815 /** … … 4889 4977 4890 4978 module.exports = Frame; 4891 4979 4892 },{}],4 2:[function(require,module,exports){4980 },{}],44:[function(require,module,exports){ 4893 4981 /*globals wp */ 4894 4982 4895 4983 /** … … 5068 5156 5069 5157 module.exports = ImageDetails; 5070 5158 5071 },{}],4 3:[function(require,module,exports){5159 },{}],45:[function(require,module,exports){ 5072 5160 /*globals wp, _ */ 5073 5161 5074 5162 /** … … 5805 5893 5806 5894 module.exports = Post; 5807 5895 5808 },{}],4 4:[function(require,module,exports){5896 },{}],46:[function(require,module,exports){ 5809 5897 /*globals wp, _ */ 5810 5898 5811 5899 /** … … 5978 6066 5979 6067 module.exports = Select; 5980 6068 5981 },{}],4 5:[function(require,module,exports){6069 },{}],47:[function(require,module,exports){ 5982 6070 /** 5983 6071 * wp.media.view.Iframe 5984 6072 * … … 6002 6090 6003 6091 module.exports = Iframe; 6004 6092 6005 },{}],4 6:[function(require,module,exports){6093 },{}],48:[function(require,module,exports){ 6006 6094 /*globals wp, _, jQuery */ 6007 6095 6008 6096 /** … … 6172 6260 6173 6261 module.exports = ImageDetails; 6174 6262 6175 },{}],4 7:[function(require,module,exports){6263 },{}],49:[function(require,module,exports){ 6176 6264 /** 6177 6265 * wp.media.view.Label 6178 6266 * … … 6198 6286 6199 6287 module.exports = Label; 6200 6288 6201 },{}], 48:[function(require,module,exports){6289 },{}],50:[function(require,module,exports){ 6202 6290 /*globals wp, _, jQuery */ 6203 6291 6204 6292 /** … … 6447 6535 6448 6536 module.exports = MediaFrame; 6449 6537 6450 },{}], 49:[function(require,module,exports){6538 },{}],51:[function(require,module,exports){ 6451 6539 /*globals jQuery */ 6452 6540 6453 6541 /** … … 6521 6609 6522 6610 module.exports = MenuItem; 6523 6611 6524 },{}],5 0:[function(require,module,exports){6612 },{}],52:[function(require,module,exports){ 6525 6613 /** 6526 6614 * wp.media.view.Menu 6527 6615 * … … 6638 6726 6639 6727 module.exports = Menu; 6640 6728 6641 },{}],5 1:[function(require,module,exports){6729 },{}],53:[function(require,module,exports){ 6642 6730 /*globals wp, _, jQuery */ 6643 6731 6644 6732 /** … … 6853 6941 6854 6942 module.exports = Modal; 6855 6943 6856 },{}],5 2:[function(require,module,exports){6944 },{}],54:[function(require,module,exports){ 6857 6945 /*globals _, Backbone */ 6858 6946 6859 6947 /** … … 6952 7040 6953 7041 module.exports = PriorityList; 6954 7042 6955 },{}],5 3:[function(require,module,exports){7043 },{}],55:[function(require,module,exports){ 6956 7044 /** 6957 7045 * wp.media.view.RouterItem 6958 7046 * … … 6976 7064 6977 7065 module.exports = RouterItem; 6978 7066 6979 },{}],5 4:[function(require,module,exports){7067 },{}],56:[function(require,module,exports){ 6980 7068 /*globals wp */ 6981 7069 6982 7070 /** … … 7015 7103 7016 7104 module.exports = Router; 7017 7105 7018 },{}],5 5:[function(require,module,exports){7106 },{}],57:[function(require,module,exports){ 7019 7107 /*globals wp */ 7020 7108 7021 7109 /** … … 7065 7153 7066 7154 module.exports = Search; 7067 7155 7068 },{}],5 6:[function(require,module,exports){7156 },{}],58:[function(require,module,exports){ 7069 7157 /*globals wp, _, Backbone */ 7070 7158 7071 7159 /** … … 7150 7238 7151 7239 module.exports = Selection; 7152 7240 7153 },{}],5 7:[function(require,module,exports){7241 },{}],59:[function(require,module,exports){ 7154 7242 /*globals _, Backbone */ 7155 7243 7156 7244 /** … … 7273 7361 7274 7362 module.exports = Settings; 7275 7363 7276 },{}], 58:[function(require,module,exports){7364 },{}],60:[function(require,module,exports){ 7277 7365 /*globals wp, _ */ 7278 7366 7279 7367 /** … … 7369 7457 7370 7458 module.exports = AttachmentDisplay; 7371 7459 7372 },{}], 59:[function(require,module,exports){7460 },{}],61:[function(require,module,exports){ 7373 7461 /*globals wp */ 7374 7462 7375 7463 /** … … 7388 7476 7389 7477 module.exports = Gallery; 7390 7478 7391 },{}],6 0:[function(require,module,exports){7479 },{}],62:[function(require,module,exports){ 7392 7480 /*globals wp */ 7393 7481 7394 7482 /** … … 7407 7495 7408 7496 module.exports = Playlist; 7409 7497 7410 },{}],6 1:[function(require,module,exports){7498 },{}],63:[function(require,module,exports){ 7411 7499 /** 7412 7500 * wp.media.view.Sidebar 7413 7501 * … … 7423 7511 7424 7512 module.exports = Sidebar; 7425 7513 7426 },{}],62:[function(require,module,exports){ 7514 },{}],64:[function(require,module,exports){ 7515 /*globals wp, _ */ 7516 7517 /** 7518 * wp.media.view.Cropper 7519 * 7520 * Uses the imgAreaSelect plugin to allow a user to crop an image. 7521 * 7522 * Takes imgAreaSelect options from 7523 * wp.customize.HeaderControl.calculateImageSelectOptions via 7524 * wp.customize.HeaderControl.openMM. 7525 * 7526 * @class 7527 * @augments wp.media.View 7528 * @augments wp.Backbone.View 7529 * @augments Backbone.View 7530 */ 7531 var View = wp.media.view, 7532 SiteIconCropper; 7533 7534 SiteIconCropper = View.Cropper.extend({ 7535 className: 'crop-content site-icon', 7536 7537 onImageLoad: function() { 7538 var imgOptions = this.controller.get('imgSelectOptions'); 7539 if (typeof imgOptions === 'function') { 7540 imgOptions = imgOptions(this.options.attachment, this.controller); 7541 } 7542 7543 imgOptions = _.extend(imgOptions, {parent: this.$el}); 7544 this.trigger('image-loaded'); 7545 this.controller.imgSelect = this.$image.imgAreaSelect(imgOptions); 7546 7547 this.sidebar = new wp.media.view.Sidebar({ 7548 controller: this.controller 7549 }); 7550 this.sidebar.set( 'preview', new wp.media.view.SiteIconPreview({ 7551 controller: this.controller, 7552 attachment: this.options.attachment 7553 }) ); 7554 7555 this.controller.cropperView.views.add( this.sidebar ); 7556 } 7557 }); 7558 7559 module.exports = SiteIconCropper; 7560 7561 },{}],65:[function(require,module,exports){ 7562 /*globals wp, jQuery */ 7563 7564 /** 7565 * wp.media.view.Cropper 7566 * 7567 * Uses the imgAreaSelect plugin to allow a user to crop an image. 7568 * 7569 * Takes imgAreaSelect options from 7570 * wp.customize.HeaderControl.calculateImageSelectOptions via 7571 * wp.customize.HeaderControl.openMM. 7572 * 7573 * @class 7574 * @augments wp.media.View 7575 * @augments wp.Backbone.View 7576 * @augments Backbone.View 7577 */ 7578 var View = wp.media.View, 7579 $ = jQuery, 7580 SiteIconPreview; 7581 7582 SiteIconPreview = View.extend({ 7583 className: 'site-icon-preview', 7584 template: wp.template( 'site-icon-preview' ), 7585 7586 ready: function() { 7587 this.controller.imgSelect.setOptions({ 7588 onInit: this.updatePreview, 7589 onSelectChange: this.updatePreview 7590 }); 7591 }, 7592 7593 prepare: function() { 7594 return { 7595 url: this.options.attachment.get('url') 7596 }; 7597 }, 7598 7599 updatePreview: function(img, coords) { 7600 var rx = 64 / coords.width, 7601 ry = 64 / coords.height, 7602 preview_rx = 16 / coords.width, 7603 preview_ry = 16 / coords.height; 7604 7605 $( '#preview-homeicon' ).css({ 7606 width: Math.round(rx * this.imageWidth ) + 'px', 7607 height: Math.round(ry * this.imageHeight ) + 'px', 7608 marginLeft: '-' + Math.round(rx * coords.x1) + 'px', 7609 marginTop: '-' + Math.round(ry * coords.y1) + 'px' 7610 }); 7611 7612 $( '#preview-favicon' ).css({ 7613 width: Math.round( preview_rx * this.imageWidth ) + 'px', 7614 height: Math.round( preview_ry * this.imageHeight ) + 'px', 7615 marginLeft: '-' + Math.round( preview_rx * coords.x1 ) + 'px', 7616 marginTop: '-' + Math.floor( preview_ry* coords.y1 ) + 'px' 7617 }); 7618 } 7619 }); 7620 7621 module.exports = SiteIconPreview; 7622 7623 },{}],66:[function(require,module,exports){ 7427 7624 /*globals _ */ 7428 7625 7429 7626 /** … … 7460 7657 7461 7658 module.exports = Spinner; 7462 7659 7463 },{}],6 3:[function(require,module,exports){7660 },{}],67:[function(require,module,exports){ 7464 7661 /*globals _, Backbone */ 7465 7662 7466 7663 /** … … 7622 7819 7623 7820 module.exports = Toolbar; 7624 7821 7625 },{}],6 4:[function(require,module,exports){7822 },{}],68:[function(require,module,exports){ 7626 7823 /*globals wp, _ */ 7627 7824 7628 7825 /** … … 7661 7858 7662 7859 module.exports = Embed; 7663 7860 7664 },{}],6 5:[function(require,module,exports){7861 },{}],69:[function(require,module,exports){ 7665 7862 /*globals wp, _ */ 7666 7863 7667 7864 /** … … 7733 7930 7734 7931 module.exports = Select; 7735 7932 7736 },{}], 66:[function(require,module,exports){7933 },{}],70:[function(require,module,exports){ 7737 7934 /*globals wp, _, jQuery */ 7738 7935 7739 7936 /** … … 7956 8153 7957 8154 module.exports = EditorUploader; 7958 8155 7959 },{}], 67:[function(require,module,exports){8156 },{}],71:[function(require,module,exports){ 7960 8157 /*globals wp, _ */ 7961 8158 7962 8159 /** … … 8089 8286 8090 8287 module.exports = UploaderInline; 8091 8288 8092 },{}], 68:[function(require,module,exports){8289 },{}],72:[function(require,module,exports){ 8093 8290 /*globals wp */ 8094 8291 8095 8292 /** … … 8107 8304 8108 8305 module.exports = UploaderStatusError; 8109 8306 8110 },{}], 69:[function(require,module,exports){8307 },{}],73:[function(require,module,exports){ 8111 8308 /*globals wp, _ */ 8112 8309 8113 8310 /** … … 8247 8444 8248 8445 module.exports = UploaderStatus; 8249 8446 8250 },{}],7 0:[function(require,module,exports){8447 },{}],74:[function(require,module,exports){ 8251 8448 /*globals wp, _, jQuery */ 8252 8449 8253 8450 /** … … 8360 8557 8361 8558 module.exports = UploaderWindow; 8362 8559 8363 },{}],7 1:[function(require,module,exports){8560 },{}],75:[function(require,module,exports){ 8364 8561 /*globals wp */ 8365 8562 8366 8563 /** … … 8428 8625 8429 8626 module.exports = View; 8430 8627 8431 },{}]},{},[1 7]);8628 },{}]},{},[19]); -
src/wp-includes/media-template.php
1243 1243 <div class="upload-errors"></div> 1244 1244 </script> 1245 1245 1246 <script type="text/html" id="tmpl-site-icon-preview"> 1247 <h2><?php _e( 'Preview' ); ?></h2> 1248 <strong><?php _e( 'As a browser icon' ); ?></strong> 1249 <div class="site-icon-crop-favicon-preview-shell"> 1250 <img src="images/browser.png" class="site-icon-browser-preview" width="182" height="" alt=""/> 1251 1252 <div class="site-icon-crop-preview-favicon"> 1253 <img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/> 1254 </div> 1255 <span class="site-icon-browser-title"><?php bloginfo( 'name' ); ?></span> 1256 </div> 1257 1258 <strong><?php _e( 'As an app icon' ); ?></strong> 1259 <div class="site-icon-crop-preview-homeicon"> 1260 <img id="preview-homeicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/> 1261 </div> 1262 </script> 1263 1246 1264 <?php 1247 1265 1248 1266 /**