Skip to content

Commit 5d9814e

Browse files
committed
Revert changes covered in #1674
1 parent 46efafb commit 5d9814e

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

assets/js/activitypub-admin.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
jQuery( function ( $ ) {
1+
jQuery( function( $ ) {
22
// Accordion handling in various areas.
3-
$( '.activitypub-settings-accordion' ).on( 'click', '.activitypub-settings-accordion-trigger', function () {
4-
var isExpanded = 'true' === $( this ).attr( 'aria-expanded' );
3+
$( '.activitypub-settings-accordion' ).on( 'click', '.activitypub-settings-accordion-trigger', function() {
4+
var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
55

66
if ( isExpanded ) {
77
$( this ).attr( 'aria-expanded', 'false' );
@@ -12,9 +12,10 @@ jQuery( function ( $ ) {
1212
}
1313
} );
1414

15-
$( document ).on( 'wp-plugin-install-success', function ( event, response ) {
16-
setTimeout( function () {
15+
$(document).on( 'wp-plugin-install-success', function( event, response ) {
16+
setTimeout( function() {
1717
$( '.activate-now' ).removeClass( 'thickbox open-plugin-details-modal' );
1818
}, 1200 );
1919
} );
20+
2021
} );

assets/js/activitypub-header-image.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,34 @@
2323
* See https://github.com/Automattic/wordpress-activitypub/issues/846
2424
*/
2525
ImageCropperNoCustomizer = wp.media.controller.CustomizeImageCropper.extend( {
26-
doCrop: function ( attachment ) {
26+
doCrop: function( attachment ) {
2727
var cropDetails = attachment.get( 'cropDetails' ),
2828
control = this.get( 'control' ),
2929
ratio = cropDetails.width / cropDetails.height;
3030

3131
// Use crop measurements when flexible in both directions.
3232
if ( control.params.flex_width && control.params.flex_height ) {
33-
cropDetails.dst_width = cropDetails.width;
33+
cropDetails.dst_width = cropDetails.width;
3434
cropDetails.dst_height = cropDetails.height;
3535

36-
// Constrain flexible side based on image ratio and size of the fixed side.
36+
// Constrain flexible side based on image ratio and size of the fixed side.
3737
} else {
38-
cropDetails.dst_width = control.params.flex_width
39-
? control.params.height * ratio
40-
: control.params.width;
41-
cropDetails.dst_height = control.params.flex_height
42-
? control.params.width / ratio
43-
: control.params.height;
38+
cropDetails.dst_width = control.params.flex_width ? control.params.height * ratio : control.params.width;
39+
cropDetails.dst_height = control.params.flex_height ? control.params.width / ratio : control.params.height;
4440
}
4541

4642
return wp.ajax.post( 'crop-image', {
4743
// where wp_customize: 'on' would be in Core, for no good reason I understand.
4844
nonce: attachment.get( 'nonces' ).edit,
4945
id: attachment.get( 'id' ),
5046
context: control.id,
51-
cropDetails: cropDetails,
47+
cropDetails: cropDetails
5248
} );
53-
},
49+
}
5450
} );
5551

52+
53+
5654
/**
5755
* Calculate image selection options based on the attachment dimensions.
5856
*
@@ -205,12 +203,16 @@
205203
} else {
206204
i18nAppAlternativeString = wp.i18n.sprintf(
207205
/* translators: %s: The selected image filename. */
208-
wp.i18n.__( 'Header Image preview: The current image has no alternative text. The file name is: %s' ),
206+
wp.i18n.__(
207+
'Header Image preview: The current image has no alternative text. The file name is: %s'
208+
),
209209
attributes.filename
210210
);
211211
i18nBrowserAlternativeString = wp.i18n.sprintf(
212212
/* translators: %s: The selected image filename. */
213-
wp.i18n.__( 'Header Image preview: The current image has no alternative text. The file name is: %s' ),
213+
wp.i18n.__(
214+
'Header Image preview: The current image has no alternative text. The file name is: %s'
215+
),
214216
attributes.filename
215217
);
216218
}

0 commit comments

Comments
 (0)