Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into latest
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickebates committed Feb 6, 2018
2 parents ae09b17 + 3319209 commit c632fca
Show file tree
Hide file tree
Showing 60 changed files with 7,231 additions and 24,789 deletions.
36 changes: 36 additions & 0 deletions wp-admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,42 @@

<div class="changelog point-releases">
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
1
),
'4.9.4',
number_format_i18n( 1 )
);
?>
<?php
/* translators: %s: Codex URL */
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.9.4' );
?>
</p>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
34
),
'4.9.3',
number_format_i18n( 34 )
);
?>
<?php
/* translators: %s: Codex URL */
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.9.3' );
?>
</p>
<p>
<?php
printf(
Expand Down
6 changes: 2 additions & 4 deletions wp-admin/css/widgets-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@
cursor: pointer;
}

.media-widget-preview.media_image,
.media-widget-preview.media_audio,
.attachment-media-view {
.media-widget-preview .placeholder {
background: #f1f1f1;
}

Expand All @@ -190,7 +188,7 @@
background: transparent;
}

.media-widget-gallery-preview .gallery-item .gallery-icon {
.media-widget-gallery-preview .gallery-item .gallery-icon {
margin: 4.5%;
}

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/css/widgets-rtl.min.css

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions wp-admin/css/widgets.css
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@
cursor: pointer;
}

.media-widget-preview.media_image,
.media-widget-preview.media_audio,
.attachment-media-view {
.media-widget-preview .placeholder {
background: #f1f1f1;
}

Expand All @@ -190,7 +188,7 @@
background: transparent;
}

.media-widget-gallery-preview .gallery-item .gallery-icon {
.media-widget-gallery-preview .gallery-item .gallery-icon {
margin: 4.5%;
}

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/css/widgets.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-admin/customize.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'This changeset has already been published and cannot be further modified.' ) . '</p>' .
'<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .
'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
403
);
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/plugin-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function install_plugin_information() {
) );
?>
<div class="counter-container">
<span class="counter-label"><a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
<span class="counter-label"><a href="https://wordpress.org/support/plugin/<?php echo $api->slug; ?>/reviews/?filter=<?php echo $key; ?>"
target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a></span>
<span class="counter-back">
<span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
Expand Down
17 changes: 9 additions & 8 deletions wp-admin/js/customize-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -2564,7 +2564,7 @@

// Temporary special function since supplying SFTP credentials does not work yet. See #42184.
function disableInstallButtons() {
return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
}

section.overlay.find( 'button.preview, button.preview-theme' ).toggleClass( 'disabled', disableSwitchButtons() );
Expand Down Expand Up @@ -3074,7 +3074,7 @@
api.Panel.prototype.attachEvents.apply( panel );

// Temporary since supplying SFTP credentials does not work yet. See #42184
if ( api.settings.theme._filesystemCredentialsNeeded ) {
if ( api.settings.theme._canInstall && api.settings.theme._filesystemCredentialsNeeded ) {
panel.notifications.add( new api.Notification( 'theme_install_unavailable', {
message: api.l10n.themeInstallUnavailable,
type: 'info',
Expand Down Expand Up @@ -5132,7 +5132,7 @@

// Temporary special function since supplying SFTP credentials does not work yet. See #42184.
function disableInstallButtons() {
return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
}
function updateButtons() {
control.container.find( 'button.preview, button.preview-theme' ).toggleClass( 'disabled', disableSwitchButtons() );
Expand Down Expand Up @@ -7931,7 +7931,7 @@
previewerAlive = state.instance( 'previewerAlive' ),
editShortcutVisibility = state.instance( 'editShortcutVisibility' ),
changesetLocked = state.instance( 'changesetLocked' ),
populateChangesetUuidParam;
populateChangesetUuidParam, defaultSelectedChangesetStatus;

state.bind( 'change', function() {
var canSave;
Expand Down Expand Up @@ -7965,9 +7965,7 @@
} else {
saveBtn.val( api.l10n.schedule );
}
} else if ( ! api.settings.changeset.currentUserCanPublish ) {
selectedChangesetStatus( 'draft' );
} else {
} else if ( api.settings.changeset.currentUserCanPublish ) {
saveBtn.val( api.l10n.publish );
}
closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel );
Expand All @@ -7989,12 +7987,14 @@
return status;
};

defaultSelectedChangesetStatus = api.settings.changeset.currentUserCanPublish ? 'publish' : 'draft';

// Set default states.
changesetStatus( api.settings.changeset.status );
changesetLocked( Boolean( api.settings.changeset.lockUser ) );
changesetDate( api.settings.changeset.publishDate );
selectedChangesetDate( api.settings.changeset.publishDate );
selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? 'publish' : api.settings.changeset.status );
selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? defaultSelectedChangesetStatus : api.settings.changeset.status );
selectedChangesetStatus.link( changesetStatus ); // Ensure that direct updates to status on server via wp.customizer.previewer.save() will update selection.
saved( true );
if ( '' === changesetStatus() ) { // Handle case for loading starter content.
Expand Down Expand Up @@ -8240,6 +8240,7 @@
// Check for lock when sending heartbeat requests.
$( document ).on( 'heartbeat-send.update_lock_notice', function( event, data ) {
data.check_changeset_lock = true;
data.changeset_uuid = api.settings.changeset.uuid;
} );

// Handle heartbeat ticks.
Expand Down
8 changes: 4 additions & 4 deletions wp-admin/js/customize-controls.min.js

Large diffs are not rendered by default.

42 changes: 3 additions & 39 deletions wp-admin/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,30 +280,6 @@ window.wp = window.wp || {};
return result;
}

/**
* @summary Check if a shortcode has Live Preview enabled for it.
*
* Previewable shortcodes here refers to shortcodes that have Live Preview enabled.
*
* These shortcodes get rewritten when the editor is in Visual mode, which means that
* we don't want to change anything inside them, i.e. inserting a selection marker
* inside the shortcode will break it :(
*
* @link wp-includes/js/mce-view.js
*
* @param {string} shortcode The shortcode to check.
* @return {boolean} If a shortcode has Live Preview or not
*/
function isShortcodePreviewable( shortcode ) {
var defaultPreviewableShortcodes = [ 'caption' ];

return (
defaultPreviewableShortcodes.indexOf( shortcode ) !== -1 ||
wp.mce.views.get( shortcode ) !== undefined
);

}

/**
* @summary Get all shortcodes and their positions in the content
*
Expand Down Expand Up @@ -340,23 +316,12 @@ window.wp = window.wp || {};
*/
var showAsPlainText = shortcodeMatch[1] === '[';

/**
* For more context check the docs for:
*
* @link isShortcodePreviewable
*
* In addition, if the shortcode will get rendered as plain text ( see above ),
* we can treat it as text and use the selection markers in it.
*/
var isPreviewable = ! showAsPlainText && isShortcodePreviewable( shortcodeMatch[2] );

shortcodeInfo = {
shortcodeName: shortcodeMatch[2],
showAsPlainText: showAsPlainText,
startIndex: shortcodeMatch.index,
endIndex: shortcodeMatch.index + shortcodeMatch[0].length,
length: shortcodeMatch[0].length,
isPreviewable: isPreviewable
length: shortcodeMatch[0].length
};

shortcodesDetails.push( shortcodeInfo );
Expand All @@ -382,7 +347,6 @@ window.wp = window.wp || {};
startIndex: shortcodeMatch.index,
endIndex: shortcodeMatch.index + shortcodeMatch[ 0 ].length,
length: shortcodeMatch[ 0 ].length,
isPreviewable: true,
urlAtStartOfContent: shortcodeMatch[ 1 ] === '',
urlAtEndOfContent: shortcodeMatch[ 3 ] === ''
};
Expand Down Expand Up @@ -465,7 +429,7 @@ window.wp = window.wp || {};
}

var isCursorStartInShortcode = getShortcodeWrapperInfo( content, cursorStart );
if ( isCursorStartInShortcode && isCursorStartInShortcode.isPreviewable ) {
if ( isCursorStartInShortcode && ! isCursorStartInShortcode.showAsPlainText ) {
/**
* If a URL is at the start or the end of the content,
* the selection doesn't work, because it inserts a marker in the text,
Expand All @@ -482,7 +446,7 @@ window.wp = window.wp || {};
}

var isCursorEndInShortcode = getShortcodeWrapperInfo( content, cursorEnd );
if ( isCursorEndInShortcode && isCursorEndInShortcode.isPreviewable ) {
if ( isCursorEndInShortcode && ! isCursorEndInShortcode.showAsPlainText ) {
if ( isCursorEndInShortcode.urlAtEndOfContent ) {
cursorEnd = isCursorEndInShortcode.startIndex;
} else {
Expand Down
Loading

0 comments on commit c632fca

Please sign in to comment.