<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[55919] trunk: Media: Update admin image editor design.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/55919">55919</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/55919","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>joedolson</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-06-14 20:40:42 +0000 (Wed, 14 Jun 2023)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Media: Update admin image editor design.
Significant restructure of the admin image editor interface, but no new functionality. Reorganize editing buttons into a common region at the top of the editor. Move image rotation tools into a pop-out menu. Add 180 degree rotation option. Add scale button to control group. Move sidebar tools next to the editing canvas to improve visual proximity between action and result. Enlarge editing canvas and crop handles. Separate activating crop functions from applying crop. Add numeric inputs for crop & scale values.
A long term goal is to move undo/redo and cancel/save into the modal title bar, but that is not feasible without significant updates to the modal framework.
Props afercia, karmatosed, nrqsnchz, antpb, chaion07, costdev, peterwilsoncc, antpb, sabernhardt, prashantbhivsane, joedolson.
Fixes <a href="https://core.trac.wordpress.org/ticket/50523">#50523</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkenv">trunk/.env</a></li>
<li><a href="#trunksrcjs_enqueueslibimageeditjs">trunk/src/js/_enqueues/lib/image-edit.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendorimgareaselectjqueryimgareaselectjs">trunk/src/js/_enqueues/vendor/imgareaselect/jquery.imgareaselect.js</a></li>
<li><a href="#trunksrcwpadmincsscommoncss">trunk/src/wp-admin/css/common.css</a></li>
<li><a href="#trunksrcwpadmincssmediacss">trunk/src/wp-admin/css/media.css</a></li>
<li><a href="#trunksrcwpadminincludesimageeditphp">trunk/src/wp-admin/includes/image-edit.php</a></li>
<li><a href="#trunksrcwpincludescssmediaviewscss">trunk/src/wp-includes/css/media-views.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkenv"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/.env</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.env 2023-06-14 14:09:23 UTC (rev 55918)
+++ trunk/.env 2023-06-14 20:40:42 UTC (rev 55919)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +12,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> LOCAL_PORT=8889
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> # Where to run WordPress from. Valid options are 'src' and 'build'.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-LOCAL_DIR=src
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+LOCAL_DIR=build
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> # The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
</span><span class="cx" style="display: block; padding: 0 10px"> LOCAL_PHP=latest
</span></span></pre></div>
<a id="trunksrcjs_enqueueslibimageeditjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/lib/image-edit.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/lib/image-edit.js 2023-06-14 14:09:23 UTC (rev 55918)
+++ trunk/src/js/_enqueues/lib/image-edit.js 2023-06-14 20:40:42 UTC (rev 55919)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,25 +22,61 @@
</span><span class="cx" style="display: block; padding: 0 10px"> _view : false,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Handle crop tool clicks.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Enable crop tool.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- handleCropToolClick: function( postid, nonce, cropButton ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ toggleCropTool: function( postid, nonce, cropButton ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var img = $( '#image-preview-' + postid ),
</span><span class="cx" style="display: block; padding: 0 10px"> selection = this.iasapi.getSelection();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Ensure selection is available, otherwise reset to full image.
- if ( isNaN( selection.x1 ) ) {
- this.setCropSelection( postid, { 'x1': 0, 'y1': 0, 'x2': img.innerWidth(), 'y2': img.innerHeight(), 'width': img.innerWidth(), 'height': img.innerHeight() } );
- selection = this.iasapi.getSelection();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ imageEdit.toggleControls( cropButton );
+ var $el = $( cropButton );
+ var state = ( $el.attr( 'aria-expanded' ) === 'true' ) ? 'true' : 'false';
+ // Crop tools have been closed.
+ if ( 'false' === state ) {
+ // Cancel selection, but do not unset inputs.
+ this.iasapi.cancelSelection();
+ imageEdit.setDisabled($('.imgedit-crop-clear'), 0);
+ } else {
+ imageEdit.setDisabled($('.imgedit-crop-clear'), 1);
+ // Get values from inputs to restore previous selection.
+ var startX = ( $( '#imgedit-start-x-' + postid ).val() ) ? $('#imgedit-start-x-' + postid).val() : 0;
+ var startY = ( $( '#imgedit-start-y-' + postid ).val() ) ? $('#imgedit-start-y-' + postid).val() : 0;
+ var width = ( $( '#imgedit-sel-width-' + postid ).val() ) ? $('#imgedit-sel-width-' + postid).val() : img.innerWidth();
+ var height = ( $( '#imgedit-sel-height-' + postid ).val() ) ? $('#imgedit-sel-height-' + postid).val() : img.innerHeight();
+ // Ensure selection is available, otherwise reset to full image.
+ if ( isNaN( selection.x1 ) ) {
+ this.setCropSelection( postid, { 'x1': startX, 'y1': startY, 'x2': width, 'y2': height, 'width': width, 'height': height } );
+ selection = this.iasapi.getSelection();
+ }
+
+ // If we don't already have a selection, select the entire image.
+ if ( 0 === selection.x1 && 0 === selection.y1 && 0 === selection.x2 && 0 === selection.y2 ) {
+ this.iasapi.setSelection( 0, 0, img.innerWidth(), img.innerHeight(), true );
+ this.iasapi.setOptions( { show: true } );
+ this.iasapi.update();
+ } else {
+ this.iasapi.setSelection( startX, startY, width, height, true );
+ this.iasapi.setOptions( { show: true } );
+ this.iasapi.update();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If we don't already have a selection, select the entire image.
- if ( 0 === selection.x1 && 0 === selection.y1 && 0 === selection.x2 && 0 === selection.y2 ) {
- this.iasapi.setSelection( 0, 0, img.innerWidth(), img.innerHeight(), true );
- this.iasapi.setOptions( { show: true } );
- this.iasapi.update();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Handle crop tool clicks.
+ */
+ handleCropToolClick: function( postid, nonce, cropButton ) {
+
+ if ( cropButton.classList.contains( 'imgedit-crop-clear' ) ) {
+ this.iasapi.cancelSelection();
+ imageEdit.setDisabled($('.imgedit-crop-apply'), 0);
+
+ $('#imgedit-sel-width-' + postid).val('');
+ $('#imgedit-sel-height-' + postid).val('');
+ $('#imgedit-start-x-' + postid).val('0');
+ $('#imgedit-start-y-' + postid).val('0');
+ $('#imgedit-selection-' + postid).val('');
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> // Otherwise, perform the crop.
</span><span class="cx" style="display: block; padding: 0 10px"> imageEdit.crop( postid, nonce , cropButton );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,6 +158,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> t.postid = postid;
</span><span class="cx" style="display: block; padding: 0 10px"> $('#imgedit-response-' + postid).empty();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#imgedit-panel-' + postid).on( 'keypress', function(e) {
+ var nonce = $( '#imgedit-nonce-' + postid ).val();
+ if ( e.which === 26 && e.ctrlKey ) {
+ imageEdit.undo( postid, nonce );
+ }
+
+ if ( e.which === 25 && e.ctrlKey ) {
+ imageEdit.redo( postid, nonce );
+ }
+ });
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#imgedit-panel-' + postid).on( 'keypress', 'input[type="text"]', function(e) {
</span><span class="cx" style="display: block; padding: 0 10px"> var k = e.keyCode;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,6 +217,93 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Shows or hides image menu popup.
+ *
+ * @since 6.3.0
+ *
+ * @memberof imageEdit
+ *
+ * @param {HTMLElement} el The activated control element.
+ *
+ * @return {boolean} Always returns false.
+ */
+ togglePopup : function(el) {
+ var $el = $( el );
+ var $targetEl = $( el ).attr( 'aria-controls' );
+ var $target = $( '#' + $targetEl );
+ $el
+ .attr( 'aria-expanded', 'false' === $el.attr( 'aria-expanded' ) ? 'true' : 'false' );
+ // Open menu and set z-index to appear above image crop area if it is enabled.
+ $target
+ .toggleClass( 'imgedit-popup-menu-open' ).slideToggle( 'fast' ).css( { 'z-index' : 200000 } );
+ // Move focus to first item in menu.
+ $target.find( 'button' ).first().trigger( 'focus' );
+
+ return false;
+ },
+
+ /**
+ * Navigate popup menu by arrow keys.
+ *
+ * @since 6.3.0
+ *
+ * @memberof imageEdit
+ *
+ * @param {HTMLElement} el The current element.
+ *
+ * @return {boolean} Always returns false.
+ */
+ browsePopup : function(el) {
+ var $el = $( el );
+ var $collection = $( el ).parent( '.imgedit-popup-menu' ).find( 'button' );
+ var $index = $collection.index( $el );
+ var $prev = $index - 1;
+ var $next = $index + 1;
+ var $last = $collection.length;
+ if ( $prev < 0 ) {
+ $prev = $last - 1;
+ }
+ if ( $next === $last ) {
+ $next = 0;
+ }
+ var $target = false;
+ if ( event.keyCode === 40 ) {
+ $target = $collection.get( $next );
+ } else if ( event.keyCode === 38 ) {
+ $target = $collection.get( $prev );
+ }
+ if ( $target ) {
+ $target.focus();
+ event.preventDefault();
+ }
+
+ return false;
+ },
+
+ /**
+ * Close popup menu and reset focus on feature activation.
+ *
+ * @since 6.3.0
+ *
+ * @memberof imageEdit
+ *
+ * @param {HTMLElement} el The current element.
+ *
+ * @return {boolean} Always returns false.
+ */
+ closePopup : function(el) {
+ var $parent = $(el).parent( '.imgedit-popup-menu' );
+ var $controlledID = $parent.attr( 'id' );
+ var $target = $( 'button[aria-controls="' + $controlledID + '"]' );
+ $target
+ .attr( 'aria-expanded', 'false' ).trigger( 'focus' );
+ $parent
+ .toggleClass( 'imgedit-popup-menu-open' ).slideToggle( 'fast' );
+
+ return false;
+ },
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Shows or hides the image edit help box.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,6 +324,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Shows or hides image edit input fields when enabled.
+ *
+ * @since 6.3.0
+ *
+ * @memberof imageEdit
+ *
+ * @param {HTMLElement} el The element to trigger the edit panel.
+ *
+ * @return {boolean} Always returns false.
+ */
+ toggleControls : function(el) {
+ var $el = $( el );
+ var $target = $( '#' + $el.attr( 'aria-controls' ) );
+ $el
+ .attr( 'aria-expanded', 'false' === $el.attr( 'aria-expanded' ) ? 'true' : 'false' );
+ $target
+ .parent( '.imgedit-group' ).toggleClass( 'imgedit-panel-active' );
+
+ return false;
+ },
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Gets the value from the image edit target.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * The image edit target contains the image sizes where the (possible) changes
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -405,12 +561,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $('#imgedit-history-' + postid).val() && $('#imgedit-undone-' + postid).val() === '0' ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('button.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', false);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('button.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var successMessage = __( 'Image updated.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> t.toggleEditor(postid, 0);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp.a11y.speak( successMessage, 'assertive' );
</ins><span class="cx" style="display: block; padding: 0 10px"> })
</span><span class="cx" style="display: block; padding: 0 10px"> .on( 'error', function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var errorMessage = __( 'Could not load the preview image. Please reload the page and try again.' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -713,6 +871,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var t = this,
</span><span class="cx" style="display: block; padding: 0 10px"> selW = $('#imgedit-sel-width-' + postid),
</span><span class="cx" style="display: block; padding: 0 10px"> selH = $('#imgedit-sel-height-' + postid),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selX = $('#imgedit-start-x-' + postid),
+ selY = $('#imgedit-start-y-' + postid),
</ins><span class="cx" style="display: block; padding: 0 10px"> $image = $( image ),
</span><span class="cx" style="display: block; padding: 0 10px"> $img;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -771,6 +931,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> onSelectStart: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> imageEdit.setDisabled($('#imgedit-crop-sel-' + postid), 1);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ imageEdit.setDisabled($('.imgedit-crop-clear'), 1);
+ imageEdit.setDisabled($('.imgedit-crop-apply'), 1);
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Event triggered when the selection is ended.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -784,6 +946,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> onSelectEnd: function(img, c) {
</span><span class="cx" style="display: block; padding: 0 10px"> imageEdit.setCropSelection(postid, c);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $('#imgedit-crop > *').is(':visible') ) {
+ imageEdit.toggleControls($('.imgedit-crop.button'));
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,6 +965,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var sizer = imageEdit.hold.sizer;
</span><span class="cx" style="display: block; padding: 0 10px"> selW.val( imageEdit.round(c.width / sizer) );
</span><span class="cx" style="display: block; padding: 0 10px"> selH.val( imageEdit.round(c.height / sizer) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selX.val( imageEdit.round(c.x1 / sizer) );
+ selY.val( imageEdit.round(c.y1 / sizer) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -826,6 +993,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.setDisabled( $( '#imgedit-crop-sel-' + postid ), 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $('#imgedit-sel-width-' + postid).val('');
</span><span class="cx" style="display: block; padding: 0 10px"> $('#imgedit-sel-height-' + postid).val('');
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#imgedit-start-x-' + postid).val('0');
+ $('#imgedit-start-y-' + postid).val('0');
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#imgedit-selection-' + postid).val('');
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -956,7 +1125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $(t).hasClass('disabled') ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.closePopup(t);
</ins><span class="cx" style="display: block; padding: 0 10px"> this.addStep({ 'r': { 'r': angle, 'fw': this.hold.h, 'fh': this.hold.w }}, postid, nonce);
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -978,7 +1147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $(t).hasClass('disabled') ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.closePopup(t);
</ins><span class="cx" style="display: block; padding: 0 10px"> this.addStep({ 'f': { 'f': axis, 'fw': this.hold.w, 'fh': this.hold.h }}, postid, nonce);
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1014,6 +1183,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clear the selection fields after cropping.
</span><span class="cx" style="display: block; padding: 0 10px"> $('#imgedit-sel-width-' + postid).val('');
</span><span class="cx" style="display: block; padding: 0 10px"> $('#imgedit-sel-height-' + postid).val('');
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#imgedit-start-x-' + postid).val('0');
+ $('#imgedit-start-y-' + postid).val('0');
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1097,6 +1268,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> setNumSelection : function( postid, el ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var sel, elX = $('#imgedit-sel-width-' + postid), elY = $('#imgedit-sel-height-' + postid),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ elX1 = $('#imgedit-start-x-' + postid), elY1 = $('#imgedit-start-y-' + postid),
+ xS = this.intval( elX1.val() ), yS = this.intval( elY1.val() ),
</ins><span class="cx" style="display: block; padding: 0 10px"> x = this.intval( elX.val() ), y = this.intval( elY.val() ),
</span><span class="cx" style="display: block; padding: 0 10px"> img = $('#image-preview-' + postid), imgh = img.height(), imgw = img.width(),
</span><span class="cx" style="display: block; padding: 0 10px"> sizer = this.hold.sizer, x1, y1, x2, y2, ias = this.iasapi;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1115,11 +1288,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( x && y && ( sel = ias.getSelection() ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ( ( x && y ) || ( xS && yS ) ) && ( sel = ias.getSelection() ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> x2 = sel.x1 + Math.round( x * sizer );
</span><span class="cx" style="display: block; padding: 0 10px"> y2 = sel.y1 + Math.round( y * sizer );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- x1 = sel.x1;
- y1 = sel.y1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ x1 = ( xS === sel.x1 ) ? sel.x1 : Math.round( xS * sizer );
+ y1 = ( yS === sel.y1 ) ? sel.y1 : Math.round( yS * sizer );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( x2 > imgw ) {
</span><span class="cx" style="display: block; padding: 0 10px"> x1 = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1205,11 +1378,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( r > h ) {
</span><span class="cx" style="display: block; padding: 0 10px"> r = h;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var errorMessage = __( 'Selected crop ratio exceeds the boundaries of the image. Try a different ratio.' );
+
+ $( '#imgedit-crop-' + postid )
+ .prepend( '<div class="notice notice-error" tabindex="-1" role="alert"><p>' + errorMessage + '</p></div>' );
+
+ wp.a11y.speak( errorMessage, 'assertive' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( n ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#imgedit-crop-height-' + postid).val('');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#imgedit-crop-height-' + postid).val( '' );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#imgedit-crop-width-' + postid).val('');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#imgedit-crop-width-' + postid).val( '');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ var error = $( '#imgedit-crop-' + postid ).find( '.notice-error' );
+ if ( 'undefined' !== typeof( error ) ) {
+ error.remove();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.iasapi.setSelection( sel.x1, sel.y1, sel.x2, r );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1231,7 +1415,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * void when it is.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> validateNumeric: function( el ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! this.intval( $( el ).val() ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( false === this.intval( $( el ).val() ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $( el ).val( '' );
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendorimgareaselectjqueryimgareaselectjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/imgareaselect/jquery.imgareaselect.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/imgareaselect/jquery.imgareaselect.js 2023-06-14 14:09:23 UTC (rev 55918)
+++ trunk/src/js/_enqueues/vendor/imgareaselect/jquery.imgareaselect.js 2023-06-14 20:40:42 UTC (rev 55919)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -956,7 +956,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * default 5px
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!parseInt($handles.css('width')) >= 0)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $handles.width(5).height(5);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $handles.width(10).height(10);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * If the borderWidth option is in use, add a solid border to
</span></span></pre></div>
<a id="trunksrcwpadmincsscommoncss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/common.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/common.css 2023-06-14 14:09:23 UTC (rev 55918)
+++ trunk/src/wp-admin/css/common.css 2023-06-14 20:40:42 UTC (rev 55919)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,7 +191,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .wp-editor-container,
</span><span class="cx" style="display: block; padding: 0 10px"> .popular-tags,
</span><span class="cx" style="display: block; padding: 0 10px"> .feature-filter,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-group,
</del><span class="cx" style="display: block; padding: 0 10px"> .comment-ays {
</span><span class="cx" style="display: block; padding: 0 10px"> border: 1px solid #c3c4c7;
</span><span class="cx" style="display: block; padding: 0 10px"> box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,7 +203,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widgets-holder-wrap,
</span><span class="cx" style="display: block; padding: 0 10px"> .popular-tags,
</span><span class="cx" style="display: block; padding: 0 10px"> .feature-filter,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-group,
</del><span class="cx" style="display: block; padding: 0 10px"> .comment-ays {
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadmincssmediacss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/media.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/media.css 2023-06-14 14:09:23 UTC (rev 55918)
+++ trunk/src/wp-admin/css/media.css 2023-06-14 20:40:42 UTC (rev 55919)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -877,16 +877,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding-top: 10px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings p,
-.imgedit-settings fieldset {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor p,
+.image-editor fieldset {
</ins><span class="cx" style="display: block; padding: 0 10px"> margin: 8px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings legend {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor legend {
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 5px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.describe .imgedit-wrap .imgedit-settings {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.describe .imgedit-wrap .image-editor {
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 0 5px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -898,19 +898,36 @@
</span><span class="cx" style="display: block; padding: 0 10px"> height: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.wp_attachment_holder .imgedit-wrap .imgedit-panel-content {
- float: left;
- padding: 3px 16px 0 0;
- min-width: 400px;
- max-width: calc( 100% - 266px );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-panel-content {
+ display: grid;
+ grid-template-columns: 640px 1fr;
+ gap: 20px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.wp_attachment_holder .imgedit-wrap .imgedit-settings {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+@media screen and (max-width: 1120px) {
+ .imgedit-panel-content {
+ grid-template-columns: 1fr;
+ }
+}
+
+.imgedit-settings {
+ max-width: 400px; /* Prevent reflow when help info is expanded. */
+}
+
+.imgedit-group-controls > * {
+ display: none;
+}
+
+.imgedit-panel-active .imgedit-group-controls > * {
+ display: block;
+}
+
+.wp_attachment_holder .imgedit-wrap .image-editor {
</ins><span class="cx" style="display: block; padding: 0 10px"> float: right;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 250px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings input {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor input {
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-top: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> vertical-align: middle;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -945,7 +962,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-disabled,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings .disabled {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor .disabled {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* WCAG 1.4.3 Text or images of text that are part of an inactive user
</span><span class="cx" style="display: block; padding: 0 10px"> interface component ... have no contrast requirement. */
</span><span class="cx" style="display: block; padding: 0 10px"> color: #a7aaad;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -969,10 +986,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> float: left;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-menu {
- margin: 0 0 12px;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .imgedit-menu .note-no-rotate {
</span><span class="cx" style="display: block; padding: 0 10px"> clear: both;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -985,7 +998,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> min-height: 28px;
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 13px;
</span><span class="cx" style="display: block; padding: 0 10px"> line-height: 2;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin: 0 8px 8px 0;
</del><span class="cx" style="display: block; padding: 0 10px"> padding: 0 10px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1014,22 +1026,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> content: "\f165";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-rleft:before {
- content: "\f166";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-scale:before {
+ content: "\f211";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-rright:before {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-rotate:before {
</ins><span class="cx" style="display: block; padding: 0 10px"> content: "\f167";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-flipv:before {
- content: "\f168";
-}
-
-.imgedit-fliph:before {
- content: "\f169";
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .imgedit-undo:before {
</span><span class="cx" style="display: block; padding: 0 10px"> content: "\f171";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1048,23 +1052,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> background-size: 20px 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-crop {
- margin: 0 8px 0 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-crop-wrap {
+ padding: 20px;
+ background-image: linear-gradient(45deg, #c3c4c7 25%, transparent 25%, transparent 75%, #c3c4c7 75%, #c3c4c7), linear-gradient(45deg, #c3c4c7 25%, transparent 25%, transparent 75%, #c3c4c7 75%, #c3c4c7);
+ background-position: 0 0, 10px 10px;
+ background-size: 20px 20px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-rleft {
- margin: 0 3px;
-}
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-rright {
- margin: 0 8px 0 3px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-crop {
+ margin: 0 8px 0 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-flipv {
- margin: 0 3px;
-}
-
-.imgedit-fliph {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-rotate {
</ins><span class="cx" style="display: block; padding: 0 10px"> margin: 0 8px 0 3px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1076,6 +1076,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0 8px 0 3px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-thumbnail-preview-group {
+ display: flex;
+ flex-wrap: wrap;
+ column-gap: 10px;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .imgedit-thumbnail-preview {
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 10px 8px 0 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1102,11 +1108,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding: .5em 0 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-popup-menu,
</ins><span class="cx" style="display: block; padding: 0 10px"> .imgedit-help {
</span><span class="cx" style="display: block; padding: 0 10px"> display: none;
</span><span class="cx" style="display: block; padding: 0 10px"> padding-bottom: 8px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.imgedit-panel-tools > .imgedit-menu {
+ display: flex;
+ column-gap: 4px;
+ align-items: start;
+}
+
+.imgedit-popup-menu {
+ width: fit-content;
+ position: absolute;
+ left: calc( 100% + 4px );
+ top: -3px;
+}
+
+.image-editor .imgedit-menu .imgedit-popup-menu button {
+ display: block;
+ margin: 2px 0;
+ width: 100%;
+}
+
+.imgedit-rotate-menu-container {
+ position: relative;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .imgedit-help.imgedit-restore {
</span><span class="cx" style="display: block; padding: 0 10px"> padding-bottom: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1139,10 +1169,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-submit {
- margin: 8px 0 0;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .imgedit-submit-btn {
</span><span class="cx" style="display: block; padding: 0 10px"> margin-left: 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1173,17 +1199,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .imgedit-group {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin-bottom: 8px;
- padding: 10px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ margin-bottom: 20px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings .imgedit-original-dimensions {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor .imgedit-original-dimensions {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: inline-block;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings .imgedit-scale input[type="text"],
-.imgedit-settings .imgedit-crop-ratio input[type="text"],
-.imgedit-settings .imgedit-crop-sel input[type="text"] {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor .imgedit-scale-controls input[type="text"],
+.image-editor .imgedit-crop-ratio input[type="text"],
+.image-editor .imgedit-crop-sel input[type="text"] {
</ins><span class="cx" style="display: block; padding: 0 10px"> width: 80px;
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 14px;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0 8px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1197,12 +1222,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> color: #3c434a;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings .imgedit-scale-button-wrapper {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor .imgedit-scale-button-wrapper {
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-top: 0.3077em;
</span><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.imgedit-settings .imgedit-scale .button {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.image-editor .imgedit-scale-controls .button {
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1271,15 +1296,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 10px 0 10px 12px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .imgedit-settings .imgedit-scale input[type="text"],
- .imgedit-settings .imgedit-crop-ratio input[type="text"],
- .imgedit-settings .imgedit-crop-sel input[type="text"] {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .image-editor .imgedit-scale input[type="text"],
+ .image-editor .imgedit-crop-ratio input[type="text"],
+ .image-editor .imgedit-crop-sel input[type="text"] {
</ins><span class="cx" style="display: block; padding: 0 10px"> font-size: 16px;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 6px 10px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .wp_attachment_holder .imgedit-wrap .imgedit-panel-content,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .wp_attachment_holder .imgedit-wrap .imgedit-settings {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .wp_attachment_holder .imgedit-wrap .image-editor {
</ins><span class="cx" style="display: block; padding: 0 10px"> float: none;
</span><span class="cx" style="display: block; padding: 0 10px"> width: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> max-width: none;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1296,16 +1321,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-modal .imgedit-wrap .imgedit-panel-content,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-modal .imgedit-wrap .imgedit-settings {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-modal .imgedit-wrap .image-editor {
</ins><span class="cx" style="display: block; padding: 0 10px"> position: initial !important;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-modal .imgedit-wrap .imgedit-settings {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-modal .imgedit-wrap .image-editor {
</ins><span class="cx" style="display: block; padding: 0 10px"> box-sizing: border-box;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 100% !important;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .imgedit-settings .imgedit-scale-button-wrapper {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .image-editor .imgedit-scale-button-wrapper {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: inline-block;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesimageeditphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/image-edit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/image-edit.php 2023-06-14 14:09:23 UTC (rev 55918)
+++ trunk/src/wp-admin/includes/image-edit.php 2023-06-14 20:40:42 UTC (rev 55919)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> die( __( 'Image data does not exist. Please re-upload the image.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sizer = $big > 400 ? 400 / $big : 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sizer = $big > 600 ? 600 / $big : 1;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $can_restore = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,13 +55,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="imgedit-wrap wp-clearfix">
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="imgedit-panel-<?php echo $post_id; ?>">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- <div class="imgedit-panel-content wp-clearfix">
- <?php echo $note; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php echo $note; ?>
+ <div class="imgedit-panel-content imgedit-panel-tools wp-clearfix">
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="imgedit-menu wp-clearfix">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <button type="button" onclick="imageEdit.toggleCropTool( <?php echo "$post_id, '$nonce'"; ?>, this );" aria-expanded="false" aria-controls="imgedit-crop" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button>
+ <button type="button" class="imgedit-scale button" onclick="imageEdit.toggleControls(this);" aria-expanded="false" aria-controls="imgedit-scale"><?php esc_html_e( 'Scale' ); ?></button>
+ <div class="imgedit-rotate-menu-container">
+ <button type="button" aria-controls="imgedit-rotate-menu" class="imgedit-rotate button" onclick="imageEdit.togglePopup(this)"><?php esc_html_e( 'Image Rotation' ); ?></button>
+ <div id="imgedit-rotate-menu" class="imgedit-popup-menu">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> // On some setups GD library does not provide imagerotate() - Ticket #11536.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wp_image_editor_supports(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,184 +73,202 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $note_no_rotate = '';
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate left' ); ?></button>
- <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate right' ); ?></button>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <button type="button" class="imgedit-rleft button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate 90° left' ); ?></button>
+ <button type="button" class="imgedit-rright button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate 90° right' ); ?></button>
+ <button type="button" class="imgedit-rfull button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.rotate(180, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate 180°' ); ?></button>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <button type="button" class="imgedit-rleft button disabled" disabled></button>
- <button type="button" class="imgedit-rright button disabled" disabled></button>
- <?php } ?>
-
- <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertical' ); ?></button>
- <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontal' ); ?></button>
-
- <br class="imgedit-undo-redo-separator" />
- <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><?php esc_html_e( 'Undo' ); ?></button>
- <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><?php esc_html_e( 'Redo' ); ?></button>
- <?php echo $note_no_rotate; ?>
- </div>
-
- <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" />
- <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" />
- <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" />
- <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" />
- <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
- <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
-
- <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
- <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')"
- src="<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '?action=imgedit-preview&_ajax_nonce=' . $nonce . '&postid=' . $post_id . '&rand=' . rand( 1, 99999 ); ?>" alt="" />
- </div>
-
- <div class="imgedit-submit">
- <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn" value="<?php esc_attr_e( 'Cancel' ); ?>" />
- <input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" />
- </div>
- </div>
-
- <div class="imgedit-settings">
- <div class="imgedit-group">
- <div class="imgedit-group-top">
- <h2><?php _e( 'Scale Image' ); ?></h2>
- <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- esc_html_e( 'Scale Image Help' );
- ?>
- </span></button>
- <div class="imgedit-help">
- <p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p>
- </div>
- <?php if ( isset( $meta['width'], $meta['height'] ) ) : ?>
- <p>
- <?php
- printf(
- /* translators: %s: Image width and height in pixels. */
- __( 'Original dimensions %s' ),
- '<span class="imgedit-original-dimensions">' . $meta['width'] . ' × ' . $meta['height'] . '</span>'
- );
- ?>
- </p>
- <?php endif; ?>
- <div class="imgedit-submit">
-
- <fieldset class="imgedit-scale">
- <legend><?php _e( 'New dimensions:' ); ?></legend>
- <div class="nowrap">
- <label for="imgedit-scale-width-<?php echo $post_id; ?>" class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- _e( 'scale width' );
- ?>
- </label>
- <input type="number" aria-describedby="imgedit-scale-warn-<?php echo $post_id; ?>" min="1" max="<?php echo isset( $meta['width'] ) ? $meta['width'] : ''; ?>" step="1" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" onchange="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
- <span class="imgedit-separator" aria-hidden="true">×</span>
- <label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- _e( 'scale height' );
- ?>
- </label>
- <input type="number" aria-describedby="imgedit-scale-warn-<?php echo $post_id; ?>" min="1" max="<?php echo isset( $meta['height'] ) ? $meta['height'] : ''; ?>" step="1" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onchange="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
- <div class="imgedit-scale-button-wrapper"><input id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" /></div>
- </div>
- <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>"><span class="dashicons dashicons-warning" aria-hidden="true"></span><?php esc_html_e( 'Images cannot be scaled to a size larger than the original.' ); ?></span>
-
- </fieldset>
-
- </div>
- </div>
- </div>
-
- <?php if ( $can_restore ) { ?>
-
- <div class="imgedit-group">
- <div class="imgedit-group-top">
- <h2><button type="button" onclick="imageEdit.toggleHelp(this);" class="button-link" aria-expanded="false"><?php _e( 'Restore original image' ); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></button></h2>
- <div class="imgedit-help imgedit-restore">
- <p>
- <?php
- _e( 'Discard any changes and restore the original image.' );
-
- if ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) {
- echo ' ' . __( 'Previously edited copies of the image will not be deleted.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <button type="button" class="imgedit-rleft button disabled" disabled></button>
+ <button type="button" class="imgedit-rright button disabled" disabled></button>
+ <?php
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </p>
- <div class="imgedit-submit">
- <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <hr />
+ <button type="button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertical' ); ?></button>
+ <button type="button" onkeyup="imageEdit.browsePopup(this)" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontal' ); ?></button>
+ <?php echo $note_no_rotate; ?>
+ </div>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="imgedit-submit imgedit-menu">
+ <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><?php esc_html_e( 'Undo' ); ?></button>
+ <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><?php esc_html_e( 'Redo' ); ?></button>
+ <button type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn"><?php esc_html_e( 'Cancel Editing' ); ?></button>
+ <button type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button button-primary imgedit-submit-btn"><?php esc_html_e( 'Save Edits' ); ?></button>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </div>
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php } ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="imgedit-panel-content wp-clearfix">
+ <div class="imgedit-tools">
+ <input type="hidden" id="imgedit-nonce-<?php echo $post_id; ?>" value="<?php echo $nonce; ?>" />
+ <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" />
+ <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" />
+ <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" />
+ <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" />
+ <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
+ <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="imgedit-group">
- <div class="imgedit-group-top">
- <h2><?php _e( 'Image Crop' ); ?></h2>
- <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- esc_html_e( 'Image Crop Help' );
- ?>
- </span></button>
-
- <div class="imgedit-help">
- <p><?php _e( 'To crop the image, click on it and drag to make your selection.' ); ?></p>
-
- <p><strong><?php _e( 'Crop Aspect Ratio' ); ?></strong><br />
- <?php _e( 'The aspect ratio is the relationship between the width and height. You can preserve the aspect ratio by holding down the shift key while resizing your selection. Use the input box to specify the aspect ratio, e.g. 1:1 (square), 4:3, 16:9, etc.' ); ?></p>
-
- <p><strong><?php _e( 'Crop Selection' ); ?></strong><br />
- <?php _e( 'Once you have made your selection, you can adjust it by entering the size in pixels. The minimum selection size is the thumbnail size as set in the Media settings.' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
+ <div class="imgedit-crop-grid"></div>
+ <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')"
+ src="<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '?action=imgedit-preview&_ajax_nonce=' . $nonce . '&postid=' . $post_id . '&rand=' . rand( 1, 99999 ); ?>" alt="" />
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="imgedit-settings">
+ <div class="imgedit-tool-active">
+ <div class="imgedit-group">
+ <div id="imgedit-scale" tabindex="-1" class="imgedit-group-controls">
+ <div class="imgedit-group-top">
+ <h2><?php _e( 'Scale Image' ); ?></h2>
+ <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ esc_html_e( 'Scale Image Help' );
+ ?>
+ </span></button>
+ <div class="imgedit-help">
+ <p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p>
+ </div>
+ <?php if ( isset( $meta['width'], $meta['height'] ) ) : ?>
+ <p>
+ <?php
+ printf(
+ /* translators: %s: Image width and height in pixels. */
+ __( 'Original dimensions %s' ),
+ '<span class="imgedit-original-dimensions">' . $meta['width'] . ' × ' . $meta['height'] . '</span>'
+ );
+ ?>
+ </p>
+ <?php endif; ?>
+ <div class="imgedit-submit">
+ <fieldset class="imgedit-scale-controls">
+ <legend><?php _e( 'New dimensions:' ); ?></legend>
+ <div class="nowrap">
+ <label for="imgedit-scale-width-<?php echo $post_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'scale height' );
+ ?>
+ </label>
+ <input type="number" step="1" min="0" max="<?php echo isset( $meta['width'] ) ? $meta['width'] : ''; ?>" aria-describedby="imgedit-scale-warn-<?php echo $post_id; ?>" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
+ <span class="imgedit-separator" aria-hidden="true">×</span>
+ <label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale height' ); ?></label>
+ <input type="number" step="1" min="0" max="<?php echo isset( $meta['height'] ) ? $meta['width'] : ''; ?>" aria-describedby="imgedit-scale-warn-<?php echo $post_id; ?>" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
+ <button id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary"><?php esc_html_e( 'Scale' ); ?></button>
+ <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>"><span class="dashicons dashicons-warning" aria-hidden="true"></span><?php esc_html_e( 'Images cannot be scaled to a size larger than the original.' ); ?></span>
+ </div>
+ </fieldset>
+ </div>
+ </div>
+ </div>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <fieldset class="imgedit-crop-ratio">
- <legend><?php _e( 'Aspect ratio:' ); ?></legend>
- <div class="nowrap">
- <label for="imgedit-crop-width-<?php echo $post_id; ?>" class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- _e( 'crop ratio width' );
- ?>
- </label>
- <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" />
- <span class="imgedit-separator" aria-hidden="true">:</span>
- <label for="imgedit-crop-height-<?php echo $post_id; ?>" class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- _e( 'crop ratio height' );
- ?>
- </label>
- <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" />
- </div>
- </fieldset>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( $can_restore ) { ?>
+ <div class="imgedit-group">
+ <div class="imgedit-group-top">
+ <h2><button type="button" onclick="imageEdit.toggleHelp(this);" class="button-link" aria-expanded="false"><?php _e( 'Restore original image' ); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></button></h2>
+ <div class="imgedit-help imgedit-restore">
+ <p>
+ <?php
+ _e( 'Discard any changes and restore the original image.' );
+ if ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) {
+ echo ' ' . __( 'Previously edited copies of the image will not be deleted.' );
+ }
+ ?>
+ </p>
+ <div class="imgedit-submit">
+ <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> />
+ </div>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+ <div class="imgedit-group">
+ <div id="imgedit-crop" tabindex="-1" class="imgedit-group-controls">
+ <div class="imgedit-group-top">
+ <h2><?php _e( 'Crop Image' ); ?></h2>
+ <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'Image Crop Help' );
+ ?>
+ </span></button>
+ <div class="imgedit-help">
+ <p><?php _e( 'To crop the image, click on it and drag to make your selection.' ); ?></p>
+ <p><strong><?php _e( 'Crop Aspect Ratio' ); ?></strong><br />
+ <?php _e( 'The aspect ratio is the relationship between the width and height. You can preserve the aspect ratio by holding down the shift key while resizing your selection. Use the input box to specify the aspect ratio, e.g. 1:1 (square), 4:3, 16:9, etc.' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel">
- <legend><?php _e( 'Selection:' ); ?></legend>
- <div class="nowrap">
- <label for="imgedit-sel-width-<?php echo $post_id; ?>" class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- _e( 'selection width' );
- ?>
- </label>
- <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
- <span class="imgedit-separator" aria-hidden="true">×</span>
- <label for="imgedit-sel-height-<?php echo $post_id; ?>" class="screen-reader-text">
- <?php
- /* translators: Hidden accessibility text. */
- _e( 'selection height' );
- ?>
- </label>
- <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p><strong><?php _e( 'Crop Selection' ); ?></strong><br />
+ <?php _e( 'Once you have made your selection, you can adjust it by entering the size in pixels. The minimum selection size is the thumbnail size as set in the Media settings.' ); ?></p>
+ </div>
+ </div>
+ <fieldset class="imgedit-crop-ratio">
+ <legend><?php _e( 'Aspect ratio:' ); ?></legend>
+ <div class="nowrap">
+ <label for="imgedit-crop-width-<?php echo $post_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'crop ratio width' );
+ ?>
+ </label>
+ <input type="number" step="1" min="1" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" />
+ <span class="imgedit-separator" aria-hidden="true">:</span>
+ <label for="imgedit-crop-height-<?php echo $post_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'crop ratio height' );
+ ?>
+ </label>
+ <input type="number" step="1" min="0" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" />
+ </div>
+ </fieldset>
+ <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel">
+ <legend><?php _e( 'Selection:' ); ?></legend>
+ <div class="nowrap">
+ <label for="imgedit-sel-width-<?php echo $post_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'selection width' );
+ ?>
+ </label>
+ <input type="number" step="1" min="0" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
+ <span class="imgedit-separator" aria-hidden="true">×</span>
+ <label for="imgedit-sel-height-<?php echo $post_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'selection height' );
+ ?>
+ </label>
+ <input type="number" step="1" min="0" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
+ </div>
+ </fieldset>
+ <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel">
+ <legend><?php _e( 'Starting Coordinates:' ); ?></legend>
+ <div class="nowrap">
+ <label for="imgedit-start-x-<?php echo $post_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'horizontal start position' );
+ ?>
+ </label>
+ <input type="number" step="1" min="0" id="imgedit-start-x-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" value="0" />
+ <span class="imgedit-separator" aria-hidden="true">×</span>
+ <label for="imgedit-start-y-<?php echo $post_id; ?>" class="screen-reader-text">
+ <?php
+ /* translators: Hidden accessibility text. */
+ _e( 'vertical start position' );
+ ?>
+ </label>
+ <input type="number" step="1" min="0" id="imgedit-start-y-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" value="0" />
+ </div>
+ </fieldset>
+ <div class="imgedit-crop-apply imgedit-menu container">
+ <button class="button-primary" type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );" class="imgedit-crop-apply button"><?php esc_html_e( 'Apply Crop' ); ?></button> <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );" class="imgedit-crop-clear button" disabled="disabled"><?php esc_html_e( 'Clear Crop' ); ?></button>
+ </div>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </fieldset>
-
</del><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,69 +277,73 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="imgedit-group imgedit-applyto">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="imgedit-group-top">
- <h2><?php _e( 'Thumbnail Settings' ); ?></h2>
- <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="imgedit-group-top">
+ <h2><?php _e( 'Thumbnail Settings' ); ?></h2>
+ <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: Hidden accessibility text. */
</span><span class="cx" style="display: block; padding: 0 10px"> esc_html_e( 'Thumbnail Settings Help' );
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </span></button>
- <div class="imgedit-help">
- <p><?php _e( 'You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </span></button>
+ <div class="imgedit-help">
+ <p><?php _e( 'You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.' ); ?></p>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="imgedit-thumbnail-preview-group">
+ <figure class="imgedit-thumbnail-preview">
+ <img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" draggable="false" />
+ <figcaption class="imgedit-thumbnail-preview-caption"><?php _e( 'Current thumbnail' ); ?></figcaption>
+ </figure>
+ <div id="imgedit-save-target-<?php echo $post_id; ?>" class="imgedit-save-target">
+ <fieldset>
+ <legend><?php _e( 'Apply changes to:' ); ?></legend>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <figure class="imgedit-thumbnail-preview">
- <img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" draggable="false" />
- <figcaption class="imgedit-thumbnail-preview-caption"><?php _e( 'Current thumbnail' ); ?></figcaption>
- </figure>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <span class="imgedit-label">
+ <input type="radio" id="imgedit-target-all" name="imgedit-target-<?php echo $post_id; ?>" value="all" checked="checked" />
+ <label for="imgedit-target-all"><?php _e( 'All image sizes' ); ?></label>
+ </span>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div id="imgedit-save-target-<?php echo $post_id; ?>" class="imgedit-save-target">
- <fieldset>
- <legend><?php _e( 'Apply changes to:' ); ?></legend>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <span class="imgedit-label">
+ <input type="radio" id="imgedit-target-thumbnail" name="imgedit-target-<?php echo $post_id; ?>" value="thumbnail" />
+ <label for="imgedit-target-thumbnail"><?php _e( 'Thumbnail' ); ?></label>
+ </span>
+
+ <span class="imgedit-label">
+ <input type="radio" id="imgedit-target-nothumb" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" />
+ <label for="imgedit-target-nothumb"><?php _e( 'All sizes except thumbnail' ); ?></label>
+ </span>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span class="imgedit-label">
- <input type="radio" id="imgedit-target-all" name="imgedit-target-<?php echo $post_id; ?>" value="all" checked="checked" />
- <label for="imgedit-target-all"><?php _e( 'All image sizes' ); ?></label>
- </span>
-
- <span class="imgedit-label">
- <input type="radio" id="imgedit-target-thumbnail" name="imgedit-target-<?php echo $post_id; ?>" value="thumbnail" />
- <label for="imgedit-target-thumbnail"><?php _e( 'Thumbnail' ); ?></label>
- </span>
-
- <span class="imgedit-label">
- <input type="radio" id="imgedit-target-nothumb" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" />
- <label for="imgedit-target-nothumb"><?php _e( 'All sizes except thumbnail' ); ?></label>
- </span>
- <?php
- if ( $edit_custom_sizes ) {
- if ( ! is_array( $edit_custom_sizes ) ) {
- $edit_custom_sizes = get_intermediate_image_sizes();
- }
- foreach ( array_unique( $edit_custom_sizes ) as $key => $size ) {
- if ( array_key_exists( $size, $meta['sizes'] ) ) {
- if ( 'thumbnail' === $size ) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( $edit_custom_sizes ) {
+ if ( ! is_array( $edit_custom_sizes ) ) {
+ $edit_custom_sizes = get_intermediate_image_sizes();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <span class="imgedit-label">
- <input type="radio" id="imgedit-target-custom<?php echo esc_attr( $key ); ?>" name="imgedit-target-<?php echo $post_id; ?>" value="<?php echo esc_attr( $size ); ?>" />
- <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $size ); ?></label>
- </span>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( array_unique( $edit_custom_sizes ) as $key => $size ) {
+ if ( array_key_exists( $size, $meta['sizes'] ) ) {
+ if ( 'thumbnail' === $size ) {
+ continue;
+ }
+ ?>
+ <span class="imgedit-label">
+ <input type="radio" id="imgedit-target-custom<?php echo esc_attr( $key ); ?>" name="imgedit-target-<?php echo $post_id; ?>" value="<?php echo esc_attr( $size ); ?>" />
+ <label for="imgedit-target-custom<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $size ); ?></label>
+ </span>
+ <?php
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- }
- ?>
- </fieldset>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ?>
+ </fieldset>
+ </div>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php } ?>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php } ?>
-
</del><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div>
+ <div class="hidden" id="imgedit-leaving-<?php echo $post_id; ?>"><?php _e( "There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor." ); ?></div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,7 +533,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _image_get_preview_ratio( $w, $h ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $max = max( $w, $h );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $max > 400 ? ( 400 / $max ) : 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $max > 600 ? ( 600 / $max ) : 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludescssmediaviewscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/css/media-views.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/css/media-views.css 2023-06-14 14:09:23 UTC (rev 55918)
+++ trunk/src/wp-includes/css/media-views.css 2023-06-14 20:40:42 UTC (rev 55919)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1957,12 +1957,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-modal .imgedit-wrap .imgedit-panel-content {
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 16px 16px 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- position: absolute;
- top: 0;
- right: 282px;
- bottom: 0;
- left: 0;
- overflow: auto;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ overflow: visible;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1969,26 +1964,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Implementation of bottom padding in overflow content differs across browsers.
</span><span class="cx" style="display: block; padding: 0 10px"> * We need a different method. See https://github.com/w3c/csswg-drafts/issues/129
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-modal .imgedit-wrap .imgedit-submit {
- margin-bottom: 16px;
-}
-
-.media-modal .imgedit-wrap .imgedit-settings {
- background: #f6f7f7;
- border-left: 1px solid #dcdcde;
- padding: 20px 16px 0;
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- width: 250px;
- overflow: auto;
-}
-
-/*
- * Implementation of bottom padding in overflow content differs across browsers.
- * We need a different method. See https://github.com/w3c/csswg-drafts/issues/129
- */
</del><span class="cx" style="display: block; padding: 0 10px"> .media-modal .imgedit-wrap .imgedit-save-target {
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 8px 0 24px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1996,19 +1971,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .media-modal .imgedit-group {
</span><span class="cx" style="display: block; padding: 0 10px"> background: none;
</span><span class="cx" style="display: block; padding: 0 10px"> border: none;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #dcdcde;
</del><span class="cx" style="display: block; padding: 0 10px"> box-shadow: none;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin-bottom: 16px;
</del><span class="cx" style="display: block; padding: 0 10px"> padding: 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- padding-bottom: 16px;
</del><span class="cx" style="display: block; padding: 0 10px"> position: relative; /* RTL fix, #WP29352 */
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-modal .imgedit-group:last-of-type {
- border: none;
- margin: 0;
- padding: 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-modal .imgedit-group.imgedit-panel-active {
+ margin-bottom: 16px;
+ padding-bottom: 16px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-modal .imgedit-group-top {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2077,8 +2048,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-modal .imgedit-wrap div.updated, /* Back-compat for pre-5.5 */
</span><span class="cx" style="display: block; padding: 0 10px"> .media-modal .imgedit-wrap .notice {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin: 0;
- margin-bottom: 16px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ margin: 0 16px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2827,6 +2797,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> @media screen and (max-width: 782px) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .imgedit-panel-content {
+ grid-template-columns: auto;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .media-frame-toolbar .media-toolbar {
</span><span class="cx" style="display: block; padding: 0 10px"> bottom: -54px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>