Changeset 8313
- Timestamp:
- 07/11/2008 03:59:14 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/gears-manifest.php
r8307 r8313 65 65 { 66 66 "betaManifestVersion" : 1, 67 "version" : "<?php echo $man_version; ?>_20080710 ",67 "version" : "<?php echo $man_version; ?>_20080710a", 68 68 "entries" : [ 69 69 <?php echo $defaults; ?> … … 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 c" },134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311d" }, 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" }, … … 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 c" },151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311d" }, 152 152 { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 153 153 … … 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 c" },164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311d" }, 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" }, -
trunk/wp-admin/includes/media.php
r8312 r8313 68 68 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 69 69 70 if ( empty($alt) ) return $html;70 if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html; 71 71 $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 72 72 … … 78 78 if ( empty($align) ) $align = 'none'; 79 79 80 $shcode = '[ wp_caption id="' . $id . '" align="align' . $align81 . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/ wp_caption]';80 $shcode = '[caption id="' . $id . '" align="align' . $align 81 . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]'; 82 82 83 83 return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); … … 509 509 if ( substr($post->post_mime_type, 0, 5) == 'image' ) { 510 510 $form_fields['post_title']['required'] = true; 511 $form_fields['post_excerpt']['label'] = __('Caption'); 512 $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"'); 511 512 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 513 $form_fields['post_excerpt']['label'] = __('Alternate Text'); 514 $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"'); 515 } else { 516 $form_fields['post_excerpt']['label'] = __('Caption'); 517 $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 518 } 513 519 514 520 $form_fields['post_content']['label'] = __('Description'); … … 599 605 $link = get_attachment_link($post->ID); 600 606 607 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) 608 $alt = __('Alternate Text'); 609 else 610 $alt = __('Caption'); 611 601 612 $form_fields = array( 602 613 'post_title' => array( … … 605 616 ), 606 617 'post_excerpt' => array( 607 'label' => __('Caption'),618 'label' => $alt, 608 619 'value' => $edit_post->post_excerpt, 609 620 ), … … 1008 1019 if ( f.alt.value ) { 1009 1020 alt = f.alt.value.replace(/['"<>]+/g, ''); 1021 <?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { ?> 1010 1022 caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 1023 <?php } ?> 1011 1024 } 1012 1025 … … 1019 1032 1020 1033 if ( caption ) 1021 html = '[ wp_caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/wp_caption]';1034 html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]'; 1022 1035 1023 1036 var win = window.dialogArguments || opener || parent || top; … … 1263 1276 1264 1277 function type_form_image() { 1265 return'1278 $form = ' 1266 1279 <table class="describe"><tbody> 1267 1280 <tr> … … 1280 1293 <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td> 1281 1294 </tr> 1282 1295 '; 1296 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 1297 $form .= ' 1298 <tr> 1299 <th valign="top" scope="row" class="label"> 1300 <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span> 1301 </th> 1302 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 1303 <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td> 1304 </tr> 1305 '; 1306 1307 } else { 1308 $form .= ' 1283 1309 <tr> 1284 1310 <th valign="top" scope="row" class="label"> … … 1288 1314 <p class="help">' . __('Also used as alternate text for the image') . '</p></td> 1289 1315 </tr> 1290 1316 '; 1317 } 1318 $form .= ' 1291 1319 <tr class="align"> 1292 1320 <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th> … … 1322 1350 </tbody></table> 1323 1351 '; 1352 1353 return $form; 1324 1354 } 1325 1355 -
trunk/wp-admin/js/editor.js
r8260 r8313 53 53 content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div'); 54 54 content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n'); 55 content = content.replace(new RegExp('\\s*\\[ wp_caption([^\\[]+)\\[/wp_caption\\]\\s*', 'gi'), '\n\n[wp_caption$1[/wp_caption]\n\n');56 content = content.replace(new RegExp(' wp_caption\\]\\n\\n+\\[wp_caption', 'g'), 'wp_caption]\n\n[wp_caption');55 content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n'); 56 content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption'); 57 57 58 58 var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; … … 167 167 pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1"); 168 168 pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1'); 169 pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[ wp_caption([^\\[]+)\\[/wp_caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[wp_caption$1[/wp_caption]');169 pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]'); 170 170 // pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 '); 171 171 -
trunk/wp-admin/js/media-upload.js
r8245 r8313 6 6 ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); 7 7 8 if ( h.indexOf('[ wp_caption') != -1 )8 if ( h.indexOf('[caption') != -1 ) 9 9 h = ed.plugins.wpeditimage._do_shcode(h); 10 10 -
trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
r8307 r8313 5 5 <title></title> 6 6 7 <script type="text/javascript" src="js/editimage.js?ver=311 c"></script>7 <script type="text/javascript" src="js/editimage.js?ver=311d"></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 c" type="text/css" media="all" />10 <link rel="stylesheet" href="css/editimage.css?ver=311d" type="text/css" media="all" /> 11 11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta3" type="text/css" media="all" /> 12 12 <script type="text/javascript"> … … 86 86 </tr> 87 87 88 <tr >88 <tr id="cap_field"> 89 89 <th valign="top" scope="row" class="label"> 90 90 <label for="img_cap"> -
trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
r8307 r8313 88 88 89 89 _do_shcode : function(co) { 90 return co.replace(/\[ wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){90 return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){ 91 91 b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); 92 92 c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); … … 102 102 var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; 103 103 104 return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp _caption '+cls+'" style="width: '+(10+parseInt(w))+105 'px"><dt class="wp _caption_dt">'+c+'</dt><dd class="wp_caption_dd">'+cap+'</dd></dl></div>';104 return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+ 105 'px"><dt class="wp-caption-dt">'+c+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>'; 106 106 }); 107 107 }, … … 120 120 cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"'); 121 121 122 return '[ wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]';122 return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; 123 123 }); 124 124 }, -
trunk/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
r8307 r8313 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 251 if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) ) 252 t.I('cap_field').style.display = 'none'; 253 250 254 tinyMCEPopup.restoreSelection(); 251 255 el = ed.selection.getNode(); … … 266 270 267 271 tinymce.each(DL.childNodes, function(e) { 268 if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp _caption_dd') ) {272 if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp-caption-dd') ) { 269 273 caption = e.innerHTML; 270 274 return; … … 424 428 if ( DL ) { 425 429 ed.dom.setAttribs(DL, { 426 'class' : 'wp _caption '+t.align,430 'class' : 'wp-caption '+t.align, 427 431 style : 'width: '+cap_width+'px;' 428 432 }); … … 431 435 ed.dom.setAttrib(DIV, 'class', div_cls); 432 436 433 if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp _caption_dd') )437 if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp-caption-dd') ) 434 438 ed.dom.setHTML(DD, f.img_cap.value); 435 439 … … 449 453 } else html = ed.dom.getOuterHTML(el); 450 454 451 html = '<dl id="'+cap_id+'" class="wp _caption '+t.align+'" style="width: '+cap_width+452 'px"><dt class="wp _caption_dt">'+html+'</dt><dd class="wp_caption_dd">'+f.img_cap.value+'</dd></dl>';455 html = '<dl id="'+cap_id+'" class="wp-caption '+t.align+'" style="width: '+cap_width+ 456 'px"><dt class="wp-caption-dt">'+html+'</dt><dd class="wp-caption-dd">'+f.img_cap.value+'</dd></dl>'; 453 457 454 458 cap = ed.dom.create('div', {'class': div_cls}, html); -
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r8307 r8313 130 130 $mce_buttons_4 = apply_filters('mce_buttons_4', array()); 131 131 $mce_buttons_4 = implode($mce_buttons_4, ','); 132 133 $do_captions = ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ? false : true; 132 134 133 135 // TinyMCE init settings … … 164 166 'content_css' => "$mce_css", 165 167 'save_callback' => 'switchEditors.saveCallback', 168 'wpeditimage_do_captions' => $do_captions, 166 169 'plugins' => "$plugins", 167 170 // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" … … 223 226 if ( $disk_cache ) { 224 227 225 $cacheKey = apply_filters('tiny_mce_version', '200807 09');228 $cacheKey = apply_filters('tiny_mce_version', '20080710'); 226 229 227 230 foreach ( $initArray as $v ) -
trunk/wp-includes/js/tinymce/wordpress.css
r8239 r8313 16 16 } 17 17 18 .wp _caption {18 .wp-caption { 19 19 border: 1px solid #ddd; 20 20 text-align: center; … … 28 28 } 29 29 30 .wp _caption img {30 .wp-caption img { 31 31 margin: 0; 32 32 padding: 0; … … 34 34 } 35 35 36 .wp _caption_dd {36 .wp-caption-dd { 37 37 font-size: 11px; 38 38 line-height: 17px; -
trunk/wp-includes/media.php
r8289 r8313 352 352 353 353 add_shortcode('wp_caption', 'img_caption_shortcode'); 354 add_shortcode('caption', 'img_caption_shortcode'); 354 355 355 356 function img_caption_shortcode($attr, $content = null) { 356 357 358 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) 359 return $content; 360 357 361 // Allow plugins/themes to override the default caption template. 358 362 $output = apply_filters('img_caption_shortcode', '', $attr, $content); -
trunk/wp-includes/script-loader.php
r8307 r8313 35 35 $scripts->add( 'editor', false, $visual_editor, '20080321' ); 36 36 37 $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '200807 06' );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', '200807 09');40 $mce_version = apply_filters('tiny_mce_version', '20080710'); 41 41 $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 42 42 … … 160 160 ) ); 161 161 $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080709' ); 162 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '200807 02' );162 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080710' ); 163 163 $scripts->localize( 'upload', 'uploadL10n', array( 164 164 'browseTitle' => attribute_escape(__('Browse your files')),
Note: See TracChangeset
for help on using the changeset viewer.