Commit Graph

125 Commits

Author SHA1 Message Date
Andrew Ozz
e518fda253 Regex should be non-greedy, see #28389
Built from https://develop.svn.wordpress.org/trunk@28615


git-svn-id: http://core.svn.wordpress.org/trunk@28439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-29 07:56:14 +00:00
Andrew Ozz
500bfe7a54 TinyMCE: fix problems with undo/redo after resizing an image several times. Fixes #28389.
Built from https://develop.svn.wordpress.org/trunk@28614


git-svn-id: http://core.svn.wordpress.org/trunk@28438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-29 07:51:14 +00:00
Andrew Ozz
7b4d339454 TinyMCE: when adding a caption to an image that is in a paragraph with other text, move the caption node above the paragraph instead of below. See #27922, for trunk.
Built from https://develop.svn.wordpress.org/trunk@28190


git-svn-id: http://core.svn.wordpress.org/trunk@28020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-23 20:42:14 +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
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
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
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
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
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
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
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
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
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
Andrew Ozz
a322a0cd3d TinyMCE: move the caption and gallery toolbars to the right, fix selected gallery border/outline, see #27320
Built from https://develop.svn.wordpress.org/trunk@27579


git-svn-id: http://core.svn.wordpress.org/trunk@27422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-18 02:30:15 +00:00
Andrew Ozz
402f48ca15 TinyMCE:
- Update the styling of the image caption and gallery toolbars.
- Fix issue where the hidden clipboard div in wpView.
- Switch to using the pencil dashicon for Edit.
- Add `max-width: 100%;` to images in the gallery preview and adjust column widths.
Props cramdesign, mattheu, gcorne, melchoyce, see #27320, fixes #27376, fixes #27354

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


git-svn-id: http://core.svn.wordpress.org/trunk@27421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-18 00:20:15 +00:00
Andrew Ozz
88a47ecd06 TinyMCE editimage: show the toolbar on mouseup to avoid accidental clicks on the buttons, fixes #24409
Built from https://develop.svn.wordpress.org/trunk@27451


git-svn-id: http://core.svn.wordpress.org/trunk@27297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-07 06:34:14 +00:00
Andrew Ozz
62d68cc992 TinyMCE: when parsing [caption] and the width attribute is missing, recreate it from the image tag width, fixes #23103
Built from https://develop.svn.wordpress.org/trunk@27426


git-svn-id: http://core.svn.wordpress.org/trunk@27273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-06 00:13:14 +00:00
Andrew Ozz
511f12f793 When closing the various "edit" media modals, remove the related views elements from the DOM. Props gcorne, fixes #27204.
Built from https://develop.svn.wordpress.org/trunk@27276


git-svn-id: http://core.svn.wordpress.org/trunk@27132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-25 21:03:15 +00:00
Andrew Ozz
c908c8f708 Edit image in TinyMCE:
- Add a "toolbar" at the top of the image with two buttons: Edit and Delete.
- Don't open the edit modal on second click on the image. Makes the "edit" button somewhat pointless and can sometimes trigger after resizing the image.
- When the image has caption: attempt to prevent IE11 from making the caption element resizable and wrapping it in thick border.
- When the caret is inside a caption next to the image, pressing Enter will create a new <p> tag above the caption.
- Hide the image toolbar on drag, cut, align.
Props gcorne, see #24409.
Built from https://develop.svn.wordpress.org/trunk@27159


git-svn-id: http://core.svn.wordpress.org/trunk@27025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-10 23:48:12 +00:00
Andrew Ozz
c4f8dede57 TinyMCE: set the proper caption width when clicking image resize handle on image with caption. Props gcorne, fixes #27009, see #24067.
Built from https://develop.svn.wordpress.org/trunk@27098


git-svn-id: http://core.svn.wordpress.org/trunk@26969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-05 02:07:13 +00:00
Scott Taylor
0347a8944e Update the versions of several devDependencies in package.json. grunt-cssjanus has been updated to 0.2.2, we no longer need the fork. Run npm install to receive updates for node_modules in the project root.
Props yoavf, TobiasBg.
Fixes #26073.


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


git-svn-id: http://core.svn.wordpress.org/trunk@26927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-29 04:43:30 +00:00
Scott Taylor
e1759d668a For starters, [27050] is rad. This just cleans up some extra new lines that were littered about, updates *some* of the inline docs (needs more), moves wp.media.controller.ImageDetails closer to its parent class, and de-dupes some code in media-template.php.
See #24409.


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


git-svn-id: http://core.svn.wordpress.org/trunk@26925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-28 23:21:13 +00:00
Andrew Ozz
33eedc570b Introduce Edit Image (single mode) in the media modal and use it to edit images inserted in the editor. Adds new feature: replace an image in the editor. Props gcorne, see #24409.
Built from https://develop.svn.wordpress.org/trunk@27050


git-svn-id: http://core.svn.wordpress.org/trunk@26924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-28 21:17:12 +00:00
Andrew Ozz
1ddc17780a TinyMCE: add/remove the 'alignnone' class when aligning images without captions. See #24067.
Built from https://develop.svn.wordpress.org/trunk@26942


git-svn-id: http://core.svn.wordpress.org/trunk@26822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-14 05:52:09 +00:00
Andrew Ozz
6c0fe71d05 TinyMCE: re-enable soft resizing of images inside the editor. See #24067.
Built from https://develop.svn.wordpress.org/trunk@26934


git-svn-id: http://core.svn.wordpress.org/trunk@26815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-13 01:13:10 +00:00
Andrew Ozz
3373b5ff0f TinyMCE: 'wpdialogs' plugin, don't add the (external) UI dialogs element to the internal windows array, fix .close(). See #24067.
Built from https://develop.svn.wordpress.org/trunk@26900


git-svn-id: http://core.svn.wordpress.org/trunk@26783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-04 01:28:13 +00:00
Andrew Ozz
cf5aa6d6da TinyMCE:
- Fix removing leftovers from broken captions.
- Better filter for line breaks and <br> tags when editing captions.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26882


git-svn-id: http://core.svn.wordpress.org/trunk@26765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-31 03:10:11 +00:00
Andrew Ozz
a16cc19790 TinyMCE:
- Fix toolbar icons in IE9.
- Remove background gradients in IE < 10.
- Lint our plugins.
- Add draggable attribute to the caption wrapper and make the captioned images non-draggable in Chrome.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26880


git-svn-id: http://core.svn.wordpress.org/trunk@26763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-30 01:54:11 +00:00
Andrew Ozz
855889f7aa TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876


git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-28 23:53:15 +00:00
Andrew Nacin
bd265f4983 Fix JSHint errors in remaining WP TinyMCE plugin files.
fixes #26048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-15 15:05:09 +00:00
Andrew Nacin
d8564963b8 Temporarily remove CSS preprocessing until we can get our Ruby dependency sorted out.
see #25858, #22862.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-13 21:45:11 +00:00
Helen Hou-Sandí
437caa9972 Turns out it helps if you add those pesky Sass files if you're going to use a preprocessor. see #25858.
Built from https://develop.svn.wordpress.org/trunk@26139


git-svn-id: http://core.svn.wordpress.org/trunk@26050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-13 19:54:14 +00:00
Andrew Nacin
dfe0e26154 3.7 regression: Fix the width of captioned images inserted into the visual editor.
Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: https://github.com/mishoo/UglifyJS2/pull/330.

props LucP.
fixes #25700 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-26 02:51:09 +00:00
Andrew Nacin
1a2f89d5d0 Avoid a notice for an undefined $checksums variable when updating from pre-3.7 to post-3.7.
props GaryJ.
fixes #25689 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-25 20:15:10 +00:00
Andrew Nacin
70fd806759 Revert r25824:25875 from the core.svn.wordpress.org repository.
These commits were accidentally re-synced commits from develop.svn.wordpress.org due to a race condition. Thankfully, the history of this repository matters fairly little. It also happened only for trunk.


git-svn-id: http://core.svn.wordpress.org/trunk@25876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-25 02:29:52 +00:00
Andrew Ozz
65cd133a6f TinyMCE: add support for IE11.
- Add the latest changes from the 3.x branch upstream.
- Reduce the number of calls to tinyMCEPopup.restoreSelection() in our custom plugins.
- Remove the deprecated execCommand("mceBeginUndoLevel");.
See #25281.
Built from https://develop.svn.wordpress.org/trunk@25748


git-svn-id: http://core.svn.wordpress.org/trunk@25661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-09 21:05:10 +00:00
Andrew Nacin
2356b54f7e Build tinymce.js.gz using grunt.
props azaozz.
see #25159.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-30 22:17:15 +00:00
Andrew Ozz
8f3abb856a TinyMCE: always use js/editimage.js in the custom 'editimage' plugin, same way as the default TinyMCE plugins. Fixes #24999.
Built from https://develop.svn.wordpress.org/trunk@25022


git-svn-id: http://core.svn.wordpress.org/trunk@25013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-15 03:13:36 +00:00
Bot (Assets)
6e798324e9 New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory.
 * New task runner (Grunt), configured to copy a built WordPress to build/.
 * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
 * Remove Akismet external from develop.svn. Still exists in core.svn.
 * Drop minified files from src/. The build process will now generate these.

props koop.
see #24976.

and see http://wp.me/p2AvED-1AI.


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


git-svn-id: http://core.svn.wordpress.org/trunk@25001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-07 05:49:02 +00:00
Andrew Ozz
449156f3c8 Upgrade to TinyMCE 3.5.8, fixes #22755
git-svn-id: http://core.svn.wordpress.org/trunk@23090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 04:50:31 +00:00
Andrew Nacin
173806d7a1 Restore the Description field to the media UI in 3.5.
We tried in vain -- a noble but ultimately failed effort -- to reduce the number of fields for attachments from four (title, caption, alt, description) to one (caption for images, title otherwise). Alternative text needed to stay for accessibility reasons, of course.

Eventually title returned due to heavy plugin reliance. Description is too used by too many plugins (often times incorrectly -- the caption is more likely the proper field), hence its less-than-triumphant return today.

Version 3.5 has tried to streamline media in a number of ways. Removing fields may have been too much at once, as it forced not only a user interface change, but a paradigm change as well.

Finally, on upload we populate the description field with IPTC/EXIF captions, rather than the caption field. See #22768, this should be fixed. For now, Description stays.

This commit also restores 'Title' attribute editing to the main tab of the Edit Image dialog. The "Title" field no longer populates title attributes for <img> tags by design (for accessibility and other purposes, see #18984). So, here is a more obvious 'workaround' for the tooltip community.

Finally, this:
 * Cleans up the post.php attachment editor, including by showing a prettier form of the mime type.
 * Enables plugins to specifically hide attachment_fields_to_edit from either post.php (where you can create meta boxes) or the modal (which you may not want to clutter), for compatibility reasons.
 * Hides the 'Describe this file...' placeholder when a field is read-only in the modal.

props nacin, helenyhou.
fixes #22759.



git-svn-id: http://core.svn.wordpress.org/trunk@23083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 00:41:06 +00:00
Andrew Ozz
48ef1a9784 RTL: properly align the demo image in the Edit Image popup, props nacin, fixes #22733
git-svn-id: http://core.svn.wordpress.org/trunk@23039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 19:51:35 +00:00
Ryan Boren
d4abd95449 Scope button classes so they can be used on the frontend without interfering with theme styles.
Props helenyhou, koopersmith
fixes #22644


git-svn-id: http://core.svn.wordpress.org/trunk@22948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 13:40:59 +00:00
Ryan Boren
c9cf1508a6 In the edit image modal, move Title to the advanced section and move Caption above Alt.
Props nacin
fixes #22646


git-svn-id: http://core.svn.wordpress.org/trunk@22942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 04:09:17 +00:00
Bot (Assets)
c33e862097 Compress scripts/styles: 3.5-RC1-22860. TinyMCE updated.
git-svn-id: http://core.svn.wordpress.org/trunk@22860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 02:58:50 +00:00
Andrew Ozz
3fd9321c91 TinyMCE: improve hiding of the image/gallery popup buttons, fix selecting a gallery in IE, don't leave empty paragraph after deleting an image with the popup button, fixes #22463, see #21390
git-svn-id: http://core.svn.wordpress.org/trunk@22857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 01:31:51 +00:00