Ticket #19389: 19389.patch
File 19389.patch, 2.9 KB (added by , 13 years ago) |
---|
-
wp-admin/js/editor.dev.js
209 209 if ( preserve_br ) 210 210 pee = pee.replace(/<wp-temp-br([^>]*)>/g, '<br$1>'); 211 211 212 if ( typeof(tinymce) != 'undefined' && tinymce.isIE ) 213 pee = pee.replace(/<p> <\/p>/gi, '<p></p>'); 214 212 215 return pee; 213 216 }, 214 217 -
wp-admin/js/media-upload.dev.js
26 26 27 27 if ( h.indexOf('[caption') === 0 ) { 28 28 if ( ed.wpSetImgCaption ) 29 h = ed.wpSetImgCaption(h );29 h = ed.wpSetImgCaption(h, true); 30 30 } else if ( h.indexOf('[gallery') === 0 ) { 31 31 if ( ed.plugins.wpgallery ) 32 32 h = ed.plugins.wpgallery._do_gallery(h); … … 79 79 var ed; 80 80 81 81 if ( typeof(tinymce) != 'undefined' && tinymce.isIE && ( ed = tinymce.get(wpActiveEditor) ) && !ed.isHidden() ) { 82 ed.focus(); 83 ed.windowManager.insertimagebookmark = ed.selection.getBookmark(); 82 ed.windowManager.insertimagebookmark = ed.selection.getBookmark(2); 84 83 } 85 84 }); 86 85 }); -
wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js
124 124 }); 125 125 126 126 ed.onPostProcess.add(function(ed, o) { 127 if ( o.get)127 if ( o.get ) 128 128 o.content = ed.wpGetImgCaption(o.content); 129 129 }); 130 130 131 ed.wpSetImgCaption = function( content) {132 return t._do_shcode( content);131 ed.wpSetImgCaption = function(str, insert) { 132 return t._do_shcode(str, insert); 133 133 }; 134 134 135 ed.wpGetImgCaption = function( content) {136 return t._get_shcode( content);135 ed.wpGetImgCaption = function(str) { 136 return t._get_shcode(str); 137 137 }; 138 138 }, 139 139 140 _do_shcode : function(content) { 141 return content.replace(/(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function(a,b,c){ 140 _do_shcode : function(str, insert) { 141 var ed = this.editor, n; 142 143 if ( insert ) { // new image with caption inserted 144 n = ed.selection.getNode(); 145 146 if ( n && n.nodeName === 'P' && /^(?: |<br[^>]*>|\s|\uFEFF|\u200B)*$/.test(n.innerHTML) ) { 147 // add a paragraph after the caption, the caret would go there 148 if ( tinymce.isIE ) { 149 str += '<p>' 150 } else { 151 ed.selection.select(n); 152 str += '<p></p>' 153 } 154 } 155 } 156 157 return str.replace(/(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function(a,b,c){ 142 158 var id, cls, w, cap, div_cls, img, trim = tinymce.trim; 143 159 144 160 id = b.match(/id=['"]([^'"]*)['"] ?/);