Skip to content

Commit

Permalink
Initial merge with WP 4.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickebates committed Aug 3, 2017
1 parent dba4ba6 commit b2718e4
Show file tree
Hide file tree
Showing 45 changed files with 1,024 additions and 200 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Project Nami
===============

### Version: `1.6.0` ###
### Version: `1.6.1` ###

### Description: ###
[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://deploy.azure.com/?repository=https://github.com/ProjectNami/projectnami/tree/latest)
Expand Down
22 changes: 22 additions & 0 deletions wp-admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@
<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
</h2>

<div class="changelog point-releases">
<h3><?php _e( 'Maintenance Release' ); ?></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.',
29
),
'4.8.1',
number_format_i18n( 29 )
);
?>
<?php
/* translators: %s: Codex URL */
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.1' );
?>
</p>
</div>

<div class="feature-section one-col">
<div class="col">
<h2><?php _e( 'An Update with You in Mind' ); ?></h2>
Expand Down
2 changes: 2 additions & 0 deletions wp-admin/css/themes-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,8 @@ body.full-overlay-active {
min-width: 299px;
max-width: 599px;
width: 18%;
width: -webkit-calc( 18% - 1px );
width: calc( 18% - 1px );
height: 45px;
border-top: 1px solid #ddd;
background: #eee;
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/css/themes-rtl.min.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions wp-admin/css/themes.css
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,8 @@ body.full-overlay-active {
min-width: 299px;
max-width: 599px;
width: 18%;
width: -webkit-calc( 18% - 1px );
width: calc( 18% - 1px );
height: 45px;
border-top: 1px solid #ddd;
background: #eee;
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/css/themes.min.css

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions wp-admin/css/widgets-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,29 @@ div#widgets-right .widget-top:hover,
cursor: move;
}

/* =Specific widget styling
-------------------------------------------------------------- */
.text-widget-fields {
position: relative;
}
.text-widget-fields [hidden] {
display: none;
}
.text-widget-fields .wp-pointer.wp-pointer-top {
position: absolute;
z-index: 3;
top: 100px;
left: 10px;
right: 10px;
}
.text-widget-fields .wp-pointer .wp-pointer-arrow {
right: auto;
left: 15px;
}
.text-widget-fields .wp-pointer .wp-pointer-buttons {
line-height: 1.4em;
}

/* =Media Queries
-------------------------------------------------------------- */

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

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions wp-admin/css/widgets.css
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,29 @@ div#widgets-right .widget-top:hover,
cursor: move;
}

/* =Specific widget styling
-------------------------------------------------------------- */
.text-widget-fields {
position: relative;
}
.text-widget-fields [hidden] {
display: none;
}
.text-widget-fields .wp-pointer.wp-pointer-top {
position: absolute;
z-index: 3;
top: 100px;
right: 10px;
left: 10px;
}
.text-widget-fields .wp-pointer .wp-pointer-arrow {
left: auto;
right: 15px;
}
.text-widget-fields .wp-pointer .wp-pointer-buttons {
line-height: 1.4em;
}

/* =Media Queries
-------------------------------------------------------------- */

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

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion wp-admin/includes/class-wp-comments-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ protected function get_bulk_actions() {
*/
protected function extra_tablenav( $which ) {
global $comment_status, $comment_type;
static $has_items;

if ( ! isset( $has_items ) ) {
$has_items = $this->has_items();
}
?>
<div class="alignleft actions">
<?php
Expand Down Expand Up @@ -354,7 +359,7 @@ protected function extra_tablenav( $which ) {
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}

if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $this->has_items() ) {
if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
$title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
submit_button( $title, 'apply', 'delete_all', false );
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/includes/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ function options_permalink_add_js() {
return;
jQuery('#permalink_structure').val( this.value );
});
jQuery('#permalink_structure').focus(function() {
jQuery("#custom_selection").attr('checked', 'checked');
jQuery( '#permalink_structure' ).on( 'click input', function() {
jQuery( '#custom_selection' ).prop( 'checked', true );
});
});
</script>
Expand Down
7 changes: 7 additions & 0 deletions wp-admin/js/customize-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5507,6 +5507,13 @@
} );
} ());

// Make sure TinyMCE dialogs appear above Customizer UI.
$( document ).one( 'wp-before-tinymce-init', function() {
if ( ! window.tinymce.ui.FloatPanel.zIndex || window.tinymce.ui.FloatPanel.zIndex < 500001 ) {
window.tinymce.ui.FloatPanel.zIndex = 500001;
}
} );

api.trigger( 'ready' );
});

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/customize-controls.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions wp-admin/js/customize-nav-menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2229,8 +2229,7 @@
}
} );

control.container.find( '.menu-delete-item' ).on( 'click', function( event ) {
event.stopPropagation();
control.container.find( '.menu-delete-item .button-link-delete' ).on( 'click', function( event ) {
event.preventDefault();
control.setting.set( false );
});
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/customize-nav-menus.min.js

Large diffs are not rendered by default.

87 changes: 76 additions & 11 deletions wp-admin/js/widgets/media-widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ wp.mediaWidgets = ( function( $ ) {
return;
}

// If video, test for Vimeo and YouTube, otherwise, renderFail(). This should be removed once #34115 is resolved.
if ( 'video' === this.controller.options.mimeType && ! /vimeo|youtu\.?be/.test( urlParser.host ) ) {
embedLinkView.renderFail();
return;
}

embedLinkView.dfd = $.ajax({
url: wp.media.view.settings.oEmbedProxyUrl,
data: {
Expand Down Expand Up @@ -429,20 +435,28 @@ wp.mediaWidgets = ( function( $ ) {
*
* @param {Object} options - Options.
* @param {Backbone.Model} options.model - Model.
* @param {jQuery} options.el - Control container element.
* @param {jQuery} options.el - Control field container element.
* @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
* @returns {void}
*/
initialize: function initialize( options ) {
var control = this;

Backbone.View.prototype.initialize.call( control, options );

if ( ! control.el ) {
throw new Error( 'Missing options.el' );
}
if ( ! ( control.model instanceof component.MediaWidgetModel ) ) {
throw new Error( 'Missing options.model' );
}
if ( ! options.el ) {
throw new Error( 'Missing options.el' );
}
if ( ! options.syncContainer ) {
throw new Error( 'Missing options.syncContainer' );
}

control.syncContainer = options.syncContainer;

control.$el.addClass( 'media-widget-control' );

// Allow methods to be passed in with control context preserved.
_.bindAll( control, 'syncModelToInputs', 'render', 'updateSelectedAttachment', 'renderPreview' );
Expand Down Expand Up @@ -547,7 +561,7 @@ wp.mediaWidgets = ( function( $ ) {
*/
syncModelToInputs: function syncModelToInputs() {
var control = this;
control.$el.next( '.widget-content' ).find( '.media-widget-instance-property' ).each( function() {
control.syncContainer.find( '.media-widget-instance-property' ).each( function() {
var input = $( this ), value;
value = control.model.get( input.data( 'property' ) );
if ( _.isUndefined( value ) ) {
Expand Down Expand Up @@ -1003,9 +1017,8 @@ wp.mediaWidgets = ( function( $ ) {
* @returns {void}
*/
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
var widgetContent, controlContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, widgetInside, animatedCheckDelay = 50, renderWhenAnimationDone;
var fieldContainer, syncContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, widgetInside, animatedCheckDelay = 50, renderWhenAnimationDone;
widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
widgetContent = widgetForm.find( '> .widget-content' );
idBase = widgetForm.find( '> .id_base' ).val();
widgetId = widgetForm.find( '> .widget-id' ).val();

Expand All @@ -1032,16 +1045,17 @@ wp.mediaWidgets = ( function( $ ) {
* components", the JS template is rendered outside of the normal form
* container.
*/
controlContainer = $( '<div class="media-widget-control"></div>' );
widgetContent.before( controlContainer );
fieldContainer = $( '<div></div>' );
syncContainer = widgetContainer.find( '.widget-content:first' );
syncContainer.before( fieldContainer );

/*
* Sync the widget instance model attributes onto the hidden inputs that widgets currently use to store the state.
* In the future, when widgets are JS-driven, the underlying widget instance data should be exposed as a model
* from the start, without having to sync with hidden fields. See <https://core.trac.wordpress.org/ticket/33507>.
*/
modelAttributes = {};
widgetContent.find( '.media-widget-instance-property' ).each( function() {
syncContainer.find( '.media-widget-instance-property' ).each( function() {
var input = $( this );
modelAttributes[ input.data( 'property' ) ] = input.val();
});
Expand All @@ -1050,7 +1064,8 @@ wp.mediaWidgets = ( function( $ ) {
widgetModel = new ModelConstructor( modelAttributes );

widgetControl = new ControlConstructor({
el: controlContainer,
el: fieldContainer,
syncContainer: syncContainer,
model: widgetModel
});

Expand Down Expand Up @@ -1078,6 +1093,51 @@ wp.mediaWidgets = ( function( $ ) {
component.widgetControls[ widgetModel.get( 'widget_id' ) ] = widgetControl;
};

/**
* Setup widget in accessibility mode.
*
* @returns {void}
*/
component.setupAccessibleMode = function setupAccessibleMode() {
var widgetForm, widgetId, idBase, widgetControl, ControlConstructor, ModelConstructor, modelAttributes, fieldContainer, syncContainer;
widgetForm = $( '.editwidget > form' );
if ( 0 === widgetForm.length ) {
return;
}

idBase = widgetForm.find( '> .widget-control-actions > .id_base' ).val();

ControlConstructor = component.controlConstructors[ idBase ];
if ( ! ControlConstructor ) {
return;
}

widgetId = widgetForm.find( '> .widget-control-actions > .widget-id' ).val();

ModelConstructor = component.modelConstructors[ idBase ] || component.MediaWidgetModel;
fieldContainer = $( '<div></div>' );
syncContainer = widgetForm.find( '> .widget-inside' );
syncContainer.before( fieldContainer );

modelAttributes = {};
syncContainer.find( '.media-widget-instance-property' ).each( function() {
var input = $( this );
modelAttributes[ input.data( 'property' ) ] = input.val();
});
modelAttributes.widget_id = widgetId;

widgetControl = new ControlConstructor({
el: fieldContainer,
syncContainer: syncContainer,
model: new ModelConstructor( modelAttributes )
});

component.modelCollection.add( [ widgetControl.model ] );
component.widgetControls[ widgetControl.model.get( 'widget_id' ) ] = widgetControl;

widgetControl.render();
};

/**
* Sync widget instance data sanitized from server back onto widget model.
*
Expand Down Expand Up @@ -1146,6 +1206,11 @@ wp.mediaWidgets = ( function( $ ) {
var widgetContainer = $( this );
component.handleWidgetAdded( new jQuery.Event( 'widget-added' ), widgetContainer );
});

// Accessibility mode.
$( window ).on( 'load', function() {
component.setupAccessibleMode();
});
});
};

Expand Down
Loading

0 comments on commit b2718e4

Please sign in to comment.