diff --git a/wp-admin/gears-manifest.php b/wp-admin/gears-manifest.php index 961fdb23f..ba965a4e0 100644 --- a/wp-admin/gears-manifest.php +++ b/wp-admin/gears-manifest.php @@ -64,7 +64,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); ?> { "betaManifestVersion" : 1, -"version" : "_20080710", +"version" : "_20080710a", "entries" : [ @@ -131,7 +131,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); { "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, -{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311c" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311d" }, { "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" }, @@ -148,7 +148,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, -{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311c" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311d" }, { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" }, @@ -161,7 +161,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, -{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311c" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311d" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index fe9eb265e..0cb7e373f 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -67,7 +67,7 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { - if ( empty($alt) ) return $html; + if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html; $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; preg_match( '/width="([0-9]+)/', $html, $matches ); @@ -77,8 +77,8 @@ function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { $html = preg_replace( '/align[^\s\'"]+\s?/', '', $html ); if ( empty($align) ) $align = 'none'; - $shcode = '[wp_caption id="' . $id . '" align="align' . $align - . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/wp_caption]'; + $shcode = '[caption id="' . $id . '" align="align' . $align + . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]'; return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); } @@ -508,8 +508,14 @@ function media_upload_library() { function image_attachment_fields_to_edit($form_fields, $post) { if ( substr($post->post_mime_type, 0, 5) == 'image' ) { $form_fields['post_title']['required'] = true; - $form_fields['post_excerpt']['label'] = __('Caption'); - $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"'); + + if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { + $form_fields['post_excerpt']['label'] = __('Alternate Text'); + $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"'); + } else { + $form_fields['post_excerpt']['label'] = __('Caption'); + $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); + } $form_fields['post_content']['label'] = __('Description'); @@ -598,13 +604,18 @@ function get_attachment_fields_to_edit($post, $errors = null) { $file = wp_get_attachment_url($post->ID); $link = get_attachment_link($post->ID); + if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) + $alt = __('Alternate Text'); + else + $alt = __('Caption'); + $form_fields = array( 'post_title' => array( 'label' => __('Title'), 'value' => $edit_post->post_title, ), 'post_excerpt' => array( - 'label' => __('Caption'), + 'label' => $alt, 'value' => $edit_post->post_excerpt, ), 'post_content' => array( @@ -1007,7 +1018,9 @@ var addExtImage = { if ( f.alt.value ) { alt = f.alt.value.replace(/['"<>]+/g, ''); + caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); + } cls = caption ? '' : ' class="'+t.align+'"'; @@ -1018,7 +1031,7 @@ var addExtImage = { html = ''+html+''; if ( caption ) - html = '[wp_caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/wp_caption]'; + html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]'; var win = window.dialogArguments || opener || parent || top; win.send_to_editor(html); @@ -1262,7 +1275,7 @@ jQuery(function($){ } function type_form_image() { - return ' + $form = ' +'; + if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { + $form .= ' + + + + +'; + } else { + $form .= ' - +'; + } + $form .= '
@@ -1279,7 +1292,20 @@ function type_form_image() {

+ + +

' . __('Alt text for the image, e.g. "The Mona Lisa"') . '

@@ -1287,7 +1313,9 @@ function type_form_image() {

' . __('Also used as alternate text for the image') . '

@@ -1321,6 +1349,8 @@ function type_form_image() {
'; + + return $form; } function type_form_audio() { diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js index 7f5875ad0..4b32f1b10 100644 --- a/wp-admin/js/editor.js +++ b/wp-admin/js/editor.js @@ -52,8 +52,8 @@ switchEditors = { // Fix some block element newline issues content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); - content = content.replace(new RegExp('\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*', 'gi'), '\n\n[wp_caption$1[/wp_caption]\n\n'); - content = content.replace(new RegExp('wp_caption\\]\\n\\n+\\[wp_caption', 'g'), 'wp_caption]\n\n[wp_caption'); + content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n'); + content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption'); var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>'); @@ -166,7 +166,7 @@ switchEditors = { pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "
\n"); pee = pee.replace(new RegExp('(]*>)\\s*
', 'gi'), "$1"); pee = pee.replace(new RegExp('
(\\s*)', 'gi'), '$1'); - pee = pee.replace(new RegExp('(?:

|
)*\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*(?:

|
)*', 'gi'), '[wp_caption$1[/wp_caption]'); + pee = pee.replace(new RegExp('(?:

|
)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:

|
)*', 'gi'), '[caption$1[/caption]'); // pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 '); // Fix the pre|script tags diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js index 3a034ac9f..4d4065bc1 100644 --- a/wp-admin/js/media-upload.js +++ b/wp-admin/js/media-upload.js @@ -5,7 +5,7 @@ function send_to_editor(h) { if (tinymce.isIE) ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); - if ( h.indexOf('[wp_caption') != -1 ) + if ( h.indexOf('[caption') != -1 ) h = ed.plugins.wpeditimage._do_shcode(h); ed.execCommand('mceInsertContent', false, h); diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html index 49b82c81c..a9f1c1556 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html @@ -4,10 +4,10 @@ - + - +