Ticket #6812: img_captions7.patch
File img_captions7.patch, 11.5 KB (added by , 16 years ago) |
---|
-
wp-admin/gears-manifest.php
64 64 ?> 65 65 { 66 66 "betaManifestVersion" : 1, 67 "version" : "<?php echo $man_version; ?>_2008071 0a",67 "version" : "<?php echo $man_version; ?>_20080712", 68 68 "entries" : [ 69 69 <?php echo $defaults; ?> 70 70 … … 131 131 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" }, 132 132 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, 133 133 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, 134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311 d" },134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311e" }, 135 135 { "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, 136 136 { "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, 137 137 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" }, … … 148 148 { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" }, 149 149 { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, 150 150 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, 151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311 d" },151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311e" }, 152 152 { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 153 153 154 154 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" }, … … 161 161 { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" }, 162 162 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, 163 163 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, 164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311 d" },164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311e" }, 165 165 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, 166 166 { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, 167 167 -
wp-admin/includes/media.php
67 67 68 68 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 69 69 70 // CAPTIONS_OFF is temporary. Do not use it. 71 if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html; 70 if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html; 72 71 $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 73 72 74 73 preg_match( '/width="([0-9]+)/', $html, $matches ); … … 510 509 if ( substr($post->post_mime_type, 0, 5) == 'image' ) { 511 510 $form_fields['post_title']['required'] = true; 512 511 513 // CAPTIONS_OFF is temporary. Do not use it. 514 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 515 $form_fields['post_excerpt']['label'] = __('Alternate Text'); 516 $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"'); 517 } else { 518 $form_fields['post_excerpt']['label'] = __('Caption'); 519 $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 520 } 512 $form_fields['post_excerpt']['label'] = __('Caption'); 513 $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 521 514 522 515 $form_fields['post_content']['label'] = __('Description'); 523 516 … … 606 599 $file = wp_get_attachment_url($post->ID); 607 600 $link = get_attachment_link($post->ID); 608 601 609 // CAPTIONS_OFF is temporary. Do not use it.610 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )611 $alt = __('Alternate Text');612 else613 $alt = __('Caption');614 615 602 $form_fields = array( 616 603 'post_title' => array( 617 604 'label' => __('Title'), 618 605 'value' => $edit_post->post_title, 619 606 ), 620 607 'post_excerpt' => array( 621 'label' => $alt,608 'label' => __('Caption'), 622 609 'value' => $edit_post->post_excerpt, 623 610 ), 624 611 'post_content' => array( … … 1021 1008 1022 1009 if ( f.alt.value ) { 1023 1010 alt = f.alt.value.replace(/['"<>]+/g, ''); 1024 <?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { // CAPTIONS_OFF is temporary. Do not use it.?>1011 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?> 1025 1012 caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 1026 1013 <?php } ?> 1027 1014 } … … 1278 1265 } 1279 1266 1280 1267 function type_form_image() { 1281 $form = ' 1268 1269 if ( apply_filters( 'disable_captions', '' ) ) { 1270 $alt = __('Alternate Text'); 1271 $alt_help = __('Alt text for the image, e.g. "The Mona Lisa"'); 1272 } else { 1273 $alt = __('Image Caption'); 1274 $alt_help = __('Also used as alternate text for the image'); 1275 } 1276 1277 return ' 1282 1278 <table class="describe"><tbody> 1283 1279 <tr> 1284 1280 <th valign="top" scope="row" class="label" style="width:120px;"> … … 1295 1291 </th> 1296 1292 <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td> 1297 1293 </tr> 1298 ';1299 // CAPTIONS_OFF is temporary. Do not use it.1300 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) {1301 $form .= '1302 <tr>1303 <th valign="top" scope="row" class="label">1304 <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span>1305 </th>1306 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />1307 <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td>1308 </tr>1309 ';1310 1294 1311 } else {1312 $form .= '1313 1295 <tr> 1314 1296 <th valign="top" scope="row" class="label"> 1315 <span class="alignleft"><label for="alt">' . __('Image Caption'). '</label></span>1297 <span class="alignleft"><label for="alt">' . $alt . '</label></span> 1316 1298 </th> 1317 1299 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 1318 <p class="help">' . __('Also used as alternate text for the image'). '</p></td>1300 <p class="help">' . $alt_help . '</p></td> 1319 1301 </tr> 1320 '; 1321 } 1322 $form .= ' 1302 1323 1303 <tr class="align"> 1324 1304 <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th> 1325 1305 <td class="field"> … … 1354 1334 </tbody></table> 1355 1335 '; 1356 1336 1357 return $form;1358 1337 } 1359 1338 1360 1339 function type_form_audio() { … … 1498 1477 1499 1478 add_filter('media_upload_library', 'media_upload_library'); 1500 1479 1501 ?> 1480 ?> 1481 No newline at end of file -
wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
4 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 5 <title></title> 6 6 7 <script type="text/javascript" src="js/editimage.js?ver=311 d"></script>7 <script type="text/javascript" src="js/editimage.js?ver=311e"></script> 8 8 <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> 9 9 10 <link rel="stylesheet" href="css/editimage.css?ver=311 d" type="text/css" media="all" />11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6 -beta3" type="text/css" media="all" />10 <link rel="stylesheet" href="css/editimage.css?ver=311e" type="text/css" media="all" /> 11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6" type="text/css" media="all" /> 12 12 <script type="text/javascript"> 13 13 if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) 14 14 document.write('<link rel="stylesheet" href="css/editimage-rtl.css?ver=311" type="text/css" media="all" />'); -
wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
15 15 if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' ) 16 16 return; 17 17 18 tb_show('', url + '/editimage.html?ver=311 c&TB_iframe=true');18 tb_show('', url + '/editimage.html?ver=311e&TB_iframe=true'); 19 19 tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 20 20 }); 21 21 -
wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
248 248 var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption = null; 249 249 document.dir = tinyMCEPopup.editor.getParam('directionality',''); 250 250 251 if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) )251 if ( tinyMCEPopup.editor.getParam('wpeditimage_disable_captions', false) ) 252 252 t.I('cap_field').style.display = 'none'; 253 253 254 254 tinyMCEPopup.restoreSelection(); -
wp-includes/js/tinymce/tiny_mce_config.php
130 130 $mce_buttons_4 = apply_filters('mce_buttons_4', array()); 131 131 $mce_buttons_4 = implode($mce_buttons_4, ','); 132 132 133 $ do_captions = ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ? false : true;133 $no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false; 134 134 135 135 // TinyMCE init settings 136 136 $initArray = array ( … … 165 165 'tab_focus' => ':next', 166 166 'content_css' => "$mce_css", 167 167 'save_callback' => 'switchEditors.saveCallback', 168 'wpeditimage_d o_captions' => $do_captions,168 'wpeditimage_disable_captions' => $no_captions, 169 169 'plugins' => "$plugins", 170 170 // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" 171 171 'disk_cache' => true, … … 225 225 // Setup cache info 226 226 if ( $disk_cache ) { 227 227 228 $cacheKey = apply_filters('tiny_mce_version', '2008071 0');228 $cacheKey = apply_filters('tiny_mce_version', '20080712'); 229 229 230 230 foreach ( $initArray as $v ) 231 231 $cacheKey .= $v; -
wp-includes/media.php
355 355 356 356 function img_caption_shortcode($attr, $content = null) { 357 357 358 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )359 return $content;360 361 358 // Allow plugins/themes to override the default caption template. 362 359 $output = apply_filters('img_caption_shortcode', '', $attr, $content); 363 360 if ( $output != '' ) -
wp-includes/script-loader.php
37 37 $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080710' ); 38 38 39 39 // Modify this version when tinyMCE plugins are changed. 40 $mce_version = apply_filters('tiny_mce_version', '2008071 0');40 $mce_version = apply_filters('tiny_mce_version', '20080712'); 41 41 $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 42 42 43 43 $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');