Commit Graph

3240 Commits

Author SHA1 Message Date
Adam Silverstein 43eb51d4a6 Customizer: retain aspect ration when cropping media w/ shift+click/drag.
Enforce a 1:1 ratio when holding the shift key and dragging in the image cropping tool in the customizer context.

Props melchoyce, mikeschroder.
Fixes #40211.

Built from https://develop.svn.wordpress.org/trunk@41557


git-svn-id: http://core.svn.wordpress.org/trunk@41390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 22:45:44 +00:00
Andrew Ozz 76296ef657 Remove SWFUpload,
- Refactor swfupload.js to output a simple upload form, and handlers.js.
- Delete the SWFUpload plugins directory and swfupload.swf.
- Remove flash cookies "hack" from async-upload.php.

See #41752.
Built from https://develop.svn.wordpress.org/trunk@41554


git-svn-id: http://core.svn.wordpress.org/trunk@41387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 16:35:48 +00:00
Adam Silverstein 639d215300 REST API JS Client: Improve nonce handling, refresh stale nonce on sync.
Keep the nonce used for cookie based authentication fresh by pulling in and using any new nonce supplied in the response headers.

* Enable passing nonce to init so each api/endpoint can use a unique nonce.
* Store nonce for endpoint on endpointModel.
* New model helper `nonce()` retrieves a model's routeModel nonce.
* When a response header contains a nonce that doesn't match the stored nonce, replace it.

Fixes #40422.

Built from https://develop.svn.wordpress.org/trunk@41553


git-svn-id: http://core.svn.wordpress.org/trunk@41386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 12:58:45 +00:00
Dominik Schilling 83853f9fd2 TinyMCE: Improve the previews for shortcodes.
Built from https://develop.svn.wordpress.org/trunk@41395


git-svn-id: http://core.svn.wordpress.org/trunk@41228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 08:19:45 +00:00
Dominik Schilling c2ead9d046 Editor: Prevent adding `javascript:` and `data:` URLs through the inline link dialog.
Built from https://develop.svn.wordpress.org/trunk@41393


git-svn-id: http://core.svn.wordpress.org/trunk@41226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 08:01:45 +00:00
Weston Ruter 19e3d8bc41 Customize: Use `input` event instead of `keyup` or `propertychange` events when listening for changes in `wp.customize.Element` instances.
Ensures that a control's `Element` is updated in response to pasting into the field. Also fixes issue where inputs using "new" HTML5 types (like `url` and `number`) were not updating in the preview during keystrokes. The use of `input` was previously blocked due to needing to support IE9, but this is no longer a concern since IE<11 is no longer supported.

See #38845, #28477.
Fixes #35832.

Built from https://develop.svn.wordpress.org/trunk@41387


git-svn-id: http://core.svn.wordpress.org/trunk@41220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-18 19:11:48 +00:00
Peter Wilson 10970701d7 Emoji: Invert value returned by UN test for accuracy.
The JavaScript testing for UN flag support was passing when it failed, and failing when it passes.

This inverts the result to take more traditional approach of returning the correct result.

Unprops Pento.
Fixes #41852.


Built from https://develop.svn.wordpress.org/trunk@41386


git-svn-id: http://core.svn.wordpress.org/trunk@41219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-17 22:52:47 +00:00
Sergey Biryukov 2f701f7d0e Media: Rename "Insert Media" window title to "Add Media" for consistency with the "Add Media" button.
Props danieltj.
Fixes #41704.
Built from https://develop.svn.wordpress.org/trunk@41383


git-svn-id: http://core.svn.wordpress.org/trunk@41216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-16 11:03:45 +00:00
Adam Silverstein 938e93fe1f wp.sanitize - fix namespace for calls to `stripTags`.
Fixes an `undefined` JavaScript error in PressThis since [41061].

Props afercia.
Fixes #41883.

Built from https://develop.svn.wordpress.org/trunk@41379


git-svn-id: http://core.svn.wordpress.org/trunk@41212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-14 19:29:44 +00:00
Weston Ruter 90bedf8f9d Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion.
* Code editor is integrated into the Theme/Plugin Editor, Additional CSS in Customizer, and Custom HTML widget. Code editor is not yet integrated into the post editor, and it may not be until accessibility concerns are addressed.
* The CodeMirror component in the Custom HTML widget is integrated in a similar way to TinyMCE being integrated into the Text widget, adopting the same approach for integrating dynamic JavaScript-initialized fields.
* Linting is performed for JS, CSS, HTML, and JSON via JSHint, CSSLint, HTMLHint, and JSONLint respectively. Linting is not yet supported for PHP.
* When user lacks `unfiltered_html` the capability, the Custom HTML widget will report any Kses-invalid elements and attributes as errors via a custom Kses rule for HTMLHint.
* When linting errors are detected, the user will be prevented from saving the code until the errors are fixed, reducing instances of broken websites.
* The placeholder value is removed from Custom CSS in favor of a fleshed-out section description which now auto-expands when the CSS field is empty. See #39892.
* The CodeMirror library is included as `wp.CodeMirror` to prevent conflicts with any existing `CodeMirror` global.
* An `wp.codeEditor.initialize()` API in JS is provided to convert a `textarea` into CodeMirror, with a `wp_enqueue_code_editor()` function in PHP to manage enqueueing the assets and settings needed to edit a given type of code.
* A user preference is added to manage whether or not "syntax highlighting" is enabled. The feature is opt-out, being enabled by default.
* Allowed file extensions in the theme and plugin editors have been updated to include formats which CodeMirror has modes for: `conf`, `css`, `diff`, `patch`, `html`, `htm`, `http`, `js`, `json`, `jsx`, `less`, `md`, `php`, `phtml`, `php3`, `php4`, `php5`, `php7`, `phps`, `scss`, `sass`, `sh`, `bash`, `sql`, `svg`, `xml`, `yml`, `yaml`, `txt`.

Props westonruter, georgestephanis, obenland, melchoyce, pixolin, mizejewski, michelleweber, afercia, grahamarmfield, samikeijonen, rianrietveld, iseulde.
See #38707.
Fixes #12423, #39892.

Built from https://develop.svn.wordpress.org/trunk@41376


git-svn-id: http://core.svn.wordpress.org/trunk@41209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-13 06:08:47 +00:00
Adam Silverstein f36cccde7e Add `wp.hooks` - JavaScript actions and filters.
Add a JavaScript hooks library with an API that mirrors the WordPress Plugin API; provides similar functionality and API to PHP hooks.

Called via the global `wp.hooks`, eg: `wp.hooks.addAction()`, etc. Adds:

* `addAction( 'hook', 'vendor/plugin/function', callback, priority )`
* `addFilter( 'hook', 'vendor/plugin/function', callback, priority )`
* `removeAction( 'hook', 'vendor/plugin/function' )`
* `removeFilter( 'hook',  'vendor/plugin/function' )`
* `removeAllActions( 'hook' )`
* `removeAllFilters( 'hook' )`
* `doAction( 'hook', arg1, arg2, moreArgs, finalArg )`
* `applyFilters( 'hook', content, arg1, arg2, moreArgs, finalArg )`
* `doingAction( 'hook' )`
* `doingFilter( 'hook' )`
* `didAction( 'hook' )`
* `didFilter( 'hook' )`
* `hasAction( 'hook' )`
* `hasFilter( 'hook' )`

Props adamsilverstein, jnylen0, aduth, kadamwhite, youknowriad, schlessera, mikeschinkel, azaozz, vhauri, CaptainN, scribu, carldanley, chetanchauhan, mgibbs189, stephenharris, justnorris, koopersmith, gcorne, TV productions, atimmer.

Fixes #21170.


Built from https://develop.svn.wordpress.org/trunk@41375


git-svn-id: http://core.svn.wordpress.org/trunk@41208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 12:54:45 +00:00
Weston Ruter d8f445bf0f Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.

Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.

Built from https://develop.svn.wordpress.org/trunk@41374


git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 07:03:46 +00:00
Sergey Biryukov eeb147e349 Docs: Remove "being being" dittography from inline comments.
Props birgire.
Fixes #41841.
Built from https://develop.svn.wordpress.org/trunk@41358


git-svn-id: http://core.svn.wordpress.org/trunk@41191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 14:49:44 +00:00
Andrea Fercia a4ae97437b Administration: Thickbox: Fix conflicts with the Plugin details and native Thickbox modals.
The Plugin details modal custom implementation in the Plugins page conflicts with
other Thickbox instances added by plugins. Thickbox shows its age and has been
modified over time to suit core needs. However, WordPress should do its best to
not create conflicts with the native Thickbox styles and functionalities. Plugin
authors should be able to use `add_thickbox()` in any admin page as documented, 
without having to worry about potential errors.

- fixes a JavaScript error when closing a native Thickbox modal in the Plugins page
- avoids to override the native Thickbox modal styles
- uses a CSS class to target the Plugin details modal and remove a pile of overqualified CSS selectors

Fixes #41417.

Built from https://develop.svn.wordpress.org/trunk@41356


git-svn-id: http://core.svn.wordpress.org/trunk@41189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 14:14:43 +00:00
Adam Silverstein 8a23b80b56 Docs: JSDoc improvements for namespaces.
Improve JS parsing of our inline JSDocs by introducing `@namespace`, `@lends` and `@memberOf`. Helps set the way for showing our JavaScript documentation on developer.wordpress.org, see https://meta.trac.wordpress.org/ticket/3063.

* Define all used namespaces using @namespace.
* Correctly specify in which namespace each class is using @memberOf.
* Define each usage of the extend function as a prototype assignment using @lends.
* Some comment blocks were moved to correct the parsing of certain definitions. 

Props herregroen, atimmer, netweb, SergeyBiryukov.  
Fixes #41682.

Built from https://develop.svn.wordpress.org/trunk@41351


git-svn-id: http://core.svn.wordpress.org/trunk@41184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 18:42:49 +00:00
Weston Ruter 0391928790 Customize: Do not show `cursor: not-allowed` on audio/video track titles within playlists in preview.
Props scott.deluzio, mitraval192, westonruter.
See #31517.
Fixes #41489.

Built from https://develop.svn.wordpress.org/trunk@41338


git-svn-id: http://core.svn.wordpress.org/trunk@41171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-06 18:00:43 +00:00
Adam Silverstein ba0970ab28 WP-API JS Client: Add helpers to get a model or collection by route.
Add two new helper functions, `wp.api.getModelByRoute` and `wp.api.getCollectionByRoute`. Passed a route, they return the matching model or collection, or `undefined` if none is found.

Also adds tests to verify these functions work as expected.

Props rcutmore.
Fixes #41111.

Built from https://develop.svn.wordpress.org/trunk@41334


git-svn-id: http://core.svn.wordpress.org/trunk@41165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-04 16:01:43 +00:00
Andrea Fercia c3cf5cb324 Docs: Update media-audiovideo.js after [41239].
Fixes #41602.

Built from https://develop.svn.wordpress.org/trunk@41330


git-svn-id: http://core.svn.wordpress.org/trunk@41161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-03 16:16:43 +00:00
Andrew Ozz e38ec0f485 Plupload:
- Update to 2.1.9.
- Include the non-minified plupload.js and moxie.js.
- Remove support for Flash and Silverlight, the available runtime options are `html5` and `html4`.
- Delete plupload.flash.swf and plupload.silverlight.xap.

Fixes #41755.
Built from https://develop.svn.wordpress.org/trunk@41328


git-svn-id: http://core.svn.wordpress.org/trunk@41159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-01 12:28:46 +00:00
Weston Ruter a979e17e2b Media: Upgrade MediaElement.js to `4.2.5-74e01a40` fixing missing `mejs.MediaElement` reference.
ALso fixes:

* Accessibility for volume control
* Progress bar tooltip positioning and dimensions correctly set for media with long duration
* Better codec checking
* Minor CSS fix to avoid flickering effect on volume control

Props rafa8626.
See #39686.
Fixes #41640.

Built from https://develop.svn.wordpress.org/trunk@41320


git-svn-id: http://core.svn.wordpress.org/trunk@41151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-28 19:29:47 +00:00
Andrew Ozz c56801657a TinyMCE: fix cases where an additional empty link is created while updating an image with a link.
Props spocke.
Fixes #41259.
Built from https://develop.svn.wordpress.org/trunk@41319


git-svn-id: http://core.svn.wordpress.org/trunk@41150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-26 16:34:46 +00:00
Scott Taylor 10177e7fbb Docs: improve JS docs for `comment-reply.js`
Props andizer, ireneyoast.
Fixes #41548.

Built from https://develop.svn.wordpress.org/trunk@41314


git-svn-id: http://core.svn.wordpress.org/trunk@41145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:58:44 +00:00
Adam Silverstein a806e2d3b3 Docs: Improve JavaScript documentation in autosave.js.
Add and improve JSDOC blocks.

Props carolinegeven.
Fixes #41203.



Built from https://develop.svn.wordpress.org/trunk@41265


git-svn-id: http://core.svn.wordpress.org/trunk@41105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 14:24:45 +00:00
Andrew Ozz b1d28c5e90 TinyMCE: Add the default `link` plugin without enabling it. This makes it easy for WordPress plugins to use it at places where `wplink` is not suitable, for example when initializing the editor from JS.
Props turtlepod.
Fixes #41590.
Built from https://develop.svn.wordpress.org/trunk@41259


git-svn-id: http://core.svn.wordpress.org/trunk@41099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-17 21:04:45 +00:00
Peter Wilson d8bf666313 Emoji: Update Twemoji to 2.5.0.
Twemoji 2.3.0 has a rendering issue in Safari, emoji can sometimes be followed by U+FEOF (which is just a flag meaning "render the preceding character as emoji).

Twemoji wasn't catching this character correctly, and Safari rendered it incorrectly.

Twemoji 2.5.0 resolves this issue.

Fixes #41584.

Built from https://develop.svn.wordpress.org/trunk@41250


git-svn-id: http://core.svn.wordpress.org/trunk@41090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-14 02:04:45 +00:00
Weston Ruter f0ee106d86 Media: Upgrade MediaElement.js from 4.2.3 to 4.2.5.
Props rafa8626.
See #39686.

Built from https://develop.svn.wordpress.org/trunk@41240


git-svn-id: http://core.svn.wordpress.org/trunk@41080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-12 06:20:44 +00:00
Drew Jaynes 1a123e432f External Libraries: Update jQuery Form (unused in core) to the latest version, 4.2.1.
Fixes #41565.

Built from https://develop.svn.wordpress.org/trunk@41233


git-svn-id: http://core.svn.wordpress.org/trunk@41073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-05 13:00:47 +00:00
James Nylen e77ac0c6eb Remove unnecessary semicolon
See #40919.

Built from https://develop.svn.wordpress.org/trunk@41207


git-svn-id: http://core.svn.wordpress.org/trunk@41047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 17:16:44 +00:00
James Nylen c91b130b53 REST API: Allow overriding `jQuery.ajax` calls from within wp-admin
There are now 3 places where we call out to the REST API from within wp-admin.  This commit introduces a small library to allow overriding these calls, centralize nonce-passing logic, and eliminate the need to pass a full REST URL down to client code (this last feature is not yet used and will be explored in a separate ticket).

Fixes #40919.

Built from https://develop.svn.wordpress.org/trunk@41206


git-svn-id: http://core.svn.wordpress.org/trunk@41046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 16:45:44 +00:00
Weston Ruter 7af3b92736 Media: Upgrade MediaElement.js from 2.22.0 to 4.2.3.
Props rafa8626, grosbouff, westonruter, azaozz, Plastikschnitzer for testing.
See #39686.

Built from https://develop.svn.wordpress.org/trunk@41198


git-svn-id: http://core.svn.wordpress.org/trunk@41038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-01 04:43:51 +00:00
Weston Ruter 18fd50d2b6 Media: Improve acceptance of YouTube /embed/ URLs when inserting in media modal.
Props timmydcrawford.
Fixes #41201.

Built from https://develop.svn.wordpress.org/trunk@41179


git-svn-id: http://core.svn.wordpress.org/trunk@41019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 02:36:46 +00:00
Weston Ruter 4042c0b416 TinyMCE: Fix styling of selected state for linked images containing captions.
Props azaozz.
Fixes #41408.

Built from https://develop.svn.wordpress.org/trunk@41141


git-svn-id: http://core.svn.wordpress.org/trunk@40981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 02:19:42 +00:00
K. Adam White 6aaba32b36 WP-API JS Client: Interpret Settings resource as a model.
The REST API does not provide a mechanism to distinguish between endpoints representing models and those representing collections, so the Backbone client must make that distinction internally. Previously wp-api.js accounted for `/users/me`, but not for `/settings`. This patch updates the logic so that `/settings` is properly registered as a Backbone model.

When calling `wp.api.init`, additional endpoints can be specified to be models using the `modelEndpoints` argument.

Props @adamsilverstein.
Fixes #41056.

Built from https://develop.svn.wordpress.org/trunk@41112


git-svn-id: http://core.svn.wordpress.org/trunk@40952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 20:26:45 +00:00
Andrew Ozz a798266ba3 TinyMCE: remove unused code from the `wpeditimage` plugin.
Fixes #41369.
Built from https://develop.svn.wordpress.org/trunk@41092


git-svn-id: http://core.svn.wordpress.org/trunk@40932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-19 13:41:46 +00:00
Adam Silverstein 499e2a0ff9 Move `sanitizeText` and `stripTags` from press this to `wp.sanitize`.
Introduce the `wp.sanitize` namespace and add two helpers for text sanitization. `stripTags` strips HTML tags from a string using regex.

Fixes #40635.

Built from https://develop.svn.wordpress.org/trunk@41061


git-svn-id: http://core.svn.wordpress.org/trunk@40911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-15 15:48:46 +00:00
Sergey Biryukov a545745a54 Shortcodes: Allow using single quotes for empty value attributes.
Props enrico.sorcinelli.
Fixes #37304.
Built from https://develop.svn.wordpress.org/trunk@41026


git-svn-id: http://core.svn.wordpress.org/trunk@40876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-11 00:54:41 +00:00
Adam Silverstein 5cfbf0519b Media: library grid view - improve browser history support.
Set view state properly when navigating history using the browser back/next button in the media library (grid view). Correctly handle navigating, search, image detail view and image edit mode. Also handle bookmarking/reloading.

Props kucrut, joemcgill, afercia.
Fixes #31846.


Built from https://develop.svn.wordpress.org/trunk@41021


git-svn-id: http://core.svn.wordpress.org/trunk@40871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-10 19:08:41 +00:00
Joe McGill 37b500c4bd Sanity check $uploaderToggler in wp.media.view.UploaderInline.
This ensures `$uploaderToggler` exists before checking length so any views
extending or scripts accessing this view, won't encounter errors that stop execution.

Props Blackbam, yahil.
Fixes #41231.

Built from https://develop.svn.wordpress.org/trunk@41009


git-svn-id: http://core.svn.wordpress.org/trunk@40859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 00:41:41 +00:00
Andrew Ozz 8c47285f4e TinyMCE: fix adding the `<!-- more -->` tag when the editor is inline.
Props iseulde.
Fixes #41230.
Built from https://develop.svn.wordpress.org/trunk@40996


git-svn-id: http://core.svn.wordpress.org/trunk@40846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-03 21:41:41 +00:00
Andrew Ozz 16167ffe41 Text widget: bump the TinyMCE modals z-index to 500001 so they show in the Customizer.
Props greuben.
Fixes #41158 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40990


git-svn-id: http://core.svn.wordpress.org/trunk@40840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 20:33:41 +00:00
Peter Wilson cc82d38f47 Emoji: Fix typo in `browserSupportsEmoji()` comment.
Fairies not Faries, introduced in [40850].

Fixes #41157.


Built from https://develop.svn.wordpress.org/trunk@40936


git-svn-id: http://core.svn.wordpress.org/trunk@40786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:05:42 +00:00
Adam Silverstein 7846cdc632 Media: Disable the edit image->replace button when no item selected.
On the edit media screen, ensure that the 'replace' button is disabled until a media item is selected. Fix an issue where clicking the button with no item selected threw a JavaScript error and failed to work.

Props timmydcrawford, subrataemfluence, psiico.
Fixes #40589.


Built from https://develop.svn.wordpress.org/trunk@40902


git-svn-id: http://core.svn.wordpress.org/trunk@40752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 09:38:46 +00:00
Adam Silverstein c7f7e76515 Media: Fix an issue selecting media when clicking item edges.
Adjust targeting of the click handler for media item selection so clicking edges of media items properly selects them.

Props circlecube, psiico.
Fixes #40578.


Built from https://develop.svn.wordpress.org/trunk@40874


git-svn-id: http://core.svn.wordpress.org/trunk@40724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-05 00:49:43 +00:00
Andrew Ozz 9799bf93f5 TinyMCE: update to 4.6.3. Fixes few more edge cases with link boundaries. Changelog: https://www.tinymce.com/docs/changelog/#version463-may302017
Fixes #40890.
Built from https://develop.svn.wordpress.org/trunk@40856


git-svn-id: http://core.svn.wordpress.org/trunk@40707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-30 23:35:41 +00:00
Gary Pendergast 930d29f267 Emoji: Fix the flag and emoji5 tests not working correctly.
Fixes the UN flag not being correctly compared to itself, introduced in [40837].

Replaces the bearded person check with a male fairy. Emoji 5 does not have gendered bearded people, so we needed to switch it out to use the ZWJ check for a broken render.

Props peterwilsoncc for the code and commit message.
Fixes #40858.



Built from https://develop.svn.wordpress.org/trunk@40850


git-svn-id: http://core.svn.wordpress.org/trunk@40701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-29 03:21:42 +00:00
Andrew Ozz 5136fe6ca6 TinyMCE: update to the TINY-1079 (latest) branch. Fixes several edge cases including the errors thrown when moving the caret with the arrow keys around nested `<a><code>` elements.
Fixes #40874 #40868.
Built from https://develop.svn.wordpress.org/trunk@40848


git-svn-id: http://core.svn.wordpress.org/trunk@40699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-27 02:09:45 +00:00
Peter Wilson 03f483215d Emoji: Add Emoji 5 support.
Updates Twemoji to 2.3.0 to include Emoji 5 support.

The pride flag test is replaced with a test for the English flag, a five character sub-devision locale. The UN flag test is retained as the most recent two character locale.

An Emoji 5 "bearded person" replaces both Emoji 4 tests.

Fixes #40858.


Built from https://develop.svn.wordpress.org/trunk@40837


git-svn-id: http://core.svn.wordpress.org/trunk@40688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 07:18:45 +00:00
Andrew Ozz a8309f80c3 TinyMCE: update to 4.6.2. Changelog: https://www.tinymce.com/docs/changelog/#version462-may232017.
Fixes #40859 #40756.
Built from https://develop.svn.wordpress.org/trunk@40834


git-svn-id: http://core.svn.wordpress.org/trunk@40685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 01:14:43 +00:00
Andrew Ozz a89f203b21 TinyMCE: fix selecting the link node after creating a link by pasting an URL.
Props iseulde.
Fixes #40818.
Built from https://develop.svn.wordpress.org/trunk@40801


git-svn-id: http://core.svn.wordpress.org/trunk@40659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 18:55:44 +00:00
Andrew Ozz b398ccf2a1 TinyMCE: fix pasting while an image with caption is selected. The image and the caption should be replaced with the pasted content.
Fixes #40809.
Built from https://develop.svn.wordpress.org/trunk@40786


git-svn-id: http://core.svn.wordpress.org/trunk@40644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 22:25:41 +00:00
Matias Ventura aee7e6a1bf TinyMCE: Provide styles for link and code boundaries.
The new version of TinyMCE introduces a cursor-boundary feature for some formatting elements but, by default, it does not provide much in the way of styles. This tweaks their appearance in the WordPress custom skin to match the intended design of the feature.

Props joen.
Fixes #40767.

Built from https://develop.svn.wordpress.org/trunk@40783


git-svn-id: http://core.svn.wordpress.org/trunk@40641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 17:52:42 +00:00
Weston Ruter 764d8b521f Media: Trim whitespace in URLs provided for external embeds.
Also avoid showing error notice in media widget when URL field is empty.

Props timmydcrawford, westonruter.
Fixes #40771.

Built from https://develop.svn.wordpress.org/trunk@40772


git-svn-id: http://core.svn.wordpress.org/trunk@40630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-17 01:59:42 +00:00
Weston Ruter 509e706c13 Customize: Run a partial's fallback behavior (full refresh) when selective refresh fails due to a script error.
This ensures that 3rd-party scripts that users paste into Text widgets will gracefully recover and result in the expected preview.

See #27355.
Fixes #40658.

Built from https://develop.svn.wordpress.org/trunk@40771


git-svn-id: http://core.svn.wordpress.org/trunk@40629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-17 00:01:40 +00:00
Pascal Birchler 8c7ea71edb Media: Simplify upload error message construction.
Built from https://develop.svn.wordpress.org/trunk@40736


git-svn-id: http://core.svn.wordpress.org/trunk@40594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 17:58:41 +00:00
Adam Silverstein 498613ccd7 Media: Fix improper use of jQuery `hasClass` method.
The jQuery `hasClass` method accepts a class name without a prefix '.' (period). Remove an errant class name with a '.' in `wp-mediaelement.js` that broke the selector in certain circumstances.

Props kostasx, Presskopp.
Fixes #40354.


Built from https://develop.svn.wordpress.org/trunk@40659


git-svn-id: http://core.svn.wordpress.org/trunk@40522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 20:53:45 +00:00
Andrew Ozz 6f4a1049a8 TinyMCE: do not override `line-height` for paragraphs and headings in 4.6+, makes them hard to read.
Fixes #40743.
Built from https://develop.svn.wordpress.org/trunk@40654


git-svn-id: http://core.svn.wordpress.org/trunk@40517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 18:06:40 +00:00
Andrew Ozz 8c46657c9d TinyMCE: update to 4.6.1. Changelog: https://www.tinymce.com/docs/changelog/#version461-may102017
Fixes #40727.
Built from https://develop.svn.wordpress.org/trunk@40645


git-svn-id: http://core.svn.wordpress.org/trunk@40506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 23:12:40 +00:00
Andrew Ozz da92cce494 TinyMCE: prevent removing of the temp link element when opening the advanced link dialog to insert new link.
Part props figureone for finding the cause.
Fixes #40558.
Built from https://develop.svn.wordpress.org/trunk@40644


git-svn-id: http://core.svn.wordpress.org/trunk@40505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 23:04:40 +00:00
Andrea Fercia 691d649329 Media: Remove the custom styling for the MediaElementJS controls offscreen text.
This offscreen text is not meant to be revealed on focus and just acts as fallback
for assistive technologies that don't support `aria-label` and `role="slider"`.
Also, revealing it on focus has proven over time to be very fragile and to cause
unexpected layout issues.

See #30281.
Fixes #40707.

Built from https://develop.svn.wordpress.org/trunk@40642


git-svn-id: http://core.svn.wordpress.org/trunk@40503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 22:29:42 +00:00
Weston Ruter 31d4d81039 Widgets: Introduce media widgets for images, audio, and video with extensible base for additional media widgets in the future.
The last time a new widget was introduced, Vuvuzelas were a thing, Angry Birds started taking over phones, and WordPress stopped shipping with Kubrick. Seven years and 17 releases without new widgets have been enough, time to spice up your sidebar!

Props westonruter, melchoyce, obenland, timmydcrawford, adamsilverstein, gonom9, wonderboymusic, Fab1en, DrewAPicture, sirbrillig, joen, matias, samikeijonen, afercia, celloexpressions, designsimply, michelleweber, ranh, kjellr, karmatosed.
Fixes #32417, #39993, #39994, #39995.

Built from https://develop.svn.wordpress.org/trunk@40640


git-svn-id: http://core.svn.wordpress.org/trunk@40501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 21:11:44 +00:00
James Nylen 589c4b4b2d REST API: Add endpoint for proxying requests to external oEmbed providers.
This endpoint is a prerequisite for the media widgets work (see https://github.com/xwp/wp-core-media-widgets).

Also use the new endpoint in the media modal instead of the `parse-embed` AJAX action.

Props westonruter, timmydcrawford, swissspidy, jnylen0.
Fixes #40450.

Built from https://develop.svn.wordpress.org/trunk@40628


git-svn-id: http://core.svn.wordpress.org/trunk@40489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 18:18:46 +00:00
Peter Wilson 746edb23f2 Emoji: Update Twemoji to version 2.2.5
Updates Twemoji and adds a second Emoji 4 test to include a shrugging man. Emoji 4 is being implemented gradually, while some browsers now support the female technologist, the indifferent shrugging man is breaking things with his presence.

Props peterwilsoncc, pento for code review.
Fixes #40615.

Built from https://develop.svn.wordpress.org/trunk@40626


git-svn-id: http://core.svn.wordpress.org/trunk@40487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 04:26:41 +00:00
Andrew Ozz 57ef33fa2a Editor: manually trigger `change` event when text is modified from JS.
Props westonruter.
Fixes #40726.
Built from https://develop.svn.wordpress.org/trunk@40615


git-svn-id: http://core.svn.wordpress.org/trunk@40485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 00:29:41 +00:00
Peter Wilson 6c23b4750c Emoji: Clear canvas between flag tests.
Clear the canvas following the two flag tests following [40582].

Fixes #40616.


Built from https://develop.svn.wordpress.org/trunk@40609


git-svn-id: http://core.svn.wordpress.org/trunk@40479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 22:44:40 +00:00
Andrew Ozz 0b2f789e93 Editor: Add `init` and `remove` methods to Quicktags.
Props helgatheviking azaozz.
Fixes #26183 #40708.
Built from https://develop.svn.wordpress.org/trunk@40598


git-svn-id: http://core.svn.wordpress.org/trunk@40468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 02:47:42 +00:00
Andrew Ozz ec622956c8 TinyMCE: improve adding of custom UI to the MCE Factory.
Props iseulde.
Fixes #40690.
Built from https://develop.svn.wordpress.org/trunk@40587


git-svn-id: http://core.svn.wordpress.org/trunk@40457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 01:40:46 +00:00
Andrew Ozz dd0d110520 TinyMCE: update to 4.6.0. Has many new features and bug fixes, changelog: https://www.tinymce.com/docs/changelog/#version460-may42017.
Fixes #40690.
Built from https://develop.svn.wordpress.org/trunk@40583


git-svn-id: http://core.svn.wordpress.org/trunk@40453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 05:32:46 +00:00
Gary Pendergast 1b85aa404d Emoji: Make the UN flag test more accurate.
Previously, the UN flag test relied on the image being produced to be quite small. Unfortunately, the Chrome PNG encoder seems to have changed recently, and it now produces a relatively large image.

For a better test, we can compare the rendering of [U] + [N] against [U] + zero width space + [N].

Fixes #40616.


Built from https://develop.svn.wordpress.org/trunk@40582


git-svn-id: http://core.svn.wordpress.org/trunk@40452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 05:04:52 +00:00
Andrea Fercia 88e515fac0 Accessibility: Improve the suggested image size text in the media views.
Adds `pixels` as unit, avoiding abbreviation for a clearer pronunciation by screen
readers. Also, adds the word `by` instead of the special character `times`.

Props Presskopp, stormrockwell.
Fixes #38932.

Built from https://develop.svn.wordpress.org/trunk@40573


git-svn-id: http://core.svn.wordpress.org/trunk@40443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-05 23:29:44 +00:00
Andrew Ozz c0399b4fde TinyMCE: Fix cursor position after updating a wpview node. Fix hiding the inline toolbar on editor blur.
Props iseulde, azaozz.
Fixes #40480 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40481


git-svn-id: http://core.svn.wordpress.org/trunk@40357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 22:10:42 +00:00
Andrea Fercia 711796d172 Accessibility: Make Safari 10 + VoiceOver announce repeated, identical, `wp.a11y.speak()` messages.
Safari 10 + VoiceOver don't announce repeated, identical, strings sent to an 
`aria-live` region. Appending a `no-break space` to a repeated message string,
forces them to think the strings are different.

Fixes #36853.

Built from https://develop.svn.wordpress.org/trunk@40479


git-svn-id: http://core.svn.wordpress.org/trunk@40355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 19:53:42 +00:00
Adam Silverstein 9ff1301ae5 Upload: improve legacy SWFUpload event handlers for current jQuery.
Fix an issue where legacy JavaScript for SWFUpload still used jQuery's 
deprecated `live` event which no longer works - switch to using `on`.
This JavaScript is still used by some plugins and themes.

Props MMDeveloper.
Fixes #39886.


Built from https://develop.svn.wordpress.org/trunk@40431


git-svn-id: http://core.svn.wordpress.org/trunk@40329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 16:43:44 +00:00
Andrew Ozz 23850c3952 Update TinyMCE to 4.5.6. Has many improvements and bug fixes. Changelog: https://github.com/tinymce/tinymce/blob/4.5.x/changelog.txt.
Fixes #40305 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40398


git-svn-id: http://core.svn.wordpress.org/trunk@40305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 23:01:43 +00:00
Weston Ruter 19d960e257 Customize: Fix HTTPS navigation of site in preview on IE11.
Accounts for HTTPS links (port 443) where [40318] only accounted for HTTP links (port 80). Addresses issue in IE11 where the default port number is unexpectedly included on `link.host` for links dynamically created by scripts.

Props mattwiebe.
Amends [40318], [38890].
See #38409.
Fixes #40198.

Built from https://develop.svn.wordpress.org/trunk@40381


git-svn-id: http://core.svn.wordpress.org/trunk@40288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 00:32:44 +00:00
Adam Silverstein 789f141045 REST API: JS Client - Enable connecting to multiple endpoints.
Enable connecting to multiple wp-api `endpoints`. Calling `wp.api.init` with a new `apiRoot` will parse the new endpoint's schema and store a new set of models and collections. A collection of connected endpoints is stored in `wp.api.endpoints`.

Props lucasstark.
Fixes #39683.


Built from https://develop.svn.wordpress.org/trunk@40364


git-svn-id: http://core.svn.wordpress.org/trunk@40271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-02 19:41:41 +00:00
Andrea Fercia 822b8afb50 Accessibility: Improve the Media Library inline uploader accessibility.
For better accessibility, expandable panels should be placed immediately after
the control that expands them. This change moves the Media Library inline
uploader up, right after the "Add New" button, also introducing consistency with
the Plugin and Theme uploaders.
Adds a proper ARIA role on the button and an `aria-expanded` attribute to give
better feedback to assistive technologies users about the uploader's expanded state.
Improves the focus handling when closing the uploader, improves the focus style
and color contrast ratio of the uploader "close" button.

Props mantismamita, karmatosed, adamsilverstein, afercia.
Fixes #37188.

Built from https://develop.svn.wordpress.org/trunk@40359


git-svn-id: http://core.svn.wordpress.org/trunk@40266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 17:38:43 +00:00
Weston Ruter 5aec57b209 Customize: Fix navigation of site in preview on IE11.
Addresses issue in IE11 where the default port number of `:80` is unexpectedly included on `link.host` for links dynamically created by scripts.

Props westonruter, afercia for testing.
See #38409.
Fixes #40198.

Built from https://develop.svn.wordpress.org/trunk@40318


git-svn-id: http://core.svn.wordpress.org/trunk@40225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 17:25:43 +00:00
Andrea Fercia c3a2b57241 Media: Restore correct upload errors displaying after [37610].
Props codegeass, MatheusGimenez, joemcgill.
Fixes #39516.

Built from https://develop.svn.wordpress.org/trunk@40126


git-svn-id: http://core.svn.wordpress.org/trunk@40063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-26 18:15:43 +00:00
Andrew Ozz 9c1d14b875 TinyMCE: preserve empty image alt attributes.
Props afercia.
Fixes #39912 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40110


git-svn-id: http://core.svn.wordpress.org/trunk@40047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 20:41:43 +00:00
Weston Ruter 0343f50561 Customize: Prevent vertical clipping of thumbnail in header image customizer control.
Removes some method overrides on `wp.customize.HeaderTool.ChoiceView` introduced in [27497].

See #21785.
Props bradyvercher.
Fixes #38559.

Built from https://develop.svn.wordpress.org/trunk@40082


git-svn-id: http://core.svn.wordpress.org/trunk@40019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 00:10:49 +00:00
Adam Silverstein c7b217cee9 JavaScript: when starting Backbone history, stop if previously started.
Prevent a potential error condition if Backbone history is started by a plugin or theme before core tries to start it. 

Props tfrommen.
Fixes #39612.

Built from https://develop.svn.wordpress.org/trunk@40076


git-svn-id: http://core.svn.wordpress.org/trunk@40013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 22:00:42 +00:00
Adam Silverstein 518ff1576b REST API: JavaScript client - improve route discovery for custom namespaces.
Fix parsing of custom namespace routes. Transform class names, removing dashes and capitalizing each word/route part so a route path of `widgets/recent-posts` becomes a collection with the name `WidgetsRecentPosts`. Correct parent route part when routes are longer than expected, reversing parse direction.

Props westonruter, jazbek.
Fixes #39561.

Built from https://develop.svn.wordpress.org/trunk@40074


git-svn-id: http://core.svn.wordpress.org/trunk@40011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 20:54:44 +00:00
Weston Ruter 34b179876e Customize: Skip intercepting non-HTTP(S) links in customizer preview just as jump links are ignored.
Ensures that links with `javascript:`, `mailto:` and other protocols work as expected in the customizer preview.

Fixes #39797.

Built from https://develop.svn.wordpress.org/trunk@40064


git-svn-id: http://core.svn.wordpress.org/trunk@40001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-16 21:21:45 +00:00
Adam Silverstein e322b0eb77 Media: debounce the media grid search, avoiding duplicate requests.
Add a debounce wrapper to the media grid search handler. The search callback is now fired after a 300 ms typing pause.

Remove redundant handlers for 'search' and 'change', preventing multiple/duplicate search callbacks.

Props certainstrings, joemcgill, Kelderic, batmoo.
Fixes #38911.

Built from https://develop.svn.wordpress.org/trunk@40060


git-svn-id: http://core.svn.wordpress.org/trunk@39997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-15 17:29:44 +00:00
Weston Ruter f3644a702e Customize: Ensure edit shortcuts get re-created for nested partials when a parent partial is refreshed.
Fixes issue where the edit shortcut for a nav menu gets dropped when the containing Custom Menu widget is updated.

See #39101.
Fixes #39353.

Built from https://develop.svn.wordpress.org/trunk@40055


git-svn-id: http://core.svn.wordpress.org/trunk@39992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-11 03:35:43 +00:00
Andrea Fercia d33301821b Buttons: Improve the `.button-link` CSS class for link-like buttons.
Updates `.button-link` adding color and underline to make link-like buttons look
like links by default. Introduces `.button-link-delete` as a modifier, stackable
CSS class for red button-links.

Props Cheffheid, afercia.

See #34242.
Fixes #35126.

Built from https://develop.svn.wordpress.org/trunk@40052


git-svn-id: http://core.svn.wordpress.org/trunk@39989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-09 16:47:44 +00:00
Scott Taylor 9bf3844ef9 Media: in `wp.media.view.DeleteSelectedPermanentlyButton`, move destructive async operations outside of the `selection` loop.
Fixes #39780.

Built from https://develop.svn.wordpress.org/trunk@40051


git-svn-id: http://core.svn.wordpress.org/trunk@39988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-08 19:44:41 +00:00
Scott Taylor 907e8cbd66 Media: in `wp.media.view.Toolbar.refresh()`, check for a selection before iterating over models.
Props chandrapatel.
Fixes #39511.

Built from https://develop.svn.wordpress.org/trunk@40050


git-svn-id: http://core.svn.wordpress.org/trunk@39987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-08 19:17:43 +00:00
Adam Silverstein 717aeab3cc REST API: JavaScript client should use `_.extend` when merging objects.
Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects.

Props ketuchetan.
Fixes #39341.


Built from https://develop.svn.wordpress.org/trunk@40040


git-svn-id: http://core.svn.wordpress.org/trunk@39977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-03 21:46:43 +00:00
Andrea Fercia 4ca4ff999a Accessibility: Make the inline uploader button a real button.
See `wp.media.view.UploaderWindow`.

Fixes #39305.

Built from https://develop.svn.wordpress.org/trunk@40021


git-svn-id: http://core.svn.wordpress.org/trunk@39958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 18:32:41 +00:00
Andrew Ozz 69c29935d5 TinyMCE: improve the previews for embedded WordPress posts:
- Add option to force a sandbox iframe in wpview.
- Use it to show the embedded post preview.
- Remove the deprecated `wpembed` plugin.js

Fixes #39513.
Built from https://develop.svn.wordpress.org/trunk@40019


git-svn-id: http://core.svn.wordpress.org/trunk@39956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 04:25:44 +00:00
Andrew Ozz 66a39611f6 TinyMCE: strip browser inserted `<u>` and <font>` tags from inside links when copying and pasting in IE and Edge.
Fixes #39570.
Built from https://develop.svn.wordpress.org/trunk@39916


git-svn-id: http://core.svn.wordpress.org/trunk@39853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 01:25:44 +00:00
Andrew Ozz 82a8065f70 TinyMCE: ensure the inline toolbar is shown and properly positioned when there are several wpview blocks in the editor and the user selects one after the other.
Props gitlost.
Fixes #38849.
Built from https://develop.svn.wordpress.org/trunk@39910


git-svn-id: http://core.svn.wordpress.org/trunk@39847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-16 00:22:43 +00:00
Andrew Ozz 35c91b7c0d TinyMCE: prevent the inline toolbar from appearing on partially selected wpview nodes. This can happen when HTML is initially loaded in the editor and wpview is the first node, or sometimes on repeatedly pasting the same wpview.
Props gitlost.
Fixes #38849.
Built from https://develop.svn.wordpress.org/trunk@39904


git-svn-id: http://core.svn.wordpress.org/trunk@39841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 03:00:43 +00:00
Andrew Ozz 45f3ee380c TinyMCE: when inserting a wpview, place the caret after is so the user can continue typing without interruption.
Props iseulde.
Fixes #39337.
Built from https://develop.svn.wordpress.org/trunk@39903


git-svn-id: http://core.svn.wordpress.org/trunk@39840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 02:41:40 +00:00
Andrew Ozz 90f441e1b4 TinyMCE: improve removal of spaces from empty paragraphs when loading HTML in the editor.
Fixes #39437.
Built from https://develop.svn.wordpress.org/trunk@39902


git-svn-id: http://core.svn.wordpress.org/trunk@39839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 02:06:41 +00:00
Adam Silverstein c8a3496ebe REST API: Add error handling for fetch error in `buildModelGetter` of wp-api.js.
When a call to a model getter method fails, reject the returned deferred object. Enables better handling of fetch errors.

Props westonruter, adamsilverstein.
Fixes #39314.

Built from https://develop.svn.wordpress.org/trunk@39680


git-svn-id: http://core.svn.wordpress.org/trunk@39620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 03:03:42 +00:00
Weston Ruter f7ba137f19 Customize: Fix visible edit shortcuts for `wp_nav_menu()` instances using the `menu` arg (such as in the Custom Menu widget) instead of the `theme_location` arg.
Also fix logic for `focus-control-for-setting` handler to focus on the first control (lowest `priority` value) associated with a given setting instead of the last control encountered when iterating over all controls, as this ensures the first control in a `nav_menu` section is focused rather than the last one.

Props westonruter, sirbrillig.
See #27403.
Fixes #39101.

Built from https://develop.svn.wordpress.org/trunk@39622


git-svn-id: http://core.svn.wordpress.org/trunk@39562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-20 22:05:43 +00:00
Adam Silverstein bc7a03a33b WP-API: JavaScript client - fix setup of models used by wp.api.collections objects.
Correct setup for the `model` attribute of `wp.api.collections` objects. Set the collection model as a function that returns a new model of the underlying type, instead of setting it as the model prototype. Fixes an issue where models for fetched collections weren't set up properly and didn't have the expected mixin methods such as `getCategories` available.

Props jesseenterprises.
Fixes #39070.

Built from https://develop.svn.wordpress.org/trunk@39603


git-svn-id: http://core.svn.wordpress.org/trunk@39543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-15 12:54:42 +00:00
Ella Iseulde Van Dorpe 4ec102c189 Editor: Remove target=_blank when unchecked in the link modal.
Fixes #39276 for trunk.


Built from https://develop.svn.wordpress.org/trunk@39601


git-svn-id: http://core.svn.wordpress.org/trunk@39541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-14 20:30:44 +00:00