diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-07-07 17:16:43 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-07-07 17:16:43 +0000 |
commit | 6081c995737157ea06244568c48570148b08258f (patch) | |
tree | c74a90925305ffff924a8261efd1d92265e3146c | |
parent | 62cf455ec3bed02f518048f8ddca91a23e6b95a4 (diff) | |
download | wordpress-mu-6081c995737157ea06244568c48570148b08258f.tar.gz wordpress-mu-6081c995737157ea06244568c48570148b08258f.tar.xz wordpress-mu-6081c995737157ea06244568c48570148b08258f.zip |
WP Merge to revision 8266
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1355 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r-- | wp-admin/css/press-this.css | 6 | ||||
-rw-r--r-- | wp-admin/gears-manifest.php | 7 | ||||
-rw-r--r-- | wp-admin/includes/media.php | 1 | ||||
-rw-r--r-- | wp-admin/includes/plugin.php | 10 | ||||
-rw-r--r-- | wp-admin/includes/widgets.php | 2 | ||||
-rw-r--r-- | wp-admin/js/editor.js | 1 | ||||
-rw-r--r-- | wp-admin/js/gallery.js | 2 | ||||
-rw-r--r-- | wp-admin/press-this.php | 8 | ||||
-rw-r--r-- | wp-includes/classes.php | 4 | ||||
-rw-r--r-- | wp-includes/functions.php | 2 | ||||
-rw-r--r-- | wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js | 110 | ||||
-rw-r--r-- | wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js | 38 | ||||
-rw-r--r-- | wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js | 56 | ||||
-rw-r--r-- | wp-includes/js/tinymce/tiny_mce_config.php | 2 | ||||
-rw-r--r-- | wp-includes/media.php | 4 | ||||
-rw-r--r-- | wp-includes/post.php | 2 | ||||
-rw-r--r-- | wp-includes/script-loader.php | 8 | ||||
-rw-r--r-- | wp-includes/wp-diff.php | 2 |
18 files changed, 141 insertions, 124 deletions
diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css index 71a4125..005e13f 100644 --- a/wp-admin/css/press-this.css +++ b/wp-admin/css/press-this.css @@ -428,7 +428,6 @@ padding-bottom: .25em; position: absolute; top: 20px; right: 25px; -background: white; padding: 5px; } #TB_ajaxContent h3 { @@ -505,3 +504,8 @@ margin-bottom: 8px; #footer p a:hover { text-decoration: underline; +} + +.centered { + text-align: center; +} diff --git a/wp-admin/gears-manifest.php b/wp-admin/gears-manifest.php index c8ea433..7daed22 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" : "<?php echo $man_version; ?>_20080703", +"version" : "<?php echo $man_version; ?>_20080704", "entries" : [ <?php echo $defaults; ?> @@ -97,6 +97,8 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); { "url" : "images/toggle-arrow.gif" }, { "url" : "images/wordpress-logo.png" }, { "url" : "images/xit.gif" }, +{ "url" : "images/loading-publish.gif" }, +{ "url" : "images/loading.gif" }, { "url" : "../wp-includes/images/crystal/archive.png" }, { "url" : "../wp-includes/images/crystal/audio.png" }, @@ -127,6 +129,9 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); { "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=311" }, +{ "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" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311" }, diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index a79944a..89a3040 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -720,6 +720,7 @@ function get_media_item( $attachment_id, $args = null ) { } $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case + $display_title = wp_html_excerpt($display_title, 100); $item = " $type diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 72acd45..2822dac 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -470,18 +470,16 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) { $parent = get_admin_page_parent(); + $page_type = 'admin'; if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) { if ( isset( $admin_page_hooks[$plugin_page] )) $page_type = 'toplevel'; else if ( isset( $admin_page_hooks[$parent] )) $page_type = $admin_page_hooks[$parent]; - } else - if ( isset( $admin_page_hooks[$parent_page] ) ) { - $page_type = $admin_page_hooks[$parent_page]; - } else { - $page_type = 'admin'; - } + } else if ( isset( $admin_page_hooks[$parent_page] ) ) { + $page_type = $admin_page_hooks[$parent_page]; + } $plugin_name = preg_replace( '!\.php!', '', $plugin_page ); diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index 79a4f1a..52d1d7b 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -64,7 +64,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) { if ( 'all' == $show && $is_multi ) { // it's a multi-widget. We only need to show it in the list once. $already_shown[] = $widget['callback']; - $num = (int) array_pop( explode( '-', $widget['id'] ) ); + $num = (int) array_pop( $ids = explode( '-', $widget['id'] ) ); $id_base = $wp_registered_widget_controls[$widget['id']]['id_base']; // so that we always add a new one when clicking "add" while ( isset($wp_registered_widgets["$id_base-$num"]) ) diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js index d2049e4..7f5875a 100644 --- a/wp-admin/js/editor.js +++ b/wp-admin/js/editor.js @@ -53,6 +53,7 @@ switchEditors = { content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div'); content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\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'); 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>'); diff --git a/wp-admin/js/gallery.js b/wp-admin/js/gallery.js index aae0221..f29573b 100644 --- a/wp-admin/js/gallery.js +++ b/wp-admin/js/gallery.js @@ -10,7 +10,7 @@ jQuery(function($) { // When an update has occurred, adjust the order for each item var galleryReorder = function(e, sort) { - jQuery.each(sort['instance'].toArray(), function(i, id) { + jQuery.each(sort['element'].sortable('toArray'), function(i, id) { jQuery('#' + id + ' .menu_order input')[0].value = i; }); } diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index 56d5a27..5957803 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -136,10 +136,10 @@ if($_REQUEST['ajax'] == 'thickbox') { ?> <input id="this_photo_description" name="photo_description" class="text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo attribute_escape($title);?>"/> </div> - <p><input type="hidden" name="this_photo" value="<?php echo attribute_escape($image); ?>" id="this_photo" /> - <a href="#" class="select"><img src="<?php echo clean_url($image); ?>" width="475" alt="<?php echo attribute_escape(__('Click to insert.')); ?>" title="<?php echo attribute_escape(__('Click to insert.')); ?>" /></a></p> + <p class="centered"><input type="hidden" name="this_photo" value="<?php echo attribute_escape($image); ?>" id="this_photo" /> + <a href="#" class="select"><img src="<?php echo clean_url($image); ?>" alt="<?php echo attribute_escape(__('Click to insert.')); ?>" title="<?php echo attribute_escape(__('Click to insert.')); ?>" /></a></p> - <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> + <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p> <?php die; } @@ -295,7 +295,7 @@ if($_REQUEST['ajax'] == 'photo') { ?> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> <title><?php _e('Press This') ?></title> - <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce.js"></script> + <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce.js?ver=311"></script> <?php add_thickbox(); wp_enqueue_style('press-this'); diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 289b27e..62196ee 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -91,6 +91,10 @@ class WP { // Look for matches. $request_match = $request; foreach ($rewrite as $match => $query) { + // Don't try to match against AtomPub calls + if ( $req_uri == 'wp-app.php' ) + break; + // If the requesting file is the anchor of the match, prepend it // to the path info. if ((! empty($req_uri)) && (strpos($match, $req_uri) === 0) && ($req_uri != $request)) { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 0fe154d..bcec475 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2255,7 +2255,7 @@ function validate_file( $file, $allowed_files = '' ) { * @return bool True if SSL, false if not used. */ function is_ssl() { - return ( 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; + return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; } /** diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index ab3eb12..faff841 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -127,68 +127,48 @@ }); // Add Media buttons to fullscreen - ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { - if ( 'mceFullScreen' != cmd ) return; + ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + if ( 'mceFullScreen' != cmd ) return; if ( 'mce_fullscreen' != ed.id ) ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media'; - }); + }); // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images. - ed.onExecCommand.add(function( ed, cmd ) { - var n, bl, dom = ed.dom; - - if ( 'JustifyCenter' == cmd ) { - tinymce.each(dom.select('img'), function(n) { - var v = n.className; - - if (v.indexOf('aligncenter') == -1) { - dom.getParent(n, function(P) { - if (P && P.style && P.style.textAlign == 'center') - dom.setStyle(P, 'textAlign', ''); - }); - } - }); + ed.addCommand('JustifyLeft', function() { + var n = ed.selection.getNode(); - ed.execCommand('mceRepaint'); - } + if ( n.nodeName != 'IMG' ) + ed.editorCommands.mceJustify('JustifyLeft', 'left'); + else ed.plugins.wordpress.do_align(n, 'alignleft'); }); - ed.onBeforeExecCommand.add(function( ed, cmd ) { - var n, dir, xdir, bl, dom = ed.dom; - - if ( ( cmd.indexOf('Justify') != -1 ) && ( n = ed.selection.getNode() ) ) { - if ( 'JustifyFull' == cmd || n.nodeName !== 'IMG' ) return; - dir = cmd.substring(7).toLowerCase(); - - if ( ed.queryCommandState( cmd ) ) { - n.className = n.className.replace(/align[^ '"]+\s?/g, ''); - dom.addClass( n, "alignnone" ); - } else if ( 'JustifyCenter' == cmd ) { - n.className = n.className.replace(/alignleft\s?|alignright\s?|alignnone\s?/g, ''); - if ( dom.hasClass( n, "aligncenter" ) ) { - dom.removeClass( n, "aligncenter" ); - dom.addClass( n, "alignnone" ); - } else - dom.addClass( n, "aligncenter" ); - - } else { - n.className = n.className.replace(/align[^ '"]+\s?/g, ''); - dom.addClass( n, "align"+dir ); - } - } + ed.addCommand('JustifyRight', function() { + var n = ed.selection.getNode(); + + if ( n.nodeName != 'IMG' ) + ed.editorCommands.mceJustify('JustifyRight', 'right'); + else ed.plugins.wordpress.do_align(n, 'alignright'); }); - // Word count if script is loaded - if ( 'undefined' != typeof wpWordCount ) { - var last = 0; - ed.onKeyUp.add(function(ed, e) { - if ( e.keyCode == last ) return; - if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); - last = e.keyCode; - }); - }; - - // Add listeners to handle more break + ed.addCommand('JustifyCenter', function() { + var n = ed.selection.getNode(), P = ed.dom.getParent(n, 'p'), DL = ed.dom.getParent(n, 'dl'); + + if ( n.nodeName == 'IMG' && ( P || DL ) ) + ed.plugins.wordpress.do_align(n, 'aligncenter'); + else ed.editorCommands.mceJustify('JustifyCenter', 'center'); + }); + + // Word count if script is loaded + if ( 'undefined' != typeof wpWordCount ) { + var last = 0; + ed.onKeyUp.add(function(ed, e) { + if ( e.keyCode == last ) return; + if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); + last = e.keyCode; + }); + }; + + // Add listeners to handle more break t._handleMoreBreak(ed, url); // Add custom shortcuts @@ -227,6 +207,30 @@ }, // Internal functions + do_align : function(n, a) { + var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor; + + P = ed.dom.getParent(n, 'p'); + DL = ed.dom.getParent(n, 'dl'); + DIV = ed.dom.getParent(n, 'div'); + + if ( DL && DIV ) { + cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a; + DL.className = DL.className.replace(/align[^ '"]+\s?/g, ''); + ed.dom.addClass(DL, cls); + c = (cls == 'aligncenter') ? ed.dom.addClass(DIV, 'mceIEcenter') : ed.dom.removeClass(DIV, 'mceIEcenter'); + } else if ( P ) { + cls = ed.dom.hasClass(n, a) ? 'alignnone' : a; + n.className = n.className.replace(/align[^ '"]+\s?/g, ''); + ed.dom.addClass(n, cls); + if ( cls == 'aligncenter' ) + ed.dom.setStyle(P, 'textAlign', 'center'); + else if (P.style && P.style.textAlign == 'center') + ed.dom.setStyle(P, 'textAlign', ''); + } + + ed.execCommand('mceRepaint'); + }, // Resizes the iframe by a relative height value _resizeIframe : function(ed, tb_id, dy) { diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js index 230746e..7e6b4ba 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js @@ -21,16 +21,16 @@ ed.onInit.add(function(ed) { tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { - ed.plugins.wpeditimage.hideButtons(); + ed.plugins.wpeditimage.hideButtons(); }); }); ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { ed.plugins.wpeditimage.hideButtons(); - }); + }); ed.onSaveContent.add(function(ed, o) { - ed.plugins.wpeditimage.hideButtons(); + ed.plugins.wpeditimage.hideButtons(); }); ed.onMouseUp.add(function(ed, e) { @@ -63,8 +63,8 @@ }); ed.onBeforeSetContent.add(function(ed, o) { - o.content = t._do_shcode(o.content); - }); + o.content = t._do_shcode(o.content); + }); ed.onPostProcess.add(function(ed, o) { if (o.get) @@ -74,8 +74,8 @@ _do_shcode : function(co) { return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){ - var id = b.match(/id=['"]([^'"]+)/), cls = b.match(/align=['"]([^'"]+)/); - var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/); + var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); + var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i); id = ( id && id[1] ) ? id[1] : ''; cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; @@ -91,8 +91,8 @@ }, _get_shcode : function(co) { - return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>([^<]+)<\/dd>\s*<\/dl>\s*<\/div>\s*/g, function(a,b,c,cap){ - var id = b.match(/id=['"]([^'"]+)/), cls = b.match(/class=['"]([^'"]+)/); + return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>([^<]+)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ + var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i); var w = c.match(/width=['"]([0-9]+)/); id = ( id && id[1] ) ? id[1] : ''; @@ -100,26 +100,12 @@ w = ( w && w[1] ) ? w[1] : ''; if ( ! w || ! cap ) return c; - cls = cls ? cls.match(/align[^ '"]+/) : ''; + cls = cls.match(/align[^ '"]+/) || 'alignnone'; return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]'; }); }, - _fixCenter : function(c) { - var ed = tinyMCE.activeEditor; - - tinymce.each(ed.dom.select('img', c), function(n) { - if ( ed.dom.hasClass(n, 'aligncenter') ) { - var P = ed.dom.getParent(n, 'p'); - if ( tinymce.isIE ) - ed.dom.addClass(P, 'mce_iecenter'); - if ( P.style && P.style.textAlign == 'center' ) - ed.dom.setStyle(P, 'textAlign', ''); - } - }); - }, - showButtons : function(n) { var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; @@ -172,7 +158,7 @@ ed.windowManager.bookmark = ed.selection.getBookmark('simple'); ed.execCommand("WP_EditImage"); this.parentNode.style.display = 'none'; - } + }; var wp_delimgbtn = DOM.add('wp_editbtns', 'img', { src : t.url+'/img/delete.png', @@ -196,7 +182,7 @@ ed.execCommand('mceRepaint'); return false; } - } + }; }, getInfo : function() { diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js index 89b4d71..fb1d2d8 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js @@ -260,11 +260,11 @@ var wpImage = { if ( DL = dom.getParent(el, 'dl') ) { var dlc = ed.dom.getAttrib(DL, 'class'); dlc = dlc.match(/align[^ "']+/i); - if ( ! dom.hasClass(el, dlc) ) + if ( dlc && ! dom.hasClass(el, dlc) ) c += ' '+dlc; - + tinymce.each(DL.childNodes, function(e) { - if ( e.nodeName == 'DD' ) { + if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp_caption_dd') ) { caption = e.innerHTML; return; } @@ -377,16 +377,10 @@ var wpImage = { 'class' : img_class }); - if ( ! f.link_href.value ) { - if ( A ) { - b = ed.selection.getBookmark(); - ed.dom.remove(A, 1); - ed.selection.moveToBookmark(b); - } - } else { + if ( f.link_href.value ) { // Create new anchor elements if ( A == null ) { - if ( ! f.link_href.value.match(/https?:\/\//) ) + if ( ! f.link_href.value.match(/https?:\/\//i) ) f.link_href.value = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.link_href.value); if ( tinymce.isWebKit && ed.dom.hasClass(el, 'aligncenter') ) { @@ -431,18 +425,26 @@ var wpImage = { style : 'width: '+cap_width+'px;' }); - if ( DIV ) + if ( DIV ) ed.dom.setAttrib(DIV, 'class', div_cls); if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp_caption_dd') ) ed.dom.setHTML(DD, f.img_alt.value); } else { + var lnk = '', pa; if ( (id = f.img_classes.value.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) cap_id = 'attachment_'+id[1]; - if ( f.link_href.value ) html = ed.dom.getOuterHTML(ed.dom.getParent(el, 'a')); - else html = ed.dom.getOuterHTML(el); + if ( f.link_href.value && (lnk = ed.dom.getParent(el, 'a')) ) { + if ( lnk.childNodes.length == 1 ) + html = ed.dom.getOuterHTML(lnk); + else { + html = ed.dom.getOuterHTML(lnk); + html = html.match(/<a[^>]+>/i); + html = html+ed.dom.getOuterHTML(el)+'</a>'; + } + } else html = ed.dom.getOuterHTML(el); html = '<dl id="'+cap_id+'" class="wp_caption '+t.align+'" style="width: '+cap_width+ 'px"><dt class="wp_caption_dt">'+html+'</dt><dd class="wp_caption_dd">'+f.img_alt.value+'</dd></dl>'; @@ -451,19 +453,25 @@ var wpImage = { if ( P ) { P.parentNode.insertBefore(cap, P); - ed.dom.remove(P); + if ( P.childNodes.length == 1 ) + ed.dom.remove(P); + else if ( lnk && lnk.childNodes.length == 1 ) + ed.dom.remove(lnk); + else ed.dom.remove(el); + } else if ( pa = ed.dom.getParent(el, 'TD,TH,LI') ) { + pa.appendChild(cap); + if ( lnk && lnk.childNodes.length == 1 ) + ed.dom.remove(lnk); + else ed.dom.remove(el); } } - tinyMCEPopup.execCommand("mceEndUndoLevel"); - ed.execCommand('mceRepaint'); - tinyMCEPopup.close(); - return; } else { if ( DL && DIV ) { - if ( f.link_href.value ) html = ed.dom.getOuterHTML(ed.dom.getParent(el, 'a')); + var aa; + if ( f.link_href.value && (aa = ed.dom.getParent(el, 'a')) ) html = ed.dom.getOuterHTML(aa); else html = ed.dom.getOuterHTML(el); - + P = ed.dom.create('p', {}, html); DIV.parentNode.insertBefore(P, DIV); ed.dom.remove(DIV); @@ -478,6 +486,12 @@ var wpImage = { ed.dom.setStyle(P, 'textAlign', ''); } + if ( ! f.link_href.value && A ) { + b = ed.selection.getBookmark(); + ed.dom.remove(A, 1); + ed.selection.moveToBookmark(b); + } + tinyMCEPopup.execCommand("mceEndUndoLevel"); ed.execCommand('mceRepaint'); tinyMCEPopup.close(); diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 8a72ad4..1d36907 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -222,7 +222,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { // Setup cache info if ( $disk_cache ) { - $cacheKey = apply_filters('tiny_mce_version', '20080703'); + $cacheKey = apply_filters('tiny_mce_version', '20080706'); foreach ( $initArray as $v ) $cacheKey .= $v; diff --git a/wp-includes/media.php b/wp-includes/media.php index dc625d0..7be0e50 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -73,7 +73,7 @@ function image_downsize($id, $size = 'medium') { } elseif ( $size == 'thumbnail' ) { // fall back to the old thumbnail - if ( $thumb_file = wp_get_attachment_thumb_file() && $info = getimagesize($thumb_file) ) { + if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) { $img_url = str_replace(basename($img_url), basename($thumb_file), $img_url); $width = $info[0]; $height = $info[1]; @@ -274,7 +274,7 @@ function image_make_intermediate_size($file, $width, $height, $crop=false) { } function image_get_intermediate_size($post_id, $size='thumbnail') { - if ( !$imagedata = wp_get_attachment_metadata( $post_id ) ) + if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) ) return false; // get the best one for a specified set of dimensions diff --git a/wp-includes/post.php b/wp-includes/post.php index 25aa9a1..122eb83 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2424,7 +2424,7 @@ function wp_get_attachment_thumb_file( $post_id = 0 ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; - if ( !$imagedata = wp_get_attachment_metadata( $post->ID ) ) + if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) return false; $file = get_attached_file( $post->ID ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index e8a7d40..273951a 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -34,10 +34,10 @@ function wp_default_scripts( &$scripts ) { $visual_editor = apply_filters('visual_editor', array('tiny_mce')); $scripts->add( 'editor', false, $visual_editor, '20080321' ); - $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080702' ); + $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080706' ); // Modify this version when tinyMCE plugins are changed. - $mce_version = apply_filters('tiny_mce_version', '20080703'); + $mce_version = apply_filters('tiny_mce_version', '20080706'); $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); @@ -158,7 +158,7 @@ function wp_default_scripts( &$scripts ) { 'cancel' => __('Cancel'), 'edit' => __('Edit'), ) ); - $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' ); + $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080705' ); $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080702' ); $scripts->localize( 'upload', 'uploadL10n', array( 'browseTitle' => attribute_escape(__('Browse your files')), @@ -229,7 +229,7 @@ function wp_default_styles( &$styles ) { $styles->add( 'dashboard', '/wp-admin/css/dashboard.css' ); $styles->add( 'install', '/wp-admin/css/install.css' ); $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' ); - $styles->add( 'press-this', '/wp-admin/css/press-this.css' ); + $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20080704' ); $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20080613' ); $styles->add( 'login', '/wp-admin/css/login.css' ); diff --git a/wp-includes/wp-diff.php b/wp-includes/wp-diff.php index f60614a..77f3258 100644 --- a/wp-includes/wp-diff.php +++ b/wp-includes/wp-diff.php @@ -308,7 +308,7 @@ class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline { function _splitOnWords($string, $newlineEscape = "\n") { $string = str_replace("\0", '', $string); - $words = preg_split( '/([^\w])/', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); + $words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); $words = str_replace( "\n", $newlineEscape, $words ); return $words; } |