Commit Graph

678 Commits

Author SHA1 Message Date
Scott Taylor
0b1272e445 Persisting <track> elements as the body of a [video] shortcode in MCE Views:
* When generating the view's HTML, ensure that the shortcode's `content` is added to the model
* Add a `PostProcess` event in the `wpview` plugin to properly return the shortcode when the editor mode is toggled, ensuring that elements in the body are not dropped.

Props azaozz, wonderboymusic.
See #27915.



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


git-svn-id: http://core.svn.wordpress.org/trunk@28014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-22 18:21:16 +00:00
Andrew Nacin
a6eedd18b2 TinyMCE: Restore old wordpress_adv_hidden editor parameter to enable force-showing the kitchen sink.
props azaozz.
see #27963, for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-22 13:50:14 +00:00
Andrew Nacin
a8cefa836d Graceful failures for TinyMCE views of video/audio playlists.
props gcorne.
fixes #27821.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-16 00:23:15 +00:00
Andrew Ozz
0df02eb8ea Add hooks to the wpeditimage tinymce plugin and to the image details portion of the media modal.
- Add wp.media.events which is intended to be a global media event bus.
- Add a post-render event to the ImageDetails view that third-party code can leverage to add subviews.
- Performance improvement for the initialization of the PostImage model.
- A bit more markup to the image details template to make it easier to add a view to the advanced options.
Props gcorne, fixes #27698
Built from https://develop.svn.wordpress.org/trunk@28095


git-svn-id: http://core.svn.wordpress.org/trunk@27926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-13 04:02:15 +00:00
Andrew Ozz
dc52e17417 RTL for TinyMCE:
- Add _dir: 'rtl' to the TinyMCE translation object.
- Fix editor.css for RTL.
- Fix the Edit and Delete buttons position for wpview and images.
- For _mce_set_direction(), update documentation and fix adding the 'ltr' button.
Fixes #27773
Built from https://develop.svn.wordpress.org/trunk@28094


git-svn-id: http://core.svn.wordpress.org/trunk@27925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-13 00:23:15 +00:00
Andrew Ozz
1a538353fc Update the TinyMCE paste plugin to the latest development version. It includes a fix for pasting from Word: removes inline comments and change tracking.
Changeset: f8cffdf342
Fixes #27771
Built from https://develop.svn.wordpress.org/trunk@28089


git-svn-id: http://core.svn.wordpress.org/trunk@27920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-12 20:01:14 +00:00
Andrew Ozz
191dd168c1 TinyMCE wpViews:
- Prevent undo steps from being added when the body of a wpview changes.
- Add unbind() to handle cleanup on DOM rebuilding in TinyMCE.
- Ensure that MediaElement's cleanup routine is run on every player in all instances of the editor.
- Initialize the players after some delay to ensure CSS is loaded.
Props gcorne and wonderboymusic, fixes #27389
Built from https://develop.svn.wordpress.org/trunk@28084


git-svn-id: http://core.svn.wordpress.org/trunk@27915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-12 00:46:14 +00:00
Andrew Ozz
68cbde29ca Don't include the non-minified tinymce.js in /build. Load it when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG). Props nacin, fixes #27739
Built from https://develop.svn.wordpress.org/trunk@28081


git-svn-id: http://core.svn.wordpress.org/trunk@27912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-11 22:16:14 +00:00
Andrew Ozz
c631d144f1 Update TinyMCE to the current development version, 4.0.21.1. Fixes #27744
Built from https://develop.svn.wordpress.org/trunk@28066


git-svn-id: http://core.svn.wordpress.org/trunk@27898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-10 21:09:16 +00:00
Andrew Ozz
a3c725f5b4 TinyMCE Views in IE8 and 7: change deselect event only for old IE, props gcorne, fixes #27546
Built from https://develop.svn.wordpress.org/trunk@28063


git-svn-id: http://core.svn.wordpress.org/trunk@27895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-09 15:29:17 +00:00
Andrew Ozz
cc694bac21 Fix TinyMCE Views in IE8 and 7:
- Add fallback background images for dashicons.
- Fix hiding the clipboard while still allowing the contents to be selected.
- Work around lack of border-box in gallery styles.
(Includes precommit cleanup for theme.js)
Props gcorne, fixes 27546
Built from https://develop.svn.wordpress.org/trunk@28062


git-svn-id: http://core.svn.wordpress.org/trunk@27894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-09 00:58:15 +00:00
Andrew Ozz
fd0ae7e406 Precommit cleanup for theme.js, editor.css amd wpdialogs/plugin.js, See #27055, #26907, #16284
Built from https://develop.svn.wordpress.org/trunk@28045


git-svn-id: http://core.svn.wordpress.org/trunk@27875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 08:29:14 +00:00
Andrew Nacin
819da2ac6d Nuke the TinyMCE help dialog as it is duplicated by help tabs. This leaves just Keyboard Shortcuts.
fixes #27100.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 02:32:14 +00:00
Andrew Nacin
64936ec9b5 TinyMCE help: Break up strings changed in [28027] for ease of changing later.
Restores a not inaccurate paragraph to reduce churn.

see #27100.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 01:19:15 +00:00
Andrew Ozz
06acbdcd5a TinyMCE help modal:
- Don't load the old tiny_mce_popup.js.
- Add the shortcut for <code> and the second shortcut for link to the shortcuts listing.
- Update some of the text.
See #27100
Built from https://develop.svn.wordpress.org/trunk@28027


git-svn-id: http://core.svn.wordpress.org/trunk@27857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 23:53:15 +00:00
Andrew Ozz
5ce9ab1293 Fix typo and add more text to the error shown when 'wpdialogs' is not enqueued. Add 'wp_enqueue_editor' action fired when scripts and styles for the editor are being enqueued, fixes #16284
Built from https://develop.svn.wordpress.org/trunk@28024


git-svn-id: http://core.svn.wordpress.org/trunk@27854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 22:55:15 +00:00
Andrew Ozz
df7b16dda1 TinyMCE: show an error in the console when a plugin attempts to use the 'wpdialogs' plugin but wpdialog.js is not enqueued, fixes #16284
Built from https://develop.svn.wordpress.org/trunk@28012


git-svn-id: http://core.svn.wordpress.org/trunk@27842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 21:35:15 +00:00
Scott Taylor
2c88f6e941 [27640] supported a caption for audio and video shortcodes as part of a UX iteration for the related MCE views. These captions have since be excluded, so the extra code should be removed (it was there for this sole reason).
See #27320.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 06:13:18 +00:00
Dominik Schilling
f8d4a00b6a Update TinyMCE help for pasting content.
props chiragswadia.
see #27100.
Built from https://develop.svn.wordpress.org/trunk@27972


git-svn-id: http://core.svn.wordpress.org/trunk@27802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-06 19:46:15 +00:00
Andrew Ozz
e392b42c70 TinyMCE: update the default style for html5-captions, props obenland fixes #26642
Built from https://develop.svn.wordpress.org/trunk@27949


git-svn-id: http://core.svn.wordpress.org/trunk@27779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-04 23:12:16 +00:00
Andrew Ozz
d4755ebea3 TinyMCE: add image backgrounds for more and nextpage tags (also jshint fix for theme.js). Fixes #27106
Built from https://develop.svn.wordpress.org/trunk@27944


git-svn-id: http://core.svn.wordpress.org/trunk@27774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-04 05:23:14 +00:00
Andrew Ozz
a3650b68cd Edit image modal:
- Make the calculation of the aspect ratio more robust.
- Better getting of the image height and width.
Props gcorne, see #27366
Built from https://develop.svn.wordpress.org/trunk@27942


git-svn-id: http://core.svn.wordpress.org/trunk@27772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-04 01:49:15 +00:00
Andrew Ozz
0ee57f8f88 TinyMCE: improve setting disabled/enabled/activated states on the Unlink button, fixes #27309
Built from https://develop.svn.wordpress.org/trunk@27934


git-svn-id: http://core.svn.wordpress.org/trunk@27764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-03 20:05:31 +00:00
Andrew Ozz
a2e1d9f4c8 Edit Image modal:
- Fix issue with adding a link to an image that didn't have one previously.
- Adjust the look-and-feel of the advance options toggle so that it becomes a section heading that can be open/closed.
- Add a Custom Size option to the size drop-down that reveals fields for soft-resizing the image inserted into the post.
Props gcorne, and props sdasse for the design help, see #27366
Built from https://develop.svn.wordpress.org/trunk@27918


git-svn-id: http://core.svn.wordpress.org/trunk@27748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-03 03:21:15 +00:00
Andrew Ozz
668235fb42 Drag and drop files on the editor to upload: add new argument to wp_editor() to enable, fixes #27465
Built from https://develop.svn.wordpress.org/trunk@27901


git-svn-id: http://core.svn.wordpress.org/trunk@27732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-02 02:42:16 +00:00
Andrew Ozz
c7eb5e7f1f Gallery preview: add a "No items found" state which is displayed when rendering the gallery wpview and no attachments are found. Props gcorne, fixes #27558
Built from https://develop.svn.wordpress.org/trunk@27899


git-svn-id: http://core.svn.wordpress.org/trunk@27730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-02 02:18:15 +00:00
Andrew Ozz
56ede0bad7 Edit Image modal:
- Move all advanced options under a single “Show advanced options” toggle that mirrors the behavior and look-and-feel of the wplink modal.
- Switch to using <select> for the Size and Link To.
- Bring back the field for CSS Class for the image, but don’t incorporate the internally managed WordPress classes (size-, wp-image-, etc…).
- On larger screen sizes, float labels to the left. When the width drops below 900px, stack the label above the fields.
- Keep image at top on screen sizes where the two columns are stacked into a single column.
- Don't replace the nodes in the editor DOM so we don't stomp on any custom attributes that the user may have added via the Text editor or some other mechanism.
Props gcorne, see #27366
Built from https://develop.svn.wordpress.org/trunk@27898


git-svn-id: http://core.svn.wordpress.org/trunk@27729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-02 01:54:15 +00:00
Andrew Ozz
2547ba21ae TinyMCE: update to 4.0.21, see #24067
Built from https://develop.svn.wordpress.org/trunk@27897


git-svn-id: http://core.svn.wordpress.org/trunk@27728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-01 22:46:14 +00:00
Andrew Ozz
bfaf007e97 Editor:
- Use standard button styles for the Quicktags buttons.
- Better style for the TinyMCE buttons (hover/focus/active/disabled).
- Move the fullscreen (DFW) button to the right.
- Better style for the Visual/Text buttons in DFW.
Props avryl, see #27279
Built from https://develop.svn.wordpress.org/trunk@27857


git-svn-id: http://core.svn.wordpress.org/trunk@27688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-29 23:58:14 +00:00
Andrew Ozz
60435c4143 Edit Image modal:
- Bring back some of the advanced settings.
- Make the layout two-column for wider screens, remove the sidebar, and shrink the modal a bit.
- The image reflects the size as inserted in the post as long as it doesn't overflow the column and is not too tall. Changing the size to another intermediate will also update the image "preview."
- Rename "Edit Image" to "Edit Original" to try and better communicate that editing the image will modify the media library item not just the image inserted into the post that is being edited.
(updates two PNGs from precommit)
Props gcorne, see #27366
Built from https://develop.svn.wordpress.org/trunk@27797


git-svn-id: http://core.svn.wordpress.org/trunk@27632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 22:41:14 +00:00
Helen Hou-Sandí
502dab46e5 Affix the audio view toolbar to the bottom as opposed to the top of the view. Otherwise it's not accessible when the view is the first item in the content. Said views keep a newline underneath, so there's space for it to appear there instead. fixes #27548, see #27320.
Built from https://develop.svn.wordpress.org/trunk@27792


git-svn-id: http://core.svn.wordpress.org/trunk@27628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 20:10:15 +00:00
Scott Taylor
26773541ab Make sure Playlist states that are audio are marked as such with proper localized strings.
See #27554.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 18:37:17 +00:00
Andrew Nacin
bd0df204a1 Remove the TinyMCE image toolbar when the image is deleted via the keyboard.
props gcorne.
fixes #27527.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 18:07:14 +00:00
Andrew Nacin
68bfa704cf Remove unused JS variables after [27770]. see #27013.
Built from https://develop.svn.wordpress.org/trunk@27783


git-svn-id: http://core.svn.wordpress.org/trunk@27619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 17:31:14 +00:00
Helen Hou-Sandí
443ab3001e MCE view controls:
* Move controls back over to the left, as they were before. Wide images and muscle memory have been causing frustration.
* Improve the experience and unify the UI of media view controls. Audio and video views now require an initial click to select before further interaction.
* CSS clean up and organization.

fixes #27320, #27542.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 07:02:16 +00:00
Andrew Ozz
15549e75f3 Remove containment of scrolling inside the editor for now. See #27013
Built from https://develop.svn.wordpress.org/trunk@27770


git-svn-id: http://core.svn.wordpress.org/trunk@27607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 02:35:14 +00:00
Helen Hou-Sandí
c3b59e06b8 Better, more consistent styling for plugin details Thickbox and TinyMCE help.
props avryl. fixes #26952.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 00:08:15 +00:00
Andrew Ozz
cb489f5a9c Add the 'attachment_' prefix to caption IDs after editing, see #24409
Built from https://develop.svn.wordpress.org/trunk@27764


git-svn-id: http://core.svn.wordpress.org/trunk@27601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 00:07:14 +00:00
Andrew Nacin
bb129b90f0 Add an .html4-captions class to the editor when HTML5 captions are not supported, for theme use.
see #26642.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-26 23:13:15 +00:00
Andrew Ozz
c66f166956 TinyMCE: fix the More and Next Page tags behavior:
- Append them inside top level <p> tags.
- If the caret is not in a top level <p>, create new paragraph after the current top level tag.
- Do not change placement when edited in the Text editor.
See #27378
Built from https://develop.svn.wordpress.org/trunk@27729


git-svn-id: http://core.svn.wordpress.org/trunk@27566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-26 02:08:15 +00:00
Andrew Ozz
a3d08715ab TinyMCE: bring back removal of the size-* class when the user soft-resizes an image, see #24409
Built from https://develop.svn.wordpress.org/trunk@27694


git-svn-id: http://core.svn.wordpress.org/trunk@27533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 00:16:14 +00:00
Scott Taylor
d85ac5b841 Let us pass jshint:core.
Built from https://develop.svn.wordpress.org/trunk@27693


git-svn-id: http://core.svn.wordpress.org/trunk@27532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-24 23:02:13 +00:00
Andrew Nacin
60676ee282 Introduce HTML5 caption support.
When a theme supports HTML5 captions via add_theme_support( 'html5', 'caption' ), figure and figcaption will be used instead of div and p.

There's a bonus. But first, some history: Captions were introduced with an inline style set for the container. This remains, as it is there to force captions to wrap. But this inline style included an extra 10 pixels, which have vexxed theme developers for years. While these pixels were designed to ensure padding around floated images, modern themes handle this with grace. The additional pixels thus feel encumbering.

As the new HTML5 gallery support avoids outputting default gallery styles (again, irking theme developers for years; see #26697), the new HTML5 caption support will also ditch these 10 pixels of unwanted hand-holding. 

The 10 pixels are also removed entirely in the visual editor (and more styles may also disappear here; see #26642), giving themes the power necessary to match the frontend styles.

The filter img_caption_shortcode_width added in 3.7 to work around this madness (see #14380) is skipped entirely when the theme supports HTML5 captions.

props obenland, azaozz.
see #26642. also fixes #9066.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-24 02:05:14 +00:00
Scott Taylor
16f93f3952 When inserting a video shortcode into the editor, set the poster attribute automatically if the video has a featured image attached to it.
See #27460.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-23 03:36:15 +00:00
Scott Taylor
410646fc52 General code cleanup and improving video sizing in the admin:
* Abstract the setting of a primary button and its callback in `wp.media.view.MediaFrame.MediaDetails`
* Account for the existence or non-existence of `$content_width` in the TinyMCE views for video
* Make sure video models always have dimensions, even if they are the defaults
* For browsers that are not Firefox, don't use a timeout when setting the `MediaElementPlayer` instance in TinyMCE views

See #27320.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-22 23:26:17 +00:00
Scott Taylor
615dd5331b Unifying media controls and supporting playlists in the editor:
* Support a `caption` attribute for audio and video shortcodes
* In `wp.media.audio|video`, rename `update` to `shortcode` to allow these models to share the same mixins as `wp.media.collection` subclasses
* When sending an audio or video shortcode to the editor, create a default caption if the user hasn't entered one. This currently only displays in the editor, not on the front end. Captions aren't tied to a specific attachment here because external sources are supported.
* In the `wp.mce.media` mixin, in the `edit` method, read `attr` instead of `data` when attempting to parse the encoded shortcode. `data` does not automatically update when the attribute changes. This was a blessing to debug.
* Add `wp.mce.media.PlaylistView` to support playlist views in TinyMCE
* Expose `WPPlaylistView` to global scope and suppress auto-parsing of playlist nodes when in the admin. Allow `WPPlaylistView` to be passed `metadata` on creation instead of requiring a JSON blob to be parsed.
* Remove all of the playlist logic from the `wpgallery` TinyMCE plugin.
* In `wp_prepare_attachment_for_js()` return more data for audio/video so that playlists can have parity in the admin/front end.

See #27320.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-20 13:33:14 +00:00
Andrew Ozz
e05fa407bf wpView: select/deselect views when moving the caret with the arrow keys, don't move the caret after deselect(), props gcorne, see #26959
Built from https://develop.svn.wordpress.org/trunk@27632


git-svn-id: http://core.svn.wordpress.org/trunk@27475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-20 02:48:14 +00:00
Helen Hou-Sandí
bef7f9e75e Further unify and refine media and view control styling. see #27320.
Built from https://develop.svn.wordpress.org/trunk@27628


git-svn-id: http://core.svn.wordpress.org/trunk@27471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-20 00:48:15 +00:00
Scott Taylor
7ad4205f70 Add MCE views for audio and video shortcodes. When the shortcode does not contain a source that supports native playback, just show the filename.
* Remove the audio/video shortcode parsing from the `wpgallery` plugin.
* Make `mce-view` a dependency of `media-audiovideo`
* Introduce `wp.mce.video`, `wp.mce.audio`, `wp.mce.media`, and `wp.mce.media.View`
* Rename `wp.media.audio|video.shortcode()` to `wp.media.audio|video.update()` since it is called on Update and returns a `wp.shortcode` object now.
* In `wp.mce.View.render()`, fire a `ready` event when the placeholder is being parsed and pass the current node to the event handler.

See #27389, #27437.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-19 07:02:15 +00:00
Andrew Ozz
ee6d178f15 TinyMCE: update to 4.0.20, see #24067
Built from https://develop.svn.wordpress.org/trunk@27603


git-svn-id: http://core.svn.wordpress.org/trunk@27446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-19 04:46:15 +00:00